digitalmars.D.learn - Writing your own runtime, runtime hooks, etc.
- solidstate1991 (11/11) Dec 11 I'm thinking about writing, or well, rather modifying the
- GrimMaple (7/18) Dec 11 All you need to do is have an `object.d` file in your build,
- H. S. Teoh (10/28) Dec 12 [...]
- solidstate1991 (10/16) Dec 12 I know and I might abandon the project halfway through it in
- Kagamin (2/7) Dec 12 I use stock object.d, only replaced switch.d with old hook.
- Kagamin (3/6) Dec 12 Just link programs with your runtime instead of druntime.
I'm thinking about writing, or well, rather modifying the existing default runtime of D, mainly by stripping out the GC and moving memory management to a primarily manual one. Option for refcounting etc. will be added (especially as it exists in Phobos, I just need to modify it), reworking D arrays for manual management will be a wild ride though. I will try to catalogue the runtime hooks too during my process, however I don't really see any info about how to use a custom made runtime. Is it enough to just use betterC, then include the newly created runtime as a dependency? Do I need to mess with compiler configurations?
Dec 11
On Wednesday, 11 December 2024 at 18:16:24 UTC, solidstate1991 wrote:I'm thinking about writing, or well, rather modifying the existing default runtime of D, mainly by stripping out the GC and moving memory management to a primarily manual one. Option for refcounting etc. will be added (especially as it exists in Phobos, I just need to modify it), reworking D arrays for manual management will be a wild ride though. I will try to catalogue the runtime hooks too during my process, however I don't really see any info about how to use a custom made runtime. Is it enough to just use betterC, then include the newly created runtime as a dependency? Do I need to mess with compiler configurations?All you need to do is have an `object.d` file in your build, that's where the runtime is, effectively. If you have a non-standard `object.d` supplied, the druntime is ignored and your custom runtime is used. `betterC` disables any runtime in general, so that's not what you want.
Dec 11
On Thu, Dec 12, 2024 at 06:52:27AM +0000, GrimMaple via Digitalmars-d-learn wrote:On Wednesday, 11 December 2024 at 18:16:24 UTC, solidstate1991 wrote:[...] It's not quite so simple in practice, though. You also need to know exactly which symbols need to be defined in order for the custom runtime to actually work. Some of these symbols are non-obvious, but missing them will cause the compile to fail with rather unhelpful error messages. T -- People who are more than casually interested in computers should have at least some idea of what the underlying hardware is like. Otherwise the programs they write will be pretty weird. -- D. KnuthI'm thinking about writing, or well, rather modifying the existing default runtime of D, mainly by stripping out the GC and moving memory management to a primarily manual one. Option for refcounting etc. will be added (especially as it exists in Phobos, I just need to modify it), reworking D arrays for manual management will be a wild ride though. I will try to catalogue the runtime hooks too during my process, however I don't really see any info about how to use a custom made runtime. Is it enough to just use betterC, then include the newly created runtime as a dependency? Do I need to mess with compiler configurations?All you need to do is have an `object.d` file in your build, that's where the runtime is, effectively. If you have a non-standard `object.d` supplied, the druntime is ignored and your custom runtime is used.
Dec 12
On Thursday, 12 December 2024 at 15:56:55 UTC, H. S. Teoh wrote:It's not quite so simple in practice, though. You also need to know exactly which symbols need to be defined in order for the custom runtime to actually work. Some of these symbols are non-obvious, but missing them will cause the compile to fail with rather unhelpful error messages. TI know and I might abandon the project halfway through it in favor of already existing solutions, but at least I can see if I can make it work for my usecase, and already found at least one deprecated symbol for the wiki, and some newly introduced ones. At the moment I want to do something out of my comfort zone for a bit, and while there might be some more immediately useful ideas on that front (like finishing my improved SDLang library), I don't really know, just recovered from a relatively long illness and haven't coded for a while.
Dec 12
On Thursday, 12 December 2024 at 15:56:55 UTC, H. S. Teoh wrote:It's not quite so simple in practice, though. You also need to know exactly which symbols need to be defined in order for the custom runtime to actually work. Some of these symbols are non-obvious, but missing them will cause the compile to fail with rather unhelpful error messages.I use stock object.d, only replaced switch.d with old hook.
Dec 12
On Wednesday, 11 December 2024 at 18:16:24 UTC, solidstate1991 wrote:I will try to catalogue the runtime hooks too during my process, however I don't really see any info about how to use a custom made runtime.Just link programs with your runtime instead of druntime.
Dec 12