do you know any small/portable programming languages that can directly generate wat/wasm without heavy tooling like llvm? i.e. something that could run on m68k
@mntmn It's a very interesting ask and I wish I could help.
I'm also extremely curious about the target application space, because in my head if I'm trying to generate wasm I'm already in a heavyweight space. Like... "I'm going to use the tiniest machine I can to compile this wasm so I can then run it in... Chrome? All three gigs of Chrome?"
@mntmn Free Pascal has a webassembly target, mostly with our own tooling, IIRC. And it runs 68k hosted (Amiga/Linux), if needed.
WASM works very differently to any "regular/real CPU" assembly. It's a stack machine, which is mostly good for compilers with SSA or some sort of a binary tree internal representation. It's not even recommended that you write it by hand...
Calling it "assembly" was the biggest marketing stunt ever, IMO, to gain the cool factor... But this is a story for another day.
@mntmn In theory, yes. I never tried it, but I could... And fix it if it doesn't work. 😅 But in theory (with some caveats), on any platform which can host a native compiler - and Amiga is one of them -, can be used to run any sort of cross-compiler builds too. It won't be fast, but should be usable.
It all depends what kind of external tooling it needs. But I think we mostly did our own tooling, because external tools were too dependent on "what LLVM does".
@mntmn I don't expect you actually intend to run this #WASM compiler on a Motorola 68K computer, you just want something that would be small enough to run on an m68k computer, right?
#GuileScheme has a WASM back-end called Guile Hoot developed in part by the Guile maintainer Andy Wingo ( @wingo ) and in part by the Spritely Institute.is the only such language that I know that could do this, although Guile is a relatively large Scheme implementation.