Table of Contents
The Violet programming language draws inspiration from Python's expressiveness, Rust's syntax clarity, and TypeScript's type system. The goal is to create a versatile tool for developers that is easy to learn and doesn't sacrifice performance or type-safety.
Follow these steps to set up a development environment.
You'll need to have Haskell and Stack set up on your system. I advise installing GHCup to manage your Haskell environment.
These are the versions I had installed while developing Violet.
Version | |
---|---|
GHCup | 0.1.20.0 |
GHC | 9.4.8 |
Stack | 2.13.1 |
Cabal | 3.10.2.1 |
HLS | 2.5.0.0 |
- Clone the repo
git clone https://github.com/zyrrus/violet.git
- Build the project
stack build
This section contains small, miscellaneous guides for anything I find helpful that is not specifically tied to setting up the environment for this project.
- In
stack.yaml
, addpackage-name-version
toextra-deps
- In
package.yaml
, addpackage-name
todependencies
- Build the project again
stack build
- Run the interpreter
stack ghci
- Run
:set -XOverloadedStrings
in GHCI
⚠️ Warning:
Violet is a hobby project that is still under development.
This release contains an executable, violet.exe
, that just parses a file and prints the program in the form of a list of Statements
The program expects a single file path argument (demonstrated below).
./violet.exe path/to/file.vi
- Basic lexer/parser
- Comments (block + single-line)
- Imports
- Function definitions
- Variable declaration + assignment
- Conditionals
- Expressions
- Full lexer/parser
- Type system (definitions + operations)
- Lists
- List comprehensions
- Ternary operations
- Bit-wise operations
- Syntactic sugar (
elif
, compound assignment operators likex += 4
)
- Semantic analysis
- Compiler