Live data from Hacker News

Wasm_of_OCaml

github.com

1–10 of 53 posts

Re: Wasm_of_OCaml

#5

On this subject, a question. Has anybody done this with F#? To have F# compile to WASM instead of .NET. Thus have a F# program able to execute on WASM without needing .NET.

Isn't Blazor supposed to do that?

That's right, and there's Bolero too. From my understanding, Blazor is by Microsoft and aimed at C# primarily while Bolero is from the wider community and aimed at F#. https://fsbolero.io/

Re: Wasm_of_OCaml

#6
post #5

Earlier quoted context omitted.

Isn't Blazor supposed to do that?

That's right, and there's Bolero too. From my understanding, Blazor is by Microsoft and aimed at C# primarily while Bolero is from the wider community and aimed at F#. https://fsbolero.io/

Thank You. I had not heard of Bolero.

Re: Wasm_of_OCaml

#7

On this subject, a question. Has anybody done this with F#? To have F# compile to WASM instead of .NET. Thus have a F# program able to execute on WASM without needing .NET.

I’m not sure on the level of F# support, but Blazor supports full ahead-of-time compilation of .NET code to WASM:

“Blazor WebAssembly supports ahead-of-time (AOT) compilation, where you can compile your .NET code directly into WebAssembly. AOT compilation results in runtime performance improvements at the expense of a larger app size.

Without enabling AOT compilation, Blazor WebAssembly apps run on the browser using a .NET Intermediate Language (IL) interpreter implemented in WebAssembly”

https://learn.microsoft.com/en-us/aspnet/core/blazor/host-an...

Re: Wasm_of_OCaml

#8

On this subject, a question. Has anybody done this with F#? To have F# compile to WASM instead of .NET. Thus have a F# program able to execute on WASM without needing .NET.

We've explored this. Not everyone will have this problem, but with Blazor, you have to export almost everything about F#/.NET to WASM.

The Fable compiler team seems to have made steady progress towards a Rust compilation target which would solve this, but I'm not clear on where that works or how.

Re: Wasm_of_OCaml

#9
Sorry in advance for bikeshedding. This is a cool project and the name is clearly derived from js_of_ocaml, but does anyone know why js_of_ocaml ended up with such an awkward name in the first place? I am vaguely familiar with the "x_of_y" naming scheme in OCaml (which I also find awkward, but perhaps it sounds better in French) - is that the only reason? I can't find any discussion online, so maybe I'm really the only one who finds the name awkward.

Re: Wasm_of_OCaml

#10
post #9

Sorry in advance for bikeshedding. This is a cool project and the name is clearly derived from js_of_ocaml, but does anyone know why js_of_ocaml ended up with such an awkward name in the first place? I am vaguely familiar with the "x_of_y" naming scheme in OCaml (which I also find awkward, but perhaps it sounds better in French) - is that the only reason? I can't find any discussion online, so maybe I'm really the on…

It's just a dodgy French to English translation which then became a convention. Instead of e.g. to_string's buddy being called from_string, it was called of_string.

Here's a thread of reddit about it: https://www.reddit.com/r/ocaml/comments/6es88t/what_does_the...

Post reply on HN