My mind can't grasp the concept behind doing hot reloading without doing a compile!!!
At first I thought it was a joke, but I guess it's not.
Could you please explain further the concept at least briefly.
Good question. I'll add info about it to the docs.
Let's say you have
#!hot
fn main() {
for {
foo()
time.sleep(1)
}
}
fn foo() {
println(1)
}
It will print number 1 every second.
However since we used the hot directive (name is not final 馃槂), foo() is loaded dynamically, and V will insert a small program that will run in the background and wait for modifications in main.v. Once it's modified, that program will ask V to generate main.so with the modified function and reload foo. So if you change println(1) to println(2) while the program is running, you will get
1
1
2
2
Most helpful comment
Good question. I'll add info about it to the docs.
Let's say you have
It will print number 1 every second.
However since we used the
hotdirective (name is not final 馃槂),foo()is loaded dynamically, and V will insert a small program that will run in the background and wait for modifications inmain.v. Once it's modified, that program will ask V to generatemain.sowith the modified function and reloadfoo. So if you changeprintln(1)toprintln(2)while the program is running, you will get