6 ms·
I'm confused how Go can be paraded as a low level systems language, which improves performance via concurrency, and yet the graph says it's compiler is still ov
by hacker_9 11y ago
I'm confused how Go can be paraded as a low level systems language, which improves performance via concurrency, and yet the graph says it's compiler is still over twice as slow as when it was written in C?
- duncanawoods 11y agoIts an irritating dual meaning of "system's language". For Rust, D, C++ and the rest of the world, "systems" implies drivers, OS and embedded systems where low level memory management is key. For the go developers, a system is a web-service so its actually competing with GC languages like node.js and Ruby rather than C.
- danieldk 11y agoBut the D standard library also relies largely on a garbage collector, so it's questionable that it differs much from Go in that respect. As most things, it's a spectrum and not binary. Userland is also part of an operating system and could be written in Go without much trouble. One could also argue that things like Docker are also systems programming. Go is less 'systems programming' than C, C++, or Rust, because it has a garbage collector. Go is more 'systems programming' than Java, C#, node.js or Ruby, because it compiles to native binaries, provides value types (C# does too), integrates more tightly in standard UNIX APIs, etc.
- Sean1708 11y agoFWIU D is actively trying to reduce it's dependence on a GC, while go has decided that the GC is here to stay.
- Ace17 11y agoBTW, as D can call C functions. Thus, in theory, you could choose to use only the C standard library, and use D as a "C with a better syntax". This way, no garbage collector nor any bloat gets linked into your program ... but you still benefit from RAII, templates, array slices, and simplified declaration syntax.
- crawshaw 11y agoYou can write an operating system in a garbage collected language. One example, Oberon System: https://en.wikipedia.org/wiki/Oberon_(operating_system) https://en.wikipedia.org/wiki/Oberon_(operating_system) I don't know anyone who has written more than a toy OS in Go, but it does not seem a fundamentally impossible task. Getting started is harder, because the earliest parts of the kernel would be modifications to the runtime package. Once you get that out of the way, writing drivers could be quite fun. But to the broader topic, I don't have a good definition of "systems language" so I'm not going to claim Go is one. (I work on Go.)
- JoeAltmaier 11y agoAn OS often has to generate nearly every opcode on the target machine (many are there just for this purpose). Can Go generate arbitrary ASM instructions? An OS has to deal with often strange calling conventions (interrupt routines, OS entry point traps, multiple language support). Can Go express the calling stack in any way? Drivers are often interested in controlling timing and latency down to the instruction. Can generated Go code be examined by the developer for instruction counts? A good kernel language is pretty low-level. Used to write them all in assembler.
- crawshaw 11y agoGo has an assembler: https://golang.org/doc/asm https://golang.org/doc/asm I have used it in sticky situations, like the trampoline for a signal handler, and writing functions that have to conform to a C ABI because they are called by the OS. (In particular, a loader .init function.) To minimize how much assembly a theoretical OS author has to write, there are a couple of extra tricks in the runtime package they could borrow, like //go:noescape annotations. You have to be careful when writing code like that, but it does the job. Before the Go runtime was rewritten in Go, I worried that for a task like writing a kernel there would be a lot of assembly. But I have been pleasantly surprised by how little is needed in the runtime, and that gives me some hope for a project like that. Of course this is speculation on my part, I could be wrong.
- nindalf 11y ago
- pjmlp 11y agoEven though I am not a big fan of some of Go's design decisions, this is one area where I do say that Go is a real systems programming language specially since 1.6, regardless of what C guys say. You have OSes written in Lisp, Cedar, Modula-2+, Modula-3, Oberon, Oberon-2, Active Oberon, Component Pascal, Sing#, System C#,... All systems programming languages which do have a GC for heap management. Given that the Go compiler and runtime are written in Go, with the necessary Assembly glue code, I would say Go is no less systems programming language than those referred above. Even ANSI C, cannot be fully implemented without Assembly or compiler specific extensions for hardware integration. But of course the naysayers will only change their discourse the day someone decides to invest their time and produce a bare metal runtime for Go, following the approach of one of those OSes that I mentioned.
- divan 11y agoIt's not a low-level systems language in traditional view of what "system" is. For Google, "system" is a cloud, not the hardware, so take it from this perspective. By the way, here is a nice video of Q&A session with Alexandresku, Matsakis, Stroustrup and Pike (D, Rust, C++ and Go creators), where they also explain what does 'systems language' mean.
- deleted 11y ago[deleted]
- Philipp__ 11y agoI would like to see that video too...
- leaveyou 11y agohere https://channel9.msdn.com/Events/Lang-NEXT/Lang-NEXT-2014/Panel-Systems-Programming-Languages-in-2014-and-Beyond https://channel9.msdn.com/Events/Lang-NEXT/Lang-NEXT-2014/Pa...
- charlieegan3 11y agoThink it's this https://m.youtube.com/watch?v=BBbv1ej0fFo https://m.youtube.com/watch?v=BBbv1ej0fFo
- mguillemot 11y agoI think you refer to this video: https://youtu.be/BBbv1ej0fFo?t=3m40s https://youtu.be/BBbv1ej0fFo?t=3m40s (bookmarked at the start of the talk about system programming)
- dawkins 11y agoThis one? https://www.youtube.com/watch?v=BBbv1ej0fFo https://www.youtube.com/watch?v=BBbv1ej0fFo
- divan 11y agoYep!
- deleted 11y ago[deleted]
- SixSigma 11y agowho's parading it as that? Certainly not the Go team https://talks.golang.org/2012/splash.article https://talks.golang.org/2012/splash.article
- kzrdude 11y agoIt was introduced with those words. They have changed since (a long time ago too).
- epoch1970 11y agoAt the very top of the Go web site it used to prominently say "a systems programming language" [1]. [1] https://web.archive.org/web/20091112094121/http://golang.org/ https://web.archive.org/web/20091112094121/http://golang.org...
- suppressingfire 11y ago"It was introduced with those words. They have changed since (a long time ago too)."
- skywhopper 11y agoI don't think the Golang people are parading it as a "systems language". Part of the goal was to make something fast that's both safer and easier than C. I think they succeeded with that. But I don't think anyone expects a language with enforced safety and built-in garbage collection to be faster than C. That just isn't going to be possible.
- myg204 11y ago> Part of the goal was to make something fast that's both safer and easier than C. Right, and also fast compilation. I remember reading the goal was ~20% slower than C for overall performance.
- _ph_ 11y agoIt was auto-translated from C to Go. This means, they replaced well-written C code with badly (unoptimized, nonidiomatic) Go code. The reason was, to guarantee that the initial Go based version was identical to the proven C version. With the releases subsequent to 1.5 the cleanup and enhancement process of the Go version started and now it shows nice results. I think its one really great feature of Go, that the whole build/runtime infrastructure is written in Go itself. So, everyone who is fluent in Go can easily read and possible enhance the infrastructure.
- awinter-py 11y agobig question & fair point. If the system includes the task of its own maintenance (and therefore the developers who work on it), go is faster than C because of maintenance and correctness advantages. (that definition of system is more like 'systems biology' than 'close to the iron software that calls OS APIs'). If golang stays popular the compiler will keep getting faster. Especially because now that it's self-hosting, future improvements will improve compile & runtime perf.