Hacker News new | past | comments | ask | show | jobs | submit login

I wrote a similarly-themed (although much less complete and much less useful) package for Go called 'Proto' which essentially sidesteps the static typechecker by mapping the 'base useful type' to `interface{}`, which is philosophically similar to `void *`.

I personally have no problem with it (other than the syntax needed to unbox/rebox values). I find that having the freedom to use a type system or not a very compelling feature in a language.

That being said, I understand why it might sit very poorly with some.




Though in Go, you can always use reflection to get back the concrete type in an `interface{}` type. In C, `void *` is pretty much all you get. This causes far more subtle bugs, IMO.

Source: someone who hasn't done much C and only a little bit of Go. So take it with a grain of salt.


In Cello, however, all types are supposed to start with a type declaration, so that you can get the type back at runtime.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: