Zedshaw/Tir
github.com
Zedshaw/Tir
1–10 of 39 posts
Re: Zedshaw/Tir
#2Re: Zedshaw/Tir
#3This description in the title would help: "A Simple Lua Web Framework For Mongrel2"
Re: Zedshaw/Tir
#4Re: Zedshaw/Tir
#5My big problem with most frameworks is that any moderately sized application becomes excruciatingly monolithic. With Rails, the idea is that you have more code reuse, but then this becomes booting the whole of the universe to do something simple. Most of the time, your feature only needs a model, or a tiny part, of the application to do it's thing.
With Tir, you have a bunch of small parts working together. You can reuse the code, but the process only needs to load the parts it needs to work with. The implicit nature of rails really hurts it's ability to scale a particular part of the application without having to install the entire application.
An example, you scrape twitter for mentions of your app and shove them on your homepage. Twitter rate limits, so you background job this and run it in an interval. In the rails world, this means a resque / utility server, running the same code, each working booting up the full app, same deps, same model.
In Tir, there's no reason to do that. Create workers, have them load only the needed bits to access twitter and your model, make updates. Very light weight.
However: PUB/SUB for workers? Really? Can't we get mongrel2 style work N:M (PUSH <- PULL, PUB <- SUB) distribution? This way we at least have an assurance that only one worker will get the job.
Re: Zedshaw/Tir
#6This isn't really a Tir feature, but do you hate when there's bugs in your core libraries and that guy who "owns" the broken library refuses to fix it? Me too, that's why Lua and LuaRocks are awesome. You get a tight core language that's completely described in_a_few_HTML_pages and then install all the platform libraries you need with LuaRocks. No more gatekeepers with Lua.
"No more gatekeepers" seems to be a theme with Zed's contributions of late. (And quite possibly over a longer time span.) In the case of Lua, the role of "core" and the "glue" are both a particular small and fast language. Because "core" is so small, any "benevolent dictators" in this environment have a small footprint. (Yes, there's a "small government" analogy here, but let's leave the politics out.)
The price of this is library fragmentation. There's more than one approach to objects, for example.
I wonder if there's a middle ground? Node.js seems successful in promoting a community standard of no blocking code.
Re: Zedshaw/Tir
#7Re: Zedshaw/Tir
#8Can this eliminate the callback hell that plagues the explicitly async frameworks (node.js, jquery, twisted, etc)?
But what about the downside? Now your handler is stateful and the language runtime is taking care of suspend / resume of the handler code. Can you migrate the suspended coroutine to another process, possibly on another machine? Or do you just take care to use sticky load balancing for all your stateful routes?
HN does something similar right? My understanding is that the fnid=... query param identifies a closure that's serving up a pagination of stories, and the "Unknown or expired link" error message happens when your own personal closure gets garbage collected by Arc.
In both the coroutine and closure cases, you've got something on the server side that's consuming resources even when there are no requests. This seems like a problem for scaling.
Re: Zedshaw/Tir
#9This description in the title would help: "A Simple Lua Web Framework For Mongrel2"
Agree. Though I clicked mostly for the "Zedshaw" in the title.
Re: Zedshaw/Tir
#10I would be nice to see Zed created a framework in Python. I am not happy with any of the existing ones.