Hot ReloadThe framework.hotreload module wraps dynamic shared-module loading and reload bookkeeping.

Hot Reload

The framework.hotreload module wraps dynamic shared-module loading and reload bookkeeping.

import framework::hotreload

HotModule

MethodReturnDescription
HotModule.load(path: String)Option<HotModule>Load a shared library from disk
HotModule.loadNamed(path: String, name: String)Option<HotModule>Load a shared library with a lookup name
HotModule.find(name: String)Option<HotModule>Find an already loaded module
reload()BoolReload the module from its current path
reloadFrom(path: String)BoolReload from a new shared-library path
unload()VoidClose the loaded shared library
getFunction(name: String)*VoidReturn a raw function pointer
callInt(name: String)IntCall an exported fun name() r: Int entrypoint
callIntPtr(name: String, arg0: *Void)IntCall an exported fun name(arg0: *Void) r: Int entrypoint
getVersion()IntCurrent reload count
isActive()BoolWhether the module remains loaded

Typed Calls

Use callInt and callIntPtr when the host program needs to call a known shared-module signature without manually casting a raw pointer.

let loaded = HotModule.load("./plugin.so")
if loaded.isSome() {
    let module = loaded.unwrap()
    let value = module.callInt("plugin_answer")
    println("answer: {value}")
}

If loading or symbol lookup fails, inspect getHotReloadError().

Architected in Kotlin. Rendered with Materia. Powered by Aether.
© 2026 Yousef.