hn.today

Show HN: Ant – A scripting language with goroutines and static types

ant-lang.org15 points5 comments
Screenshot of Show HN: Ant – A scripting language with goroutines and static types

Ant is a statically typed scripting language built around left-to-right data pipelines, explicit error handling, and lightweight concurrency. Its pipe operator feeds each value into the next function, while concise block lambdas support operations such as filtering, mapping, and sorting collections. Fallible functions return Result values rather than throwing exceptions; try propagates errors to callers. Record unions let programs represent alternatives such as card or cash payments, with type checks exposing the relevant fields in each branch. Goroutines can run functions concurrently, and Parallel.map distributes work across a list with a configurable limit. HTML markup is also an expression, with interpolated text escaped by default.

Ant emphasizes a complete development workflow alongside the language. A single command-line tool checks, formats, tests, and documents code, with a sound type checker that reports precise errors and suggests fixes. Warnings flag issues such as ignoring a file operation’s error result. Tests live beside the code, and failed assertions show the compared values. Editor integrations for VS Code, IntelliJ IDEA, and Neovim provide completion, diagnostics, navigation, renaming, and debugging. Additional tools include command-line queries for types and references, an interactive REPL with completion and history, and terminal documentation for library and user-defined names.

Read on ant-lang.org5 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.