Skip to content
/ zypo-rs Public

Old lalrpop-based compiler that was never finished. See link for new compiler

License

Notifications You must be signed in to change notification settings

Owez/zypo-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Zypo is a new language focused on portability and developer needs ✨

Objectives

  • Dynamic typing
  • Binary portability
  • Static compilation
  • Markdown-friendly (all compiler logs should be in markdown)
  • Memory safe compiler (programs written are not memory safe!)

The Syntax

2 simple dummy functions:

fun hello(other_int) {
    if(other_int == 5) {
        var x = 24;

        while(x / other_int != 2) {
            --snip--
        }
    }

    var result = "hello";
}

fun mul_x(first, second) {
    return first * second == 6;
}

Fibonacci sequence:

fun fibonacci(stop_iteration) {
    if (stop_iteration == (0 or 1)) {
        return 0; -- return just 0 as user input is incorrect.
    }

    return fibonacci(stop_iteration - 1) + fibonacci(stop_iteration - 2);
}

You can find more code examples in the examples/ directory in the same path as this README!

Note: we use kotlin for markdown highlighting as Zypo highlighting is not supported just yet.. 🤞

Project structure

In the sublevels are descriptions on each made part of this compiler.

/ - Main repository

  • Contains general docs on the rest of zypo including setup and running
  • Contains the 2 core Zypo modules, zypo-lib (the main compiler library) and zypo (the cli)
  • Named "Zypo"/"The compiler" or if referencing in docs "zypo-rs" (always lowercase in codeblock)

/zypo-lib/ - Compiler library

  • Named "The compiler library" or "zypo-lib" (always lowercase in codeblock)
  • Contains the main guts of the compiler and a simple API to connect outside code to multiple stages of the library

/zypo-cli/ - Main CLI

  • Named "The CLI" or "zypo-cli" (always lowercase in codeblock)
  • The CLI the majority of people use to interact with Zypo
  • On releasing the binary, the name is shortened to just ./zypo for linux or ./zypo.exe for windows

/examples/ - Zypo examples

  • Contains some examples for .zy/Zypo code that are used in this README

About

Old lalrpop-based compiler that was never finished. See link for new compiler

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages