r/ProgrammingLanguages • u/Solid_Statement6313 • 20d ago
Requesting criticism [PussyLang] A minimal scripting language with bytecode VM and AOT C backend! NSFW
Hi everyone,
I've been working on a language called PussyLang (yes, funny). It started small but grew into something I'd like to share and get feedback on.
What it is
Dynamically typed, imperative, C‑like syntax. Compiles to bytecode that runs on a custom Java VM. Also supports ahead‑of‑time compilation to native executables by transpiling the bytecode to C and compiling with gcc.
func factorial(n) {
if (n <= 1) return 1;
return n * factorial(n - 1);
}
print factorial(5);
var arr = [10, "hello", true];
arr[1] = "world";
print arr[0];
Expandability and Customization
One thing I'm proud of is how easy it is to extend or modify PussyLang. I built it with the idea that users (or myself) might want to add new native functions, change the syntax, or even replace parts of the compilation pipeline.
- Adding native functions: In the Java VM, you just implement a class that implements
NativeFunctionand register it inNativeRegistry.registerAll(). In the C AOT backend, you add a function with aValuesignature and an entry innative_table. - Changing the bytecode or VM: The compiler, VM, and bytecode format are decoupled. You can add new
OpCodevalues and implement them in both Java and C without breaking existing code. - Lexer/parser: The lexer and parser are short. Adding a new keyword or operator is straightforward.
The whole thing is MIT licensed fork it, change it, use it in your own projects.
I made it this way because I wanted a language that could evolve with who uses it. If someone wants to add a for loop or a new built‑in networking protocol, they can do it.
What I'd Like Feedback On
- The type system — only
number,bool,string,array,bytes,function,null. Is that enough for most scripting tasks? - The C AOT backend — it's a lot of extra code. Worth maintaining? Or just stick with the Java VM?
- Any obvious missing features that would make the language more practical without bloating it?
27
u/Ifeee001 19d ago
Well, definitely won't have issues with gaining publicity