Skip to content

arr-ai/arrai

Repository files navigation

Arr.ai

Go build status

The ultimate data engine.

Install

On a Unix-like OS, install Go (1.15 or above), then:

git clone https://github.com/arr-ai/arrai.git
cd arrai
make install

On Windows, download the relevant ZIP file from the Releases page.

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 what batteries are included in arr.ai.

Arr.ai Examples

  1. Snippets
  2. More complete examples

Use

Run the interactive shell

$ arrai i
@> 6 * 7
42
@> //<tab>
archive  bits     dict     encoding eval     fn       grammar  log
math     net      os       re       reflect  rel      seq      str
test     tuple    unicode  {
@> //str.<tab>
expand lower  repr   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

(See here for a full description of eval.)

arrai eval '41 + 1'

Run arrai help or arrai help <command> for more information.

Run an arrai file

(See here for a full description of run.)

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")'
arrai u localhost '$ + (a: $.a | {4, 5, 6})'