Where do things stand today regarding WebAssembly?

Personally, I think that “WebAssembly is the Next Big Thing.™” The next Very Big Thing.™

And so, I would like to know what present plans are to support it. Are we going to compile to C++ and then rely on tools such as Emscripten, or will we expect the gcc compiler suite to support it, or will Haxe undertake to generate WebAssembly bytecodes for itself as it presently now does e.g. for Flash or nme?

What do you think – by when – and, why?

I don’t know much about WebAssembly, but I’m pretty sure that just outputting C++ or HL/C output and compiling it to webassembly using native C/C++ tools will be enough.

I’ve heard it thrown around that a direct WebAssmebly target could become attractive once Garbage Collection makes it into the spec (GitHub - WebAssembly/gc: Branch of the spec repo scoped to discussion of GC integration in WebAssembly). Other than that HXCPP or HL/C would be needed, since they include their own GC.

1 Like

Well, I know that this is indeed a design-concern for them, because some of their runtime targets don’t support “explicit” garbage collection … but I guess that I really think that the Haxe team should be making – and, stating that they are making – specific in-roads into the direct generation of WebAssembly bytecode as a target.

I predict that WebAssembly is going to “suddenly(!) become a Very Big Thing.” But of course there’s going to be lead-time in setting up your language system to do it, “so we’d better get started now.” When Wasm suddenly turns big, you need to be able to say that you are "already in" this game. Not that you’ve got an inelegant strategy or that you’re racing to catch up. You’d like to have the O’Reilly book well in process by the time Wasm “hits big.”

1 Like

Well, contributions are welcome :slight_smile:


"Wel-l-l-l … I admit that I really hadn’t thought of that angle – yet."

I’ve pored through that OCaml source-code and I candidly admit that I presently find that language to be quite baffling – which is maybe a bit of a strange thing to say since I usually like to say that “I’ve been a student of programming languages for over thirty-five(!) years.” Maybe that’s a very big part of what’s put me off – so far.

If I seriously did want to put in a bid for more-active involvement … I do have a lot of compiler experience, come to think of it … “where on earth would I begin?” The thought of actually wrapping my head around “this Haxe thing,” let alone actively contributing to it, is quite daunting. "But . . ."

Do you have any materials on-line that might help me to explore this possibility? (I can’t deny that I very well might be qualified, although this remains to be seen.)

One thing that really helps a lot if you’re new to OCaml is IDE support - the VSCode extension is not terrible. That means you get errors on-the-fly via diagnostics, have hover hints to show you the types of things (there’s almost no explicit type hints anywhere in the compiler, it’s all inferred) and of course completion. Also the code navigation features (workspace symbols, goto declaration…).


I don’t think I’ve gotten that far yet, Gamma . . . “functional programming” is surely the bee’s knees but . . . :exploding_head: . . . “it somehow tires my brain.” (And I really don’t know why.)

Well, “I called myself a ‘student,’ didn’t I?” Maybe it’s just time to have another go . . . :smiley: . . . (but which tutorials should I start with?)

Hey, I’m not exactly a newcomer to “this crazy programming thing,” and, If I could actually become actively involved in this feature that I’m “standing around here just wishing for,” now wouldn’t that just be cool.

(Ummm … I didn’t "just ‘sign up.™’" No, not quite yet.)

1 Like

TBH I didn’t fully understand your two last posts, but if you’re seriously interested in joining the compiler development, we could help you out with both OCaml and Haxe compiler architecture details via some real-time communication channel (Discord/Slack), but you have to be prepared to wrap your head around the general FP way of dealing with data (basically, get ready for a lot of recursion and pattern matching). Besides that, as it was said before, diving deeper into macros can give you a gentle intro into how the compiler works.