Frigate

From Esolang
Jump to navigation Jump to search

Frigate is an esoteric programming language based on Logic Gates!

Interpreter needed!

Currently, Frigate has no interpreter, since I haven't a clue as to how one goes about making one. If you'd like to make one, then please do so. Link it in the issues so that I can add it to this README.

Language Features

Logic gates

The language has two gates by default, AND and NOT. These are the building blocks upon which you will build your own gates.

You can use gates using the following syntax:

input1, input2 -> AND -> output

Defining Logic gates

You can define your own logic gates using the following syntax:

gate "XOR" : (input1, input2 -> AND), (input1, input2 -> NOR) -> NOR -> gate.Out

Comments

Comments are made with double pipes

|| This is a comment

I/O

User input is taken as a binary value with the userInput() method.

You can output with the output() method.

A simple Cat program could be userInput() -> output()

Conditionals

The only conditional statement in Frigate is a Switch.

input1, input2 -> and -> switch(
    1 -> output()
    0 -> halt()
)

Loops

The only loop in Frigate is a forever loop.

loop(1 -> output())

Example program

This is an example program, a Truth machine!

userInput(), 1 -> AND -> switch(
    1 -> loop(
        1 -> output()
    )
    0 -> output() -> halt()
)