Hey 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…
I was just looking at love2d, I don't know much about it. My son is 8 and is very bored with Scratch. A once over the documentation makes me think love2d might be a good fit for a next step from Scratch. How is the love2d community and is it active?
MoonScript, a programmer friendly language that compiles to Lua
51–60 of 171 posts
Re: MoonScript, a programmer friendly language that compiles to Lua
#52Earlier quoted context omitted.
Thankfully, GitHub starting gutting Coffee from Atom a long time ago. There's still too much in there though.
While I understand the move to es6 or whatever we're calling it now, a part of me really misses coffeescript. I found it to be very elegant
Re: MoonScript, a programmer friendly language that compiles to Lua
#53Lapis + MoonScript + OpenResty looks like a lot of fun, so I was just starting to get a local environment running for it and immediately ran into the Lua 5.1 and 5.2+ divergence. For someone who has just been a casual observer of the Lua ecosystem over the years, can someone talk about the community's feelings towards that divergence? The OpenResty docs basically state it's not worth the effort to support anything bu…
Re: MoonScript, a programmer friendly language that compiles to Lua
#54Earlier 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…
Yes. Specific, context sensitive, that requires disambiguation in your head and therefore harder to read.
> We trade an unambiguous set of characters --the parentheses-- by whitespace, and make it context sensitive. Parenthesis are often context sensitive in languages.
Yes, but they're consistent with the mathematical notation everyone has used over their entire life. By the time you pick up a programming language you have most likely used parenthesis for a while.
I am going to create a new language 99% identical to English, where fork means knife, knife means spoon and spoon means fork. Have a happy time translating paragraphs of text involving those 3 objects from English into my language.
> "Readable" is subjective.
Yes. But implicit vs explicit is not subjective. Implicit meaning takes non-zero effort to understand. It works when you the implicit subject is not relevant and you can be abstracted from it, but in this case there is no encapsulation taking place. Therefore, we could objectively say it's less readable. Quod erat demonstrandum.
> Or, it actually is that some people prefer it, even if you and I do not, and that's what it is
Now you have 2 ways of doing the same thing with no added value. Now you have more possible ways of writing down an expression, if you are parsing an expression or refactoring your code with a regex now it's much more complex. If you are writing a coding standard now you will have to make rules for it, and people may not reach agreement on those rules. People may have meeting to discuss which one to use and why, and spend time moving from one style to the other. It's a waste of time.
In 2017 there's still people fighting over tabs vs spaces. Now we add another dimension to it: spaces vs parenthesis. An endless source of bikeshedding.
> In the end, unless you're being forced to use this language
That's not how it works. I have had to use languages that I dislike because that was what was needed in my organization.
Re: MoonScript, a programmer friendly language that compiles to Lua
#55Back to moonscript/Lua, I've been super impressed with the YAGNI principals of the language. I was originally drawn to LuaJIT and its raw speed, but there's a lot of great things to say about the language and its community.
My goal is to write more Lua for smaller scripting purposes, and use Haxe/Lua for more complex projects, taking advantage of LuaJIT speed in both cases.
Re: MoonScript, a programmer friendly language that compiles to Lua
#56I find Lua itself very programmer friendly.
Re: MoonScript, a programmer friendly language that compiles to Lua
#57Earlier quoted context omitted.
Are you aware that TIC-80 supports moonscript? It's one of the better PICO-8 "clones" out there. https://nesbox.itch.io/tic https://github.com/nesbox/tic.computer/wiki#cartridge-metada...
Is that open source? I'm wondering if it uses SDL or a similar library - binaries look pretty small.
Plus that file's about 2 MB, so really not surprisingly small.
Re: MoonScript, a programmer friendly language that compiles to Lua
#58I understand that people love programming in classes, but I really want something like a stripped-down ES6. In particular, I want: 1. Lists and objects/dicts only; objects have no prototypes at all; objects have no first-class methods, but they can have functions as member variables, and those functions can close over other data in the object 2. All function and variable declaration is anonymous (as a consequence of…
foo = {
x: {1, 2, 3},
y: (a, b, c) ->
sum = a + b + c
sum * sum
}Re: MoonScript, a programmer friendly language that compiles to Lua
#59That's a very succinct description and from skimming the examples, quite apt.
But what I want is Typescript for Lua, specifically to use with Redis. That way I can define interfaces for my keys/values and have static checks on their usage.
Re: MoonScript, a programmer friendly language that compiles to Lua
#60"Moonscript is like CoffeeScript for Lua" That's a very succinct description and from skimming the examples, quite apt. But what I want is Typescript for Lua, specifically to use with Redis. That way I can define interfaces for my keys/values and have static checks on their usage.