News for hackers. Stuff that matters.
Re:Show HN: High-speed UTF-8 validation in Rust by nerdponx on Wednesday April 21, 2021 @08:07AM (#26888507)
Does Rust compile code that can be used/called from other languages with an FFI? That to me is always one of the persistent advantages of C, I don't have to fully understand how compile machine code works on a technical level, but there are lots of different languages that let me use C libraries in their own language runtimes.

It would be great to have things like high-performance unicode handling with consistent semantics across multiple languages!

Re:Show HN: High-speed UTF-8 validation in Rust by hardwaresofton on Wednesday April 21, 2021 @08:32AM (#26888775)
Yes it does -- one of the great parts about Rust. There are lots of projects out there slotting rust into other languages and getting crazy speedups.

- https://doc.rust-lang.org/reference/linkage.html

- https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html#call...

Re:Show HN: High-speed UTF-8 validation in Rust by jhgb on Wednesday April 21, 2021 @08:22AM (#26888647)
A few days ago I read https://dev.to/veer66/calling-rust-from-common-lisp-45c5 , which illustrates presumably what you're talking about.
Re:Show HN: High-speed UTF-8 validation in Rust by Disp4tch on Wednesday April 21, 2021 @10:08AM (#26889888)
Yes, from the python side of things there are tools like py03 that make integrating rust into python code really painless.

I have a sql parsing library (shameless plug) that is 50x faster than any other python implementation, it is just a super simple wrapper around a rust crate.

https://github.com/wseaton/sqloxide

Re:Show HN: High-speed UTF-8 validation in Rust by gliptic on Wednesday April 21, 2021 @08:21AM (#26888642)
Yes, you can expose things with the C ABI. This is essential for how it's used in Firefox.
Re:Show HN: High-speed UTF-8 validation in Rust by kzrdude on Wednesday April 21, 2021 @10:37AM (#26890219)
Yes, Rust natively can expose C ffi functions (for example).

The https://cxx.rs/ project is also a major crate for C++ interoperability.