3 ms·
The point, which he outlines in the post, is to be able to mix high level programming with lower level languages. This is already a common pattern in the indust
by Manishearth 10y ago
The point, which he outlines in the post, is to be able to mix high level programming with lower level languages. This is already a common pattern in the industry where you write your application in python/ruby and speed up the tight loops with C/C++/Rust. The lingua franca of the interop is C. Which means that the boundary between the two is very stark and unsafe. You can't use advanced typesystems or seamlessly share datatypes. I'm working on something similar these days (C++ and Rust though, no high level language). You lose all template/generics info at the C bindings boundary. Bindgen programs let you get it back to some degree, but forcing monomorphization/etc are all not easy problems to solve without making the compilers talk to each other (also not easy to do).
Will's idea seems to be to use Rust as a target for a high level GCd language, which can then (mostly) seamlessly interop with "pure" Rust code, and the interop won't have an unsafe boundary.
- pjmlp 10y agoYou should check how COM and now WinRT (aka 2nd coming of COM+ Runtime) work. You get an OO ABI, with support for generics and OS level interoperability and reference counting as the GC algorithm. Yes, using COM from C is a pain, but it was never intended to be used as such, rather C++, VB, Delphi and any other Windows language able to speak COM.
- Manishearth 10y agoYeah, I'm aware :) I don't like it as much but that's because I've always ended in situations where I need to bind via a C API, which isn't COM's fault.
- mike_hearn 10y agoYou might want to read an article I wrote on a new technique that allows high and low level languages to be mixed (relatively) seamlessly: https://medium.com/@octskyward/graal-truffle-134d8f28fb69 https://medium.com/@octskyward/graal-truffle-134d8f28fb69
- Manishearth 10y agoOoh, this is cool and interesting :) It seems to address a similar need as the one i mentioned above, among others.