3 ms·
Green threads are indeed very useful, and probably the right way to go. In Javascript, see Tamejs: http://tamejs.org/ http://tamejs.org/ NCD looks interesting,
by kerneis 14y ago
Green threads are indeed very useful, and probably the right way to go. In Javascript, see Tamejs: http://tamejs.org/ http://tamejs.org/
NCD looks interesting, in particular the backtracking feature.
But I'm a bit concerned by your choice of developing a new language from scratch, with a very awkward syntax (at least at first sight). Why not extend an existing language?
See CPC for instance, which extends the C language with a spawn primitive (disclaimer - this is my PhD thesis project): http://www.pps.univ-paris-diderot.fr/%7Ekerneis/software/cpc/ http://www.pps.univ-paris-diderot.fr/%7Ekerneis/software/cpc... and http://www.pps.univ-paris-diderot.fr/%7Ekerneis/research/ http://www.pps.univ-paris-diderot.fr/%7Ekerneis/research/ for more details.
- ambrop7 14y agoYes, Tamejs and CPC indeed do exactly what I had in mind. CPC is particularly amazing for doing this to C. Considering NCD: you might have noticed that NCD was never meant to be a general-purpose language, but rather a simple scripting language for controlling other programs and OS configuration. My thinking was that extending a language with the features that define NCD (asynchronous execution, backtracking and extended statement lifetime) would essentially require a complete rewrite of a language implementation. However after seeing tamejs and your CPC I'm not so sure anymore :) P.S. Check out the Read File example I just added to the NCD demo page; it shows how backtracking can be used to handle errors elegantly.