Relying on Go
Solod, a systems language designed for C and Go developers, presents a unique approach to language development. Unlike many of its contemporaries, Solod isn't merely an iteration of Go or Rust; instead, it functions as a subset of Go. This language retains the majority of Go's existing tooling, ensuring a seamless transition for users familiar with the Go ecosystem.
Creating a new Solod project is straightforward. Developers can simply set up a regular Go project and add the Solod dependency. The code written in Solod is essentially regular Go code, but with Solod packages replacing the standard Go packages. The development process remains largely unchanged, except for the inclusion of the 'so run' command, which functions similarly to 'go run'.
Solod also inherits a significant portion of Go's standard library, with some components taken directly from Go's source code. However, certain functions require modifications to accommodate Solod's unique manual memory management system. While Go tools may not recognize the subset nature of Solod, they flag unsupported features, such as function literals or iterators, through custom 'so' tooling.
Despite inheriting a large chunk of Go's standard library, Solod's code isn't automatically correct. It's essential for Solod to undergo its own testing process, including tests that run under sanitizers and static analyzers. All Solod code undergoes translation to C11 and then compiles with GCC or Clang, leveraging the robust C tooling and decades of optimization work.
Despite the noise in the resulting C version, especially for complex programs, Solod remains highly readable. Its reliance on C allows for interoperability with minimal overhead, as there's no runtime involved. In essence, Solod doesn't necessitate a new ecosystem; instead, it capitalizes on Go's proven tools and standard library, enhancing reliability and ease of use. For those interested in trying Solod, the comprehensive README provides all the necessary steps to get started.
Written by urgent.news from Lobsters's reporting — not their text. Machine-written — it may contain errors, so check the original before relying on it.