| ▲ | dnautics 3 hours ago | ||||||||||||||||
do you suspect it will be possible to implement printf?? while we're talking about printf, can i incept in you the idea of making an io.printf function that does print-then-flush? | |||||||||||||||||
| ▲ | Cloudef 37 minutes ago | parent [-] | ||||||||||||||||
It's completely possible to implement printf. here is my impl (not 100% correct yet) of snprintf for my custom libc implemented on top of a platform I'm working on <https://zigbin.io/ab1e79> The va_arg stuff are extern because zig's va arg stuff is pretty broken at the moment. Here's a C++ game ported to web using said libc running on top of the custom platform and web frontend that implements the platform ABI <https://cloudef.pw/sorvi/#supertux.sorvi> (you might need javascript.options.wasm_js_promise_integration enabled if using firefox based browser) | |||||||||||||||||
| |||||||||||||||||