<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>There are domain-specific languages that are entirely pure.</div><div><br></div><div>One nice example is Cryptol (<a href="http://www.cryptol.net">http://www.cryptol.net</a>, a DSL written in Haskell):</div><div><br></div><div>An example from (<a href="http://hcss-cps.org/events/erkok.pdf">http://hcss-cps.org/events/erkok.pdf</a>):</div><div><br></div><div><div><br></div><div>encrypt128 : ([4][32],[4][4][8]) -> [4][4][8];</div><div>encrypt128 (initialKey, plainText) = cipherText where { </div><div> roundKeys = [ initialKey ] # [| nextKey (round, prev) </div><div> || round <- [1..10] </div><div> || prev <- roundKeys </div><div> |]; </div><div> initialState = first(roundKeys) ^ plainText; </div><div> rounds = [ initialState ] # [| nextState (prev, roundKey, round) </div><div> || round <- [1..10] </div><div> || prev <- rounds </div><div> || roundKey <- drop (1, roundKeys) </div><div> |]; </div><div> cipherText = last(rounds); </div><div>}</div></div><div><br></div><div>BR,</div><div>Ulf W</div><br><div><div>On 20 Jan 2012, at 16:58, Max Lapshin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>I can't imagine language, which is built only from pure functions.<br>_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>http://erlang.org/mailman/listinfo/erlang-questions<br></div></blockquote></div><br></body></html>