Show HN: Lapis – A web framework for MoonScript and OpenResty
11–20 of 26 posts
Re: Show HN: Lapis – A web framework for MoonScript and OpenResty
#12Looks interesting, but the use of "\" instead of "." is really a turnoff. Why do languages (I'm looking at you, PHP) think that using the backslash in any other way than escaping is a good idea?
What's worse, is it is inconsistent. Take:
csrf.assert_token @
Users\create name: @params.username
I don't get why they both can't be '.', which would be very readable and approachable to everyone.All that said, this looks great given it is built on OpenResty (whose performance seems outstanding at initial blush). Wonder if anyone has deployed anything really big with it.
Re: Show HN: Lapis – A web framework for MoonScript and OpenResty
#13Earlier quoted context omitted.
Yes I'll have a better testing setup in the near future. (Right now there are individual unit tests scattered in the modules themselves) Glad you like the documentation, I try to take pride in writing detailed documentation. :)
Pushed native moonscript support to busted[0] this morning. :D [0] https://github.com/Olivine-Labs/busted/blob/master/spec/moon...
Re: Show HN: Lapis – A web framework for MoonScript and OpenResty
#14Looks interesting, but the use of "\" instead of "." is really a turnoff. Why do languages (I'm looking at you, PHP) think that using the backslash in any other way than escaping is a good idea?
Couldn't agree more. I've am looking at Lua for a new project and got excited when I saw this. However, that syntax looks terrible. What's worse, is it is inconsistent. Take: csrf.assert_token @ Users\create name: @params.username I don't get why they both can't be '.', which would be very readable and approachable to everyone. All that said, this looks great given it is built on OpenResty (whose performance seems ou…
It would be hard to have both be '.', because of lua semantics: '.' means "get the property from the table", while ':' in lua and '\' in moonscript mean "get the function from this table, with the first parameter for that function bound to the table itself".
Javascript/Coffeescript can get away with both being '.' because of the horrible mess that is implicit 'this'. All functions have an implicit first parameter, that non-method functions usually ignore, and '.' in javascript does the equivalent of ':' and '\' in moonscript (for functions). I find the lua approach much simpler and cleaner, and think it is actually more approachable than the javascript way, because the difference between '.' and ':' or '\' is conceptually simpler than all the rules behind 'this' in javascript.
Programming in Lua explains ':' in http://www.lua.org/pil/16.html , and probably has a better explanation that I wrote :).
Re: Show HN: Lapis – A web framework for MoonScript and OpenResty
#15Looks interesting, but the use of "\" instead of "." is really a turnoff. Why do languages (I'm looking at you, PHP) think that using the backslash in any other way than escaping is a good idea?
Couldn't agree more. I've am looking at Lua for a new project and got excited when I saw this. However, that syntax looks terrible. What's worse, is it is inconsistent. Take: csrf.assert_token @ Users\create name: @params.username I don't get why they both can't be '.', which would be very readable and approachable to everyone. All that said, this looks great given it is built on OpenResty (whose performance seems ou…
Re: Show HN: Lapis – A web framework for MoonScript and OpenResty
#16Looks interesting, but the use of "\" instead of "." is really a turnoff. Why do languages (I'm looking at you, PHP) think that using the backslash in any other way than escaping is a good idea?
. is taken. : is taken. propose a better alternate and maybe it'll end up in the language.
Re: Show HN: Lapis – A web framework for MoonScript and OpenResty
#17Looks interesting, but the use of "\" instead of "." is really a turnoff. Why do languages (I'm looking at you, PHP) think that using the backslash in any other way than escaping is a good idea?
Couldn't agree more. I've am looking at Lua for a new project and got excited when I saw this. However, that syntax looks terrible. What's worse, is it is inconsistent. Take: csrf.assert_token @ Users\create name: @params.username I don't get why they both can't be '.', which would be very readable and approachable to everyone. All that said, this looks great given it is built on OpenResty (whose performance seems ou…
In Lua, `foo.bar` is just syntactic sugar for `foo["bar"]`, a table lookup with a string key.
In turn, `foo:bar(baz)` is syntactic sugar for `foo.bar(foo, baz)`.
It is not uncommon to mix things up, and put a dot instead of the column. IIRC, Leafo used the backslash instead because it is more distinct, visually.
Users\create name: @params.username
is thus equivalent to Users.create( Users, name: @params.username )
(adding parens for maximum clarity).Re: Show HN: Lapis – A web framework for MoonScript and OpenResty
#18Looks interesting, but the use of "\" instead of "." is really a turnoff. Why do languages (I'm looking at you, PHP) think that using the backslash in any other way than escaping is a good idea?
Re: Show HN: Lapis – A web framework for MoonScript and OpenResty
#19Earlier quoted context omitted.
Yes I'll have a better testing setup in the near future. (Right now there are individual unit tests scattered in the modules themselves) Glad you like the documentation, I try to take pride in writing detailed documentation. :)
Pushed native moonscript support to busted[0] this morning. :D [0] https://github.com/Olivine-Labs/busted/blob/master/spec/moon...