Skip to content
/ violet Public

A hobby programming language that blends my favorite parts of Python, Rust, and TypeScript

License

Notifications You must be signed in to change notification settings

zyrrus/violet

Repository files navigation

Violet

An expressive, type-safe programming language

Release v0.1.0 Haskell

Table of Contents
  1. About the Project
  2. Getting Started
  3. Usage
  4. Roadmap

About the Project

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.

Getting Started

Follow these steps to set up a development environment.

Prerequisites

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

Installation

  1. Clone the repo
    git clone https://github.com/zyrrus/violet.git
  2. Build the project
    stack build

Development Guides

This section contains small, miscellaneous guides for anything I find helpful that is not specifically tied to setting up the environment for this project.

Installing Dependencies

  1. In stack.yaml, add package-name-version to extra-deps
  2. In package.yaml, add package-name to dependencies
  3. Build the project again
    stack build

Running GHCI

  1. Run the interpreter
    stack ghci
  2. Run :set -XOverloadedStrings in GHCI

Usage

⚠️ Warning:
Violet is a hobby project that is still under development.

Release v0.1.0 (Parser executable)

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

Roadmap

  • 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 like x += 4)
  • Semantic analysis
  • Compiler

About

A hobby programming language that blends my favorite parts of Python, Rust, and TypeScript

Topics

Resources

License

Stars

Watchers

Forks