interpreted-language

Mentor assignment:

Implement a simple programming language using Python. For the sake of argument, let's call the language Anaconda. When you run the anaconda interpreter, you will give it a file of anaconda source code (suffix .an), just as when you run the python interpreter you give it a file of python source code. So, executing an anaconda program on the command line would look something like this:

python anaconda.py program.an

Now, to get started, let's go with something very basic. Anaconda will support setting variables to values, performing binary arithmetic operations and printing the value of a variable or literal. For example, all the following statements would be legal:

x = 5

y = x * x

print y

Running this program should emit the value: 25.

====

I ended up using Ruby for starters

====

Extensions:

  • Define and call functions
  • Array type variables
  • Floating point and string data types
  • Unary operators
  • More complex expressions (e.g., 5 * 3 - 2)