Kal – a clean JavaScript alternative without callbacks
31–40 of 130 posts
Re: Kal – a clean JavaScript alternative without callbacks
#32So 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/
Re: Kal – a clean JavaScript alternative without callbacks
#33Earlier quoted context omitted.
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
#34Excellent work. Especially useful since it appears to throw exceptions. That means it's a step up from Iced Coffeescript. The syntax is a little verbose and might be shortened to something like C#: `user = await db.users.findOne {name:userName}`. Would be a lot more clear to me.
kal -o output.js -f beautify input.kal
to see the sausages being made. The http server demo is a good example (https://github.com/rzimmerman/kal/blob/master/examples/async...)
Re: Kal – a clean JavaScript alternative without callbacks
#35So 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/
Thanks. I think the main issue with JS callback syntax is that it quickly becomes unmaintainable. Hopefully this fixes a lot of that by abstracting away the mechanics. I don't think there's something fundamentally wrong with the "relinquish control and wait for I/O" model, so I tried to make that explicit here.
Re: Kal – a clean JavaScript alternative without callbacks
#36rzimmerman 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
#37Earlier quoted context omitted.
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
#38The title is kinda funny to the russian ear because kal means feces in Russian :)
That is really unfortunate... I chose it because it in Hebrew it roughly means something like easy/simple/BASIC. edit: More importantly, does that make you more or less likely to use it?
Also, note that kal is mere `faeces` in Russian, not `shit`. I don't remember when I've last used the word outside of a hospital... or inside, for that matter.