Arr.ai
The ultimate data engine.
Install
Install Go, then:
go get -v -u github.com/arr-ai/arrai/cmd/arrai
arrai -h
On Unix-like platforms, you can also symlink a handy shortcut:
ln -s arrai $(dirname $(which arrai))/ai
Learn
Follow the Arr.ai tutorial for a step by step guide
into the world of arr.ai programming.
See the Introduction to Arr.ai to learn more about the arr.ai
language.
See the Standard Library Reference to learn which are batteries
are included in arr.ai.
Arr.ai Examples
- Snippets
- More complete examples
Use
Run the interactive shell
$ arrai i
@> 6 * 7
42
@> //.<tab>
archive dict encoding eval fn grammar log math
net os re reflect rel seq str tuple
unicode
@> //.str.<tab>
contains expand has_prefix has_suffix join lower repr
split sub title upper
@> //.str.upper("hello")
'HELLO'
Ctrl+D to exit. or use the /exit
command.
@> /exit
On Unix-like platforms, you can use the ai
shortcut:
$ ai
@> _
There are more features in the interactive shell. For more info please read the
shell tutorial.
Evaluate an expression
arrai eval '41 + 1'
Run arrai help
or arrai help <command>
for more information.
Run an arrai file
arrai path/to/file.arrai
or use the run
command
arrai run path/to/file.arrai
arrai run
can be used to avoid ambiguity between filename and a command.
For example, running an arrai file named run
(arrai run run
). Alternatively, include a
subdirectory component in the filename (arrai ./run
).
Start a server
arrai serve --listen localhost
Observe a server
arrai observe localhost '$'
Update a server
arrai update localhost '{a: {|1, 2, 3|}, b: "hello"}'