Right now we can only print numbers between 0 and 999 correctly, and even then it's with leading spaces.
Ideally we could do negatives and more digits, without the leading spaces. Ideally we'd just call printf but Cranelift doesn't support varargs yet. So a bespoke version is going to need to reserve storage to store digits, LSB to MSB. It'll need to either reverse the bytes in storage and then call puts or it could putchar the digits in the right order.
Right now we can only print numbers between 0 and 999 correctly, and even then it's with leading spaces.
Ideally we could do negatives and more digits, without the leading spaces. Ideally we'd just call
printfbut Cranelift doesn't supportvarargsyet. So a bespoke version is going to need to reserve storage to store digits, LSB to MSB. It'll need to either reverse the bytes in storage and then callputsor it couldputcharthe digits in the right order.