Writing your own runtime, runtime hooks, etc.
H. S. Teoh
hsteoh at qfbox.info
Thu Dec 12 15:56:55 UTC 2024
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:
> > 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.
[...]
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. Knuth
More information about the Digitalmars-d-learn
mailing list