News for hackers. Stuff that matters.
Re:Go bindings to Rust's regex engine by falcolas on Monday May 02, 2016 @03:39PM (#11614818)
> ... because code written in them is not easily reusable from other languages.

Which is also technically true for C as well. The ABI [EDIT: Not API] is an implementation detail which can vary from compiler to compiler.

So long as you're just using LLVM-based compilers for both Rust and your other languages, you should be OK, but don't be surprised if you run into problems.

Re:Go bindings to Rust's regex engine by burntsushi on Monday May 02, 2016 @04:05PM (#11615083)
> So long as you're just using LLVM-based compilers for both Rust and your other languages, you should be OK, but don't be surprised if you run into problems.

No. You can use the Go bindings to Rust's regex library where the regex library is compiled with `rustc` (llvm based) and your host program, written in Go, is compiled with the standard Go compiler, which is not llvm based.

This works because the Go toolchain knows how to link with objects exposing a C ABI and the Rust toolchain knows how to provide said objects. There is no particular dependency on llvm here.

Re:Go bindings to Rust's regex engine by masklinn on Monday May 02, 2016 @03:58PM (#11615017)
> Which is also technically true for C as well. The API is an implementation detail which can vary from compiler to compiler.

The C ABI (API is less relevant there) is really the platform/OS's calling convention, which — aside from Microsoft (and embedded systems I guess, because embedded) — is generally the architecture's calling conventions. Which are usually well documented.

> So long as you're just using LLVM-based compilers for both Rust and your other languages, you should be OK, but don't be surprised if you run into problems.

As long as all the languages involved use the same ABI you're in the clear, that's got nothing to do with LLVM. That's what cgo does on the Go side[0]. And as pcwalton notes in an other comment, in theory you could even have the Rust FFI follow the Go/Plan9 ABI.

[0] at a significant cost for the default toolchain since `gc` doesn't use the platform ABI. I believe the gccgo-based alternative toolchain has no cgo overhead.

Re:Go bindings to Rust's regex engine by Manishearth on Monday May 02, 2016 @10:34PM (#11617429)
- Calling into the C ABI is a stable and well documented operation that most languages support in some form

- Rust allows you to export functions with the C ABI

- LLVM wasn't involved here at all