C? Go? Cgo
blog.golang.org
blog.golang.org
Nothing really very big (yet), but mostly 'scratching my itch' stuff. I do thoroughly enjoy writing Go code, which is why I stick with it. A large project where I can use it will present itself sooner or later.
At this point I don't miss generics at all. The benefit they would give me are marginal enough to not consider it a vital component.
I've found that when you become proficient in Go, you will write different code that does not really require generics to be present. At least 99% of the time.
Having said that, I am still hoping that we might one day get unions. Unfortunately there is little hope of that at this point. It has been considered, but they would have to be type-safe in order not to circumvent Go's type system. And doing so, would differentiate them very little from Go's existing 'interface{}' type. There is a small benefit to unions, but apparently not big enough to warrant implementing them.
As far as generics go, they are not out of the question. The problem so far has been that nobody has yet offered a generics proposal that doesn't partially or completely mess up the language and generally make things more difficult for everyone.
Written ~10k lines in total maybe more. I like the language. However, it has its limitations.
[1] https://github.com/timtadh/Go-Filestructures
[2] https://github.com/timtadh/tdpp
- A port from C of a fast prime number generator: https://github.com/jbarham/primegen.go
- A Cdb ("constant database") implementation: https://github.com/jbarham/cdb.go
- A Cgo PostgreSQL wrapper: https://github.com/jbarham/pgsql.go
- The beginnings of an AWS library: http://code.google.com/p/goaws/
Regarding the OP, Cgo is like magic since e.g. my PostgreSQL libpq wrapper provides a pretty rich PostgreSQL driver for Go in well under 400 LOC. Best of all, I can write most of it in pure Go itself! The grungy low-level C interface code is mostly auto-generated.
http://news.ycombinator.com/item?id=2335228 is another comment I made about programming in Go.
Can you elaborate what is so "dreadful" about it and which language does it better?
I'll give props to C# as one of the languages that does it very well, but most others don't (Java's jni is worse, Python before ctypes was worse, lua is worse - I could go on).
D has pretty nice integration - you can convert (reasonably non-hacky) C headers to D headers and use C functions and types almost as if they were D native.
Explicit type casts, even for most basic types like ulong and void* stuck me as very inelegant.
For known prototypes, it should be possible to do it much cleaner. There are various Objective-C bridges (e.g. PyObjC) which are able to seamlessly convert known C types and ObjC classes to equivalents in high(er)-level languages.