Re:WebAssembly Interface Types: Interoperate with All the Th...
by throwaway34241 on Thursday August 22, 2019 @03:04AM
(#20765397)
I've often wondered for client-side apps if a simple thread-per-goroutine model would work for Go. Sure, you'd lose some of the easy scalability. But I think that's mostly useful for server software and client apps don't usually have thousands of concurrent tasks anyway. You could also lower the overhead some for calling C libraries (which client software does more often).
Re:WebAssembly Interface Types: Interoperate with All the Th...
by afiori on Thursday August 22, 2019 @02:19AM
(#20765178)
I think Rust macros and C++ templates are not lazy wrt execution.
Re:WebAssembly Interface Types: Interoperate with All the Th...
by ori_b on Thursday August 22, 2019 @03:51PM
(#20771744)
They are lazy wrt compilation. So, unless you use the specialization in C++ or Rust, there's no code to call.
std::vector<Java.lang.Object>
Simply doesn't exist for interop code to call.
You just need to manually insert stack growth checks before all function calls in anything that can be called from go to support goroutines, because those can't live on a normal stack and still be sufficiently small to support desired go semantics. Async has similar issues, where the semantics are incompatible, which means that many things go horribly wrong in cross-language calls
Or you use a lowest common denominator and essentially treat the thing like an rpc, with a thick layer to paper over semantic mismatches.
And that's before we get to things like C++ or D templates, Rust or Lisp macros, and similar. Those are lazy syntactic transformations on source code, and are meaningless across languages. Not to mention that, if unused, they produce no data to import. But, especially in modern C++, they're incredibly important.