Home of the ABS programming language: the joy of shell scripting.
Clone or download
Pull request Compare This branch is 1 commit ahead, 11 commits behind abs-lang:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ast
bin
builds
docs
evaluator
examples
lexer
object
parser
repl
scripts
token
util
.gitignore
.travis.yml
Dockerfile
LICENSE
Makefile
README.md
main.go

README.md

abs language logo

Travis Status License Version

The ABS programming language

ABS is a scripting language that works best when you're on your terminal. It tries to combine the elegance of languages such as Python, or Ruby, to the convenience of Bash.

tz = $(cat /etc/timezone);
continent, city = tz.split("/")

echo("Best city in the world?")

selection = stdin()

if selection == city {
  echo("You might be biased...")
}

See it in action:

asciicast

Let's try to fetch our IP address and print the sum of its parts, if its higher than 100. Here's how you could do it in Bash:

# Simple program that fetches your IP and sums it up
RES=$(curl -s 'https://api.ipify.org?format=json' || "ERR")

if [ "$RES" = "ERR" ]; then
    echo "An error occurred"
    exit 1
fi

IP=$(echo $RES | jq -r ".ip")
IFS=. read first second third fourth <<EOF
${IP##*-}
EOF

total=$((first + second + third + fourth))
if [ $total -gt 100 ]; then
    echo "The sum of [$IP] is a large number, $total."
fi

And here's how you could write the same code in ABS:

# Simple program that fetches your IP and sums it up
res = $(curl -s 'https://api.ipify.org?format=json');

if !res.ok {
  echo("An error occurred: %s", res)
  exit(1)
}

ip = res.json().ip
total = ip.split(".").map(int).sum()
if total > 100 {
    echo("The sum of [%s] is a large number, %s.", ip, total)
}

Wondering how you can run this code? Simply grab the latest release and run:

$ abs script.abs

Documentation

Visit abs-lang.org

Status

ABS is fresh and under active development, meaning exciting things happen on a weekly basis.

Have a look at the roadmaps here: we're currently working on the release of ABS 1.0.