3 ms·
I wrote a similarly-themed (although much less complete and much less useful) package for Go called 'Proto' which essentially sidesteps the static typechecker b
by eblume 13y ago
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.
- bjeanes 13y agoThough 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.
- tomp 13y agoIn Cello, however, all types are supposed to start with a type declaration, so that you can get the type back at runtime.