v2.0.0
Full changelog from GitHub
Written on the GitHub release page. It lists every change that went into v2.0.0.
TurfLang 2.0 is a major release, and it changes the language: most 1.x programs need small edits before they compile. Start with the migration guide. It lists every change that affects existing code and the fix for each, and turf migrate pub --write makes the most common fix for you.
Highlights
- Projects and packages.
turfis now the tool you work with:turf new,run,build,check,testandfmt. A project is described byturf.toml, and its dependencies, local paths or git repositories, are pinned inturf.lock. - Visibility. Declarations are private to their module unless marked
pub. - Safer by default. Signed integer overflow panics instead of wrapping. Out-of-range literals are compile errors.
s[i]returns a bounds-checkedchar. Returning a reference to a local is a compile error. Raw pointers can only be used insideunsafe { }or anunsafe module;. - Self-contained installs. Each archive carries the compiler, its LLVM, a linker and the runtime, so nothing else needs installing to compile and run programs. On Windows that means no MSYS2 and no Visual Studio.
--smartdiagnostics. In the-smartbuild, an error the compiler cannot fix by itself is passed to a small language model running on your own machine. A suggestion is shown only if it removes the error without adding another. You supply one.ggufmodel; none is shipped or downloaded.
Platforms
Linux x86-64, Linux arm64, Windows x86-64 and macOS arm64 (Apple Silicon). Each has two archives: the plain one, and a -smart one that adds the runtime for --smart. Linux needs glibc 2.34 or newer.
Install
Linux and macOS:
curl -fsSL https://raw.githubusercontent.com/turf-lang/turf-lang/master/scripts/install/install.sh | shWindows (PowerShell):
irm https://raw.githubusercontent.com/turf-lang/turf-lang/master/scripts/install/install.ps1 | iexFor the smart build, run the saved script with --smart (or -Smart on Windows). Then check the install with turf version, which should print turf 1.0.0 and turfc 2.0.0.
What's Changed
- Compiler Architecture Overhaul by @a2ys in #253
- Turflang 2.0.0 by @a2ys in #262
- TurfLang 2.0.0 by @a2ys in #274
Full Changelog: v1.0.0...v2.0.0