Repository navigation
Pepper v0.3.0
Pepper v0.3.0: everything merged since v0.2.1. Grouped by area, with each pull request linked.
The VS Code extension is published as release vsix-v0.3.0.
Breaking changes
- The compiler binary is
pep-build, and a newpepperentry point runs the tools (pepper build,pepper help, ...);pepper main.pepstill works with a deprecation warning (#421) pepper-lspandpepper-docgenare renamedpep-lspandpep-doc(#426)- Integer arithmetic traps on overflow; explicit wrapping operations do the old thing (#372)
- Optional's cases are
EmptyandValue(#429) asis a checked static cast;unsafe_cast<T>does reinterpret casts (#403)Array.findand thePathaccessors return optionals (#276)printtakesStrings; floats and tuples getto_string(#216)[LinkName]is replaced by[Link(name = ...)](#357)- Exported names live in per-module namespaces (#298)
Language
- Pattern matching: guards on match arms (#435), ranges and module-scope constants in patterns (#439), nested patterns (#445)
- The
?operator propagatesResulterrors and empty Optionals (#433) **raises floating-point numbers to a power (#437); a number on the left of an operator can call an extension operator (#440)- Function values: extern functions (#438), a bare method name inside a method (#436), generic methods (#444), generic functions whose type arguments come from the slot (#441), and closures in trait default methods can use
this(#446) - Overloading an extern is reported, with what to do instead (#442)
- Static blocks, the reflect API and
[Attribute]structs (#402); module-scope static blocks compute constants (#420);while,breakandcontinuerun at compile time (#416) - Built-in attributes are declared in the runtime and their values reflected (#422); qualified attribute names like
[serialize.Ignore](#428) - Named arguments for calls and attributes (#357), with parameter-name hints and completion (#358)
- Properties on structs, traits and extensions (#356)
- Value structs:
[Value]and a value Optional (#306), boxing and value iterators (#307), value enums, withResultandOptionalas value enums (#308) - Ranges
a..banda..>b(#315); iterator adaptersenumerate,zip,to_array(#317) - Trait values can be copied (#353);
extend X with Trait;needs no body (#333) - One overload set can mix exported and private members (#321) and span the files of a module (#323)
- Asserts and panics print their source location (#427)
- Type inference: through sibling bounds and partial type arguments (#336), generic
vardeclarations (#401),sizeof<T>()(#342), match and?:arms of different numeric types (#309), type arguments in ternary arms (#398) - New and better errors: uninferred generic method calls (#341), enum and bound methods read without a call (#417), function-type mismatches located and reworded (#400), a type exported by two prelude files (#363), codegen's unknown-type errors located (#330)
- Fixes: a parameter typed
Tin a generic match arm (#443), chained overloaded indexers and an enum case namedString(#413), string literals through C function pointers (#406), long collection literals no longer overflow the stack (#397), a value enum of an uncopyable struct (#335), tuples holding a value struct (#320), trait-typed locals over pointer elements (#326), use-after-free assigning over a slot whose destructor reads it (#302)
Runtime and library
json: a dynamicJsonValue(#412),json.encodeandjson.decodefor structs (#423), enums with values (#430), errors with line and column (#432), JSONC comments kept byjson.parse_document(#434)- New modules:
regex(RE2 syntax, linear time) (#347),clioption parsing (#361),digest(SHA-256, SHA-1, BLAKE3) (#368),compress(DEFLATE, zlib, gzip) andarchive(tar) (#364),os(#348),process(#289),text(Utf8, Utf16, Ascii) (#254) Map,SetandOrderedMap(#359);Handleand a-Llibrary search option (#371)- io:
ReaderandWritertraits (#334),io.Print(#294), iterating aDirectoryandFile.lines()(#322),TcpListener.incoming()(#332), io enumsErrorKind,SeekFrom,FileType,StdStream(#271) Regexis[Shared](#351);async.sleep(Duration)(#352)- Faster: value-struct hash table and hashing (#329),
Arraymoves and swap (#337), constructing into empty slots (#419), no allocation on async and http hot paths (#264), io_uring as fast as epoll (#250), sharded live-allocation counter (#311), cancel flag read without a copy (#312) - Cleanup: modernized runtime code (#270), value enums in the async runtime (#269), shared socket code (#277), duplicate helpers removed (#233), refcount trace helpers removed and O(1)
Array.clearfor plain data (#286),Iterator.to_arrayworkaround dropped (#328), IOCP address workaround dropped (#316), straymsvc.batremoved (#319)
Compiler and optimization
-O0through-O3with LLVM's pipeline (#257), link-time optimization at-O2/-O3(#293), target CPU options (#299)- Debug info with
-g: DWARF, CodeView and.pdb(#288) - Reference counting: steps inlined at call sites (#295) and folded by LLVM (#303)
memcpy,memmoveandmemsetexterns lower to LLVM intrinsics (#415)- Build cache: syntax trees kept per file (#219), canonical specialization (#296), the checked runtime cached (#305) and checked once per process (#304), passes skip it so imports are cheap (#431), fixes for string-constant order (#297) and module identity (#301)
Tooling and LSP
- The language server analyzes in the background (#214), caches the runtime's syntax trees (#292), analyzes for the file's target OS (#290), resolves names sema leaves untyped (#300), and no longer panics after a non-ASCII character (#355)
- VS Code dims code for other platforms (#284)
- Apache 2.0 license; VSIX packaging warnings fixed (#278)
Docs and tests
- Waiting on several sockets with tasks, channels and
Select(#291); the tour's word counter usesString.split(#399); regenerated io-file reference (#418) - Shared integration-test helpers (#239), trimmed redundant tests (#407), LTO cache test accepts Apple's bitcode wrapper (#310)
CI and build
- The gate passes on draft PRs (#343), requires test-linux (#314), no longer requires test-macos (#313, #404); the
changesjob is capped at 2 minutes (#346) - The version is 0.3.0 (#448)