Urgent.News

What's breaking now, across thousands of outlets.

Tech

The Golden Spike, and Resurrecting the Vale(n) Programming Language

On May 10th, 1869, railroad builders completed the first United States transcontinental railroad by joining the east coast rail network with the west coast rail network at Promontory Summit, Utah, driving a golden spike into the final tie of the railroad.

In the compiler world, the phrase "golden spike" symbolizes an incredibly challenging task of joining two separate, distant systems. When a language wants to call into another language, various acrobatic rituals and C bindings are usually required. However, cross-language generics don't work, and memory safety across the boundary is impossible. Integrating two compilers is also a difficult task.

The author, Evan, aims to create a new language called Valen, which enables true Rust interop with a compiler that talks to rustc seamlessly. This would allow the use of the author's Rust graphics library, Glass Domino, with cross-language generics, memory safety, linear types, and other advanced features. The process of creating Valen is described as a ridiculously over-ambitious endeavor.

The author explains that creating interoperability between Valen and Rust involves a three-way tie between C++, Scala, and Rust. By generating the corresponding function signature in Valen AST, the Valen compiler can understand Rust signatures without reimplementing Rust's generics and traits systems. The author also highlights the open interface constructor feature, which allows creating new subclasses of Rust traits inline.

The ultimate goal is to enable seamless use of Rust code within the Valen language, while still benefiting from Rust's ecosystem of libraries.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at verdagon.dev →

More in Tech

More from Thursday 17 September →