

Ask HN: Is go a system programming language or a web language? - zedzedzed

I ve seen many startups using go as a web language. Have i missed anything?
======
hasenj
It was initially built for writing concurrent network services and they called
it a systems language for that reason.

Now they just call it a general purpose language.

It's not a web language per se but it's great for building web applications:

\- Compiled, performant

\- Elegant concurrency model

\- Bridges the gap between dynamic and static typing (it's statically typed
but with ideas borrowed from dynamic languages)

Unlike Java, it's pleasant to work with.

Unlike Ruby/Python, it's very fast.

I've seen some python setups where you have 3 separate servers: one for
serving static media (usually written in C), one for serving the main app
(python), and one for providing websockets (node.js).

With Go, you don't need this convoluted setup. You can do all of these things
from within Go.

Here's an example chat app that uses websockets:

[http://theplant.jp/en/blogs/10-techforce-building-a-web-
chat...](http://theplant.jp/en/blogs/10-techforce-building-a-web-chat-with-
the-go-programming-language-and-html5-websockets)

~~~
slurgfest
I am interested to know how your web application pushed the performance limits
of Python. You should be able to get thousands of requests per second, even
out of a laptop running a pure-Python server. (I'd defend Ruby the same way
but I don't know its details - I doubt it is very different, though)

The bottleneck in almost any real web app is going to be the database, not the
programming language.

If you can't scale horizontally then your language choice is not your problem.
If you can then what performance metric is going to show the inadequacy of
Ruby or Python running on a few servers?

Add the caching that you should be doing anyway and even slower
Ruby/PHP/Python frameworks can perform quite adequately.

I don't dispute that Go is a cool language but this seems like FUD.

------
jfaucett
Go is a web language in the sense that its a great "networking" language. Its
not gonna replace JS in the browser any time soon, but it does handle
concurrency and everything large scale server side really (and I do mean
really) well. Personally, from my limited (only been using / testing for
couple months or so) experimentation with it, I think its a great lang for
networking, building distributed services, and its concurrency primitives are
clean and just fun.

~~~
slurgfest
It would be really interesting if Go could be used in the browser! I think
client side programming is suffering from the Javascript monopoly.

------
murz
The goals of Go, as stated in the 2011 I/O slides
([http://golang.org/doc/talks/io2011/Writing_Web_Apps_in_Go.pd...](http://golang.org/doc/talks/io2011/Writing_Web_Apps_in_Go.pdf)):

\- fun to work in.

\- efficient - performance approaching C for CPU-intensive tasks,

\- designed for modern hardware (multicore, networks),

\- aimed at software such as web servers,

\- ... but turned out to be a great general-purpose language.

------
CyberFonic
From my best understanding Go has its roots in the Plan9 project and it is
very capable as a systems language. When it comes to the web it is very well
suited to writing services. Bit like what you'd use NodeJS for - but with
different trade-offs. Presently Go is not used on the client / browser side
code. For that JavaScript is still the main game.

------
geofft
Perl, Python, and Tcl all started life out as system programming languages.

~~~
mhd
Not for the common definition of "system programming language", as e.g.
offered by John Ousterhout, author of the aforementioned Tcl
(<http://www.tcl.tk/doc/scripting.html>)

(Never mind that "web language" ain't exactly a great term, either. I'd apply
that to some integrated language like Opa, but most languages commonly used
for web programming aren't restricted to that and do enjoy some common use
outside of that area.)

~~~
zedzedzed
So can you tell me, what kind of tasks are best solved and evaluated in go? Is
it a low level lamguage like c, or does it find best use in javascript like
domain? Or is it like java/c#?

~~~
mhd
From a use case perspective, I'd put it in the Java camp. Can do low level,
although probably not the best choice for really down-to-the-metal stuff (if
you really need all the optimization you can get and don't want to deal with
GC). Due to its pretty decent library support and compilation speed/build
system, it's also a bit more suited to application where you might reach for a
scripting language, as turnaround doesn't suffer too much. There's also a
pretty strong concurrency support, using the CSP approach.

So no really narrow sweet spot. A good language for general network
programming, which might include some framework web stuff, but also could
involve writing your own custom servers and consumers.

There's probably a better language for each individual task, but go is quite
solid at a wide spectrum of tasks. Good community, too, if a bit fanboyish.

~~~
zedzedzed
but still, i could go some degree low level, right?

~~~
mhd
Sure. It has signed and unsigned numeric types with specified sizes, and the
"unsafe" module provides some alignment and even pointer arithmetic
capabilities if you _really_ need to tell the computer everything.

I'd just except the very end of _low level_ stuff from it, mostly due to
maturity and GC issues, so it wouldn't be my choice of language for a embedded
real-time situation. If you're talking web server/3D game low-level, it's
fine.

To me, go looks like C programmers copied Modula-3, whereas Java was Cobol
programmers copying Modula-3...

------
eli_gottlieb
Mu. It's an applications language.

