[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: special forms, take two (was Re: A lua version of "amb")
- From: Jay Carlson <nop@...>
- Date: Sun, 26 Feb 2012 04:16:57 +0000
On Sun, Feb 19, 2012 at 4:55 PM, steve donovan
> On Sun, Feb 19, 2012 at 5:30 PM, Jay Carlson <email@example.com> wrote:
>> I suspect there's a translation to coroutines and pcall/error, but it does look like another example of pain by lack of macros and/or concise lambdas.
> Oh yes, I we had at least one war about the |x| x+1 syntax (Metalua
> and GSL). lhf suggested a more token-filter friendly \x(x+1) which has
> the advantage of making the expression unambiguous; that's in
But Unix programmers are allergic to backslash being used that way.
Even though my brain says "yes, lots of languages write lambda as
backslash" my eyes say "control character".
> On Reddit today there is a discussion about a language called Julia
> which looks very much like Lua
They have strings as piles of bytes, but they have a more elegant way
of describing what I had in mind: string indexing is a partial
function from strings to characters. That is, although s may be
well-defined, s may not be if it is interior to a multibyte UTF-8
> and has LuaJIT-like speed ambitions and
> metalua-like syntax quoting
I dunno, metalua is sorta at the edge of the design win space for me.
I have a copy of the *Apple* Dylan book they mailed out on request way
back when, and I guess I'm not certain how they expect to do that much
> optional type annotations, which seems to be a popular meme in the
> programming language design game at the moment.
My favorite lombok-so-bad-it's-good trick is how their implicitly
typed Java "var s = new HashSet()" is syntactically legal. Because you
imported it, it parses as "lombok.var s = new HashSet()"; their
treewalker just replaces the type node in the AST with the deduced one
from the rhs....
Somehow Metalua is still Lua to me, but Lua-with-types isn't. Even
optional static typing all of a sudden makes dynamic languages much
heavier and seems to lead implementations down the path to madness
(see Dylan, for example.)