julia

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: BSD-3-Clause

README

julia — a Julia interpreter in pure Go

github.com/go-embedded-julia/julia is the start of a Julia implementation written in Go (CGO_ENABLED=0), meant to be embedded in Go programs and to run in the browser through WebAssembly — it will back the ```julia cells of go-notebook the way rbgo backs its Ruby cells.

The plan is go-scikit/roadmap bib/julia.md. Every stage is checked against the reference implementation, the pinned julia 1.12.6 (a stable release; commit 15346901f003), never against expectations written by hand.

Status

milestone contents state
M0 oracle harness internal/oracle, cmd/jloracle, golden files done
M1 parser Go port of JuliaSyntax → expr.Expr in progress: lexer done
M2 lowering JuliaLowering → CodeInfo planned
M3 – M7 Core runtime, Base, numeric stdlib, notebook bridge, wasm playground planned
Parser parity with julia 1.12.6

Measured on the whole share/julia tree of the release: base/ (with JuliaSyntax's own sources and tests), Compiler/, stdlib/v1.12/ and test/ — 1191 files, 18.5 MB — and on the 975 golden snippets.

level compared with corpus files identical snippets identical
tokens JuliaSyntax.Tokenize.tokenize 1191 / 1191 975 / 975
green tree + diagnostics parse! then build_tree(GreenNode) next step next step
Expr Meta.parseall(text; filename) next steps next steps

The oracle

internal/oracle runs the reference julia as a persistent process speaking a line protocol (base64 payloads); oracle.jl is the julia side. Golden files are regenerated by one command:

go run ./cmd/jloracle regen     # unicode tables, snippets, corpus, programs

The julia is pkgx julia@1.12.6, or $JLGO_JULIA. Tests replay the golden files without julia; JLGO_ORACLE=1 also runs the live checks (CI does, with the official release tarball).

file what julia answered
testdata/golden/snippets.jsonl lexer tokens, green tree with diagnostics, and Meta.parseall Expr of 975 snippets: every "input" => … pair of JuliaSyntax's test files, and our own edge cases
testdata/golden/corpus.jsonl digests of the same three outputs for each of the 1191 files of share/julia (base, Compiler, stdlib, test)
testdata/golden/programs.jsonl parse, Meta.lower and evaluation of testdata/programs/*.jl (for M2+)
internal/unitab/tables_gen.go utf8proc's Unicode 16 properties the lexer will use

expr holds the Go values of Julia's syntax tree (*expr.Expr, expr.Symbol, expr.LineNumberNode, expr.QuoteNode, expr.GlobalRef, expr.Char …) and expr.Serialize, the canonical type-tagged text form the oracle prints the same trees in.

Layout

package role
expr Julia syntax-tree values, canonical serialisation
syntax the parser, a port of JuliaSyntax (so far kinds.go, tokenize.go)
internal/unitab Unicode tables from the reference build, utf8proc's grapheme breaks
internal/oracle the reference julia as a differential oracle
internal/gen, cmd/jloracle the golden-file generators

Licence

BSD 3-Clause (LICENSE). Parts are translations of MIT-licensed code (JuliaSyntax.jl, Julia, utf8proc); their notices are in NOTICE and in the header of each translated file.

Directories

Path Synopsis
cmd
jloracle command
Command jloracle regenerates everything this repository derives from the reference julia: the lexer's Unicode tables and the golden files the test suite replays without julia.
Command jloracle regenerates everything this repository derives from the reference julia: the lexer's Unicode tables and the golden files the test suite replays without julia.
Package expr holds the Go representation of Julia's surface syntax tree, Base.Expr, and the values that appear inside it.
Package expr holds the Go representation of Julia's surface syntax tree, Base.Expr, and the values that appear inside it.
internal
gen
Package gen writes the files derived from the reference oracle: the Unicode tables of the lexer and the golden files of the test suite.
Package gen writes the files derived from the reference oracle: the Unicode tables of the lexer and the golden files of the test suite.
oracle
Package oracle drives the reference Julia as a differential oracle.
Package oracle drives the reference Julia as a differential oracle.
unitab
Package unitab answers the Unicode questions the Julia lexer asks, with the answers of the reference build.
Package unitab answers the Unicode questions the Julia lexer asks, with the answers of the reference build.
Package syntax is a Go port of JuliaSyntax, the parser of Julia, in the version Julia 1.12.6 ships (JuliaSyntax 29ec5226f7b1).
Package syntax is a Go port of JuliaSyntax, the parser of Julia, in the version Julia 1.12.6 ships (JuliaSyntax 29ec5226f7b1).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL