Thread overview
Joka/Parin update - Optional GC support
Jun 20
Kapendev
3 days ago
Doigt
3 days ago
xoxo
3 days ago
Doigt
2 days ago
JN
2 days ago
Kapendev
2 days ago
Kapendev
June 20

Parin is a game engine/framework I'm working on and Joka is a utility library used by Parin. Both don't use the GC by default.

I recently added a new version flag: JokaGcMemory. When defined, it changes the allocation strategy from manual memory management to using the GC. It basically disables the "free" functions and uses new for everything. So if you prefer GC-based code, it's now an option. Nothing changes unless you opt in. The idea for this came while reading some comments on a Discord server:

>

yeah, people use D, but then go 'GC' is evil hurr durr
nogc this nogc that
like why

I personally don't hate GC. Manual stuff is just more fun for me and it makes it easier to run games on a web browser.
GC + Kapendev = ❤️ (This line makes the post more professional)

Anyway, the trickier part of adding this was working around the @nogc attribute. It wasn't too bad, but now @nogc effectively acts like a made up @noallocation attribute for my code, which is kind of nice. It would be easier to just ignore it, but I think it can be useful sometimes, so I do support it when I can.
That's it. Nothing crazy, but it's a cool thing.
Btw, check out my new game: https://kapendev.itch.io/worms-within

game screenshot

3 days ago

On Friday, 20 June 2025 at 19:23:57 UTC, Kapendev wrote:

>

The idea for this came while reading some comments on a Discord server:

>

yeah, people use D, but then go 'GC' is evil hurr durr
nogc this nogc that
like why

I wonder who said that huh

3 days ago
On Saturday, 28 June 2025 at 07:21:36 UTC, Doigt wrote:
> On Friday, 20 June 2025 at 19:23:57 UTC, Kapendev wrote:
>> The idea for this came while reading some comments on a Discord server:
>>
>>> yeah, people use D, but then go 'GC' is evil hurr durr
>>> nogc this nogc that
>>> like why
>
> I wonder who said that huh

Anyone working in the low latency/interactive field, including game developers, will tell you the same things: GCs are bad, you need to prepare ahead of time, and you should reuse your buffers and objects.

Although there are many counter-examples that fully utilize the GC, it's generally minimized because the majority of the work is done in C, C++, or Rust.

The general rule, which applies to both malloc and GC, is to avoid allocating unless absolutely required.


3 days ago
On Saturday, 28 June 2025 at 09:16:22 UTC, xoxo wrote:
> On Saturday, 28 June 2025 at 07:21:36 UTC, Doigt wrote:
>> On Friday, 20 June 2025 at 19:23:57 UTC, Kapendev wrote:
>>> The idea for this came while reading some comments on a Discord server:
>>>
>>>> yeah, people use D, but then go 'GC' is evil hurr durr
>>>> nogc this nogc that
>>>> like why
>>
>> I wonder who said that huh
>
> Anyone working in the low latency/interactive field, including game developers, will tell you the same things: GCs are bad, you need to prepare ahead of time, and you should reuse your buffers and objects.
Yeah no that's not happening. Maybe YOU are going to tell me that, but no, not just anyone. GC == Bad people are just extremists. Tell that to all the people making commercial games in Java and C# and you'll get laughed at and you know what, I live near montreal where lots of video games companies operate and I know people who work for those companies... and they use C#, an aggressively GC'd language. Do you know what they say when I tell them about this silly little bacon dance the nogc folk are doing everyday in D land? I'll let you guess...

2 days ago
On Saturday, 28 June 2025 at 12:32:38 UTC, Doigt wrote:
>>> On Friday, 20 June 2025 at 19:23:57 UTC, Kapendev wrote:
>>>> The idea for this came while reading some comments on a Discord server:
>>>>
>>>>> yeah, people use D, but then go 'GC' is evil hurr durr
>>>>> nogc this nogc that
>>>>> like why
>>>
>>> I wonder who said that huh

Well if you want to target the web you don't have access to D's GC anyway.
2 days ago

On Saturday, 28 June 2025 at 07:21:36 UTC, Doigt wrote:

>

On Friday, 20 June 2025 at 19:23:57 UTC, Kapendev wrote:

>

The idea for this came while reading some comments on a Discord server:

>

yeah, people use D, but then go 'GC' is evil hurr durr
nogc this nogc that
like why

I wonder who said that huh

It was... you.
#exposed #drama #bignews

2 days ago
On Saturday, 28 June 2025 at 09:16:22 UTC, xoxo wrote:
> game developers, will tell you the same things: GCs are bad, you need to prepare ahead of time, and you should reuse your buffers and objects.

Would not say bad. Depends also on how much control you have over the GC. I think the D GC lets you disable and enable stuff at runtime?

> The general rule, which applies to both malloc and GC, is to avoid allocating unless absolutely required.

Yep.