NOW LET US – AI RAG SaaS Studio TP.HCM
NOW LET US
Digital Product Studio
Back to news
DEV-TOOLS...2 min read

Solod – A Subset of Go That Translates to C

Share
NOW LET US Article – Solod – A Subset of Go That Translates to C

Solod (So) is a strict subset of Go that transpiles to C11 with zero runtime and manual memory management, bringing Go's syntax and safety to systems programming.

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

Highlights:

  • Go in, C out. You write regular Go code and get readable C11 as output.
  • Zero runtime. No garbage collection, no reference counting, no hidden allocations.
  • Everything is stack-allocated by default. Heap is opt-in through the standard library.
  • Native C interop. Call C from So and So from C — no CGO, no overhead.
  • Go tooling works out of the box — syntax highlighting, LSP, linting and "go test".

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.

Example • Installation and usage • Language tour • Stdlib • Playground • So by example • Testing • Benchmarks • Compatibility • Design principles • FAQ • Roadmap • Contributing

This Go code in a file main.go

:

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])
}

Translates to a header file main.h

:

#pragma once
#include "so/builtin/builtin.h"
typedef struct main_Person {
so_String Name;
so_int Age;
so_int Nums[3];
} main_Person;
so_int main_Person_Sleep(void* self);

Plus an implementation file main.c

:

#include "main.h"
so_int main_Person_Sleep(void* self) {
main_Person* p = (main_Person*)self;
p->Age += 1;
return p->Age;
}
int main(void) {
main_Person p = (main_Person){.Name = so_str("Alice"), .Age = 30};
main_Person_Sleep(&p);
so_println("%.*s %s %" PRId64 " %s", p.Name.len, p.Name.ptr, "is now", p.Age, "years old.");
p.Nums[0] = 42;
so_println("%s %" PRId64, "1st lucky number is", p.Nums[0]);
}

Check out more examples in So by example and learn about the supported language features in the language tour.

Install the So command line tool:

go install solod.dev/cmd/so@latest

Create a new Go project and add the Solod dependency to use the So standard library:

go mod init example
go get solod.dev@latest

Write regular Go code, but use So packages instead of the standard Go packages:

package main
import "solod.dev/so/math"
func main() {
ans := math.Sqrt(1764)
println("Hello, world! The answer is", int(ans))
}

Transpile to C:

so translate -o generated .

The translated C code will be saved in the generated directory.

You can also transpile to C and compile the code to a binary in one step. This uses the C compiler set by the CC environment variable:

so build -o main .

Or you can transpile, compile, and run without saving the binary:

so run .

All commands work with Go modules, not individual files (so run ., not so run main.go). Keep in mind that So is new, so it's still a bit rough around the edges.

So generates C11 code that relies on several GCC/Clang extensions: binary literals, statement expressions, constructor attributes, and alloca. Supported operating systems: Linux, macOS, and Windows (core language only).

© 2026 Now Let Us. All rights reserved.

Source: Hacker News

Advertisement
Ad slot ready: 5887729102

More in this category

NOW LET US Related – Leaving Mozilla

dev-tools

Leaving Mozilla

A poignant and candid reflection from a 15-year Mozilla veteran upon their departure. The author highlights the leadership's missteps in trying to emulate tech giants and urges Mozilla to return to its core values: community and uniqueness.

NOW LET US Related – Shepherd's Dog: A Game by the Most Dangerous AI Model

dev-tools

Shepherd's Dog: A Game by the Most Dangerous AI Model

A developer tested Anthropic's latest, supposedly 'too dangerous' AI model by asking it to build a long-held game idea in a single shot. The model succeeded, generating a complete 2,319-line game after a 45-minute reasoning session.

NOW LET US Related – Open source AI must win

dev-tools

Open source AI must win

If artificial intelligence becomes a utility rented only from a few closed institutions, humanity loses its operational freedom. Open-source AI is a vital infrastructure for the future of our digital society.

NOW LET US Related – Statement on US government directive to suspend access to Fable 5 and Mythos 5

dev-tools

Statement on US government directive to suspend access to Fable 5 and Mythos 5

The US government has issued an export control directive forcing Anthropic to suspend all access to its Fable 5 and Mythos 5 models due to national security concerns, a move the AI safety startup strongly disputes.

NOW LET US Related – Electric motors with no rare earths

dev-tools

Electric motors with no rare earths

Renault Group is pioneering the development of electrically excited synchronous motors (EESM) that eliminate the need for rare earth magnets, reducing dependency on global monopolies while driving efficiency and sustainability.

NOW LET US Related – Swift at Apple: Migrating the TrueType hinting interpreter

dev-tools

Swift at Apple: Migrating the TrueType hinting interpreter

Apple has rewritten its TrueType hinting interpreter from C to memory-safe Swift for its Fall 2025 OS releases, improving security and boosting performance by an average of 13%.

EXPLORE TOPICS

Discover All Categories

Deep dive into the specific technology sectors that matter most to you.