On Monday, January 29, 2018, 11:02:38 AM GMT, steve donovan <steve.j.donovan@gmail.com> wrote:
> On Mon, Jan 29, 2018 at 12:32 PM, Grey Knight
> <tinyplasticgreyknight@yahoo.com> wrote:
> > Well if we had filters I would want maps and all the rest too! I've got
> > a library for doing things like this already though, I don't think syntax
> > is a good way to go here. Note that it's not syntax in Rust either.
>
> Exactly - I have pl/seq for that style as well. The Rust for-statement
> is here leaning on a very feature-ful Iterator type.
Oh yes, I forgot penlight had a seq library. Well, I had fun writing my own,
so it wasn't a waste of time anyway!
The efficient performance in Rust you mention is also leaning heavily on a
very invasive compilation step which is probably not going to work in
luac :-)
> Of course, we are free to do run-time checking (there's some very cute
> libs out there for that) but in a semi-ideal world, we'd like a
> preprocessor which _does_ some typechecking based on signatures, so it
> becomes a compile-time error to put strings into integers and so
> forth. (It is possible that I've become addicted to the safety belt
> of strong typing. But too far down that road, we end up with something
> very different from Lua. I think statically-typed scripting languages
> are an interesting space to explore, though - e.g. Lily)
Well, I'm a little addicted to it too, but if we want up-front checking then
we probably need a preprocessor step as you say. So I think that could just
be a case of "pulling a Typescript" and having that step be a translation
from some like-Lua-with-types language to Lua itself. This has the benefit
that we can just go ahead and write such a tool and don't need to modify luac
or get permission from anyone. :-)
--
GK