FastPy is a statically typed programming language with pythonic syntax.
FastPy is a new general purpose, multi-paradigm, high performance, statically typed programming language which have pytonic intuitive syntax.
- "Hello, World" program:
# Just a comment :D
log('Hello, World!') # print hello world
- "Far Future" program:
interface Car:
public:
fun __init__(name: str, weight: int): ...
@property
fun brand() -> str: ...
@property
fun name() -> str: ...
@property
fun weight() -> int: ...
class Tesla(Car): # Car implementation
private:
__name: str
__weight: int
public:
fun __init__(name: str, weight: int):
__name = name
__weight = weight
@property
fun brand() -> str:
return 'Tesla'
@property
fun name() -> str:
return __name
@property
fun weight() -> int:
return __weight
fun car_factory(car_brand: str, name: str, weight: int) -> Car:
match car_brand:
case "Tesla":
return Tesla(name, weight)
default:
return null
some_car: Car = car_factory("Tesla", "Model X", 2301)
log(some_car.name) # Model X
log(some_car.weight) # 2301
*For more samples, see examples directory.
- Transpailable to C++. Therefore, compiled. Therefore, fast
- Easy intuitive syntax, similar to Python
- Statically typed
- Easy expandable
- Flexible, you can customize it for yourself or completely rewrite each component
- Built-in logging system
That language is built in such a way that allows to support customizing at every stage of transpiling or interpreting. For more info, see customizing doc file.
To enable syntax highlighting, see highlighting doc file.
To transpile and compile your program, you need to install the requirements.
- First, you need to install Python 3.10
- Then install some libs:
pip install -r requirements.txt
- Next, you need to install MinGW (optional, only used for compilation)
Usage:
python main.py [-h] -s SOURCE [-t] [-o OUTPUT] [-c]
Examples:
- Transpile file main.fpy to C++ and save to some_folder/src:
python main.py -s main.fpy -t -o some_folder
- Transpile file main.fpy to C++ and save to some_folder/src and compile:
python main.py -s main.fpy -t -c -o some_folder
First run from IDE (script: file):
The entire list of completed and scheduled tasks is available in the TODO file.
Project frozen until studying end :(
FastPy uses the MIT license. See the bundled LICENSE file for details.