"viper"_ = "An attempt to replicate Python's syntax in C++"; The goal of is to leverage as many C++ language features as possible to replicate the clean syntax and dynamic typing of python.
This project isn't designed to be used seriously but instead as a fun demonstration of some of the useful, interesting, and obscure features C++ has to offer.
viper_.h is the single include header file that requires no setup but can be configured with the preprocessor.
"my_variable"_ = 100;
// Also supports other literals:
123_ = "Hello, World!";
3.14_ = 123_; // 3.14 = "Hello, World!"print("{123} This is a format print so my_variable = {my_variable}. Cool, right?");Hello, World! This is a format print so my_variable = 100. Cool, right?
"hinted"_ _(int) = 100; // Okay
"bad_hint"_ _(int) = "100"; // Throws a type errorint main() {
"my_variable"_ = 100;
// Also supports other literals:
123_ = "Hello, World!";
3.14_ = 123_; // 3.14 = "Hello, World!"
print("{123} This is a format print so my_variable = {my_variable}. Cool, right?");
"hinted"_ _(int) = 100; // Okay
"bad_hint"_ _(int) = "100"; // Throws a type error
}my_variable = 100
# Doesn't support variable names beginning with numbers or containing '.'
var123 = "Hello, World!"
var3_14 = var123 # var3_14 = "Hello, World!"
print(f"{var123} This is a format print so my_variable = {my_variable}. Cool, right?")
hinted : int = 100 # Okay
bad_hint : int = "100" # No error but could be caught by a static analyzer