RuntimeCompiledCPlusPlus
jurigged
Our great sponsors
RuntimeCompiledCPlusPlus | jurigged | |
---|---|---|
5 | 15 | |
2,110 | 1,008 | |
- | - | |
5.7 | 4.8 | |
3 months ago | 4 days ago | |
C++ | Python | |
- | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
RuntimeCompiledCPlusPlus
-
hscpp: An experimental library to hot-reload C++
hscpp (Hotswap C++) is an experimental library I created which allows you to hot-reload C++. It was heavily inspired by Runtime Compiled C++, and works by linking DLLs into your project at runtime.
-
Continue with Javascript or switch to C++
The only recent attempt to make something like this practical, as far as I know, was RCCpp. Going by the GH activity, it looks like it kind of went nowhere.
-
I want to make my game a dll that can use functions from my engine exe
FYI I maintain a list of runtime compiled C++ approaches on this wiki: https://github.com/RuntimeCompiledCPlusPlus/RuntimeCompiledCPlusPlus/wiki/Alternatives
-
Reloadr – Hot code reloading tool for Python
There is https://github.com/RuntimeCompiledCPlusPlus/RuntimeCompiledC...
The idea is to use virtual functions, and recompile new classes into a shared library. The shared lib is linked into the running program, and old instances of the classes are deleted and replaced by new instances constructed from the share library.
I am working on a library using the same (stolen) idea here:
https://github.com/jheruty/hscpp
Proof of concept demo:
https://m.youtube.com/watch?v=pjGngeKgni8
hscpp is still very alpha, and I’m sure I’ll find lots of bugs as I work on a “real” demo. In contrast, Runtime Compiled C++ is quite mature and is used in real game projects.
Note that this approach very much limits your architecture. For example, you won’t be able to use statics, as the newly compiled shared libraries won’t see them.
It’s a finicky thing, worth it to me, but not something you can just plop in to an established project.
-
Quine or self reproducing program written using C language
Well of course it's possible to generate executable code at runtime in C++ since clang itself is written in C++, but it's definitely a much larger undertaking, but there's two such efforts I know of, Cling and RuntimeCompiledCPlusPlus.
jurigged
-
[D] Yann LeCun's Hot Take about programming languages for ML
If that interests you, I made a package called jurigged that basically does autoreload but asynchronously on Python in general (i.e. you can write jurigged script.py instead of python script.py; it works in a separate thread and can also work in notebooks). It's more surgical than what the notebook does in that it only hot swaps code in changed functions and does not re-execute anything else. This feature is cool too, IMO.
-
Debugging Lisp: in CL we can resume a program from any point in the stack
Some of the basic hot-loading features can probably be approximated in Python. Here's some from my bookmarks(i've not tried them personally)
- https://github.com/breuleux/jurigged
- https://github.com/reloadware/reloadium
I would imagine lisp can do this on a whole different level. Emacs seems like a testament to that. Basically the entire editor feels like eval()
- So you're using a weird language
-
Reloadium – Hot Reloading for Python (a.k.a. Edit and Continue)
I've been using jurigged [0] for hot code reloading which is great. It works by replacing code objects in place at the function level which naturally handles many cases like applying to existing objects, avoiding loading a module multiple times, etc. As others noted the actual source of this one is not there so it's hard to know what it's doing. The published package contains a binary shared library so I suppose it's written as a CPython extension.
[0] https://github.com/breuleux/jurigged
- jurigged - Hot reloading for Python
What are some alternatives?
ipdb - Integration of IPython pdb
reloading - Change Python code while it's running without losing state
Revise.jl - Automatically update function definitions in a running Julia session
reloadium - Hot Reloading and Profiling for Python
reloadr - Hot code reloading tool for Python
PyDev.Debugger - Sources for the debugger used in PyDev, PyCharm and VSCode Python
cr - cr.h: A Simple C Hot Reload Header-only Library
watchfiles - Simple, modern and fast file watching and code reload in python.
hotpatch - In-place hotpatching for Python functions
ipython - Official repository for IPython itself. Other repos in the IPython organization contain things like the website, documentation builds, etc.
OpenCL_Wrapper_By_PunalManalan - Lightweight, Easy to use OpenCL Wrapper By Punal Manalan. 'OCLW_P::OpenCLWrapper' This Single line of code does Everything In a Compact And Easy to Manage Manner!. Use this code wherever and whenever you want to!
PythonHotswap - Hotswap Python functions. And persistence of runtime.