mufeedvh / regretti

A programming language where comments are the first-class citizen and ASCII art flowcharts are the controls!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

regretti 🤌🍝

A programming language where comments are the first-class citizen and ASCII art flowcharts are the controls!


Made for Lang Jam (jam0001) theme: first-class comments in 48 hours.

UPDATE: regretti won Lang Jam (jam0001)!

Summary

What if all those "TODO:" comments and beautiful ASCII art diagrams in your code actually worked? Presenting you the one and only regretti, write your spaghetti and forgetti!

Basically, I took the theme "literally"!

So comments are commands!

You can only run instruction statements inside a comment! 💬

Table of Contents

Goals

  • Teaching: What initially started as a troll/esoteric language, this language could be used to teach kids "Control Flows" visually.
  • Fast: The existing functionality/examples runs faster than most interpreted languages!
  • Helpful Error Messages: Almost every errors will be catched and prints out a helpful error message as to denote what went wrong. (Inspired from Rust ❤️)

Installation

NOTE: Please run on Linux.

$ git clone https://github.com/mufeedvh/regretti.git
$ cd regretti/
$ cargo build --release
$ ./target/release/regretti

Hello World

Lo and behold!

main:
    /*
        +----------------------+
        | print "Hello World!" |
        +----------------------+
    */

Loops


main:
    let count = 69420

    /*
        +--------+
        | loop 5 |<----------+
        +--------+           |
             |               v
             |               +-------------+
             |               | print count |
             |               +-------------+
             |               ^
             |               |
             +---------------+
    */
:end

Get more examples below!

Examples

Examples are the best way to learn regretti, these cover all the features and functionalities of the language:

All other examples have not been completely implemented yet.

Also I am pretty sure there are a lot of bugs, this is probably the most obscure syntax for parsing lol...

Flow Charts?

Internals

In a nutshell:

https://xkcd.com/1209/


About

A programming language where comments are the first-class citizen and ASCII art flowcharts are the controls!

License:MIT License


Languages

Language:Rust 98.8%Language:Python 1.2%