Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I can't do system programming using Go on a platform for which there is no compiler. There is probably a reasonable C compiler for every platform in existence out there.


Probably, but realize that at first this wasn't true. Go needs time to grow, just as C grew to different systems.

Looking at other systems such as Haiku shows that porting Go is encouraged, the only issues have to deal with assumptions in the build (in this case, I think /bin/env/bash is included everywhere, there's no global variable to change this definition from different OS types).

One day we may see a change in Go for different platforms, but I don't think it will prove to hinder that many people, only the niche groups. And for all intents and purposes, Go is built for practical application (!! Don't kill me !!), which systems programming on plan9 or haiku may not be considered "practical" at the moment.

EDIT: for clarity.


> Looking at other systems such as Haiku shows that porting Go is encouraged, the only issues have to deal with assumptions in the build (in this case, I think /bin/env/bash is included everywhere, there's no global variable to change this definition from different OS types).

I think this is not longer a problem with the new build system that is part of Go 1.

Also AFAIK at least the Plan 9 port is almost complete, and is certainly functional.


Go is not a replacement for C. As many people have said, Go is not suitable for most purposes where C would currently be the best choice.

Go is a replacement for Python, Ruby, etc. Garbage collection, duck typing, an excellent library. Go is a language with the same level of abstraction of many other "scripting" languages, but is unique because it uses static typing and is compiled.


I would say Go is a replacement for C++, Java and C# instead. Python and Ruby are great at quick prototyping, but Go fixes several of the major problems with those three. C++ takes forever to compile, code quickly becomes stale and the modularity isn't great. Java and C# lacks brevity, native compilation and the error handling is overly verbose and is in the way more than it helps.


Well, back in the days it was pretty much the same thing for C. When someone needed to target a platform it used to mean writing a compiler for the said platform.


That is what cross-compiling is for.

You use the compiler toolchain in OS A, while generating executables to run on OS B.

With a bootstraping compiler, you can use this technique to bring a native compiler to new platforms.


Right now there's Go compilers for Windows, Mac and Linux. I'm sure others will follow soon.


There is more to platforms than operating systems. I worked on an application that had to function on 8 different hardware architectures[0], though on all but one we ran Linux. We also had code that was bare metal (no OS) running on FPGAs and DSPs. Go is a long way from supporting that.

This is not to say Go will not get there eventually, if the language gains popularity. Someone had to write or modify a compiler to target all those architectures for C, after all. This is just a reaction to what I see as assumptions tying operating systems to certain hardware architectures (in this and other discussions). Go can be used on a range of operating systems on two hardware architectures. Very good progress, but the language needs to get that second number up before we can seriously talk about it replacing C.

[0] Only had to perform well on two, fortunately.


+ FreeBSD.

Also, OpenBSD, NetBSD, and Plan 9 in the works.


OpenBSD and Plan 9 pretty much work already, even if the ports might not be as polished as FreeBSD.

Also there is gccgo, which AFAIK also works on Solaris and probably elsewhere.


Yes, it works on IRIX and RTEMS (an embedded OS), and the gc suite was also ported on Ethos.

I'd also like to add that the gc compilers support ARM as well as x86 and amd64 and are very, very easy to port to new platforms.




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

Search: