Show HN: Ant – A scripting language with goroutines and static types ant-lang.or...

@show

Show HN: Ant – A scripting language with goroutines and static types ant-lang.org · 10 points · 3 comments · HN thread

TL;DR Ant is a new scripting language, presented as a Show HN, that combines data-flow pipes, Result-based error handling, goroutines, and a sound static type checker. The site shows short examples of each feature and the bundled tooling: ant check, fmt, test, doc, a language server, and a debugger.

  • Pipes (|) pass the left value as the first argument to the right-hand call, with lambdas written as blocks like { x > 2 }.
  • Fallible functions return Result[T, Error]; try propagates errors to the caller and nothing is thrown.
  • Goroutines are cheap, and Parallel.map runs a function over a list with a concurrency limit.
  • Markup is a typed Html value, and interpolated text is escaped by default.
  • A single ant binary covers checking, formatting, testing, docs, a REPL, an LSP server and a DAP debugger, plus ant code for type, definition and reference queries.
  • The checker is described as sound, reports errors with exact positions and suggested fixes, and flags unused Result values as warnings.

Discussion The thread is short and mostly a creator introduction. The author, Anton, explains that he built Ant as a more pleasant alternative to JavaScript with TypeScript-style types and the Go runtime, and that it is meant both for standalone scripts and for embedding in Go applications, as a companion to his Expr expression library. A commenter asks whether it has been used in production, and the author replies that he uses it for experimental scripts that access on-premises machines at his company. The mood is friendly and exploratory, with no critical replies.

  • Ant is a useful scripting option for Go developers (some): The author and at least one commenter see Ant as a fit for embedding user-automation scripts inside Go apps and for small standalone scripts that can grow into servers using goroutines and channels.
  • Interested in trying it out of curiosity (a few): A commenter who likes Expr says they will try Ant just for fun, showing interest based on the author's prior work rather than on a specific technical argument.
  • Production use for ops scripts is already happening (a few): The author reports using Ant in experimental scripts that access on-prem machines at his company, which is the only first-hand experience reported in the thread.

#scripting #golang #programmingLanguages #staticTypes #concurrency