MCPcopy Index your code
hub / github.com/abs-lang/abs

github.com/abs-lang/abs @2.7.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release 2.7.2 ↗ · + Follow
730 symbols 2,340 edges 30 files 195 documented · 27%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

abs language logo

GitHub Workflow Status (branch) License Version undefined undefined

undefined undefined Coverage Status

undefined undefined undefined undefined

The ABS programming language

ABS is a programming language that works best when you're scripting on your terminal. It tries to combine the elegance of languages such as Python, or Ruby with 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:

sample

Let's try to fetch our IP address and print the sum of its parts if it's higher than 100. Here's how you 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 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 [$ip] is a large number, $total.")
}

Wondering how to run this code? Grab the latest release and run:

$ abs script.abs

Installation

The easiest way is to:

bash <(curl https://www.abs-lang.org/installer.sh)

then you can:

$ abs path/to/scripts.abs

Documentation

Visit abs-lang.org or check the examples directory, which contains a few short scripts.

Contributing

Want to hack on ABS locally? The recommended development environment is inside a Docker container — simply:

  • make build (builds the container)
  • make run (sends you inside the development container)
  • make test (runs the abs tests)

After you make any change, run make test and check if any errors pop up. If everything looks fine that means you're ready to open a pull request!

Status

ABS is fresh and under active development; exciting things happen on a weekly basis!

Have a look at the roadmap here: to know of what version we're currently working on take a look at abs-lang.org/misc/technical-details.

Extension points exported contracts — how you extend this code

Node (Interface)
The base Node interface [30 implementers]
ast/ast.go
Object (Interface)
(no doc) [10 implementers]
object/object.go
Expression (Interface)
All expression nodes implement this [25 implementers]
ast/ast.go
Iterable (Interface)
(no doc) [2 implementers]
object/object.go
Statement (Interface)
All statement nodes implement this [4 implementers]
ast/ast.go
Hashable (Interface)
(no doc) [1 implementers]
object/object.go
Deferrable (Interface)
Deferrable is used to be able to check whether an expression needs to be executed now or at the end of the scope [1 implementers]
ast/ast.go
BuiltinFunction (FuncType)
(no doc)
object/object.go

Core symbols most depended-on inside this repo

String
called by 110
ast/ast.go
Type
called by 78
object/object.go
newError
called by 71
evaluator/evaluator.go
validateArgs
called by 69
evaluator/functions.go
nextToken
called by 62
parser/parser.go
Inspect
called by 57
object/object.go
New
called by 55
lexer/lexer.go
New
called by 49
parser/parser.go

Shape

Function 393
Method 263
Struct 60
Interface 7
TypeAlias 4
FuncType 3

Languages

Go100%

Modules by API surface

ast/ast.go133 symbols
evaluator/functions.go90 symbols
object/object.go76 symbols
evaluator/builtin_functions_test.go69 symbols
parser/parser.go56 symbols
parser/parser_test.go53 symbols
evaluator/evaluator.go53 symbols
evaluator/evaluator_test.go51 symbols
terminal/terminal.go35 symbols
evaluator/stdlib.go24 symbols
lexer/lexer.go23 symbols
util/util.go9 symbols

For agents

$ claude mcp add abs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact