#hython
A Python 3 interpreter implemented in Haskell.
The goal of this project is to become more familiar with Haskell. It is not to produce a replacement for CPython or PyPy. I would like to implement as much of the core language as I can. While I list features out below, they're more for me to remember what I have remaining in each part of the project.
- Line comments
- Significant indentation
- Integer literals
- Floating point literals
- Imaginary literals
- Single quoted string literals
- Double quoted string literals
- Triple quoted string literals
- String escape sequences
- Byte literals
- All operators, delimiters, and keywords
- Implicit line joining in collections
- Explicit line joining via
\\
- Scalar literals
- Adjacent string literal concatenation
- Function calls
- Attribute access
- Tuples
- List literals
- List comprehensions
- Dictionary literals
- Subscript operators
- Set literals
- All arithmetic operators
- All bitwise operators
- All boolean operators
- All comparison operators
-
assertstatement -
breakstatement -
classstatement -
defstatement -
delstatement -
forstatement -
globalstatement -
if/elif/elsestatements -
importstatement (and friends) -
lambdastatement -
nonlocalstatement -
passstatement -
raisestatement -
returnstatement -
trystatement -
whilestatement -
withstatement -
yieldstatement - Keyword arguments to functions
- Default arguments to functions
-
printbuilt-in function - Variable assignment and retrieval
- Loop control flow
- Function control flow
- Scoping (basic)
- Functions
- Classes
- Inheritance
- Modules
- Exception handling
- Generators
- Standard built-in functions
- Built-in exception types
To build:
$ make
To test:
$ make test