Skip to content

Releases: amortimer20/emerald-lang

Emerald 0.6.0

Choose a tag to compare

@github-actions github-actions released this 28 Sep 20:42
51c01cc

Emerald 0.6.0 fills out the standard library: dates and times, regular expressions, terminal colors, JSON, a web client, CSV, and Base64 with digests. Programs also start almost three times faster, and Emerald now installs with one command.

Install

Windows (PowerShell):

irm https://raw.githubusercontent.com/amortimer20/emerald-lang/main/install.ps1 | iex

macOS (Apple silicon) and Linux (x86-64):

curl -fsSL https://raw.githubusercontent.com/amortimer20/emerald-lang/main/install.sh | sh

If you installed an earlier version with these scripts, running the command again updates it. Mise users can run mise use -g "github:amortimer20/emerald-lang@latest".

New in the standard library

  • Dates and times. Date, Time, DateTime, Instant, Duration, TimeZone, Weekday, and Stopwatch, plus Program.sleep. Named time zones come from the IANA database (2026d) built into Emerald, so TimeZone("America/New_York") gives the same answer on every operating system.
  • Regular expressions. Regex and Regex.Match, with groups, on Emerald's own linear-time engine. A pattern written in the program is checked before it runs.
  • Terminal colors. Console.red(text), Console.bold(text), and the rest, Console.style for combinations, and Console.plain to remove styling. run and test accept --color=auto|always|never and respect NO_COLOR and FORCE_COLOR.
  • JSON. Json.parse and navigation for data you don't know ahead of time, and Json.encode and Json.decode(text, as: Type) to convert your own structs directly.
  • A web client. Http.get, post, put, patch, and delete return a finished Http.Response with its text, JSON, bytes, and headers. Requests have timeouts, follow redirects, check certificates, and treat an error status as an error unless you pass strict: false.
  • CSV. Csv.parse and Csv.parse_records read spreadsheet exports; Csv.decode(text, as: List[Record]) and Csv.encode(records) convert your own structs, with errors that name the line and column.
  • Base64, digests, and hex. Base64.encode and decode (standard or url_safe: true), Digest.sha256 and Digest.hmac_sha256, and bytes.to_hex() with Bytes.from_hex.

Each library's problems are catchable on their own: DateTimeError, RegexError, JsonError, HttpError, CsvError, and EncodingError.

Language

  • Nested types. A struct, class, or enum can declare types inside its braces, reached by path, such as Console.Color.red.
  • The Emerald namespace. Every built-in can also be written in full, as Emerald.print or Emerald.Math.pi. A name your project declares always wins over a built-in, and Emerald warns only when it hides one of the language's own.
  • Negative numbers. A minus sign written against a number is part of it: -3.abs() is 3, and -3.positive?() is false. -2 ** 2 is still -4.
  • Empty bodies stay on one line when formatted: class Marker { }.

Faster and clearer

  • Startup is about three times faster. A program that prints one line starts in 3.5 ms, down from 9.9 ms, because Emerald now checks only the parts of its built-in library a program uses.
  • More helpful member errors. Asking a String, Int, Float, List, Dict, or Set for something it doesn't have lists what it does offer, and a method name from another language gets Emerald's word for it: push on a Set says Emerald calls this add.
  • Ranges print as written. A stepped range keeps its parentheses, and an empty range shows the bounds that made it empty.
  • The language server understands nested types.

Upgrading from 0.5.0

  • -3.abs() now means (-3).abs(), which is 3. It used to mean -(3.abs()), which is -3.
  • Bytes.to_string() on bytes that are not valid UTF-8 raises EncodingError instead of FileError. Both are RuntimeErrors, so catch error: RuntimeError catches either.
  • A module-level declaration can no longer share its name with a directory namespace in the same project.

Release archives now include LICENSE and THIRD_PARTY_NOTICES.md beside the binary.

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 24 Sep 02:36
Emerald 0.5.0: inline if expressions and Random dispatch fix

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 23 Sep 15:32
Release 0.4.0

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 21 Sep 00:24
The LSP's second phase: hover, go to definition, find references, rename,
and completion (emerald lsp).

Also since v0.2.0: the program entry point (Program.arguments, a bare
top-level return), a trait-aware warning for impossible `is` type tests, the
ledger example program, and a Windows-only fix for Path.join and a
Windows-only test bug.

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 19 Sep 01:13
Emerald 0.2.0

v0.1.2

Choose a tag to compare

@github-actions github-actions released this 15 Sep 19:33
Emerald 0.1.2: fix release binaries crashing on CPUs without AVX-512

v0.1.1

Choose a tag to compare

@github-actions github-actions released this 15 Sep 18:55
Emerald 0.1.1

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 15 Sep 18:53
Add initial Mise plugin stub