Earlier quoted context omitted.
Can't agree with that. Having used both Lua and Moonscript quite a bit I think Moonscript is what most dynamic scripting languages should be. Simple, succinct and does what you need for a scripting language. I really enjoy using it.
Care to give an example?
MoonScript, a programmer friendly language that compiles to Lua
81–90 of 171 posts
Re: MoonScript, a programmer friendly language that compiles to Lua
#82Earlier quoted context omitted.
Exactly. It's more intuitive and you have less `x-1`'s in your code.
Arrays starting at 1 and being closed intervals is mostly just worse than starting at 0 and being half-open intervals. Here's an expression to take an integer b and "mod it" into an interval from a to c, given the normal convention from C++ or Python or whatever where intervals are [a, c): (b-a)%(c-a)+a And here it is in the lua convention where intervals are [a,c]: (b-a)%(c-a+1)+a This is a generalization of what yo…
Re: MoonScript, a programmer friendly language that compiles to Lua
#83But I don't think I really needed the ! operator, for example.
Re: MoonScript, a programmer friendly language that compiles to Lua
#84Earlier quoted context omitted.
Except that that whitespace is not used only for that purpose, it could mean also something else, right? We trade an unambiguous set of characters --the parentheses-- by whitespace, and make it context sensitive. How is that now more readable? As someone who has had to match these whitespace based parenthesis I can tell you it's not more readable. It's more like someone determined that parenthesis were not visually p…
> Except that that whitespace is not used only for that purpose, it could mean also something else, right It's not just whitespace, it's the specific formatting of whitespace. It's just a character, like any other, only defined by it's lack of distinguishing characters. Instead of whitespace, block continuations could be defined by pipes, or angle brackets, or any number of things. They chose wihtespace. > We trade a…
Perl uses . or ~ depending on which version you are using. It also uses braces for code blocks and postfixed ifs which prevents errors like:
if (x)
y
z
Instead of: if (x)
y
z
It prides itself to being close to natural language yet still uses braces.Re: MoonScript, a programmer friendly language that compiles to Lua
#85Hey all, I made MoonScript about 6 years ago. I used it to build a ton of opensource stuff in addition to the company I founded. I use it every day and I'm very happy with how it's turned out. I regret not updating the language more frequently, but I've been busy building a bunch of stuff in it. The biggest open source project is a web framework for Open Resty: https://github.com/leafo/lapis It's used for the followi…
Re: MoonScript, a programmer friendly language that compiles to Lua
#86I was on a team that used Lua in production on tens of thousands of machines running 24/7. The Lua interpreter was the weak link in the system, requiring at least daily restarts. Squashed so many bugs over the years, and still found more and more all the time. What I'm saying is, the Lua interpreter itself is flawed and I can't imagine using it as a runtime if I had the chance to avoid it. That said, the language was…
This page lists every known bug in the Lua interpreter for the last 14 years, along with its fix: https://www.lua.org/bugs.html The average is 8 bugs per year, most fairly obscure. Every Lua release fixes all known bugs. Roberto, the chief architect, is kind of fanatical about quality: https://www.youtube.com/watch?v=yU5QNKpATxk I do not believe the interpreter is as flawed as you claim.
Re: MoonScript, a programmer friendly language that compiles to Lua
#87I was on a team that used Lua in production on tens of thousands of machines running 24/7. The Lua interpreter was the weak link in the system, requiring at least daily restarts. Squashed so many bugs over the years, and still found more and more all the time. What I'm saying is, the Lua interpreter itself is flawed and I can't imagine using it as a runtime if I had the chance to avoid it. That said, the language was…
This page lists every known bug in the Lua interpreter for the last 14 years, along with its fix: https://www.lua.org/bugs.html The average is 8 bugs per year, most fairly obscure. Every Lua release fixes all known bugs. Roberto, the chief architect, is kind of fanatical about quality: https://www.youtube.com/watch?v=yU5QNKpATxk I do not believe the interpreter is as flawed as you claim.
And I speak as someone who reported one of the bugs on their bugs page.
Re: MoonScript, a programmer friendly language that compiles to Lua
#88I was on a team that used Lua in production on tens of thousands of machines running 24/7. The Lua interpreter was the weak link in the system, requiring at least daily restarts. Squashed so many bugs over the years, and still found more and more all the time. What I'm saying is, the Lua interpreter itself is flawed and I can't imagine using it as a runtime if I had the chance to avoid it. That said, the language was…
This page lists every known bug in the Lua interpreter for the last 14 years, along with its fix: https://www.lua.org/bugs.html The average is 8 bugs per year, most fairly obscure. Every Lua release fixes all known bugs. Roberto, the chief architect, is kind of fanatical about quality: https://www.youtube.com/watch?v=yU5QNKpATxk I do not believe the interpreter is as flawed as you claim.
Re: MoonScript, a programmer friendly language that compiles to Lua
#89Re: MoonScript, a programmer friendly language that compiles to Lua
#90Earlier quoted context omitted.
> Except that that whitespace is not used only for that purpose, it could mean also something else, right It's not just whitespace, it's the specific formatting of whitespace. It's just a character, like any other, only defined by it's lack of distinguishing characters. Instead of whitespace, block continuations could be defined by pipes, or angle brackets, or any number of things. They chose wihtespace. > We trade a…
> Languages often use '+' for both numeric addition and string concatenation Perl uses . or ~ depending on which version you are using. It also uses braces for code blocks and postfixed ifs which prevents errors like: if (x) y z Instead of: if (x) y z It prides itself to being close to natural language yet still uses braces.
It's a pet peeve of mine that languages have promoted + for addition and string concatenation when concatenation and addition are distinct concepts that don't really share a lot in common beyond the surface. To me, in new languages, it signals that someone likely hasn't thought through that issue very clearly, or has and just doesn't care about consistency (which I think it important in a language). Python at least has the excuse of age (even if it's not all that old compared to many others).