Re:Kal – a clean JavaScript alternative without callbacks
by rzimmerman on Friday August 16, 2013 @10:18PM
(#6227935)
Thanks! I had not thought to make the comparison to Haskell and monads. That's pretty interesting.
A lot of people prefer symbols over keywords, and I think that's mainly a readability issue. I personally prefer more keywords with good syntax highlighting, so that's what I went with (and why I almost immediately made a .tmbundle).
Re:Kal – a clean JavaScript alternative without callbacks
by iandanforth on Saturday August 17, 2013 @01:41PM
(#6229732)
Coming from a Python background I appreciate the verbosity. There are times when symbols and being concise may be necessary, but I find a non-expert human readable default to be very appealing.
Thanks for your hard work!
Re:Kal – a clean JavaScript alternative without callbacks
by GeZe on Friday August 16, 2013 @10:29PM
(#6227958)
If you are looking for a syntax closer to Haskell's, you can take a look at LiveScript (http://livescript.net/)
eg.
getUserFriends = (userName) ->
user <- findUser userName
friends <- findFriends user
...
Specifically, the section on "backcalls": http://livescript.net/#backcalls
Re:Kal – a clean JavaScript alternative without callbacks
by damncabbage on Saturday August 17, 2013 @08:49AM
(#6228954)
If you are looking for Haskell, you can take a look at Fay (https://github.com/faylang/fay/wiki).
Re:Kal – a clean JavaScript alternative without callbacks
by chx on Saturday August 17, 2013 @09:57AM
(#6229087)
What about Haste? https://github.com/valderman/haste-compiler
Re:Kal – a clean JavaScript alternative without callbacks
by seanmcdirmid on Saturday August 17, 2013 @03:54AM
(#6228496)
Back calls look like array programming gone even crazier. Was live script inspired by APL?
Re:Kal – a clean JavaScript alternative without callbacks
by pcj on Friday August 16, 2013 @10:19PM
(#6227940)
This is beautiful work! I see small shades of inspiration from the .Net TPL[1] and the more recent async-await paradigm[2] in C#. But, this is way more concise and beautiful implementation :-)
[1] - http://msdn.microsoft.com/en-us/library/vstudio/system.threa...
[2] - http://msdn.microsoft.com/en-us/library/vstudio/hh191443.asp... and http://msdn.microsoft.com/en-us/library/vstudio/hh156528.asp...
Re:Kal – a clean JavaScript alternative without callbacks
by rzimmerman on Friday August 16, 2013 @10:57PM
(#6228012)
Thanks! I was wondering if someone would make that comparison. I saw async-await a little after I started working on this and felt it was good confirmation that this was actually a reasonable idea.
For this Kal code...
Here's a pseudo-ish implementation in pseudo-ish Haskell. I like the concept of Kal, and I look forward to seeing what people do with it. Regarding syntax, I have to admit that I share the opinions of a few others in terms of preferring symbols over so many keywords, but that's a minor nitpick. Great job!