r/programmingcirclejerk

Consider the C library function fopen. This function has the side effect. This means that fopen is not pure. However, we can make the fopen function appear to be pure, at least to certain observers, by ensconcing it in another function that hides the side effect.

bugzmanov.github.io
u/BenchEmbarrassed7316 — 10 days ago
▲ 17 r/programmingcirclejerk+4 crossposts

Made my own statically typed virtual bytecode machine language (Oli-Nat) in C after reading crafting interpreters!! Please tell me what you all think!

Hello everyone, I was getting bored a few months ago and decided to tackle a new personal project, and after having asked around, thought I should make my own bytecode vm. I read up on crafting interpreters and for the past month or two Ive been making my own language, the syntax is pretty standard but I still tried to spice it up in my own way, with things like 'make' for declaring vars and functions and 'pullf' for the stdlib. The language itself is a two pass compiler which compiles to ASTs first and then typechecks those until eventually compiling to bytecode. Ive been working on the project for about 2 months and finally felt it was at least complete enough to share, I still want to do a bunch of stuff like class inheritance and a library for making simple 2d games, but let me know your thoughts on how it looks so far!

https://github.com/NateTheGrappler/OliNat-Programming-Language

u/CommercialStrike9439 — 9 days ago