Skip to content

A compiler for a toy language written in typescript

Notifications You must be signed in to change notification settings

Zycrasion/avolang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Avolang or Avocado Language

Avocado language is currently a "toy langauge" its mainly for learning how compilers work. It is in its early stages, still being powered by an interpreter. I have a long way to go before a v1.0.0 before that I need to implement several features.

Contributing

This is a personal project so no pull requests will be accepted.

Setup

Typescript Compiler:

cd typescript_compiler

npm i

npm run test

npm run unit_tests

Design

I want the langauge to be human readable while also being easy for an interpereter to understand. It looks alot like Typescript with a few differences.

TODO

  • scopes {}

  • conditionals ?> a b (greater than)

  • if if cond {}

  • ifnot ifnot cond {}

  • else else {}

  • else if elif {}

  • conditional revamp a > b !(a > b) 50% done (need unary operators to work)

  • while loops while(cond) {}

  • break break;

  • loops loop {}

  • functions func:type name(param) {}

  • compiler

Variables

Avolang:


var:char char_example = 'l';

var:int int_example = 10;

Typescript:

let  char_example : string = "l";

let  int_example : number = 10;

as you can see Avolang has stricter types

Functions

Avolang:


func:void print_AHHHH()

{

out.print("AHHHH");

}

Typescript:

function  print_AHHHH() : void

{

console.log("AHHHH");

}

About

A compiler for a toy language written in typescript

Topics

Resources

Stars

Watchers

Forks