Live data from Hacker News

Kal – a clean JavaScript alternative without callbacks

rzimmerman.github.io

1–10 of 130 posts

Re: Kal – a clean JavaScript alternative without callbacks

#3

This is a project I've been working on in my spare time for a while now and I've finally decided to throw it out there and get some feedback. Do you think the 'wait for' callback syntax is useful? What big features do you think are missing?

Looks pretty good! I like it. To be honest I will not use it in my projects. I prefer using ES6 syntax for this problem when it's available.

Re: Kal – a clean JavaScript alternative without callbacks

#5

This is a project I've been working on in my spare time for a while now and I've finally decided to throw it out there and get some feedback. Do you think the 'wait for' callback syntax is useful? What big features do you think are missing?

The async handlers looks great, specially parallel and series iterators. I'm not sold on

    wait for friends from db.friends.find()
    //vs
    friends = await db.friends.find()
it's a bit hard to follow despite the natural language.

Is this a fork of the CoffeeScript compiler? Will it benefit from upstream changes/features?

Re: Kal – a clean JavaScript alternative without callbacks

#6
post #4

https://github.com/kriskowal/q solves this today without needing to cross compile. http://koush.com/post/yield-await-v8 will address this natively however unlike Q or Kal you can't start using it today.

There is no need for hacks, just run node with the `--harmony` flag to get yield support today.

Q is a huge, monster library. It's 2x the size of caolan/async, which is already bloated. I personally think it's better to use https://github.com/mbostock/queue or another small, understandable library.

Re: Kal – a clean JavaScript alternative without callbacks

#8

This is a project I've been working on in my spare time for a while now and I've finally decided to throw it out there and get some feedback. Do you think the 'wait for' callback syntax is useful? What big features do you think are missing?

The async handlers looks great, specially parallel and series iterators. I'm not sold on wait for friends from db.friends.find() //vs friends = await db.friends.find() it's a bit hard to follow despite the natural language. Is this a fork of the CoffeeScript compiler? Will it benefit from upstream changes/features?

It's not a fork of CoffeeScript (though there are a lot of similarities). I'd initially tried doing that but I really couldn't get things to work the way I wanted. Mostly, it's a pretty major rearchitecture to get coffee to parse a function block that way.

I think syntax highlighting helps a lot in this case, so try out the tmbundle in Sublime or TextMate (https://github.com/rzimmerman/kal.tmbundle) if you can.

Re: Kal – a clean JavaScript alternative without callbacks

#9
post #4

https://github.com/kriskowal/q solves this today without needing to cross compile. http://koush.com/post/yield-await-v8 will address this natively however unlike Q or Kal you can't start using it today.

Q and ECMAScript 6 solve the callback issue, but I think people might like the built in async iterators and error handling.
Post reply on HN