Live data from Hacker News

Zedshaw/Tir

github.com

11–20 of 39 posts

Re: Zedshaw/Tir

#12
How is the state stored for "natural style" functions? Is this continuation style something that Lua supports natively?

Re: Zedshaw/Tir

#13
post #12

How is the state stored for "natural style" functions? Is this continuation style something that Lua supports natively?

Lua has built-in support of this functionality through coroutines [1]. Serializing the coroutines to a database does requires a library [2].

[1] http://lua-users.org/wiki/CoroutinesTutorial

[2] http://lua-users.org/wiki/PlutoLibrary

Re: Zedshaw/Tir

#15

No Core This 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…

>The price of this is library fragmentation. There's more than one approach to objects, for example.

I've found that to be the case with Lua in general. The language is pretty easy to hack with, and so there's alot of wheel making. Lua has a mantra of "provide mechanisms, not policies", and since there's no formal class system, and multiple ways to define modules it's almost fragmented by design.

I think the designers are working on a better module system for the next release, or did that make it into 5.2?

Re: Zedshaw/Tir

#16
post #8

I'm really excited about async programming in what Zed dubs the "natural style": using coroutines to suspend and resume processing at points where input is needed. Can 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. Ca…

Scaling and session affinity are the big concerns with Coroutine and Continuation based web based solutions.

Sticky load balancing is the norm (http://continuity.tlt42.org/Performance_and_Scalability) but it means a running Coro/Continuation can remain in memory for quite a while (Seaside saves continuation (or it did) to disk after some idle time).

Still I love using these kind of libraries / frameworks especially for smaller web apps.

Some refs:

* See http://news.ycombinator.com/item?id=1686177

* Continuity (Perl Coro web library) - http://continuity.tlt42.org/ & https://metacpan.org/module/Continuity

* Seaside (Smalltalk Continuation based web framework) - http://www.seaside.st/

Re: Zedshaw/Tir

#17
post #8

I'm really excited about async programming in what Zed dubs the "natural style": using coroutines to suspend and resume processing at points where input is needed. Can 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. Ca…

(Edit: Sorry, you seem to know all this. Keeping my post here for posterity)

The logical end to this road is continuation-based web servers. See http://docs.racket-lang.org/continue/index.html and my approach to the Arc challenge, https://gist.github.com/1304257

The interesting function which does all the work is:

  (define (start req)
    ;; First, we get input from the user
    ;; Then, we pause for the link
    ;; Finally, we show what the user typed.
    (let ([input (get-input-from-user)])
      (pause-for-link)
      (show-input input)))
Each of these calls - get-input-from-user, pause-for-link, and show-input sends a complete page back to the user and waits for them to click a link or submit a form request. It's a really smooth way of solving some problems.

Re: Zedshaw/Tir

#18
post #7

I would be nice to see Zed created a framework in Python. I am not happy with any of the existing ones.

If, then wait a bit, at the moment he is focusing and having a lot of fun writing books. We can expect (or hope) to have him back to the code in a couple of months :)
Post reply on HN