Live data from Hacker News

Kal – a clean JavaScript alternative without callbacks

rzimmerman.github.io

21–30 of 130 posts

Re: Kal – a clean JavaScript alternative without callbacks

#22

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?

I also vote for 'await' here. The 'wait for friends from' construct looks too much like BASIC for my liking. It's not clear which terms are built into the language ('wait', 'for', 'from') and which are not ('friends'). Also, since the eventual result of that line is an assignment to 'friends', using the existing = operator makes the language more consistent.

Re: Kal – a clean JavaScript alternative without callbacks

#23
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.

If you're taking about node, what difference does it make how large the library is?

Re: Kal – a clean JavaScript alternative without callbacks

#25
post #22

Earlier quoted context omitted.

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?

I also vote for 'await' here. The 'wait for friends from' construct looks too much like BASIC for my liking. It's not clear which terms are built into the language ('wait', 'for', 'from') and which are not ('friends'). Also, since the eventual result of that line is an assignment to 'friends', using the existing = operator makes the language more consistent.

Thanks for the feedback. It seems like a lot of people would prefer a more normal looking assignment.

If you get a chance (and use TextMate or Sublime Text), please give syntax highlighting a try (https://github.com/rzimmerman/kal.tmbundle)!

Re: Kal – a clean JavaScript alternative without callbacks

#26
rzimmerman I like it! and would consider using it for my next big project.

If I were you I would make a slight course correction follow in the footsteps of Python and Go and have one and only one correct way to do something.

When you say use two spaces, but you can use more if you want, make it an error to use more.

Pick the correct way to call a function. Pick the correct way to declare a function.

Keep up the good work.

Re: Kal – a clean JavaScript alternative without callbacks

#27
post #10

Yay, another JavaScript super-set language that solves one problem.

On the one hand, this comment has the kernel of a legitimate criticism in it, and gets across why I probably won't use this language in a real project.

On the other hand, that's so rude! Not every project has to be the next CoffeeScript to be interesting and worthy of appreciation. If you don't like it, just click on a different story instead of cutting down someone who chose to make something cool and share it with us.

Re: Kal – a clean JavaScript alternative without callbacks

#29

rzimmerman I like it! and would consider using it for my next big project. If I were you I would make a slight course correction follow in the footsteps of Python and Go and have one and only one correct way to do something. When you say use two spaces, but you can use more if you want, make it an error to use more. Pick the correct way to call a function. Pick the correct way to declare a function. Keep up the good…

Thanks! I wouldn't call it stable or production ready by any means, just as a disclaimer.

Re: Kal – a clean JavaScript alternative without callbacks

#30
So instead of encouraging you to actually fix the bad nested callback code, you can dress it over with fancy syntax.

Well done on making a whole language though. It's pretty challenging and I hope you do well.

Aside: This seems very similar to narrativeJS in concept http://www.neilmix.com/narrativejs/doc/

Post reply on HN