Yay, another JavaScript super-set language that solves one problem.
Kal – a clean JavaScript alternative without callbacks
21–30 of 130 posts
Re: Kal – a clean JavaScript alternative without callbacks
#22This 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
#23https://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
#24Re: Kal – a clean JavaScript alternative without callbacks
#25Earlier 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.
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
#26If 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
#27Yay, another JavaScript super-set language that solves one problem.
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
#28In the `Asynchronous Wait` example did you mean: `function getUserFriends(userName, next) {` when you wrote: `var getUserFriends(userName, next) {`?
Re: Kal – a clean JavaScript alternative without callbacks
#29rzimmerman 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…
Re: Kal – a clean JavaScript alternative without callbacks
#30Well 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/