Various (and almost completely unrelated) questions and opinions
Lon Willett
Lon.Willett@REDACTED
Tue Feb 20 12:23:45 CET 2001
Chris Pressey <cpressey@REDACTED> writes:
[snip]
> Also I like Erlang's eager evaluation much better than Haskell's lazy
> evaluation. It is easy enough to build a lazy evaluator in Erlang if
> you need one.
[snip]
I prefer the eager ("strict") evaluation too, as a default. But there
are some nice things that can be done with lazy evaluation: streams as
lists, some clever data structures, etc. And it is not so trivial to
write a lazy evaluator; any reasonable implementation would require
changes to the VM.
I briefly (as in for a few moments; then reality set in and I moved on
to more pressing matters) considered modifying the beam type system to
support "promises", or whatever one wants to call the delayed-
evaluation objects. It probably wouldn't be too hard, but there are
some tricky issues as to what one should do with them when they are
passed in a message, or passed to term_to_binary. If someone else has
implemented this, then I'd be interested in the results.
And while on the topic of useful language extensions: has anyone
implemented weak-reference ets tables? (Actually, with weak-reference
ets tables, one could write a lazy-evaluator that has almost
reasonable performance, although I suspect that the memory usage
characteristics would lead to a bit of thrashing).
/Lon
--
Lon Willett <Lon.Willett@REDACTED>
Security Architect, SSE Ltd.
Fitzwilliam Court, Leeson Close
Dublin 2, Ireland
+353-1-216-2946
+353-87-8053539 (mobile)
More information about the erlang-questions
mailing list