News for hackers. Stuff that matters.
Re:The State of Go by chowells on Tuesday May 26, 2015 @11:55PM (#9609251)
Why Rust? It doesn't really compete with Go anywhere. Haskell is a much stronger player in the space of high-level, garbage-collected languages. The only thing Rust and Haskell really have in common is not willfully ignoring the last 50 years of programming language design research.
Re:The State of Go by danieldk on Wednesday May 27, 2015 @03:05AM (#9609783)
Why Rust? It doesn't really compete with Go anywhere.

I guess people compare Rust and Go because they were released in similar timeframes and people like to view things in competition.

Rust is especially attractive when you can't afford a garbage collector, need deterministic destruction, and full compatibility with C. It's what C++ would be if it could start from scratch.

I think your point needs to be re-iterated more often: if garbage collection and ~2-3x the running time of C is not a problem, OCaml, Haskell, Scala, F#, etc. are the competition of Go. They integrate modern (read: mostly 70ies/80ies) language design insights, while providing approximately the same performance as Go.

Re:The State of Go by nickpsecurity on Wednesday May 27, 2015 @03:11PM (#9613618)
Great points, esp on Go vs real competition. It's why I'm against their modernized ALGOL68. Languages such as Haskell, Clojure, Rust, Julia, Scala, Ocaml, and others are at least trying to apply lessons learned in programming research to improve things for programmers. Google would've been better off taking one of the more native ones, identifying its worst issues, using their geniuses to fix those, and then building tools + community on that.

Instead, we get an alternative to unsafe, native and safe, scripting languages without most advantages of the best of either. I might still try it out if I do a comparative evaluation of modern work. By that time, it might have gotten better.

Re:The State of Go by mkpankov on Wednesday May 27, 2015 @07:34AM (#9610615)
> similar timeframes

I hope you understand first stable release of Rust happened less than 2 weeks ago (15 May 2015), vs. Go's Go 1 in March 2012.

3 years is pretty big difference.

Re:The State of Go by danieldk on Wednesday May 27, 2015 @07:56AM (#9610694)
I hope you understand first stable release of Rust happened less

Of course, but Rust has been in tech news for a while already. E.g., the Rust 0.1 post garnered 82 comments[1], over 3 years ago. Rust seems to be first mentioned in a submission title 5 years ago.

Of course, their inception was not exactly at the same time. But if we look back in 20 years, it's the same timeframe. Just like e.g. Python and Ruby, despite being 4 years apart. Or C and Pascal.

[1] https://news.ycombinator.com/item?id=3501980

Re:The State of Go by enneff on Thursday May 28, 2015 @01:37PM (#9619733)
I find your perspective a little bizarre. For instance, if we look on a galactic time scale, Lisp and Go were created at pretty much the same instant!

It's not fair to Rust to compare it to Go, as if they are at the same stage of their adoption and development. Several years is makes a big difference in the tech world.

Re:The State of Go by dbaupp on Thursday May 28, 2015 @09:07PM (#9622149)
Err, wat.

It seems ridiculously reasonable to compare programming languages on the time-scale of modern computing (~70 years). Dismissing the comparison like that is pretty crazy.

However, don't get me wrong: I totally agree that the years between the stable releases of the projects makes a big difference, especially now, while it is such a large percentage of the total lifetime of them.

Re:The State of Go by jcranmer on Wednesday May 27, 2015 @10:46AM (#9611707)
Go was first publicly announced in November 2009, Rust in July 2010.
Re:The State of Go by kibwen on Wednesday May 27, 2015 @05:24PM (#9614470)
At the time of its announcement, Go was tremendously further along in its development than Rust was at its own public announcement. Knowing modern Go, you can go back and understand Go code from 2009. Knowing modern Rust, trying to read code from 2010 is essentially impossible.
Re:The State of Go by justthistime_ on Thursday May 28, 2015 @11:00AM (#9618583)
I wouldn't say "further along". Deciding to not tackle any medium-to-hard problems just allowed them to be finished far earlier with their language.
Re:The State of Go by muraiki on Wednesday May 27, 2015 @10:53AM (#9611768)
Actually, I read an interview with one of the Rust devs recently where he said that one of the meanings behind the name "Rust" is that they purposely chose not to use any ideas from programming language research within the past 10 years. IIRC it was because they wanted to use only ideas that had had some time to mature and be used in practice. So yes, Rust chose to willfully ignore at least some of the past 50 years of PL design research. :)
Re:The State of Go by Nelson69 on Wednesday May 27, 2015 @12:23PM (#9612440)
They both compile to machine code?

People get bent around the wheel all the time with the tiny niches but both seem well equipped for writing user land applications and are designed to be safer than C and it's cousins. Both have some legitimate interest in them which is what really differentiates them from like D or Ada. Neither is going to be used for kernels (maybe I should say 'serious kernels') and drivers any time really soon. They have a lot of similarity in those regards.

Seems like a golden era to have 2 competing languages that are aiming at C and C++ and have legitimate community interest.

Re:The State of Go by Dewie3 on Wednesday May 27, 2015 @06:53AM (#9610471)
> Why Rust?

Whenever Go is mentioned, Rust has to be mentioned somewhere in that same thread. And vice versa. It's practically law.

Perhaps a good indication that the debates tend to be more fashion-driven then about technical points (when the discussion is about new languages itself, that is of course reasonable though).

Re:The State of Go by sacado2 on Wednesday May 27, 2015 @08:39AM (#9610890)
Right. I think the closest languages to Go, regarding respective niches or overall philosophies, are Java and Oberon. Yet nobody ever compares them.
Re:The State of Go by aplummer on Wednesday May 27, 2015 @12:03AM (#9609272)
Doesn't it? Why do people seem to compare them all the time...
Re:The State of Go by learc83 on Wednesday May 27, 2015 @12:41AM (#9609376)
Go gets compared to Rust because go was originally labeled a "systems" language. But the designers had a different older view of what "systems" meant than what is commonly used to day. People heard systems and thought they meant low level/operating system/embedded systems. That is not what Go is good for because it's garbage collected.

They also planned to attract C++ programmers, but they've basically been attracting dynamic language programmers instead. Why that was a surprise is beyond me--I can't imagine that anyone currently using C++ would be OK switching to a garbage collected language.

Rust on the other hand, is shaping up to be a C++ replacement.

Re:The State of Go by mcgirr on Wednesday May 27, 2015 @02:11AM (#9609593)
Yeah, additionally it would be unwise to use Go in embedded systems because it is so reliant on heap memory for dynamic allocation. In certain situations where things could fail if an operation takes too long - rocketry and robots - it would be difficult to tell how long something would take in Go with any degree of certainty because allocating and freeing memory on the heap is highly non-deterministic.
Re:The State of Go by pjmlp on Wednesday May 27, 2015 @03:35AM (#9609895)
If you can do it with .NET Micro Framework, Java (Atego, MicroEJ, J9, ...) and Oberon (Astrobe), surely Go is also welcomed.
Re:The State of Go by learc83 on Wednesday May 27, 2015 @01:15PM (#9612839)
It's not that you can't use Go. It's that Go's probably not the best tool for the job.

Sure you can do embedded development with the .NET micro framework because there are embedded systems that don't have hard real time requirements.

If you're building a hobby robot with netduino, you might not care if you have guarantees about input response time--as long as the delays are usually small enough. But if you move beyond that, you're most likely going to need a real time system.

Re:The State of Go by pjmlp on Wednesday May 27, 2015 @03:03PM (#9613586)
Do you consider missile guidance systems hard real time requirements?

http://www.atego.com/products/atego-perc-pico/

As a language I am not a fan of Go, but on the context of using strong type languages in embedded scenarios. I think the less C the better.

Just like JavaScript JITs, it is always a matter how much companies are willing to invest to improve the quality of the existing eco-systems.

Re:The State of Go by learc83 on Wednesday May 27, 2015 @03:58PM (#9613917)
That's a virtual machine specifically designed for this kind of thing.

So sure, if you want to use go syntax and build a completely new runtime designed for use in real time systems then go ahead.

As for strong typing in embedded scenarios Ada's been doing that for decades.

Re:The State of Go by nindalf on Wednesday May 27, 2015 @05:50AM (#9610290)
This particular link has some info about that situation. GC pauses are deterministic starting Go1.5. Application code will run for at least 40ms out of every 50ms. The upper limit for the GC pause is 10ms and its typically lower.
Re:The State of Go by mkpankov on Wednesday May 27, 2015 @07:38AM (#9610635)
It's not "deterministic". It has limits on time consumption of GC defined. But you still can't tell when, and if, at any given moment you'll have a pause.
Re:The State of Go by Dewie3 on Wednesday May 27, 2015 @08:57AM (#9610990)
As soon as you put limits like that you have to compensate by risking that you run out of memory -- if you can't meet the deadline, you can't fully scan the heap[1], free, and so on. Or is that wrong?

That seems like another variable to consider if you're in an environment where you have to somewhat control how much memory you use. But I don't know really know anything about the details of garbage collection, I just figured that that would be one of the trade-offs. So correct me if I'm wrong.

[1] Or whatever technique is used

Re:The State of Go by tracker1 on Wednesday May 27, 2015 @02:56AM (#9609748)
If you can do robots with Node.js, I'm pretty sure Go may well be acceptable here.
Re:The State of Go by learc83 on Wednesday May 27, 2015 @01:22PM (#9612889)
No one is arguing that you absolutely can't use Go to build a robot, just that it's probably not a good idea.

Just because someone uses Node.js to build a hobby robot, doesn't mean that many people are using it for production embedded systems. If your systems has hard real time requirements, which many systems do (even many hobby robots), a stop the world garbage collector is out of the question.

Let's say you have a legged robot that depends on interpreting sensor feedback to keep from failing over. What happens to your balance when the garbage collector pauses your code for 10ms?

Re:The State of Go by olavk on Wednesday May 27, 2015 @05:06AM (#9610155)
Can you elaborate on the different meanings of 'systems programming'? I just thought it meant OS development.
Re:The State of Go by learc83 on Wednesday May 27, 2015 @01:00PM (#9612742)
Apparently the creators meant infrastructure like web servers, and database servers.

There is some argument that using systems programming the way it is used today is a relatively modern convention. Here is a hacker news thread where this is discussed a bit

https://news.ycombinator.com/item?id=7009563

Re:The State of Go by _ak on Wednesday May 27, 2015 @06:42AM (#9610449)
The "systems" in "systems programming" can also be interpreted to refer to Google's systems. After all, Go was designed to solve Google problems in a Google environment. That's how I always understood it.
Re:The State of Go by pjmlp on Wednesday May 27, 2015 @08:23AM (#9610814)
In CS speak that is actually known as "distributed systems", not "systems programming".
Re:The State of Go by learc83 on Wednesday May 27, 2015 @01:04PM (#9612763)
In modern CS speak yes, but the creators of Go were apparently referring to infrastructure types of programs; web servers, database servers etc...

Here's a quote from the announcement talk

"And it's a systems language in the sense that we intend it to be used to write things like web servers"

Re:The State of Go by pjmlp on Wednesday May 27, 2015 @02:59PM (#9613569)
If it has servers in the name it is distributed computing.

How modern is modern CS?

I took my CS degree around 20 years ago with focus on computer architecture, compiler design and distributed systems.

Distributed systems literature used in the degree went back to the early UNIX days.

Re:The State of Go by learc83 on Wednesday May 27, 2015 @06:09PM (#9614724)
>How modern is modern CS?

The creators of Go were on the team that built UNIX, and they clearly have a different meaning for the word systems.

They were using it to refer to infrastructure, without making a distinction whether it was distributed or local. Something like a compiler would be "systems" program under this definition.

I agree that distributed systems, and systems programming are generally accepted terms of the art in CS now, and even 20 years ago.

Re:The State of Go by olavk on Wednesday May 27, 2015 @03:23PM (#9613690)
Ah, than makes sense.
Re:The State of Go by TazeTSchnitzel on Wednesday May 27, 2015 @12:38AM (#9609366)
Rust is a systems-level programming language. Go isn't: it's garbage-collected.
Re:The State of Go by pjmlp on Wednesday May 27, 2015 @09:34AM (#9611179)
Besides the sibling post.

Xomb, Mesa/Cedar, Oberon, SPIN, Singularity were all written in GC enabled system programming languages.

Re:The State of Go by nickpsecurity on Wednesday May 27, 2015 @03:14PM (#9613640)
Good points. People often forget GC languages were often used to write OS's and system software even on constrained devices. A number of languages, such as Modula-2 and Ada, offered the ability to go unsafe in certain modules out of necessity but with safe interfaces. So, where Go or Rust can't cut it, language developers can just use a feature like that (or inline assembler) to solve those problems until the language itself can.

Additionally, they can do what PL/S and certain Ada's did where specific modules were transformed by the compiler differently based on their needs. One might have total safety, one no safety, one a GC'd runtime, one a non-GC runtime, and one no runtime at all. Still using the same language and tools for everything, albeit subsets in some modules with extra worries.

Re:The State of Go by steveklabnik on Wednesday May 27, 2015 @12:22PM (#9612428)
Yeah, but at least with XOmB, we weren't actually _using_ the GC, as you can turn it off in D.
Re:The State of Go by pjmlp on Wednesday May 27, 2015 @01:01PM (#9612747)
Thanks for the heads up.

Although given my Oberon knowledge, I would say that was more a consequence of D's GC implementation quality than anything else, right?

On Oberon and all the derived OS, the Kernel module was the only one where GC wasn't used, as it needed to be implemented somewhere.

All the other modules enjoyed access to an OS wide GC.

Re:The State of Go by steveklabnik on Wednesday May 27, 2015 @04:53PM (#9614260)
Well, it was really just that we didn't get that far, I guess. Mind you, my friends did much more of the work than I did, but like most student hobby projects, at some point, you just stop working on things.
Re:The State of Go by sacado2 on Wednesday May 27, 2015 @08:45AM (#9610927)
Lisp is garbage collected. Yet Lisp machines existed, and they were invented at the same time as UNIX.
Re:The State of Go by nickpsecurity on Wednesday May 27, 2015 @03:18PM (#9613662)
And some's details were published for other people to learn from. Anyone wanting to see how they implemented it can google LISP and Scheme machines, hardware, processors, and similar search terms. I recall one implemented cons directly while hiding GC behind memory interface. The programs didn't even know there was collection and it happened in parallel with execution without stopping execution. Great stuff. Many of these give software and hardware implementation details where they could be copied in FPGA's.

Closest thing I've seen in a modern product is Azul Systems' Java processors with concurrent GC's. So, at least one company is benefiting from the old wisdom.