Autolang is a procedural, interpreted programming language.
It supports primitive data types (int
, char
, and logical
), containers (sets
, tuples
, and maps
), and strings
.
Dependencies
gcc
4.8 or later- GNU
make
Clone (or alternatively download) the repo.
$ git clone https://github.com/TusharRakheja/Autolang
Then navigate into the directory and open the Makefile. Set CXX=g++
. Depending on your version of gcc
, you may also need to edit the -std
flag. Once done, run make.
$ cd Autolang
$ make
$ make clean
Autolang can be used either with a file, or interactively. The filename argument is optional.
$ auto filename.al
The real joy of Autolang is its very math-oriented syntax. Here are some cool examples you can try.
>>> set A = {1, 2, 3} x {'A', 'B'} # Cartesian Product
>>> print A
{(1, 'A'), (1, 'B'), (2, 'A'), (2, 'B'), (3, 'A'), (3, 'B')}
>>> print {(1, 'B')} c A # Is this set a subset of A?
True
>>> print (2 + 10 * 2) == (2 * 10 + 2) # Beware, no operator precedence!
False
>>> string first = "Tushar"
>>> string last = "Rakheja"
>>> tuple entry = (first, last) # Identifiers can be used as elements.
>>> print entry
("Tushar", "Rakheja")
>>> if (True V False) # Will quit the shell.
{ quit }
To see an example of how the while loop (the only looping construct in the language, right now) and some other things in the language work, check Examples/example6.al
out. A technical guide is coming soon.
-
Lexical scoping.
-
Casting.
-
Automatic memory management.
-
Support for graphics, modularity etc.
-
Abstract Maps/Lambda Expressions (Mapping criteria instead of fixed mappings, eg x --> x + 2)
-
Abstract Sets (Membership criteria instead of fixed members). Probably can be simulated via Abstract Maps.
Copyright (c) 2016 Tushar Rakheja (The MIT License)