keean / zenscript

A trait based language that compiles to JavaScript
MIT License
42 stars 7 forks source link

WASM #42

Open shelby3 opened 6 years ago

shelby3 commented 6 years ago

I’m having some doubts about WASM. Any thoughts?

sighoya commented 6 years ago

I'm not very familiar with WASM but I think it is better for "statically typed" languages.

One point that annoys me is the missing support for c like structs in WASM. Instead they are distributed into smaller compositions? Further, as you already mentioned is the missing GC for garbage collected languages which would be nice for the future.

And the alternative? Compile to javascript is a loss of type information at the expense of performance despite that javascript runs very fast once parsed these days.

Do you have thought about transpiling to jvm bytecode, instead? The jvm has a first class GC and is supported by other platforms very well. The only problem I see so far is that it offers limited value types which seems to change in future, however.

shelby3 commented 6 years ago

One point that annoys me is the missing support for c like structs in WASM. Instead they are distributed into smaller compositions?

Shocking. :astonished: :man_facepalming:

There’s probably some justification. But this is what happens when there’s so many competing design pressures. Difficult to design a VM that works well for all PLs and covers all the security flaws at the low-level.

Still hoping for @keean to weigh in with his opinions. He is usually quite knowledgeable about details I’m unaware of.

The only problem I see so far is that it offers limited value types which seems to change in future, however.

Interesting. The GC has been improving also.

But still no goroutines. And not as much low-level control as Go. Still leaning towards Go. See recent discussion in the Concurrency issues thread #17 and WD-40 issues thread #35.

Go compiles to JavaScript (via GopherScript) and there's a project underway to compile it to WASM.