Live data from Hacker News

C and C++ Hot-Reload/Live Coding

liveplusplus.tech

11–20 of 102 posts

Re: C and C++ Hot-Reload/Live Coding

#11

fyi, "hot reload" is a native part of every operating system (consider, even trivially, forking or https://en.wikipedia.org/wiki/Dynamic_loading ). It's a sign of how bad developer tooling has been that live reload is sold as an add-on feature. DX seems always to see-saw between bill gate's c. 1990 demo of VB, and the compile-time speeds of a N' Wirth. At a guess, when the internet happened, all DX had to be thrown a…

> fyi, "hot reload" is a native part of every operating system (consider, even trivially, forking & reforking).

Can you expand on this?

Re: C and C++ Hot-Reload/Live Coding

#12
post #10

The World of Warcraft Server emulator TrinityCore has a hot reload system for its Scripting (Boss AI, Spells etc.). AFAIK when it's enabled, those modules are compiled into their own shared library and when you make a change to one of the script .cpp files, it triggers a compilation and then unloads and reloads the shared library (I think the process is more complicated than that so it doesn't crash for scripts that…

This is how RunUO/ServeUO was designed as well. I'm pretty sure it's a common design practice that came from muds. The server is only responsible for network and communications - everything is then orchestrated through plugins/scripts/systems that can be compiled and reloaded while the server is running. The more modern way is now to separate your "server" from your "modules" in distributed-systems architecture (just deploy the new module to the farm) but the idea still permeates.

Still, RunUO was C# and like java, recompiling and loading is trivial. Doing it in C/C++ land is heroic.

Re: C and C++ Hot-Reload/Live Coding

#13

fyi, "hot reload" is a native part of every operating system (consider, even trivially, forking or https://en.wikipedia.org/wiki/Dynamic_loading ). It's a sign of how bad developer tooling has been that live reload is sold as an add-on feature. DX seems always to see-saw between bill gate's c. 1990 demo of VB, and the compile-time speeds of a N' Wirth. At a guess, when the internet happened, all DX had to be thrown a…

> fyi, "hot reload" is a native part of every operating system (consider, even trivially, forking & reforking). Can you expand on this?

https://en.wikipedia.org/wiki/Dynamic_loading

Re: C and C++ Hot-Reload/Live Coding

#14
I really liked the product video, can someone advise how to make something similar for our project?

EDIT: Oh, I guess After Effects with some stock background video and audio track mostly.

Burning logo effect: https://www.youtube.com/watch?v=wkP-IYmPzpI

Glitch effect: https://www.youtube.com/watch?v=7eOMSuPdbok

Simulated monitor recording (this doesn't show the monitor border though..) https://www.youtube.com/watch?v=JOYdGtyxMkI

Animated font effects - surely these are possible if the rest is.

At 1:04, I think they made a custom graphic to that overlays the stock video below.

Re: C and C++ Hot-Reload/Live Coding

#16

I really liked the product video, can someone advise how to make something similar for our project? EDIT: Oh, I guess After Effects with some stock background video and audio track mostly. Burning logo effect: https://www.youtube.com/watch?v=wkP-IYmPzpI Glitch effect: https://www.youtube.com/watch?v=7eOMSuPdbok Simulated monitor recording (this doesn't show the monitor border though..) https://www.youtube.com/watch?v…

Probably Adobe After Effects

Re: C and C++ Hot-Reload/Live Coding

#17
post #10

The World of Warcraft Server emulator TrinityCore has a hot reload system for its Scripting (Boss AI, Spells etc.). AFAIK when it's enabled, those modules are compiled into their own shared library and when you make a change to one of the script .cpp files, it triggers a compilation and then unloads and reloads the shared library (I think the process is more complicated than that so it doesn't crash for scripts that…

This is how RunUO/ServeUO was designed as well. I'm pretty sure it's a common design practice that came from muds. The server is only responsible for network and communications - everything is then orchestrated through plugins/scripts/systems that can be compiled and reloaded while the server is running. The more modern way is now to separate your "server" from your "modules" in distributed-systems architecture (just…

> Doing it in C/C++ land is heroic.

Not to diminish the accomplishment or anything but is it that much easier in C# and Java?

It was always really easy to use the libloaderapi in Windows. Throw a vtable on it and baby, you got a stew going!

Re: C and C++ Hot-Reload/Live Coding

#18
In one of the earlier episodes of the Handmade Hero series, Casey Muratori writes a hot-reloading functionality for C from scratch in about an hour (while giving detailed explanations of what he's doing). The following two episodes then improve upon the initial results.

https://www.youtube.com/watch?v=WMSBRk5WG58

Re: C and C++ Hot-Reload/Live Coding

#19

fyi, "hot reload" is a native part of every operating system (consider, even trivially, forking or https://en.wikipedia.org/wiki/Dynamic_loading ). It's a sign of how bad developer tooling has been that live reload is sold as an add-on feature. DX seems always to see-saw between bill gate's c. 1990 demo of VB, and the compile-time speeds of a N' Wirth. At a guess, when the internet happened, all DX had to be thrown a…

>I support being paid for your work, but live reload is a fairly trivial thing to write for yourself -- I spent one day this gone weekend writing a debugger in C which does it.

Major Dropbox “who would pay for this over just using rsync?” vibes here. Never change, HN.

Re: C and C++ Hot-Reload/Live Coding

#20
Maybe I'm just old and grumpy, but the subscription business model just puts me off. Nowadays when I read about some development tool (or just any product), I start with the price page. If there are only subscriptions available I stop reading and go on with my life.
Post reply on HN