7 ms·
Show HN: Lapis – A web framework for MoonScript and OpenResty
- MichaelGlass 13y agoNice work! This has pretty excellent documentation. Like really excellent documentation. But jumping into the code itself is a little bit of a beast with no tests or comments. so: is testing on your roadmap?
- leafo 13y agoYes 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. :)
- ajacksified 13y agoPushed native moonscript support to busted[0] this morning. :D [0] https://github.com/Olivine-Labs/busted/blob/master/spec/moonscript_spec.moon https://github.com/Olivine-Labs/busted/blob/master/spec/moon...
- alexatkeplar 13y agoBusted is awesome - really nice test framework.
- leafo 13y agoAwesome!
- bhauer 13y agoLeafo, this looks great. I was not familiar with your MoonScript language prior to this. Say, since you cite the benchmarks project, would you mind submitting a test case for Lapis? Also, just out of curiosity, what did you use to create the canvas animation?
- mangostache2 13y agoHow he created the canvas animation: https://github.com/rprichard/x11-canvas-screencast https://github.com/rprichard/x11-canvas-screencast source: https://news.ycombinator.com/item?id=5445158 https://news.ycombinator.com/item?id=5445158
- leafo 13y agoI'd definitely like it to be part of the benchmarks project. When I get some time I'll submit a pull request for it. As mentioned in the other comment I use this for recording animations: https://github.com/rprichard/x11-canvas-screencast https://github.com/rprichard/x11-canvas-screencast
- bhauer 13y agoGreat! You are prolific! A language, a web framework, sites built upon that framework, and all of the documentation. You sure you're just one person?
- gte910h 13y agoInteresting performance numbers. I am happy to see something past java frameworks working out so well.
- codewright 13y agoPeople need to get out of this habit of embedding view/template in the backend code. It's impractical and problematic in any situation where there's division of labor. Otherwise interesting web framework, makes me want to look into MoonScript.
- rufugee 13y agoLooks 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?
- fingerprinter 13y agoCouldn'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 outstanding at initial blush). Wonder if anyone has deployed anything really big with it.
- jacktoole1 13y agoI've used moonscript a lot, and don't particularly like the \ syntax. However, you get used to it quickly, and it stops seeming like such a big deal. 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 http://www.lua.org/pil/16.html , and probably has a better explanation that I wrote :).
- danjessen 13y agoWould you recommend learning Lua first before going into moonscript ?
- luisbebop 13y agoamazing work man! I was thinking in creating something like that but with mruby. Lua is a good option too. It is a perfect fit to use with Angular.js
- snaky 13y agoWould be nice to add support for not-inlined templates with high-performance template engine like CTPP2 (ngx_ctpp2)