Glad you like the documentation, I try to take pride in writing detailed documentation. :)
2,249 karma · joined August 28, 2010
Glad you like the documentation, I try to take pride in writing detailed documentation. :)
As mentioned in the other comment I use this for recording animations: https://github.com/rprichard/x11-canvas-screencast
http://leafo.net/posts/introducing_itchio.html#technology
Essentially the web app runs directly inside of nginx (but a special build of nginx from the project OpenResty[0]). The entire site is coded in MoonScript[1], which is my language that compiles to Lua.
I developed a web framework called Lapis while making this site, it doesn't have documentation yet but you can find the source here: https://github.com/leafo/lapis
I you want to see another sample Lapis webapp you can check out my MoonRocks project. The source is here: https://github.com/leafo/moonrocks-site
It definitely deserves some stars. It's based off of https://github.com/sublimehq/anim_encoder
nginx's subrequests can do just about anything with the right modules, from database queries to HTTP requests. Effectively turning nginx into your event loop. It's a very interesting idea.
I've just started using it, but I'm excited to make something with it.
http://moonscript.org/compiler/#14
Here I create 10 functions closed on the loop value. Then I loop over them and call them all. In JavaScript this would print 10 10 times, but in Lua we get the 1 through 10.
It's a great library, I highly recommend it.
I've assembled a few parsers using various tools, and I must say PEGs are my favorite. They are very flexible and performance is comparable. (even CoffeeScript 2.0 is being written with a PEG.)
You can check out the guts of the parser here: https://github.com/leafo/moonscript/blob/master/moonscript/p...
A lot of the metatable functionality just won't work: http://www.lua.org/manual/5.1/manual.html#2.8
Second, it's missing co-routines. Which is a way to suspend the execution of a piece of code.
These features aren't possible in a compiler that simply translates from Lua to JS because JS doesn't have the ability to reproduce these concepts in its own constructs. You would have to output significantly different code to simulate these features.
Without these you're just writing JavaScript in another dialect.
https://gist.github.com/1683661
You need scrot, xclip, and libnotify. Set up private key ssh access to your webserver and update the directories/url and you're good to go.
I didn't want to change the default semantics, but I wanted to have a way for the programmer to be safe if they wanted to, so I created the `using` keyword for function declarations.
You explicitly declare what you intend to overwrite in the lexical scope, including overwriting nothing at all with `using nil`.
Things like classes, comprehensions, and other syntactic sugar really do help with writing concise and easy to read programs.
CoffeeScript inspired syntax that compiles right to Lua.
After writing the majority of the compiler in MoonScript itself, and some other scripts, I've actually grown to like it and I find it perfectly readable. More readable than Lua in fact, because half of the text on my screen isn't the keyword `local` :). Try it out, if you code Lua then I think you might like it.
So I wrote the language for myself to use, but I've opened it up for other people because I think there is some potential for it. The use case for MoonScript is the same as the use case for Lua.
Also I have done a lot of mitigate the pains of compiling and debugging. It's actually pretty seamless, I've done stuff like automatic code compilation on require, and error line number rewriting. I urge you to check out the documentation: <http://moonscript.org/reference/#moonscript_api>;