koka
koka copied to clipboard
Consider better Javascript Supports
Hi!
Koka is an excellent language that supports algebraic-effects. Great Job!
Recently, I wrote a simple canvas demo via Koka v1.0. I know Koka v2.0 now is under development, just leave my wishlist here for better javascript supports.
-
use
ES modulesinstead ofAMDandrequirejs -
better
TypeScriptsupports. eg. generate*.d.ts -
better
VSCodesupports. now there is a vs-code extension just for syntax-highlighting -
WASMsupports. Koka v2 without needing a garbage collector or runtime system is suitable for WASM. -
an npm package for
nodejs apilike esbuild for better integrating with other build tools -
JSXsupports.Algebraic Effectsis perfectly fit for UI development andJSXcan improve the readability -
and so on...
I believe Koka can be a good competitor for rescript, purescript, and elm if there is better support for JavaScript:)
LGTM
LGTM
Thanks for the feedback! Currently I am mostly focused on the C backend for best performance but keeping the JavaScript backend up-to-date. Some thoughts:
- It should be not to hard to generate ES modules and perhaps even typescript -- all the code is in
src/Backend/Js/FromCore.hs. - VS code syntax highlighting should be there soonish -- it should be easy to port the
support/atom/grammars/koka.jsonfile tovscode. - WASM: that is definitely a goal and it should be not too hard by starting from the C backend. I am on the WASM design committee now and seeing if we can extend WASM to offer more efficient algebraic effect support.
- I really like that Koka is portable enough to easily run it natively compiled (through C) or in the browser/node (with JS). However, integration with other JS libraries is generally hard as Koka is strictly typed while JS is dynamic -- this may be difficult with the
JSXcase (but I have not looked into it)
I might want to tackle some of the JS issues but I'm having trouble getting the interactive JS console to run, are there any docs on doing that? I'm getting weird assert errors (the default C backend works in interactive mode). Thanks!
@alongalky Are you still getting these errors? For me the Javascript console works normally, so if you encounter anything unusual feel free to open an issue :)