Programming language made by me to learn other people how to make programming languages :3

Related tags

Command-line spectra
Overview

Spectra programming language

Programming language made for my tutorial videos (my youtube channel):

Untitled-1

Syntax

Declaring a variable:

var a = 3;

Function expression:

var even = fun (n) {
	n % 2 == 0
};

If expression:

print("number a is " + if a % 2 == 0 {
	"even"
} else {
	"odd"
});

While expression:

while true {
	println("HELLO!");
}

Classes:

class Point {
	x, 
	y,
	constructor (x, y) {
		this.x = x;
		this.y = y;
	}
	distance_from (other_point) { todo() }
}

Progress

  • Lexer
    • Tokenize identifiers
    • Tokenize string literals (without escape sequences)
    • Tokenize char literals (without escape sequences)
    • Process escape sequences
    • Tokenize integers
    • Tokenize floats
    • Process comments
  • Parser
    • Parse expressions
      • Parse binary expression
      • Parse postfix expression
      • Parse prefix expression
      • Parse if expression
      • Parse while expression
    • Parse statement
      • Parse break statement
      • Parse continue statement
      • Parse expression statement
      • Parse class statement
  • Tree-walk interpreter
    • Implement scopes
    • Evaluate expressions
      • Evaluate binary expression
      • Evaluate postfix expression
      • Evaluate prefix expression
      • Evaluate if expression
      • Evaluate while expression
    • Evaluate statements
      • Evaluate break statement
      • Evaluate continue statement
      • Evaluate expression statement
      • Evaluate class statement
  • VM
  • VM Bytecode Compiler
You might also like...
Cork is a simple command-line calculator, mainly targeted towards people who deal with hex numbers
Cork is a simple command-line calculator, mainly targeted towards people who deal with hex numbers

Cork is a simple command-line calculator, mainly targeted towards people who deal with hex numbers. It deals only with integer arithmetic. Expressions may involve mixed bases (limited to decimal, hexadecimal, octal and binary numbers). The global output format may be set to a particular radix - by default it is hex.

Oxygen is a voice journal and audio analysis toolkit for people who want to change the way their voice comes across.

Oxygen Voice Journal Oxygen is a voice journal and audio analysis toolkit for people who want to change the way their voice comes across. Or rather, i

CLI tool for generating a summary of recent github activity for people who are incredibly forgetful

CLI tool for generating a summary of recent github activity for people who are incredibly forgetful but still need to give weekly status updates to their boss without getting depressed and convincing themselves they did nothing because they can't remember what they did!

A command line tool for people of transgender experience to replace their deadname within a Git repo.

chowndn (Change Owner from Dead Name) A command line tool for people of transgender experience to replace their dead name within a Git repo. See chown

Mafa is a command-line tool that helps people interact with online websites in a terminal(tty).
Mafa is a command-line tool that helps people interact with online websites in a terminal(tty).

Table of Contents A Small Demo Installation Prerequisite Option 1: Cargo install (recommended) Option 2: Build from source Option 3: Prebuilt binaries

Mafa is a command-line tool that helps people interact with online websites in a terminal(tty).
Mafa is a command-line tool that helps people interact with online websites in a terminal(tty).

A Small Demo Installation Prerequisite Option 1: Cargo install (recommended) Option 2: Build from source Option 3: Prebuilt binaries Mafa is for me? W

xyz is a chat platform where people sign up, play a matching game, and say goodbye
xyz is a chat platform where people sign up, play a matching game, and say goodbye

xyz is an asynchronous chat and web service What you need Docker Desktop 🐳 Cargo (Rust package manager) 📦 Clone our project Follow the steps below t

An Interpreter for Brainfuck programming language implemented in the Rust programming language with zero dependencies.

Brainfuck Hello, Visitor! Hey there, welcome to my project showcase website! It's great to have you here. I hope you're ready to check out some awesom

A C-like programming language that is similar to Rust's syntax. Toy programming language.
A C-like programming language that is similar to Rust's syntax. Toy programming language.

CRUST This is a hobby project to learn about compilers and language design. I've designed the language to be similar to C and Rust. Heavily inspired b

Owner
Adi Salimgereyev
🕯 “In real open source, you have the right to control your own destiny.” - Linus Torvalds
Adi Salimgereyev
Striving to create a great Application with full functions of learning languages by ChatGPT, TTS, STT and other awesome AI models

Striving to create a great Application with full functions of learning languages by ChatGPT, TTS, STT and other awesome AI models, supports talking, speaking assessment, memorizing words with contexts, Listening test, so on.

null 155 Apr 20, 2023
A simple CLI I made while practicing rust to easily make QR codes with just one command, all in your terminal.

Welcome to rust-qrcode-cli ?? A CLI I made while practicing rust to easily make QR codes with just one command, all in your terminal. Install git clon

Dhravya Shah 2 Mar 2, 2022
Trying to solve Advent of Code 2022 in 25 different languages (1 day = 1 language)

Advent of Code 2022: 15/25 langs I’ll try to solve this Advent of Code using different language for each day. Any programs needed to run the code will

Max “Goldstein” Siling 2 Dec 15, 2022
A CLI for analyzing the programming languages and how much code written in a project.

projlyzer A CLI for analyzing the programming languages and how much code written in a project. New features are on the way... Example Screenshot Buil

null 10 Apr 10, 2022
Cloc - cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.

cloc Count Lines of Code cloc counts blank lines, comment lines, and physical lines of source code in many programming languages. Latest release: v1.9

null 15.3k Jan 8, 2023
⚙️ A curated list of static analysis (SAST) tools for all programming languages, config files, build tools, and more.

This repository lists static analysis tools for all programming languages, build tools, config files and more. The official website, analysis-tools.de

Analysis Tools 10.7k Jan 2, 2023
Run code from many programming languages!

Langbot Creating an image Install podman Build an image: podman build -t langbot . Running a language Run podman run --rm -i langbot ./scripts/run.sh

Martin Dørum 14 Jun 9, 2022
Generate Soufflé Datalog types, relations, and facts that represent ASTs from a variety of programming languages.

treeedb treeedb makes it easier to start writing a source-level program analysis in Soufflé Datalog. First, treeedb generates Soufflé types and relati

Langston Barrett 16 Nov 30, 2022
tmplt is a command-line interface tool that allows you to quickly and easily set up project templates for various programming languages and frameworks

tmplt A User Friendly CLI Tool For Creating New Projects With Templates About tmplt is a command-line tool that lets users quickly create new projects

Humble Penguin 35 Apr 8, 2023
Zellij is a workspace aimed at developers, ops-oriented people and anyone who loves the terminal

Zellij is a workspace aimed at developers, ops-oriented people and anyone who loves the terminal. At its core, it is a terminal multiplexer (similar to tmux and screen), but this is merely its infrastructure layer.

null 9.3k Jan 4, 2023