Hacker News

Amber the programming language compiled to Bash/Ksh/Zsh

Amber: The Programming Language Compiled to Bash/Ksh/Zsh

A language compiled to Bash. A modern, type-safe programming language that catches bugs and errors at compile time.

See it in action:

import { join } from "std/text"

fun get_weather(cities: [Text]): Null {
  let temperatures = [Text]
  for city in cities {
    const result = $ curl -s "https://wttr.in/{city}?format=1" $
    failed {
      echo "Error: Failed to get weather for {city}"
      continue
    }
    temperatures += [result]
  }
  return temperatures
}

get_weather([])

Click to run the function.

Modern Syntax

ECMA Script-like syntax.

Runtime Safety

Amber ensures that you handle everything that could fail.

Type Safety

Use strong typing to catch bugs at compile time.

Instant Docs

Generate documentation automatically.

Bash Ready

Interoperate with Bash scripts.

Library Baked In

Standard library with many useful functions.

Comments

No comments yet. Start the discussion.