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 :Dlog('Hello, World!') # print hello world- "Far Future" program:
interfaceCar:
public:
fun__init__(name: str, weight: int): ...
@propertyfunbrand() ->str: ...
@propertyfunname() ->str: ...
@propertyfunweight() ->int: ...
classTesla(Car): # Car implementationprivate:
__name: str__weight: intpublic:
fun__init__(name: str, weight: int):
__name=name__weight=weight@propertyfunbrand() ->str:
return'Tesla'@propertyfunname() ->str:
return__name
@propertyfunweight() ->int:
return__weightfuncar_factory(car_brand: str, name: str, weight: int) ->Car:
matchcar_brand:
case"Tesla":
returnTesla(name, weight)
default:
returnnullsome_car: Car=car_factory("Tesla", "Model X", 2301) log(some_car.name) # Model Xlog(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_folderFirst 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.
