3 ms·
It's obsolete now, but before async/await was part of JS proper I worked on a compile-to-JS language that handled this by compiling to callbacks: https://github
by rzimmerman 3y ago
It's obsolete now, but before async/await was part of JS proper I worked on a compile-to-JS language that handled this by compiling to callbacks: https://github.com/rzimmerman/kal https://github.com/rzimmerman/kal
It included try/catch support and fancy stuff, like loops. The source may be interesting for anyone interested in compilers: https://github.com/rzimmerman/kal/blob/master/source/generator.litkal https://github.com/rzimmerman/kal/blob/master/source/generat...
The Kal compiler is written in Kal, but it's supposed to be easy to read. Surprisingly the browser demo still works: http://rzimmerman.github.io/kal/demo.html http://rzimmerman.github.io/kal/demo.html
- sebazzz 3y agoBefore it was par of JS proper Typescript could also transpile to callbacks. Good stuff.
- 14u2c 3y agoBabel will still pollyfill async await too if configured.
- solarkraft 3y agoKal looks super cool!
- lf-non 3y agoThis looks pretty nice. Would you be interested in reviving this to target type-safe ts ? I have been looking forward to a type-safe coffee-script. Civet.dev comes close but goes into some pretty esoteric directions.
- rzimmerman 3y agoThat's a cool idea and it could be a lot more useful with modern approaches, like true type systems and pattern matching. I don't really have time to work on that but I support the effort of bringing some of CoffeeScript back to the world.