Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Arguably `printk(c byte)` should be `printck(c byte)`, and there should be a separate `printk(s []byte)` that handles an array of bytes.

If `printk` isn't implemented, then fall back to repeated calls of `printck`.



printk is the low level primitive for stdout printing and it's done this way as low level drivers generally only accept single characters.

There are upper level functions which simply takes a []byte and make fmt.Printf() work seamlessly and effectively when not printing on an UART that only takes a single character as output.

In TamaGo stdout is primarily used for debugging.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: