Introduction to Glean: Part 1


Disclaimer: I am employed at Meta and have worked with the Glean team in the past. The work described here is done in my spare time and purely for fun, as I like the project. In this post I’ll explore Glean. I’ll go through installation, running the server, creating our first index and querying the database. By the end, we have indexed the ripgrep codebase and queried where a function is defined.…
Read more ⟶

Generating and linking from C against a Rust library on Windows


I started working on xi-lib, which aims to provide a simple C interface to xi-editor. My initial research was focused on building a C library in Rust. The Rust FFI Rust offers a powerful FFI interface. We can easily use extern "C" fn to create functions that can be called from C. A simple example: #[no_mangle] pub extern "C" fn test() { println!("hello world"); } Using #[no_mangle] ensures that the compiler does no additional name-mangling, allowing us to call this function from C, while extern "C" ensures that the function gets exported.…
Read more ⟶