Skip to content

xeimsuck/CFroppy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CFroppy

Interpreter for Froppy programming language

Dependencies

Languages: C++23
Build systems: CMake

How to build

1. Create a build directory and navigate into it
mkdir build
cd build
  1. Build a project with CMake
cmake ..
make
sudo make install
# if possible use -j4 with make 

How to use

1. Run prompt. Usage: "cfp".
2. Run file. Usage: "cfp [path-to-file]".

The Froppy Programming Language

Multi-paradigm interpreted programming language

Weak typing

In Froppy variables are not bound to a specific data type.
let x; // by default, it is initialized to nil
println(x); // >> "nil"

x = 52; // now it is a integer
println(x); // >> 52

Dynamic scoping

Froppy has closures.
fn factory() {
    fn instance() {
        println("factory::instance");
    }
    return instance; // return inner function
}

let foo = factory();
foo(); // >> "factory::instance"

Object-oriented

Froppy is object-oriented programing language, so it has classes and inheritance.
class base { 
    let x;
    fn setX(x_) { 
        x = x_; 
    }
    fn getX() { 
        return x; 
    }
}

class derived : base { // derived is inherited from base
    fn setX(x_) {  // override method
        x=x_*2;
    }
}

let d = derived();
d.setX(3); // use overrided setX method
printlb(d.getX()); // >> 6

Documentation

Read more about Froppy language in documentation.