A performance-oriented Lisp-like language where I can have my cake, and eat it (too)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

31 lines
990 B

(import "HotReloading.cake")
(c-import "stdio.h")
(defun main (&return int)
(fprintf stderr "Hello Hot-reloading!\n")
(def-function-signature reload-entry-point-signature (&return bool))
(var hot-reload-entry-point-func reload-entry-point-signature null)
(register-function-pointer (type-cast (addr hot-reload-entry-point-func) (* (* void)))
;; TODO Support name conversion at runtime? (conversion requires tokens)
"reloadableEntryPoint")
(unless (do-hot-reload)
(fprintf stderr "error: failed to hot-reload\n")
(hot-reload-clean-up)
(return 1))
(while (hot-reload-entry-point-func)
(unless (do-hot-reload)
(fprintf stderr "error: failed to hot-reload\n")
(hot-reload-clean-up)
(return 1)))
(hot-reload-clean-up)
(return 0))
(comptime-cond
('Unix
(set-cakelisp-option executable-output "hot_loader"))
('Windows
(set-cakelisp-option executable-output "hot_loader.exe")))