Live data from Hacker News

Zed Shaw: Tir Web Framework Officially Up

sheddingbikes.com

31–40 of 70 posts

Re: Zed Shaw: Tir Web Framework Officially Up

#31
post #2

I love the natural style of page conversation on the example page. As a Java developer, I wish that this style were possible on the servlet platform: local login_page = Tir.view("login.html") local login_form = Tir.form { 'login_name', 'password'} local function login(web, req) local params = login_form:parse(req) repeat params = web:prompt(login_page {form=params, logged_in=false}) until login_form:valid(params) ret…

The natural style is sweet for things like that. I did the Hype.la signup process with natural style and it meant I didn't have to touch the database the whole time. If they quit half-way through then no DB junk left over.

Where this kind of coroutine stuff sucks though is in anything that's "RESTy". In other parts of Hype.la I had simple Xhr callbacks that just grabbed lists of data, so the coroutines were just annoyingly in the way and half the time they were just a big loop with an if-statement for the URLs.

That's where the evented came in. In that way I just map actions to callbacks and done.

Then I ran into a few simple things that didn't work in evented and were still stateless, like the search interface, and so I use the stateless handler for that. Nice and snappy with no extra junk.

Another advantage of all this is that, if you have a part of your app that needs to be resistant to restarts, then you can craft it evented or stateless. In other parts, restarts aren't a big deal so you can do natural. And since everything is just a bunch of little processes, it scales out nice and doesn't have as much of the "gotta-copy-the-world-for-users" that Seaside upgrades do.

Re: Zed Shaw: Tir Web Framework Officially Up

#32
Last time this was posted I was really interested in it. So interested in fact, I built a django-style template library to go with it because I really liked 'extends' and 'block'.

Github https://github.com/meric/tier/

Example https://github.com/meric/tier/blob/master/main.lua http://pastehtml.com/view/1c26ovp.html

Zed would think this is contradicting the point of Tir, though; it being a micro-framework. =\

Re: Zed Shaw: Tir Web Framework Officially Up

#33
post #7

This one really surprised me: "Finally, there's not much for deployment. I run my apps in GNU screen and that's about it." Seriously? Is he that lucky, serves that little traffic, or does he run with redundant power, network, server and 24/7 monitoring in an inaccessible bunker? I haven't been able to run even my toy web apps without something like monit - due to both things under my control and outside of it.

Hype.la is the only real Tir app, with the Mongrel2 BBS demo being a "proto-Tir" app. There's hardly anyone on it yet since I didn't really "launch" it. Because of that, I just run it in screen and I'll worry about the deployment scenario later. Also, the Tir start command actually works kind of like a little monit/daemontools, so if a handler dies it gets restarted. It's pretty robust already.

And yeah I need some monit soon, but so far it's been running fine for the small scale.

Re: Zed Shaw: Tir Web Framework Officially Up

#34
post #16

-------------- NO TESTS ---------------- You must work at a startup. Brilliant. Hype.la is also pretty slick. Maybe it will become the blogroll of open-source projects.

Ha, yeah I had to put that in. I find working in the valley is kind of like working with a bunch of guys before Knuth and Dijkstra established structured programming. It's like they say, "Yo, I don't do if-statements man. I use gotos only. That logic and structure crap just slows me down and busts up my creative chi."

As for hype.la, stay tuned. I gotta fix up the ad blocks and improve the UI a bunch, but I'm really aiming for it to be for FLOSS and other artists to do ads without feeling like sleeze. Definitely something I want.

Re: Zed Shaw: Tir Web Framework Officially Up

#35
post #32

Last time this was posted I was really interested in it. So interested in fact, I built a django-style template library to go with it because I really liked 'extends' and 'block'. Github https://github.com/meric/tier/ Example https://github.com/meric/tier/blob/master/main.lua http://pastehtml.com/view/1c26ovp.html Zed would think this is contradicting the point of Tir, though; it being a micro-framework . =\

Interesting, I'll take a look at this some more. My only question is, isn't plain old Lua already like django's templates. What specifically are you adding that embedded lua doesn't just give you?

Re: Zed Shaw: Tir Web Framework Officially Up

#36
post #30
post #27

Earlier quoted context omitted.

Since we're all bragging, I finished my MSCS at Stanford with over a 4.0 GPA, wrote a game that was a finalist in the CS248 competition, had my first paper published, TAed CS210, launched my startup, learned Django and CoffeeScript and JavaScript, wrote a charting library in CS/Raphael, started learning how to be someone's boss, and moved across the country and forced myself to make friends. All in all I feel good ab…

Over a 4.0 GPA? Man, are grades that badly inflated now that they have to add extra points to the GPA to make people seem better? No knock on you at all, but just curious what the scale is.

At my uni (University of Montreal), A was worth 4.0 and A+ was worth 4.3. I don't think it comes from grade inflation, though. Just a different convention.

According to Wikipedia, the 4.0 scale is anything but standard. http://en.wikipedia.org/wiki/Grade_(education)

Re: Zed Shaw: Tir Web Framework Officially Up

#37

Very cool. I was just looking for other Seaside-style web frameworks today. The "natural style" mode in Tir is just like the main way to build web apps in Seaside. Aside from Lua and Smalltalk, what other languages could host this kind of framework? I know Ruby 1.9 has Wee, but that doesn't seem to be "ready for prime time."

The main feature that is required is the ability to callcc and/or coroutine yield from any point in the stack. If you look at Wee, the user of the framework has to callcc all over the place to make it work. In Tir I have web:prompt(), which itself does the yielding without anyone having to care.

The significance of this is that Tir can provide one API for all three styles without special effort from the user.

Re: Zed Shaw: Tir Web Framework Officially Up

#38
post #5

So in 2010 Zed has written his own web server which runs his new framework he wrote for the new webapp he wrote. What did you do this year?

I wrote a rant about how much I hate people that kick back and put their feet up on the table. Oh, nope, that was Zed, too! (But seriously, Mongrel 2 is an amazing work of software engineering. In addition to being a good web server, it's also a good example of how nice C is if you forget how they did it in the 70s and write it like it's 2010.)

Yep, 'cause pointing your nasty dogs at someone is just low class. (ha)

Re: Zed Shaw: Tir Web Framework Officially Up

#39
post #35
post #32

Last time this was posted I was really interested in it. So interested in fact, I built a django-style template library to go with it because I really liked 'extends' and 'block'. Github https://github.com/meric/tier/ Example https://github.com/meric/tier/blob/master/main.lua http://pastehtml.com/view/1c26ovp.html Zed would think this is contradicting the point of Tir, though; it being a micro-framework . =\

Interesting, I'll take a look at this some more. My only question is, isn't plain old Lua already like django's templates. What specifically are you adding that embedded lua doesn't just give you?

Template inheritance. See http://docs.djangoproject.com/en/dev/topics/templates/#id1

  `Template inheritance¶
  The most powerful -- and thus the most complex -- part of 
  Django's template engine is template inheritance. Template 
  inheritance allows you to build a base "skeleton" template 
  that contains all the common elements of your site and 
  defines blocks that child templates can override.`
Having made it in lua myself, I can tell you it is indeed quite complex. ;)

The lua template only has "include" (i.e. copying another template into this template), but not "extends", (i.e. use another template as a skeleton and this template only provides details on how to fill it).

Re: Zed Shaw: Tir Web Framework Officially Up

#40
post #30
post #27

Earlier quoted context omitted.

Since we're all bragging, I finished my MSCS at Stanford with over a 4.0 GPA, wrote a game that was a finalist in the CS248 competition, had my first paper published, TAed CS210, launched my startup, learned Django and CoffeeScript and JavaScript, wrote a charting library in CS/Raphael, started learning how to be someone's boss, and moved across the country and forced myself to make friends. All in all I feel good ab…

Over a 4.0 GPA? Man, are grades that badly inflated now that they have to add extra points to the GPA to make people seem better? No knock on you at all, but just curious what the scale is.

I graduated my high school with a 4.7. They add in the 'bonus points' for taking AP and honors classes after the division, not before.

Oh, and everyone over a 4.0 was reported as valedictorian.

Post reply on HN