9 ms·
Unfortunately, Go with its mandatory GC is about as appropriate for systems programming as Java, regardless of how its marketed...
by drucken 15y ago
Unfortunately, Go with its mandatory GC is about as appropriate for systems programming as Java, regardless of how its marketed...
- burgerbrain 15y agoFor the more traditional definitions of "systems programming", yes. I would agree with that. However I don't think anybody is really marketing Go for that niche.
- wglb 15y agoOriginally they were targeting "systems programming", and, being roughly the contemporary of the most well-known go authors, "systems programming" used to mean compilers, assemblers, and the like. In this meaning, this would also include browsers, although Mozilla is going for Rust. Today, "systems programming" is more taken to mean "kernel programming", and I don't get the sense that is what was meant by the senior authors of go.
- rhizome 15y agoOriginally they were targeting "systems programming" Choose the greatest impediment and cite it as a primary goal.
- wglb 15y agoI am not quite sure if I follow you. Are you saying that "systems programming" is the greatest impediment?
- burgerbrain 15y agoTargeting systems programming is. The existing languages used there are rather firmly entrenched.
- acqq 15y agoI always believed "system programming" meant "programming operating system components or the whole operating system" and Wikipedia seems to agree: http://en.wikipedia.org/wiki/System_programming http://en.wikipedia.org/wiki/System_programming Last time I looked, inside of the Go libraries which had to do some tricky things there was some C code, meaning that even Go authors weren't able to write everything in Go. So Go can't be a substitute for C, and as long as most of the system programming is done in C, no go for Go.
- 4ad 15y agoThat's like saying C is not a system programming language because if you write a kernel you need to write parts of it in assembly, and you need to write parts of libc in assembly as well! Parts of the runtime are written in C and assembly, but that's because there is power in breaking abstractions: http://research.swtch.com/goabstract http://research.swtch.com/goabstract As it stands today, Go can be used to write operating systems. Yes, you will have assembly, yes you will likely also have C, so what?
- wglb 15y agoThat is what "system programming" means these days. It used to exclude operating system kernels, real-time components. I suspect that it isn't so much that they aren't able to write everything in Go, but more that it isn't a priority for now. It wouldn't surprise me if Go wasn't eventually self-hosting.
- delinka 15y agoI'd rather reply to wglb, but he's gone too deep... Anyway, "systems" in this case includes daemons and server processes. I'll update with a reference if I can find it in the Go context.
- burgerbrain 15y ago>"Anyway, "systems" in this case includes daemons and server processes." For that sense of "systems", Go excels and Java enjoys a great deal of popularity.
- reddit_clone 15y agoMe thinks Go's niche is to be an accessible, imperative Erlang. It is already well equipped to write distributed network servers, web servers, message queue servers and such.
- Symmetry 15y agoI don't know. Linus claims he can imagine writing an OS in Go (after they've spent a decade working the bugs out). Which is probably the most positive thing I've heard of him saying about writing kernels in other languages, and I'm inclined to trust his judgement over my own here. EDIT: My memory was almost correct, he said that (in sharp contrast to C++) he can imagine letting Go into the kernel but not for a long time. http://www.realworldtech.com/beta/forums/index.cfm?action=detail&id=110624&threadid=110549&roomid=2 http://www.realworldtech.com/beta/forums/index.cfm?action=de... EDIT2: s/Linux/Linus/
- odiroot 15y agoI believe you meant Linus.
- Tobu 15y agoYou're really misrepresenting that thread. Here[1] Linus says C is pretty readable in patch format, because it doesn't do overloading (unlike C++, which was the thread's conversation topic) and thus doesn't much depend on some outside context. Also, C gives the required level of control for kernel programming, in terms of memory model and concurrency (and those conditions implicitly exclude Go), but higher-level languages have something to offer for other problem domains; and in that context GC or concurrency primitives become interesting again. In answer to that last paragraph, someone asked about Go, which is where you got Linus's overall noncommittal answer. [1] http://www.realworldtech.com/beta/forums/index.cfm?action=detail&id=110618&threadid=110549&roomid=2 http://www.realworldtech.com/beta/forums/index.cfm?action=de...
- 4ad 15y agoGo allows the same of control over the memory layout as C, this differentiates it from most other garbage collected languages. Go is a perfectly fine language for kernel mode development, I am aware of at least three efforts of writing an operating system in Go (one such effort being mine). I do agree though that Go is not the right language to use in conjunction with the rest of the Linux kernel. While Go used for a kernel is perfectly fine, it forces you towards some design decisions and constraints that do not exist in the Linux kernel as it stands today.
- tzs 15y agoWhat do you find incompatible between GC and systems programming?
- tedunangst 15y agoI think people generally assume systems programming requires low latency and that using a GC implies high latency. That's mostly, but not strictly, true. If you're writing a web server, as opposed to a missile guidance system, the occasional GC pause is probably not a dealbreaker.
- tzs 15y agoHere's an article from IBM on their work on real-time Java, where they develop a GC that can provide a bound on latency, and on the amount of time spent doing GC: http://www.ibm.com/developerworks/java/library/j-rtj4/ http://www.ibm.com/developerworks/java/library/j-rtj4/ Based on that, I don't think I'd rule out the feasibility of doing a missile guidance system in a GC language.
- 4ad 15y agoI can, and in fact I do write an OS in Go, it's suitable enough for writing a kernel for me.