Skip to content

arciel/Autolang

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Autolang Build Status

Autolang is a procedural, interpreted programming language.

It supports primitive data types (int, char, and logical), containers (sets, tuples, and maps), and strings.

Building

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

Usage

Autolang can be used either with a file, or interactively. The filename argument is optional.

$ auto filename.al

Examples

The real joy of Autolang is its very math-oriented syntax. Here are some cool examples you can try.

1.
>>> set A = {1, 2, 3} x {'A', 'B'}      # Cartesian Product
>>> print A
{(1, 'A'), (1, 'B'), (2, 'A'), (2, 'B'), (3, 'A'), (3, 'B')} 
2.
>>> print {(1, 'B')} c A                # Is this set a subset of A?
True
3.
>>> print (2 + 10 * 2) == (2 * 10 + 2)  # Beware, no operator precedence!
False
4.
>>> string first = "Tushar"
>>> string last = "Rakheja"
>>> tuple entry = (first, last)         # Identifiers can be used as elements.
>>> print entry
("Tushar", "Rakheja")
5.
>>> 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.

Future Plans/Ideas

  • 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.

License

Copyright (c) 2016 Tushar Rakheja (The MIT License)

About

An experimental programming language.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 99.2%
  • Makefile 0.8%