Erlang & AI

Francesco Cesarini (Erlang Training & Consulting) francesco@REDACTED
Mon Sep 5 09:33:40 CEST 2005


As James and Ulf pointed out, you read a .erl file, add a few clauses 
(eg. pattern matching on specific cases), compile and load the code. 
Something similar to asserts in prolog. Speed gains can be substantial. 
Not for the faint of heart, however. People were playing around with it 
over 10 years ago.

Francesco
--
http://www.erlang-consulting.com

James Hague wrote:
> On 9/4/05, Joel Reymont <joelr1@REDACTED> wrote:
> 
>>Strange choice. How would you write self-modifying code in Erlang?
> 
> 
> Most of the time when someone says "self modifying code" in regard to
> AI, they simply mean manipulating code as an abstract syntax tree,
> then generating program text from that tree which can be compiled and
> loaded on the fly.  Lisp has the advantage here, because the AST and
> program text can be identical, but this is easy enough to do in Erlang
> or any other language where you can call the compiler and reload code
> from a running program.
> 
> 




More information about the erlang-questions mailing list