Repository navigation
Closes sub-phase 5C: Standard Library & First Training Run, built across v5.38.0 to v5.50.3.
Someone with no LLVM toolchain can now download neurc, read a batch that Python wrote, train on it on the CPU and the GPU, save a checkpoint, load it and keep training. The standard library is Neuro source rooted at std and embedded in the compiler, so a binary needs no library tree beside it. The neural network library that comes next is designed against a program that already runs on real data.
What landed:
- Prebuilt Linux compiler. Each release carries
neurc-x86_64-unknown-linux-gnu.tar.gzand its SHA-256 checksum. It runs on glibc 2.28 and newer and needs only a C compiler, since LLVM, MLIR and libstdc++ are linked in. The release workflow attaches it only after every example compiles, runs and matches its pins in clean AlmaLinux 8 and Debian 13 containers, with a signed provenance attestation. - Modules are namespaces. Two files may each declare
helper. Paths work in every position a name takes (patterns, struct literals,implheaders, bounds),export moduleopens an inline block,import Shape::Circleimports one variant, and a local binding shadows an imported name. - Per-file source spans. A compile error, a panic, a failed
assertor an overflow trap in any module names that module's own file, line and column. - A standard library in Neuro.
stdis embedded inneurcand compiled with the program; the prelude isstd::prelude, and@no_preludetakes it away from one file. @testandneurc test. Discovery, one subprocess per test so a panic fails only its own test, andstd::testing::assert_closefor floats.- Borrowing iterator values.
.iter()on arrays, slices andVec, andm.keys()/m.values()on maps, return iterator values that adapters chain and functions store and return. - String ownership in the value. A
stringrecords whether it owns its buffer in the top bit of its length, so every position that holds one (fields, payloads, arguments, captures, returns) releases it by the ordinary drop rules. This closed three string leaks. - String literals where
&stringis expected, typed from context:length("text"),open("weights.safetensors"). std::fs,std::env,std::timeandstd::io::read_line, failing withIoErrorrather than crashing, over a small linked C runtime.neurc run file.nr -- argspasses arguments through.- Return-position
impl Traitover any body, including a call result or an adapter chain. .lines()and.split(sep)yield&stringviews into the text.std::safetensors. A validated header, fixed-shape reads typed by their annotation through?,??andval ... else, and aWriterfor saving. Truncated and malformed files are refused with an error.- First training run from a file. The new tutorial has Python write a batch, Neuro train five steps on the CPU, save, reload and train five more on the GPU. Its weights match NumPy's to the bit, and the suite trains thirty steps on the CPU and the GPU side by side and finds the same bits at every step.
Known gaps are in docs/BUGS.md:
- BUG-164: a program function named like a C library function (
exp,free,malloc) takes the library's place. - BUG-077: a store through a borrow leaks the tensor it displaces.
- BUG-152: a method returning its own type nested in itself does not compile.
Next: sub-phase 5D, Tensor Type System Completion (generic element types, shape parameters, named dynamic extents, masks, FP8 and tensor-core @).
Per-version detail is in CHANGELOG.md.