News for hackers. Stuff that matters.
Re:I can't keep up with idiomatic Rust by Skunkleton on Wednesday April 08, 2020 @10:12PM (#22819196)
IMO Go is more like C people took a stab at making a Java. I really like go, and it’s ethos, even if I haven’t used it much in production. Go is not however a replacement for C in the way C++ and Rust can be. Of course Rust and C++ aren't a replacement for C in some key ways, so maybe I don't have a point here?
Re:I can't keep up with idiomatic Rust by typ on Thursday April 09, 2020 @01:40AM (#22820106)
It's been mentioned from time to time that Go is a successor of C. As I recently had a look into the Pascal/Oberon family. It looks that Go is no less influenced by Oberon than C. The CSP paradigm likely comes from Rob Pike's previous works. And the syntactical elements, such as the operators and punctuations, also follow the C tradition. But the overall program structure (including the approach to OOP and probably the 'evolving-by-reduction-rather-than-addition' philosophy) makes it seem closer to the Oberon linage.
Re:I can't keep up with idiomatic Rust by pjmlp on Thursday April 09, 2020 @07:34AM (#22821541)
Active Oberon also had co-routines in the form of active objects.

Also note that 'evolving-by-reduction-rather-than-addition' philosophy is only part of Wirth's Oberon linage.

Oberon-2 (which Go got its method syntax from), Active Oberon, Component Pascal and Zonnon, are all Oberon descendents from ETHZ as well, which go into the direction of mainstream languages, including support for generics or more low level programming capabilities.

Re:I can't keep up with idiomatic Rust by peteretep on Thursday April 09, 2020 @03:51AM (#22820605)
> The CSP paradigm likely comes from Rob Pike's previous works

"The CSP paradigm" comes from CSP: https://en.wikipedia.org/wiki/Communicating_sequential_proce... which predates the vast majority of Rob Pike's work (eg: before he went to Bell Labs).

Re:I can't keep up with idiomatic Rust by yiyus on Thursday April 09, 2020 @06:26AM (#22821217)
Yes, that's the original inspiration. But Rob Pike has been implementing CSP ideas in different languages for a few decades now, and all that work has highly influenced the implementation in Go.
Re:I can't keep up with idiomatic Rust by dgb23 on Thursday April 09, 2020 @06:33AM (#22821234)
Obviously what OP meant is the implementation of it. Rob Pike mentioned Tony Hoare‘s work in almost every talk he gave about Go‘s concurrency.
Re:I can't keep up with idiomatic Rust by SaxonRobber on Thursday April 09, 2020 @12:34AM (#22819810)
C++ has had decades to replace C, but it’s really stalled and even lost ground in embedded systems. I can’t see Rust faring much better. C might end up being an eternal language until there is a dramatic enough shift in operating systems to merit replacing it.
Re:I can't keep up with idiomatic Rust by alexhutcheson on Thursday April 09, 2020 @10:37AM (#22822931)
In my opinion, there are two main factors driving this:

- Lower spec devices have a hard cap on overall code complexity imposed both by available ROM or flash constraints (big projects literally won't fit on the chip), and by time constraints (if your chip is running at <= XX MHz when it's active, you don't have time to run very many functions between events or interrupts). Most projects for these devices won't grow to the point where you really need the code organization benefits that C++ provides.

- It's a lot less effort to port or implement a C toolchain for your chip than it is to port or implement a toolchain for a more complex language like C++, Rust, or even Ada. It's not just the compiler - you also have to have a working standard library (even if some functions are just stubs), an interactive debugger, and integrations with IDEs (if you already provide that for C). All that software engineering is expensive, and you have a much smaller market of developers to amortize that cost over.

These constraints aren't as binding for high-production, higher-spec devices like popular families of ARM Cortex-M chips, so usage of C++ seems to be relatively more popular for those devices. Even then, embedded work normally requires more of a "C with classes" or "C plus the std::algorithm library" approach, which is different from C++ projects you'd see that target servers.

Re:I can't keep up with idiomatic Rust by pjmlp on Thursday April 09, 2020 @07:30AM (#22821528)
Mostly because embedded C isn't ISO C, rather MISRA C, TI C, Microchip C,...
Re:I can't keep up with idiomatic Rust by takeda on Thursday April 09, 2020 @02:16AM (#22820250)
> IMO Go is more like C people took a stab at making a Java.

And in a way it is :) given who worked on it, and where it was created.

Re:I can't keep up with idiomatic Rust by pjmlp on Thursday April 09, 2020 @07:29AM (#22821525)
That was Limbo actually, and the attempt was at Java 1.0 apparently.

Despite my opinion regarding its design, Go was definitely a C replacement for F-Secure TamaGo, Google's gVisor, Android GPGPU and CoreBoot projects.

Re:I can't keep up with idiomatic Rust by tmh88j on Wednesday April 08, 2020 @10:23PM (#22819241)
>IMO Go is more like C people took a stab at making a Java.

I haven't used Go beyond tutorials and some very basic programs, but I am pretty comfortable with Java. What about Go makes you feel it's relatable to Java? From what I've read the lack of generics is a hot topic in the Go community, but they're pretty crucial to most programs written in Java. Is this still true?

Re:I can't keep up with idiomatic Rust by correct_horse on Wednesday April 08, 2020 @10:51PM (#22819352)
As a side note, Java also didn't ship with generics. Java was released in the mid 90s and didn't have generics until about 10 years later with version 5. This timing should feel familiar - Go first appeared ~10 years ago in 2009.

You may remember that in Java 1.4, `get`ting from collections (e.g. ArrayList) always returned Object, which you were expected to cast to their runtime type (or a class that their runtime type inherits from). I was young at the time, correct me if I'm wrong. Contrast this with Go's solution, which seems to be user-inaccessible compiler magic. I much prefer Go's solution to Java's, but I also like generics.

Re:I can't keep up with idiomatic Rust by saagarjha on Wednesday April 08, 2020 @10:53PM (#22819361)
I really hate user-inaccessible compiler magic. Java had its fair share of that, but Go seems to take it even further :(
Re:I can't keep up with idiomatic Rust by Skunkleton on Thursday April 09, 2020 @03:44PM (#22826407)
I think compiler magic is pretty great. Hotspot is a pretty magical compiler. Go is less magical IMO because it is AOT compiled.
Re:I can't keep up with idiomatic Rust by saagarjha on Thursday April 09, 2020 @04:14PM (#22826717)
By compiler magic I really mean syntax reserved to the language itself; for example, Java's String having extra operator superpowers or Go's generics that are only available to a chosen set of standard collections.
Re:I can't keep up with idiomatic Rust by antoinealb on Thursday April 09, 2020 @05:19AM (#22820956)
I think you can do the same in Go, using the empty interface (that can represent any type) and then having the user cast it to the correct type. Unfortunately this is not type safe, and type safe generics in go, such as maps is only available to the compiler.
Re:I can't keep up with idiomatic Rust by doliveira on Wednesday April 08, 2020 @10:32PM (#22819279)
Java didn't have generics before version 5, I think. It was a hell of casting back and forth Object, much like Go and interface{} today.
Re:I can't keep up with idiomatic Rust by Skunkleton on Wednesday April 08, 2020 @11:07PM (#22819418)
The language and tooling is designed for development at scale. Lots of pragmatic trade offs were made. Its not flashy at all, and could even be accused of being a bit boring. It is also appropriate for a similar domain.
Re:I can't keep up with idiomatic Rust by takeda on Thursday April 09, 2020 @02:21AM (#22820267)
yep, there Go was labeled as a replacement for C or Python, and while it in no way replaces C and and as for Python it generally only does when the Python wasn't the right choice from the start.

In reality Go can fully take over Java's problem space.

Re:I can't keep up with idiomatic Rust by qqssccfftt on Thursday April 09, 2020 @05:08AM (#22820913)
> In reality Go can fully take over Java's problem space.

Or, when Project Loom releases, Java will be able to fully take over Go's problem space.

Re:I can't keep up with idiomatic Rust by takeda on Thursday April 09, 2020 @03:39PM (#22826364)
Sorry, my previous post sounded like I was picking a favorite, what I meant is that Go and Java pretty much has identical problem space.
Re:I can't keep up with idiomatic Rust by pjmlp on Thursday April 09, 2020 @07:36AM (#22821551)
Not really, unless it provides generics, JEE and Spring like frameworks, supports all embedded CPUs, Oracle/SQL Server/DB2, mainframes, has an OS of its own, a GUI half as good as Swing,....
Re:I can't keep up with idiomatic Rust by kelnos on Thursday April 09, 2020 @07:30PM (#22828336)
Not without generics it can't. I know a lot of people seem to think that generics aren't necessary in Go, but I vehemently disagree with them.
Re:I can't keep up with idiomatic Rust by krakatau1 on Thursday April 09, 2020 @10:00AM (#22822604)
there is no way that's happening, outside of silicon valley practically no one is using Go, there are millions Java developers who are quite content with language...
Re:I can't keep up with idiomatic Rust by 7thaccount on Wednesday April 08, 2020 @10:29PM (#22819262)
Garbage Collector?
Re:I can't keep up with idiomatic Rust by EdwardDiego on Thursday April 09, 2020 @05:17AM (#22820946)
Go's GC is quite different to Java's though - deliberately not as many knobs to twiddle.