Tuesday, August 31, 2021

The ABS Programing Language

A familiar syntax

ABS should look familiar to most of us, as its elements are borrowed from popular programming languages such as Ruby, Python or JavaScript:

obj = {} 
for n in 1..10 {     
  if n % 2 == 0 { 
    obj[n] = rand(10**2) 
  } 
} 
echo("We have %s", obj)  
# {"10": 79, ...}

Scripting made easy

System commands are deeply integrated (and encouraged); they make ABS ideal to work with in the context of shell scripting:

ip = `curl icanhazip.com`

ip.ok // true
ip // 1.2.3.4

echo("type something...")
input = stdin()
echo("you typed %s",input)

Easy to run

Grab the latest release, run abs your_script.abs and see the magic happening. ABS works on Mac, Windows and Linux:

$ abs test.abs 

1.2.3.4

type something...
Hello world!
you typed Hello world!
$


from Hacker News https://ift.tt/2WGgIGt

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.