Hacker Newsnew | comments | show | ask | jobs | submit | leafo's comments login

Thanks for submitting. I make this site. Feel free to ask any questions. Been running it about two years now. Originally launched it on HN as well

-----


Nice seeing itch.io here. I make itch.io, check it out if you're into indie games: http://itch.io

-----


I thought "I recognise that username..." so I poked around your site and saw you wrote LessPHP. It's very useful thanks!

-----


itch.io is stellar. thank you.

any chance you would consider a spiking or daily/weekly popularity chart?

-----


Sure, I'm in the process of reworking the game browsing pages and having a weekly (and maybe daily) list of top sellers/top downloaded is something I'm considering.

-----


please let me know if I can help.

for delicious I built a new popular spiking algorithm - it was essentially recent popularity normalized by total popularity. it worked really well.

-----


I wrote a service in Go to transparently transcode gif to video that you might be interested in: https://github.com/leafo/gifserver

-----


Indeed :) It's got great performance, glad I chose Lapis to build it. Handling millions of requests and tens of of thousands of payments on a 10 dollar VPS.

-----


Hello, I create lapis.

I'm actually on the verge of releasing a new huge update. New features include:

* first class lua support

* built in support for a lua templating language: https://github.com/leafo/etlua

* a new postgres driver written in pure lua, should play nicer with luajit and and be available in more stages of nginx request cycle: https://github.com/leafo/pgmoon

* lots of other smaller changes

All of this code is in master I just need to write all the documentation for it, sigh.

The biggest site I've created with lapis is itch.io: http://itch.io it's currently 43,209 lines of code (excluding libraries).

I run it on a really crappy 10 dollar a month vps, memory and cpu usage is tiny. I've handled well over a million requests per day in the past with no issues. The app communicates with a lot of third party payment services over http in the server, because of the non-blocking nature of openresty throughput is not affected when these services are slow (eg. paypal).

Another interesting lapis project is MoonRocks: http://rocks.moonscript.org/ it's a public lua module hosting site. It's opensource so you can check out what a developed lapis application looks like: https://github.com/leafo/moonrocks-site

Thanks for checking out lapis!

-----


We've started using openresty quite a bit in our shop. It's great for making certain things very fast. We looked at lapis, too, but it seems to be more than we need right now. Really, I'm afraid of doing too much complex development using a framework that doesn't provide you with an interactive debugger (like pdb).

Is there something out there that I'm not aware of? The following comment by the creator of openresty seems to indicate that there is not:

https://groups.google.com/forum/#!topic/openresty-en/VSIM8jY...

-----


It's not something I've experimented with yet. Lua comes with a very low level debugger: http://www.lua.org/manual/5.1/manual.html#pdf-debug.debug but I haven't tried using it inside of an nginx worker. Because the workers are forked you don't have immediate access to their standard in.

For lapis I did build a server side console for running code in the same environment as the worker though, it might be useful: http://leafo.net/lapis/reference.html#lapis-console

This project looks interesting, maybe it can be used: http://keplerproject.org/remdebug/

-----


I've been working on extending ZeroBrane Studio (the IDE mentioned in the google groups discussion you referenced) and its debugger and has posted instructions on how to debug OpenResty Lua scripts with it: http://notebook.kulchenko.com/zerobrane/debugging-openresty-....

It's an early work, but you can set breakpoints, step through the code, run ngx commands remotely, inspect stack/variables, and do all the things you'd expect from an interactive debugger. I included a screenshot in the blog post.

I'm interested in getting it to work with moonscript/lapis as well, but ran into issues with mapping source code information between moonscript and lua from the debugger.

-----


With all of these projects, I'm unsure of the relationship between Lua and MoonScript. Is it similar to the relationship between JavaScript and CoffeeScript? Also, does it matter which one is used ultimately?

-----


Yes, that is the relationship exactly. I've used both, but found MoonScript easier to get up and running with since we already use CoffeeScript extensively.

-----


Are you sure you're just one person? Seriously, great stuff!

-----


Thanks for the great documentation. It makes lapis stand out from just some weekend project.

-----


Awesome work!

By the way, does pgmoon support arrays in postgres?

-----


I was just experimenting this today, select queries will be able to deserialize array results into lua tables automatically. Same for json values as well.

-----


Kinda surprised seeing this here. I made this project 2 years ago and haven't updated it since. It was an interesting proof of concept, but I only took it far enough to run a couple of my games. The only takeaway was that I was really disappointed with the performance of native client OpenGL.

The modern version of Love supports OpenGL ES though so a rewrite like this isn't required, a better approach would just be to try to compile Love.

If you want to see more cool stuff I've done with Lua:

Moonscript: http://moonscript.org

Lapis: http://leafo.net/lapis

-----


Hi Leafo I have tried to get in touch a couple of times. Question: Does Moonscript have coroutines ? In case it doesnt, is there a way to use Lua's coroutines together with Moonscript ? In case it does, could you point me to the syntax, couldnt find it in the docs.

-----


Yes, it does.

-----


Sorry, I can no longer edit my comment above. You just use Lua coroutines.

For people unfamiliar with Lua coroutines, there is no extra syntax for them. There are functions coroutine.create, coroutine.resume, and coroutine.yield. They do about what you'd expect them to do. If you're familiar with greenlet, the first function is greenlet() and the second two functions do the job of greenlet.switch().

Here is some Moonscript Leafo wrote using coroutines: https://gist.github.com/leafo/6788652

-----


Awesome, cant thank enough.

-----


Sorry, the page was cached for 10 minutes and it wasn't cleared after deploying fix.

-----


Awesome, my site, http://itch.io, is hosting the jam. Tell me if you have any questions.

-----


that's a very cool site some of the games were actually very fun and weird (like 90s weird) in a good way

-----


Cool site! I will have to give this a closer look later.

-----


MoonScript introduces a special construct for handling this exact situation: http://moonscript.org/reference/#the_using_clause_controllin...

-----


If you're a game developer (or just want to make a game) then we're hosting a game jam in protest of their "candy" trademark. Make a game about candy. Check it out: http://thecandyjam.com

-----

More

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: