Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Base code that can run indefinitely but accept new code?
2 points by ge96 on May 8, 2020 | hide | past | favorite | 7 comments
I have this thought about having a tiny, low power processor as a "base" for state and it's powered by a battery source that will make it last a while and also when you charge it, no interruption, TL;DR it won't die.

But then, it can add on more code without stopping the base code. Is that possible/what would you use(language) it sounds low level.

Conceptually it sounds impossible, how can you interface with an unknown endpoint(counts).



I am not sure what do you mean by "stop" but I've done similar things using C some 20 years ago, here's the general idea:

You should have spare memory space to accept updates, there are solutions for in-place updates but that will make things more complex so let's skip that.

Once the new piece of code is in place you replace or insert an assembly jump instruction to your new code and you're good to go.

This can replace the whole code, but if done smartly can replace parts of it. Think for example of using a dynamic jump table into functions.


Erlang has done live updates to code for 30 years. Definitely possible.


thanks will check that out, I hear Erlang/Golang but not sure if related


Not related at all.


Common Lisp supports live compilation and loading into a running image if this processor has support for it.


you could look at a dll plugin.

javascript has a eval function.


weird dll sounds like the Microsoft type but it's Javascript/webpack? or maybe webpack isn't just JS...




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: