Replies: 4 comments 5 replies
-
There already is an experimental prototype of wasm backend for OCaml, see this presentation to the wasm GC group by @zapashcanon and @chambart. |
Beta Was this translation helpful? Give feedback.
-
Indeed. Currently we're working on formalizing and proving our compilation scheme. We're also now confident about the fact that we'll be able to compile code written using jsoo to Wasm-only code (with the GC, exception and tail_call proposals available) without the need for users to change their code. We are currently implementing the feature in our runtime. In the (not so short) future we'll try to make C bindings available in Wasm by compiling the C bits with emscriptem and subverting the stubs. We'll (hopefully :-)) present our work at the OCaml workshop if you're interested @XantreGodlike. |
Beta Was this translation helpful? Give feedback.
-
Do the recent versions of Wasm have proper support for tail call optimizations? I'm speaking about full TCO, not simply tail recursion. In my memory, this was the main blocking point! |
Beta Was this translation helpful? Give feedback.
-
KC Sivaramakrishnan announced the ocaml-wasm GitHub organization. Hooray! |
Beta Was this translation helpful? Give feedback.
-
Wasm GC is implemented in chrome: https://chromestatus.com/feature/6062715726462976 .
I would like to propose the development of a new target for OCaml that compiles to WebAssembly (Wasm). This initiative will be a strategic move forward for our language and community, with benefits that could have far-reaching effects for the future of web development.
Fullstack Consistency: With a Wasm target, we can use OCaml throughout the entire stack. This opens up opportunities for fullstack OCaml development, simplifying workflows, improving code reusability, and reducing the context switching that comes with using multiple languages.
Expanding Use Cases: The Wasm target will allow OCaml to be used in broader contexts. Wasm is becoming more prevalent on the web and in other environments like serverless computing. By enabling OCaml to compile to Wasm, we can help expand OCaml's presence in these growing areas.
Strong Typing Advantage: Our language's strong typing system can make web applications more robust and error-resistant, something that could provide a significant advantage over dynamically typed languages commonly used in web development.
Performance: The performance characteristics of Wasm, including its near-native execution speed, will allow applications written in OCaml to run quickly and efficiently in the browser.
Interoperability: Wasm is designed to interoperate smoothly with JavaScript. This makes it possible to incrementally adopt OCaml compiled to Wasm in existing projects without a complete rewrite.
Growing Interest: The functional programming paradigm has been gaining traction in the web development community. Capitalizing on this interest by offering a solid pathway for OCaml to Wasm compilation could attract more developers to our community.
To take advantage of these opportunities, we need to invest in the development of a robust OCaml to Wasm compiler. This is a significant undertaking, but the potential benefits for the OCaml community and the broader web development landscape are considerable. Your thoughts, feedback, and support on this initiative are much appreciated.
I can start investigating it if someone gives me good starting points
Beta Was this translation helpful? Give feedback.
All reactions