(bind-func chunked_printf
(let ((chunk_size 1000))
(lambda (str:i8*)
(if (< chunk_size (strlen str))
(let ((tmpchar (pref str chunk_size)))
(pset! str chunk_size 0)
(printf "%s" str)
(pset! str chunk_size tmpchar)
(chunked_printf (pref-ptr str chunk_size)))
(printf "%s\n" str)))))