An open API service indexing awesome lists of open source software.

https://github.com/xeimsuck/cfroppy

Interpreter for Froppy language
https://github.com/xeimsuck/cfroppy

cfroppy cpp cpp-interpreter cpp23 froppy interpreter

Last synced: 10 months ago
JSON representation

Interpreter for Froppy language

Awesome Lists containing this project

README

          


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

```shell
mkdir build
cd build
```

2. Build a project with CMake
```shell
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.

```froppy
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.

```froppy
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.

```froppy
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.