Solod: Go can be a better C

Solod (So) is a strict subset of Go that translates to regular C — with zero runtime, manual memory management, and source-level interop.

Highlights:

So supports structs, methods, interfaces, slices, multiple returns, and defer. To keep things simple, there are no channels, goroutines, closures, or generics.

So is for systems programming in C, but with Go's syntax, type safety, and tooling.

Playground

Here's some Go code in a file main.go. Click Run to execute it, or Translate to see the generated C code (main.h + main.c).

package main

type Person struct {
    Name string
    Age  int
    Nums [3]int
}

func (p *Person) Sleep() int {
    p.Age += 1
    return p.Age
}

func main() {
    p := Person{Name: "Alice", Age: 30}
    p.Sleep()
    println(p.Name, "is now", p.Age, "years old.")

    p.Nums[0] = 42
    println("1st lucky number is", p.Nums[0])
}

Get started

Even though So isn't ready for production yet, I encourage you to try it out on a hobby project or just keep an eye on it if you like the concept.

Installation and usage

Language tour

Standard library

So by example

Source code

Made by Anton Zhiyanov • Ping me on social media if you have any questions.