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
- Host: GitHub
- URL: https://github.com/xeimsuck/cfroppy
- Owner: xeimsuck
- License: mit
- Created: 2024-08-06T14:48:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-25T11:58:48.000Z (about 1 year ago)
- Last Synced: 2025-01-22T12:12:38.600Z (12 months ago)
- Topics: cfroppy, cpp, cpp-interpreter, cpp23, froppy, interpreter
- Language: C++
- Homepage:
- Size: 151 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.