Releases: amortimer20/emerald-lang
Releases · amortimer20/emerald-lang
Release list
Emerald 0.6.0
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 | iexmacOS (Apple silicon) and Linux (x86-64):
curl -fsSL https://raw.githubusercontent.com/amortimer20/emerald-lang/main/install.sh | shIf 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, andStopwatch, plusProgram.sleep. Named time zones come from the IANA database (2026d) built into Emerald, soTimeZone("America/New_York")gives the same answer on every operating system. - Regular expressions.
RegexandRegex.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.stylefor combinations, andConsole.plainto remove styling.runandtestaccept--color=auto|always|neverand respectNO_COLORandFORCE_COLOR. - JSON.
Json.parseand navigation for data you don't know ahead of time, andJson.encodeandJson.decode(text, as: Type)to convert your own structs directly. - A web client.
Http.get,post,put,patch, anddeletereturn a finishedHttp.Responsewith its text, JSON, bytes, and headers. Requests have timeouts, follow redirects, check certificates, and treat an error status as an error unless you passstrict: false. - CSV.
Csv.parseandCsv.parse_recordsread spreadsheet exports;Csv.decode(text, as: List[Record])andCsv.encode(records)convert your own structs, with errors that name the line and column. - Base64, digests, and hex.
Base64.encodeanddecode(standard orurl_safe: true),Digest.sha256andDigest.hmac_sha256, andbytes.to_hex()withBytes.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
Emeraldnamespace. Every built-in can also be written in full, asEmerald.printorEmerald.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()is3, and-3.positive?()isfalse.-2 ** 2is 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:
pushon a Set says Emerald calls thisadd. - 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 is3. It used to mean-(3.abs()), which is-3.Bytes.to_string()on bytes that are not valid UTF-8 raisesEncodingErrorinstead ofFileError. Both areRuntimeErrors, socatch error: RuntimeErrorcatches 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
Emerald 0.5.0: inline if expressions and Random dispatch fix
v0.4.0
v0.3.0
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
v0.1.2
Emerald 0.1.2: fix release binaries crashing on CPUs without AVX-512