-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
115 lines (101 loc) · 4.14 KB
/
index.html
File metadata and controls
115 lines (101 loc) · 4.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="go-import" content="solod.dev git https://github.com/solod-dev/solod">
<meta name="go-import" content="solod.dev/sobind git https://github.com/solod-dev/sobind">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://unpkg.com/@antonz/codapi@0.20.0/dist/snippet.css" />
<title>Solod</title>
</head>
<body>
<h1><mark>So</mark>lod: Go can be a better C</h1>
<p>
Solod (<b>So</b>) is a strict subset of Go that translates to regular C.
</p>
<p>Highlights:</p>
<ul>
<li>Go in, C out. You write regular Go code and get readable C11 as output.</li>
<li>Zero runtime. No garbage collection, no reference counting, no hidden allocations.</li>
<li>Rich standard library. Use familiar types and functions ported from Go's stdlib.</li>
<li>Native C interop. Call C from So and So from C — no CGO, no overhead.</li>
<li>Go tooling works out of the box. Syntax highlighting, LSP, linting and "go test".</li>
</ul>
<p>
So supports structs, methods, interfaces, slices, maps, multiple returns, and defer.
Everything is stack-allocated by default; heap is opt-in through the standard library.
To keep things simple, there are no channels, goroutines, closures, or generics.
</p>
<p>
So is for Go developers who want systems-level control without learning a new language.
And for C programmers who like Go's safety, structure, and tooling.
</p>
<h2 id="try">Playground</h2>
<p>
Here's some Go code in a file <code>main.go</code>.
Click <i>Run</i> to execute it, or <i>Translate</i> to see the
generated C code (<code>main.h</code> + <code>main.c</code>).
</p>
<pre><code>package main
import "solod.dev/so/time"
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])
year := time.Now().Year()
println("The year is", year)
}
</code></pre>
<codapi-snippet sandbox="so" editor="basic" actions="Translate:translate">
</codapi-snippet>
<h2 id="doc">Getting started</h2>
<p>
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.
</p>
<p>
<a href="https://github.com/solod-dev/solod#installation-and-usage">Installation and usage</a> •
<a href="https://github.com/solod-dev/solod/blob/main/doc/spec.md">Language tour</a> •
<a href="https://github.com/solod-dev/solod/blob/main/doc/stdlib.md">Standard library</a> •
<a href="https://github.com/solod-dev/example">So by example</a> •
<a href="https://github.com/solod-dev/solod/blob/main/bench/README.md">Benchmarks</a> •
<a href="https://github.com/solod-dev/solod">Source code</a>
</p>
<h2 id="status">
Current status
<small>v0.1 released</small>
</h2>
<p>
As of May 2026, So is in active development. The core language features
are finished, the first part of the Go standard library is ported, and
the v0.1 release is out.
</p>
<pre><code>✓ bufio ✓ io ✓ path ✓ strings
✓ bytes ✓ maps ✓ rand ✓ strconv
✓ flag ✓ math ✓ slices ✓ time
✓ fmt ✓ os ✓ slog ✓ unicode</code></pre>
<p>
I'm currently gathering feedback and defining the scope for the v0.2 release.
</p>
<p>
If you have any questions, feel free to reach out
<a href="https://github.com/orgs/solod-dev/discussions">on GitHub</a>.
</p>
<p>
🧑💻 <a href="https://antonz.org/">Anton Zhiyanov</a>
</p>
<script defer src="https://unpkg.com/@antonz/codapi@0.20.0/dist/snippet.js"></script>
</body>
</html>