Skip to content

zevic v0.4.1

Choose a tag to compare

@github-actions github-actions released this 12 Nov 08:34

zevic v0.4.1

What's new

Standard library growth, and examples for other languages.

Language and prelude:

  • Text.Format("%5d|%-8s|%.2f", ...) (proposal 0008): C-style formatting that returns a String. Like Printf, the format is a string literal and the compiler checks the number and the types of the values. Printf / Eprintf / Format now also accept %o %e %E %g %G. Both compilers implement it; the runtime collects the pieces in a per-thread buffer
  • StringBuilder in the prelude
  • Iterable: Take Skip TakeWhile SkipWhile FlatMap Zip Chunk Partition GroupBy Distinct Min Max MinBy MaxBy; Array: Repeat Reversed Sorted SortedBy Swap Fill RetainWhere IndexWhere BinarySearch; Map: GetOr GetOrInsert Update Extend RemoveWhere Entries FromPairs; Set: FromArray AddAll Union Intersect Difference SymmetricDifference IsSubset IsSuperset IsDisjoint Equals
  • Text: UTF-8 aware ToChars FromChars CharAt SliceChars Reverse, PadLeft PadRight Center, TrimPrefix TrimSuffix IsBlank LastIndexOf Count SplitN Words ReplaceFirst EqualsIgnoreCase Capitalize Truncate; StartsWith / EndsWith compare bytes (they panicked on some non-ASCII text)

New modules:

  • Zevic.Chars, Zevic.Path, Zevic.Bytes, Zevic.Encoding (hex, Base64, URL, form), Zevic.Digest (CRC-32, Adler-32, SHA-256, HMAC-SHA-256; checked against the NIST and RFC 4231 vectors)
  • Zevic.DateTime (calendar, fixed-offset zones, arithmetic, ISO 8601 and pattern formatting and parsing), Zevic.Log (levels, text and JSON lines, fields, sinks), Zevic.Cli (flags, options, positionals, subcommands, generated help)
  • Zevic.Regex (Pike VM: groups, named groups, lazy repeats, replace, split), Zevic.Csv (RFC 4180), Zevic.Toml (TOML 1.0)
  • Zevic.Net: TCP streams and listeners, UDP sockets, Resolve, timeouts
  • archives: Zevic.Deflate / Zlib / Gzip (RFC 1951/1950/1952, with a decompression size limit), Zevic.Zip and Zevic.Tar (read, write, extract with zip-slip protection, ZipDir / Unzip / TarDir / Untar, .tar.gz)
  • Fs: ReadBytes WriteBytes AppendBytes ReadLines WriteLines Size ModifiedMillis IsSymlink Copy CreateDirAll RemoveAll Walk CopyDir MakeTempDir; Env.OS; Json.Quote

Tools and examples:

  • the C implementation (zevic0/, the C zevpm/) moved to its own repository, zevic-lang/zevic-c. This repository builds with make from bootstrap/zevic.ll and clang alone (the seed compiler builds tools/zevic1); make bootstrap checks the fixed point; CI no longer needs a C compiler for Zevic

  • zevic --lib --pic (also in zevic1): the library archive is position independent, so it can go into a shared library (Python ctypes)

  • examples/interop/: C++, Rust, Go and Python call a Zevic library, and Zevic calls Rust and C++ (make test-interop)

  • zevfmt compares operators by bytes, so non-ASCII sources no longer panic

Known limits: DateTime zones are fixed offsets only; TOML date-times stay as text; regex flags apply to the whole pattern; the Windows branches of Path and the runtime are not run on Windows here (CI covers them).

Downloads

File
install.ps1 installer for Windows (PowerShell)
install.sh installer for Linux and macOS
zevic-0.4.1-linux-x64.tar.gz Linux x64: unpack and put bin on PATH (or run install.sh)
zevic-0.4.1-macos-arm64.pkg macOS installer package
zevic-0.4.1-macos-arm64.tar.gz macOS (Apple silicon): unpack and put bin on PATH (or run install.sh)
zevic-0.4.1-windows-x64-setup.exe
zevic-0.4.1-windows-x64.zip Windows: unzip and put bin on PATH (or run install.ps1)
zevic_0.4.1_amd64.deb Debian / Ubuntu package (sudo apt install ./<file>)

Install

Linux and macOS: sh install.sh (or unpack the archive and add its bin directory to PATH).

Windows (PowerShell): .\install.ps1, or unzip and add the bin folder to PATH.

Then zevic --version, zevpm new hello, cd hello, zevpm run. The standard library is the Zevic package in packages/Zevic.
clang 15 or newer must be installed: zevic hands the generated LLVM IR to it.

Commits since v0.4.1-build.18

  • tests: find the specification's Appendix B by its English heading (06c85c2)
  • Packaging: signed apt repository, Windows installer and winget manifests (d12e76b)
  • docs: translate the language specification to English (433c2cc)
  • docs: plan formatting (bfe0307)
  • docs: translate the implementation plan to English (70f0a3a)
  • docs: translate proposals 0004 to 0007 to English (72263d4)
  • docs: translate proposals 0002 and 0003 to English (b022e81)
  • docs: translate the proposal template, proposal 0001 and the IR notes to English (2278823)
  • README: translate to English (4de07ea)

Contents

  • bin/zevic, bin/zevpm, bin/zevfmt 0.4.1
  • packages/Zevic/: the standard library, a zevpm package named Zevic (version 0.4.1)
  • runtime/, examples/, LICENSE, README.md, VERSION