▲ | johnisgood 3 days ago | |||||||
What about languages like Java, or other popular languages with GC? | ||||||||
▲ | lmm 2 days ago | parent | next [-] | |||||||
Java FFI is slow and cumbersome, even more so if you're using the fancy auto-async from recent versions. The JVM community has mostly bitten the bullet and rewritten the entire world in Java rather than using native libraries, you only see JNI calls for niche things like high performance linear algebra; IMO that was the right tradeoff but it's also often seen as e.g. the reason why Java GUIs on the desktop suck. Other languages generally fall into either camp of having a C-like stack and thread model and easy FFI (e.g. Ruby, TCL, OCaml) and maybe having futures/async but not in an invisible/magic way, or having a radically different threading model at the cost of FFI being slow and painful (e.g. Erlang). JavaScript is kind of special in having C-like stack but being built around calling async functions from a global event loop, so it's technically the first but feels more like the second. | ||||||||
| ||||||||
▲ | pjc50 2 days ago | parent | prev | next [-] | |||||||
C# does marshal/unmarshal for you, with a certain amount of GC-pinning required for structures while the function is executing. It's pretty convenient, although not frictionless, and I wouldn't like to say how fast it is. | ||||||||
▲ | andrewflnr 2 days ago | parent | prev | next [-] | |||||||
Similar enough to C I guess, at least in their stack layout. | ||||||||
▲ | fnord123 2 days ago | parent | prev [-] | |||||||
It's explained in the article. |