neilmix.com — "Narrative JavaScript is a small extension to the JavaScript language that enables blocking capabilities for asynchronous operations. This makes writing asynchronous code sequences easier and increases code readability."
May 30, 2006 View in Crawl 4
spamzorMay 31, 2006
What the hell... I bury you!
tehmothMay 31, 2006
javascript does have a strong object model, it just happens to be prototype based, not class based.
spamzorMay 31, 2006
I want a scripting language as strongly typed as C# - this is by the far best programming language I have used as a programmer.
daschMay 31, 2006
Wow, I really feel sorry for you then. Try out Ruby, there's reason it's so popular -- you'll probably end up typing ~50% less than you do now, and the language is a bliss to work with.
rideagainMay 31, 2006
Narrative javascript doesn't remove the asynchronous features, it just allows you to write, basically, multithreaded javascript (what they call "co-operative multitasking" in the article). When you have a bunch of little animations going around, it's very natural to launch a thread for each and let them finish when they're done. I suspect that this makes the code easier to maintain, because the animation threads are more self-contained than if you had a single thread that had to take care of all animations.
rideagainMay 31, 2006
asynchronous and narrative in this context both mean cooperative multitasking.
drfloyd5May 31, 2006
Crap, this belongs below...@heinousjay - I will agree that JS does not expose the function pointers to you as a programmer. But a very "function pointer like" mechnism is present. The function keyword just gives a block of code a handle that you can attach to a variable (optionally creating it if you use the function x() form). The () operator then invokes that code assigned to the handle, NOT the variable.x = function() {} is the same as function x() {}additionally, given the above...y = x; y() is the same as calling x();Looks like function pointers, smells like function pointers...Add that to the abilty to add members to a struct on the fly, where some of those members act like function pointers and you have JS Objects. It's really quite elegant. I bet it was a cinch to implement.