hot reloading code gist

xoxo xororwr at gmail.com
Sat May 31 06:29:03 UTC 2025


On Friday, 30 May 2025 at 18:04:14 UTC, monkyyy wrote:
> On Friday, 30 May 2025 at 17:52:19 UTC, Hipreme wrote:
>> On Friday, 16 May 2025 at 08:37:34 UTC, Ogion wrote:
>>> On Friday, 16 May 2025 at 03:18:38 UTC, H. S. Teoh wrote:
>>>>
>>>> dlopen is a POSIX call.  It sux because it's an OS C API, 
>>>> and there's nothing we can do about it.
>>>>
>>>
>>> We do have `core.runtime.Runtime.loadLibrary` that uses 
>>> `dlopen`/`LoadLibrary` depending on platform. But for some 
>>> reason there’s no wrapper for `dlsym`/`GetProcAddress`.
>>
>> We have the libraray "bindbc-loader", which solves this 
>> exactly problem
>
> Hotloading local d code vs dymanic loading some big c lib 
> probably are different problems.

https://github.com/ddovod/jet-live

This is for C++, but the logic is language agnostic, with some 
work, you could make it work for D, (strip the C++ compile part, 
and reuse the parsing and process patching patch). I've seen 
people make it work for Zig, this is much better than shared 
library reload, since the user has no build script to duplicate 
or code to separate.

https://www.jakubkonka.com/2022/03/16/hcs-zig.html
https://www.jakubkonka.com/2022/03/22/hcs-zig-part-two.html

It's ARM in that example, but they plan to make it available for 
all the supported targets, built right in the compiler.

The day they land that feature will be the day I switch.




More information about the Digitalmars-d mailing list