Re:Adding Modules to C in 10 Lines of Code [pdf]
by cyber_kinetist on Monday June 27, 2022 @06:38AM
(#31892691)
If I want to use D as a scripting language, I would like to have access to at least the core parts of the standard library (strings, lists, hashmaps, etc.), which I can’t without GC. I really don’t have time and energy to implement my own data structures when trying to prototyping gameplay code.
[ Parent
| on HN ]
Re:Adding Modules to C in 10 Lines of Code [pdf]
by bachmeier on Monday June 27, 2022 @09:32AM
(#31894367)
> If I want to use D as a scripting language, I would like to have access to at least the core parts of the standard library (strings, lists, hashmaps, etc.), which I can’t without GC.
How is it a "scripting language" if you don't want a GC? I use D for the vast majority of my scripting these days, but it would be odd for me to avoid the GC. I would not even think about using it if I had to deal with that.
Re:Adding Modules to C in 10 Lines of Code [pdf]
by cyber_kinetist on Monday June 27, 2022 @08:12PM
(#31902573)
I wasn’t talking about GC in general, but the GC in Dlang. With the GC turned off in D you can’t use most of the standard library.
You can certainly use the std without relying on GC in languages like Rust, Swift, etc, but the important thing is that you can’t in D. I’m sure it can be technically done, but nobody has actually put the effort to do it.
Re:Adding Modules to C in 10 Lines of Code [pdf]
by Shadonototra on Monday June 27, 2022 @08:44PM
(#31902793)
The plan is to finish https://dlang.org/phobos/std_experimental_allocator.html
Once finished, everything in the std will be able to make use of it
If you can't wait, you can use this package already with the allocators: https://github.com/dlang-community/containers
Re:Adding Modules to C in 10 Lines of Code [pdf]
by cyber_kinetist on Tuesday June 28, 2022 @12:14AM
(#31904009)
Ok, I’ll try it out after the feature stabilizes.
Re:Adding Modules to C in 10 Lines of Code [pdf]
by mhh__ on Monday June 27, 2022 @03:06PM
(#31899243)
How much ram does your script use?
Note that many game engines do use garbage collection for this purpose
Re:Adding Modules to C in 10 Lines of Code [pdf]
by WalterBright on Monday June 27, 2022 @02:19PM
(#31898500)
All the scripting languages I know of rely totally on the GC.