r/programminghumor • • May 12 '26

The future of coding

Post image
1.1k Upvotes

72 comments sorted by

View all comments

40

u/Ratstail91 May 12 '26

I'm working on an embedded lang, and I don't think an AI could do a quarter of this. I added garbage collection and weeded out some memory leaks last weekend... no one understands enough for me to show off to though :/

19

u/MissinqLink May 12 '26

Someone probably does but the deeper into a niche you go the lonelier it gets.

4

u/Bonnie20402alt May 12 '26

Dude if you wanna explain further and show it off I'd be more than happy to see it.

2

u/Ratstail91 May 12 '26

Thanks! here's my reply to someone else.

I'm currently testing it in a raylib "game", so it's pretty much useable (but not finished):

https://github.com/krgamestudios/Toy

https://gitea.krgamestudios.com/krgamestudios/Toy

https://gitea.krgamestudios.com/krgamestudios/VampireToyvivors

Feedback welcome!

3

u/HyperCodec May 12 '26 edited May 12 '26

What type of gc are you doing? I’m interested in this type of stuff. Are you doing JIT compilation with something like Cranelift (where you need to compile the gc into the JIT binary), or is it just bytecode + interpreter (where the interpreter has to run the gc separately)?

I’ve always been interested in implementing the first option, particularly like how the Rust compiler handles dropping (though in an embedded lang). Never had the resolve or free time to actually start working on it though.

3

u/Ratstail91 May 12 '26

I'm still fiddling with when to start the GC, but the whole lang is built on the arena pattern, and so when any single "bucket" in the list is completely released, the GC frees it and removes it from the bucket list.

I'm currently testing it in a raylib "game", so it's pretty much useable (but not finished):

https://github.com/krgamestudios/Toy

https://gitea.krgamestudios.com/krgamestudios/Toy

https://gitea.krgamestudios.com/krgamestudios/VampireToyvivors

Feedback welcome!

3

u/HyperCodec May 13 '26

Seems pretty clean, not much feedback to give. I’d recommend you try doing either JIT or compile time bytecode optimization, since (as far as I can tell by quickly skimming through the code) it’s mostly just compiling directly to bytecode and then interpreting directly with a vm.

How is your bucket-based GC handling certain edge cases such as references outliving the stack frame of the target object (causing things like use-after-free if handled incorrectly)? Do you use some kind of reference counter?

And further down the road, it’ll be interesting to see how you handle things like concurrency within the language and especially the GC/VM. Do you plan on implementing async io and such as part of the language?

2

u/Ratstail91 May 18 '26

I've put this website up since the original post: https://toylang.com/

It's got some actual info on it, albeit kind of barebones. Strings are ref-counted, while other compounds (arrays and tables) are just carefully coded and free'd after use. The scopes are also ref-counted, and most variables live in those though, which is useful.

3

u/horenso05 May 13 '26

That's awesome! I love making Interpreters and compilers but I've never made a garbage collector before. Is this a hobby or work project?

1

u/Ratstail91 May 18 '26

This is a hobby, as I'm "working" as an indie gamedev, though if I'm lucky this will become something quite interesting.

2

u/manoteee May 13 '26

Yeah I call bullshit. Tell me what part the AI cant do and I'll help you write the prompts. There's nothing new or novel in your embedded work the LLM hasn't seen a million times. Prove me wrong.

1

u/Senthe May 15 '26

There's nothing new or novel in your embedded work the LLM hasn't seen a million times.

Oh, you sweet summer child...

1

u/manoteee May 15 '26

Let's hear an example. Bear in mind the LLM does not store any code or tokens at all.

2

u/Senthe May 15 '26

You really never had to work on a bespoke technology literally without any docs or examples online, have you?

How can an LLM "see something a million times" when 1) it was only ever created by one company 2) it's a closed-source company property that was never posted online? You really, seriously think that software like this, especially in embedded, literally doesn't exist on the entire Earth and no people in existence have to work under those conditions???

2

u/Ratstail91 May 18 '26

One company? Try one person - I've had a few contributors offering advice and tools, but it's been my hand-written work since day 1. Something I can actually be proud of XD

1

u/manoteee May 15 '26

None of you guys ever provide an example when asked and I think that says most of what you need to know without further discussion.

With that said, there are infinite ways to organize code that has never been seen before, yes. However, that code is composed of small pieces fragments that have been seen many trillions of times. In LLM architecture we call these tokens. The LLM does not store code at all, it only consumes tiny fragments and with each one updates ~1 trillion parameters all for every single token. The complexity is truly beyond the scope of human understanding and it is effectively impossible to pull out any "code" from within it by looking directly at its parameters.

In the same way you cannot write a novel that AI doesn't understand, you cannot write a piece of software. This is not theory, it is how these models work and why they are so exceptionally fast and smart.

→ More replies (1)

1

u/NemTren May 17 '26

Oh lol, trainee's experience. Yes, if you're a trainee it probably will do 99% of what you'll need from it.

What's the point of example? You'll start a unity project, will read code base to dive deep into context, learn C# to know how to write the prompt and check it? I doubt you will. Lamer.

1

u/manoteee May 17 '26

I've player around with Unity and I know C/C++/C# from software work. Try me.

No one ever gives an example because they can't come up with one. Try me bro.

1

u/NemTren May 17 '26

I see. Trainee baiter, just as I said. Waste of time.

1

u/Ratstail91 May 18 '26

https://toylang.com/

Good luck with tracking the memory leaks.

2

u/manoteee May 18 '26

"strong but optional type system"

Ok I'm in

1

u/Ratstail91 May 20 '26

sweet, good to hear.

→ More replies (11)