[e-lang] Announcing development snapshot E 0.8.36i
Mark S. Miller
markm at cs.jhu.edu
Sun Apr 30 00:07:56 EDT 2006
I just had a long talk with Chip about the evolution of E. Once I explained
the issues motivating the new via pattern, I think Chip was satisfied that his
objections were adequately addressed. (Chip, if this isn't accurate, please
speak up!)
Chip's underlying discomfort is a sense that things are getting more
complicated over time. Now that I've posted a compact description of all the
Kernel-E constructs, Chip and I both thought it would be illuminating to post
an old Kernel-E definition in the same notation for comparison.
The following is the proposed Kernel-E I just posted:
-------------------------
e ::= String | Char | Integer | Float64 # LiteralExpr
| e.verb(<e>**,) ## CallExpr
| e1; e2 # SeqExpr
| noun | &noun # NounExpr,SlotExpr
| noun := e # AssignExpr
| def p := e # DefineExpr
| def p := (e1, e2) ## DefineExpr
| e =~ p # MatchBindExpr
| {e} # HideExpr
| if (e1) {e2} else {e3} # IfExpr
| try {e1} catch p {e2} ## CatchExpr
| try {e1} finally {e2} ## FinallyExpr
| escape p1 {e1} <catch p2 {e2}>? ## EscapeExpr
| <Comment>? def String <implements <e>++,>? script ## ObjectExpr
| meta.context() ## MetaContextExpr
| meta.getState() ## MetaStateExpr
p ::= <noun | &noun | _> <:e>? ## FinalPattern,SlotPattern,IgnorePattern
| [<p>**,] ## ListPattern
| via (e) =~ p ## ViaPattern
script ::= matcher | {<method>* <matcher>*} ##
method ::= <Comment>? to verb(<p>**, ) <:e1>? {e2} ##
matcher ::= match p {e}
verb ::= Ident | String ##
noun ::= Ident | ::String ##
-------------------------
Using the above notation and terminology, here is Kernel-E as found in
<http://www.erights.org/elang/elangmanual.pdf>, which has a modify time of
March 2003 but I believe dates from years earlier. The lines which are
different are commented with a "##" in both. The lines below whose comments
end with a "*" are those whose functionality is now provided by a library
rather than a Kernel-E special form.
-------------------------
e ::= String | Char | Integer | Float64 # LiteralExpr
| e verb(<e>**,) ## CallExpr
| e <- verb(<e>**,) ## SendExpr*
| e1; e2 # SeqExpr
| noun | &noun # NounExpr,SlotExpr
| noun := e # AssignExpr
| def p := e # DefineExpr
| e =~ p # MatchBindExpr
| {e} # HideExpr
| if (e1) {e2} else {e3} # IfExpr
| try {e1} <catch p {e2}>? <finally {e2}>? ## TryExpr
| throw e ## ThrowExpr*
| loop {e} ## LoopExpr*
| escape p1 {e1} ## EscapeExpr
| def param script ## ObjectExpr
| scope ## MetaStateExpr
p ::= param ##
| [<p>**,] + p ## ListPattern
| p ? e ## SuchThatPattern
param ::= noun : e ## NounPattern
| _ ## IgnorePattern
script ::= matcher | {<method>* <matcher>?} ##
method ::= to verb(<p>**, ) {e2} ##
matcher ::= match p {e}
verb ::= Ident ##
noun ::= Ident ##
-------------------------
Looking at these two, I think it's fair to say that Kernel-E has gotten much
better but only a bit bigger. In the new Kernel-E, variables are unassignable
by default, match-failure diagnostics do not get thrown away, doc-comments are
available, method-body result values do not accidentally leak, and auditors
are possible. If we can get auditors working well, I believe this last will be
the most significant.
--
Text by me above is hereby placed in the public domain
Cheers,
--MarkM
More information about the e-lang
mailing list