Repository navigation
Releases
Releases · puddi-lang/puddi
Puddi v0.1.2
Added
- Nine portable standard library modules for browser, WASI and plugins. They provide deques and priority queues, lazy iterator sources, Unicode text helpers, radix formatting, binary readers, hex and Base64 codecs, percent encoding, lexical paths, CSV and descriptive statistics.
std.dateadds Gregorian dates, UTC timestamps, Unix epoch conversions and checked arithmetic. CSV supports configurable delimiters, JSON supports pretty printing and pointer lookup, andstd.fmtparses signed and unsigned integers in bases 2 through 36.
Fixed
- JSON parsing rejects malformed surrogate escape pairs.
- Float literals can be used on either side of a binary operator with a fixed-width integer when a lossless common type exists.
- Trait implementations resolve
Self.Itemand other associated types from the current impl in method signatures and local annotations. - Naming conventions produce warnings. Struct literals and patterns accept lowercase type names.
- The compiler rejects overlapping trait implementation headers and cyclic supertraits.
- Recursive constant initializers are diagnosed instead of overflowing the compiler stack.
- Type aliases resolve in dependency order, preserve their target types in generic bounds, and report cycles.
- Constant initializers resolve names in their declaring module and reject references to ordinary functions.
- Numeric operands can constrain unannotated closure parameters.
- WIT exports can use records, variants, enums and flags aliased from an interface.
pud fmtpreserves trailing spaces inside multiline strings. #4Str.from_utf8rejects overlong encodings, surrogate code points and values above the Unicode range.
Documentation
- The bundled examples guide lists commands and expected results. #2
Puddi v0.1.1
This release improves the Puddi toolchain for the draft 0.1 language specification.
Fixed
pudrejects unknown and empty targets in the--target=<value>form, matching--target <value>and-t <value>(#6).
Performance
Measured with the programs in bench/ against Rust and MoonBit; see bench/README.md.
pud runuses Wasmtime's copying garbage collector instead of deferred reference counting and starts with a 16 MiB GC heap: up to 20x faster on allocation-heavy code- Compiled machine code is cached per component in the user cache directory, so running an unchanged program again skips Cranelift (
PUD_NO_CACHE=1turns this off) - Payload-less enum variants (
None,Ordering.Less, ...) are shared instead of allocated on every use - Integer overflow checks for
Intaddition and subtraction are emitted inline, and left out where the operands' ranges show they cannot overflow (for examplei += 1insidewhile i < n) list[i]compiles to a single unsigned bounds check and an array access instead of calls throughIndex;for x in listwalks the list by index without allocating anOptionper element- Iterator adapters implement
foldby internal iteration, so chains ending infold,count,collectorfor_eachallocate nothing per element List.sortcompares with<directly instead of through a closure and merges without branches; lists of integers of 256 or more elements are sorted by radix;List.filledandStrBuilder.pushcopy in bulk- A new IR optimizer inlines closures passed to higher-order functions, tiny functions, matches on constructors returned by small functions and one level of small recursive functions: iterator chains run 45x faster on Wasmtime, and
Optionresults ofMap.getorto_intare no longer allocated when unwrapped at once (PUD_NO_OPT=1turns it off) Map.insertfinds the key or a free slot in one probePUD_HOST=node pud runstarts Node.js with--no-liftoff: V8 cannot move a running wasm loop to optimized code, so loops inmainstayed in the baseline tierpud runcompiles faster (parallel parsing, shared declarations, only the platform operations a program uses) and starts Wasmtime on another thread while compiling;PUD_TIME=1prints the time of each phasepud buildandpud runreuse the previous build when the sources, WIT files, target and compiler are unchanged: running an unchangedhellotakes 25 ms instead of 160 ms- Wasmtime keeps compiled machine code per function, so after an edit only the changed functions are compiled again; Cranelift's own inliner is off, which makes compiling 1.7x faster at the same speed
- Large source files are lexed and parsed in pieces on several threads
- The generated WebAssembly text is assembled by
src/asm.rson several threads instead of thewatcrate, 10x faster with byte-identical code (PUD_WAT=1useswat,PUD_ASM_CHECK=1compares both); functions are also turned into WebAssembly text on several threads, with the same result as on one; a 2,000-function program builds in 250 ms instead of 570 ms bench/compile.mjscompares the edit-compile-run loop withcargoandmoon
Documentation
- Documentation site at https://puddi-lang.github.io/puddi-docs/ with a language guide, toolchain and standard library pages, built from puddi-lang/puddi-docs
- Complete Simplified Chinese documentation
- Contributing guide, code of conduct, security policy, compiler architecture and release process documents
- Draft governance model in GOVERNANCE.md, not yet in effect
Known gaps
The known conformance gaps in 0.1.0 still apply to this release.
Puddi v0.1.0
First release of Puddi and its pud toolchain, implementing the draft 0.1 language specification.
Language
- Structs, enums, tuples, generics with bounds, traits with default methods, associated types and supertraits,
dyn Trait, operator traits and closures - Pattern matching with exhaustiveness checking,
if let,while letandlet ... else ?withFromconversion, theErrortrait andAnyErr@derive(Eq, Ord, Hash, Show, Transfer), constants, type aliases, modules and importsasync fnand.await,task.scopewith structured cancellation, and workers- WIT imports,
export fn,@externand@export,@target,@deprecatedandtestblocks
Toolchain
pud new,build,run,test,check,fmt,docandaddbrowser,wasi(WASI 0.3) andplugintargets, all emitted as WebAssembly components on WasmGC- An embedded Wasmtime runtime for
pud run - Git dependencies with minimal version selection and
pud.lock, plus local path dependencies
Testing and distribution
- A conformance suite in
conformance/with cases for every normative section of SPEC.md - CI on Linux, macOS and Windows
- Prebuilt binaries for Linux (x86_64, arm64), macOS (x86_64, arm64) and Windows (x86_64), with install scripts for each
Known gaps
The conformance suite marks these differences from the spec as expected failures:
- no warnings for naming-convention violations, and struct literals need an uppercase type name (2.4)
- a float literal next to an unsigned integer does not default to
Float(3.7) Self.Itemdoes not resolve inside an impl block, and a duplicate impl is accepted (3.12)- unannotated closure parameters are not inferred from the body or later calls (4.6)
- plugin exports that use WIT records, variants, enums or flags fail to compile (8.3)