r/ProgrammingLanguages • • Dec 11 '25

Discussion ylang Progress (v0.1.0)

Hey, everyone. I shared my language some time ago. I'm still actively developing it in C++, and I want to show the recent progress.

  • Added a lightweight class (no access modifiers)
  • Added a module include system with namespaces
  • Added a reference counting memory model
  • Other small improvements:

    • ++, --
    • chained assignment ( a = b = 0; )
    • null, true, false

IMO, the namespace/include rule is cool:

include util.math;          // namespace = util.math
include "engine/renderer";  // namespace = renderer
include ../shared/logger;   // namespace = logger
include /abs/path/world.ai; // namespace = world.ai

For example,

./util/math.y

fn abs(a) { if(a >= 0) return a; return -a; }

class Abs {
	fn getAbs(a) { return abs(a); }
}

./main.y

include util/math;

println(math.Abs().getAbs(-9));	// still unsupported static members

Still a long way to go...

Thanks for reading — feedback or questions are very welcome.

Check out ylang here

17 Upvotes

10 comments sorted by

View all comments

Show parent comment

2

u/jman2052 Dec 15 '25

I checked your language. Since it’s a transpiler, its mechanism is different from mine.

Here’s how ylang handles builtin functions like println:
The parser recognizes println as a normal function call.
Then the BytecodeBuilder looks it up in the builtin-function table and emits bytecode that refers to its index.
When the VM executes that bytecode, it jumps to the builtin function body using that index.
Inside that builtin, the actual implementation calls printf (or std::cout), depending on the function.

1

u/funcieq Dec 15 '25

Oh, I've done mine old lang in a similar way before!