Agentica 0.40.0
· release
Agentica 0.40.0 is out. It gathers the two betas of this line with a few last changes, and it has breaking changes in std/http, std/utc and file error kinds. The full list is in the changelog.
What is new #
Pipes over several lines #
A line that starts with |> continues the line before it, so a pipe can span lines without parentheses. agentica fmt uses that form.
def double(n: Int) -> Int = n * 2
def describe(n: Int) -> String = "total: #{n}"
def main() -> Void
text = [1, 2, 3, 4].sum
|> double()
|> describe()
puts(text)
endtotal: 20Package modules in a src/ folder #
A package may keep its modules in a src/ folder: pkg/NAME/x is src/x.agc of the package when it has one. Imports do not change.
A time limit for tests #
agentica test --test-timeout-ms N sets the time of each test and each scenario. The default stays 30,000 ms.
Files, enums and Float32 lists #
From the betas: File.copy, File.chmod, File.symlink, File.readlink, temp files with File.open(path, "temp"), and System.hostname(). Archive.Options(keep_mode: true) keeps the permission bits of TAR entries. Enums without payloads get values and parse, and every enum value has name. A List[Float32] is stored packed, 4 bytes per item, and native modules can read it in place.
Breaking changes #
- The
std/httpconnection pool is removed:HTTP.client,HTTP.close_client,HTTP.get,HTTP.post,HTTP.requestandHTTP.Client. UseHTTP.get_responseandHTTP.post_response, or thehttp-clientpackage for a pool.HTTP.downloadtakesHTTP.ClientOptionsinstead of a client. std/utcis removed; use the builtinTime.- A 0.39 VM rejects a
.agcbbuilt by 0.40 that loads a[native]library. - A file error with errno
ENOTSUPorEOPNOTSUPPhas kindio.unsupported, notio.failed.
Also #
agentica compilewarnsPKG-NATIVE-STOREDfor each native library that must travel beside the.agcb, andagentica runlooks for it there first.- A cancelled
HTTP.downloadno longer leaves its hidden part file behind. type-atand go to definition on a module alias answer the imported file.