A simple programming language, created for AP Computer Science

Overview

lang

a simple programming language, created for AP Computer Science

design goals

to make a simple proof-of concept programming language interpreter, implemented in Rust

the syntax should be somewhere between that of Go and Rust

features

definitely:

  • functions
  • variables
  • strings
  • numbers
  • standard library

maybe:

  • compound data types
  • modules
  • first-class functions
  • static typing
  • type inference
  • string interpolation
  • ahead-of-time compiler
  • universal function call convention
  • actual name

syntax example

use std::io

// main implicitly returns unit
fn main() {
	// `name: Str = ...` would also work
	name := prompt("what is your name? ")
	io::println("hello, {name}") // string interpolation!
}

// prompt prints a prompt to standard output and waits for a line on standard input
fn prompt(prompt Str) Str {
	io::print(prompt)
	io::readln() // last-line implicit return
}

license

this software is available under the terms of the MIT license. see the license for more details

You might also like...
Mote is a systems-programming language designed to be practical, performant, and simple.
Mote is a systems-programming language designed to be practical, performant, and simple.

Mote NOTE: this following lists the goals for what Mote is supposed to be. It does not promise that any of the features here will be accomplished or a

A simple programming language for something between C and Rust.

inuc inuc is a systems programming language that is something between C and Rust. Features : [] Strong , static typing (type inference not a priority

Experimental Quantum Computer Simulator + Quantum Chess Implementation
Experimental Quantum Computer Simulator + Quantum Chess Implementation

Quantum Chess A somewhat hacky implementation of this paper (made in a week over a holiday). It's not heavily tested and probably has some bugs still

Simulator for the pioneering TX-2 computer

TX-2 Simulator We are trying to create a simulator for Lincoln Lab's historic TX-2 computer. Notably, this is the computer on which Ivan Sutherland's

Nixt is an interpreted programming language written in Rust

Nixt Nixt is an interpreted lisp inspired programming language written in Rust Index About Examples Installation Build About Nixt goal is to provide a

A programming language somewhat resembling cellular processes.

cytosol An embeddable programming language somewhat resembling cellular processes. State of the implementation tokenising parsing semantic analysis an

Orion lang is a lispy programming language that is strongly and statically typed.
Orion lang is a lispy programming language that is strongly and statically typed.

Orion Orion is a lisp inspired statically typed programming language written in Rust Install To install orion you can either: Download binary from the

a function programming language for real world applications made in rust

a function programming language for real world applications made in rust

Rust implementation of µKanren, a featherweight relational programming language.

µKanren-rs This is a Rust implementation of µKanren, a featherweight relational programming language. See the original Scheme implementation here for

Comments
  • expression parsing

    expression parsing

    the problem

    we need to parse expressions

    the solution

    this will probably require an architecture a bit different from the rest of the parsing logic so far

    the code

    https://github.com/alterae/lang/blob/be17b69d0c88f0d3252e906d528ac7cef29de12a/src/parser.rs#L155-L172

    the relevant reading

    https://craftinginterpreters.com/compiling-expressions.html

    the todo list

    • [ ] binary operators (x - y)
      • [ ] arithmetic
        • [ ] addition (+)
        • [ ] subtraction (-)
        • [ ] multiplication (*)
        • [ ] division (/)
        • [ ] modulo (%)
      • [ ] logical
        • [ ] and (&&)
        • [ ] or (||)
    • [ ] function calls (foo(), foo::bar("baz:))
    • [ ] numeric literals (3, 3.14)
    • [ ] parentheses ((x * (y + z)))
    • [ ] string literals ("foo")
    • [ ] unary operators (-x)
      • [ ] arithmetic negation (-)
      • [ ] logical negation (!)
    • [ ] variable assignment (x = y)
    • [ ] variable initialization (x := y)
    opened by alterae 2
Owner
Michelle S.
she/her or they/them. fan of Typescript, Rust, game design, and good command-line tools
Michelle S.
Simple RESTful API in rust created with actix-web. (Routing, models, JWT auth).

rust-simple-api Simple RESTful API created with rust, actix-web, Diesel, JWT. Running application Manual Firstly generate a secret.key which will be u

null 2 Jul 30, 2022
The Computer Language Benchmarks Game: Rust implementations

The Computer Language Benchmarks Game: Rust implementations This is the version I propose to the The Computer Language Benchmarks Game. For regex-dna,

Guillaume P. 69 Jul 11, 2022
Multi-platform desktop app to download and run Large Language Models(LLM) locally in your computer.

Multi-platform desktop app to download and run Large Language Models(LLM) locally in your computer ?? Download | Give it a Star ⭐ | Share it on Twitte

Julio Andres 73 Jun 15, 2023
Sorting-in-rust-jadyn-nicholas created by GitHub Classroom

Sorting in Rust Overview Traits Running the code and the tests To Do Overview This lab uses various sorting algorithms as examples several features of

null 0 Mar 24, 2022
disemvowel-in-rust-bante created by GitHub Classroom

Rust Disemvowel This is a simple lab where we'll use Rust to implement the disemvowel function that we covered in a previous C lab. What is Rust? Rust

null 0 Dec 7, 2021
learn_rust_rustlings-qinyuhang created by GitHub Classroom

rustlings ?? ❤️ Greetings and welcome to rustlings. This project contains small exercises to get you used to reading and writing Rust code. This inclu

The Learning&Training Hub of OS Kernel 2 Oct 22, 2022
kickable - a crate created to answer the age old question

kickable kickable is a crate created to answer the age old question... "Can I Kick It?" This package is for showcase purposes only. What is a kickable

@defstream 4 Jan 12, 2023
A repository for showcasing my knowledge of the Rust programming language, and continuing to learn the language.

Learning Rust I started learning the Rust programming language before using GitHub, but increased its usage afterwards. I have found it to be a fast a

Sean P. Myrick V19.1.7.2 2 Nov 8, 2022
Nyah is a programming language runtime built for high performance and comes with a scripting language.

?? Nyah ( Unfinished ) Nyah is a programming language runtime built for high performance and comes with a scripting language. ??️ Status Nyah is not c

Stacker 3 Mar 6, 2022
lelang programming language is a toy language based on LLVM.

lelang leang是一门使用Rust编写,基于LLVM(inkwell llvm safe binding library)实现的编程语言,起初作为课程实验项目,现在为个人长期维护项目。 Target Features 支持8至64位的整形类型和32/64位浮点 基本的函数定义,调用,声明外部

Aya0wind 5 Sep 4, 2022