[erlang-questions] core erlang evaluator?

Ulf Wiger ulf@REDACTED
Thu Nov 15 10:03:48 CET 2007

Is there a core erlang evaluator somewhere, and I just couldn't find it?

I am looking for a way to plug in the Haskerl compiler into
my hacked shell. The Haskerl compiler is written in Haskell,
and it compiles to core erlang. Perhaps the compiler isn't
complete enough to compile itself?

For now, I've made a simple lersp plugin
(lersp interprets "an approximation of scheme"):

2> @ mod(lersp_exp).
(+ 1 3)

(I added options to inspect the resulting parse tree:

3> @ mod(lersp_exp), return(parsed).
(+ 1 3)

(...as well as pretty-printing the parsed code - might be handy e.g. if
the block contains weird macro expansion)

4> @ mod(lersp_exp), return(pretty).
(+ 1 3)

The callback module that makes this happen:



shell_parse(Str, Bs, Env) ->
    Exprs = lersp_parse:parse_all(Str),

shell_eval(Exprs) ->
    {Value, _} = lersp_eval:eval_exprs(Exprs),

Ulf W

More information about the erlang-questions mailing list