News for hackers. Stuff that matters.
Re:Criticizing Hare language approach for generic data struc... by celeritascelery on Wednesday May 04, 2022 @07:44AM (#31259167)
Rust still considers itself a “systems programming language” . They are moving Rust into the Linux kernel and android drivers. It doesn’t get any more “systems programming” then that. But you are correct about go, it doesn’t give the programmer enough control to be used at that level.
Re:Criticizing Hare language approach for generic data struc... by lawl on Wednesday May 04, 2022 @08:31AM (#31259546)
> But you are correct about go, it doesn’t give the programmer enough control to be used at that level.

What I like about go is that I can go full unsafe.Pointer if i want to, and do whatever I want.

The other thing I really like, is that they did such a good job discouraging it that i frequently hear people complain about go having pointers but not even letting you have fun with them.

The problem isn't that go doesn't give you enough control, the problem is that it's garbage collected. And you'd need to work around the GC. It's doable and people have done it though. Good idea? Maybe not.

Still waiting for someone to make "go but with ownership and borrow checker"

Re:Criticizing Hare language approach for generic data struc... by mumblemumble on Wednesday May 04, 2022 @08:39AM (#31259595)
I think that being garbage collected is exactly the control problem in question.

I'm no a systems programmer unless you count hobby microcontroller projects, but my understanding is that, when a systems programmer is talking about control, they tend to be talking first and foremost about keeping tight limits on memory usage. Pointers and suchlike just happen to be key tools that help you do that.

Re:Criticizing Hare language approach for generic data struc... by pjmlp on Wednesday May 04, 2022 @03:22PM (#31264721)
Re:Criticizing Hare language approach for generic data struc... by ansible on Wednesday May 04, 2022 @09:26AM (#31260053)
> Still waiting for someone to make "go but with ownership and borrow checker"

That would have interested me more a few years ago, but I'm deeply invested in Rust these days.

Is that all you'd change about Go? One of the reasons I moved was the error handling and lack of generics. Go has fixed the latter, but I can't stand not having Result<> and Option<> these days. The '?' is awesome too.

Re:Criticizing Hare language approach for generic data struc... by lawl on Wednesday May 04, 2022 @09:51AM (#31260392)
> Is that all you'd change about Go?

No, go has plenty of warts, like every language (ever formatted a date in go?). I just don't like kitchen sink languages.

Re:Criticizing Hare language approach for generic data struc... by eatonphil on Wednesday May 04, 2022 @11:45AM (#31262099)
You can't even call a non-Go library without switching to cgo, which contradictorily basically everyone says not to use.

Leaving aside the GC, until Go has a real FFI it's hard to to imagine it being a really great fit for systems programming when the systems are all not written in Go.

Re:Criticizing Hare language approach for generic data struc... by User23 on Wednesday May 04, 2022 @12:28PM (#31262669)
Go is not a traditional systems programming language and calling it one is misleading at best and maybe even borderline dishonest. Two big problems are the lack of control of memory layout and the lack of some form that compiles down to a computed goto. It’s just not possible to write performant systems code without those.

I’m not bashing Go though. I appreciate the focus on readability among other things. It’s a fine language for the use cases it was actually designed for, like pushing petabytes of ad data to serving clusters all around the world with acceptable latency and reliability.

Re:Criticizing Hare language approach for generic data struc... by pjmlp on Wednesday May 04, 2022 @03:25PM (#31264738)
https://www.withsecure.com/en/solutions/innovative-security-...

I guess the Genera, Xerox PARC, ETHZ, Microsoft folks are borderline dishonest.

Re:Criticizing Hare language approach for generic data struc... by User23 on Wednesday May 04, 2022 @10:28PM (#31268657)
I would say that they evidently felt the need to write a new compiler and runtime, which appears to be a species of agreement with my thesis.
Re:Criticizing Hare language approach for generic data struc... by pjmlp on Thursday May 05, 2022 @12:14AM (#31269379)
Apparently writing compilers isn't systems programming....
Re:Criticizing Hare language approach for generic data struc... by User23 on Thursday May 05, 2022 @02:37PM (#31276982)
In my prior comments above and in all the following I use "language" in the typical way, which is to say referring to not just the syntax but the semantics of the standard toolchain and runtime as well. I wanted to clarify that since perhaps there is some confusion there. So when I talk about Go I'm talking about what I get here[1] as is everyone else who isn't explicitly specifying some other implementation.

Writing compilers is not systems programming in the sense that it requires a systems programming language, no. One could easily write a C compiler in Ruby, but we don't consider Ruby to be a systems programming language.

Thus, obviously, Go, despite not being a systems programming language, could be used to write the compiler for a systems programming language. I guess that is what Tamago is? I'm not going to read through the source to find out and the web page you linked is boring marketing copy.

[1] https://go.dev/dl/

Re:Criticizing Hare language approach for generic data struc... by pjmlp on Friday May 06, 2022 @03:41AM (#31282445)
Go compiler toolchain is written in Go.

TamaGo is a bare metal runtime for unikernels, whose main use is a commercial product for secure USB keys, sold by F-Secure.

Back on my youth, writing compilers was considered systems programming, in parity with kernel drivers, how things change.

I guess writing userspace drivers in hybrid kernels is also not considered systems programming.

Re:Criticizing Hare language approach for generic data struc... by eatonphil on Wednesday May 04, 2022 @12:33PM (#31262738)
Yes I agree it's a nice language. But the FFI situation is mildly infuriating.
Re:Criticizing Hare language approach for generic data struc... by pjmlp on Thursday May 05, 2022 @03:41AM (#31270669)
You can use the same FFI as K&R C, write a couple of Assembly helpers.
Re:Criticizing Hare language approach for generic data struc... by eatonphil on Thursday May 05, 2022 @09:47AM (#31273277)
Any links to help me understand what you mean about the K&R C FFI? (Not easy to google for)

Possibly related, building against foreign objects and manually setting up the FFI call: https://words.filippo.io/rustgo/.

Re:Criticizing Hare language approach for generic data struc... by pjmlp on Thursday May 05, 2022 @10:28AM (#31273790)
Easy, K&R C was rather limited, inline Assembly wasn't yet a common extension, rather you would use the external assembler, and link both object files together.

What was good for C while it was gaining adoption, surely is good enough for Go.

Re:Criticizing Hare language approach for generic data struc... by eatonphil on Thursday May 05, 2022 @10:30AM (#31273822)
Gotcha, that is along the same lines as the link I shared.
Re:Criticizing Hare language approach for generic data struc... by pjmlp on Thursday May 05, 2022 @10:35AM (#31273890)
Re:Criticizing Hare language approach for generic data struc... by 3a2d29 on Wednesday May 04, 2022 @09:55AM (#31260451)
> “go but with ownership and borrow checker”

Wouldn’t this be just a lesser version of rust then? If someone makes a new language and wants it to catch on, it needs new ideas. Not just nice simple syntax mixed with something someone else is already doing.

Re:Criticizing Hare language approach for generic data struc... by lawl on Wednesday May 04, 2022 @10:05AM (#31260588)
> Wouldn’t this be just a lesser version of rust then?

That depends if you consider C++ an upgrade over C :)

Many flamewars have been had on this topic and i think it's just a matter of personal taste.

I'm firmly in the less is more camp.

Re:Criticizing Hare language approach for generic data struc... by avgcorrection on Thursday May 05, 2022 @06:06AM (#31271485)
Hilarious that you think that you could just add a borrowing mechanism + ownership and still be in the so-called less is more camp. That language would be looked down upon by the so-called less is more folks because of the “straightjacket” it would force on the programmer.
[dead]
Re:Criticizing Hare language approach for generic data struc... by capableweb on Wednesday May 04, 2022 @07:56AM (#31259255)
I have no fists in this fight, but wanted some clarification.

Are you saying the reason Rust is now being integrated into the Kernel instead of Golang is because of the success of evangelists, not because of the merit of the language itself?

I'm not involved in Kernel development myself, but if I was, I'd see your statement as a big hit in the face that we don't know what we're doing, if they (Kernel developers) are being sold to use Rust because of marketing, not because of the value of the language.

Re:Criticizing Hare language approach for generic data struc... by jlokier on Wednesday May 04, 2022 @07:01PM (#31266986)
I must admit, I am still surprised to see Rust gaining acceptance when the reasons Linus gave in 2010 for rejecting C++ in the kernel appear to apply to Rust equally well. I can't think of any of the pragmatic points which he raised which doesn't apply to Rust.

For example, the arguments against namespaces and function overloading, high context dependency, easy of understanding and in favour of C's simplicity in general.

My guess (it's just a guess) is that his position has shifted over time to consider a higher-abstraction, higher-complexity language, as development methods and the complexity and professionalising of the kernel have changed since then.

Re:Criticizing Hare language approach for generic data struc... by 0des on Wednesday May 04, 2022 @08:22AM (#31259458)
Its not existing kernel devs that suddenly switched to rust. It is the incoming cohort.
Re:Criticizing Hare language approach for generic data struc... by mplanchard on Wednesday May 04, 2022 @09:39AM (#31260213)
The main push for and patches to include rust in linux have come from an established and longtime kernel contributor. What you’re saying is categorically false.
Re:Criticizing Hare language approach for generic data struc... by capableweb on Wednesday May 04, 2022 @09:03AM (#31259809)
For someone to start using a new language in the Kernel, some of the existing "guard" has to approve it, meaning they've investigated if it's fit or not. Or can anyone willy-nilly contribute to the Kernel without anyone approving changes going into the main branch?
Re:Criticizing Hare language approach for generic data struc... by mplanchard on Wednesday May 04, 2022 @09:44AM (#31260279)
Miguel Ojeda is doing the lion’s share of the work here, and he is a kernel maintainer: https://ojeda.dev/

The person you’re replying to is either deeply misinformed or trolling

Re:Criticizing Hare language approach for generic data struc... by 0des on Wednesday May 04, 2022 @09:22AM (#31259999)
The existing guard doesnt have to prove anything, theyre on the way out. C is a tough language and not a lot of people have the patience for it, and even less people are being forced to learn it like the rest of us in school. As this segment of the community ages out, we arent going to see more code written in C, so we have the new group with Rust, recreating all of the same issues in effigy of C, but with better string handling. It's not like it is terrible code, but as Nikola Tesla used to say "it is what it is, and it aint what it aint".

You see how parties completely unrelated to the fight got Linus ousted? That was not based on technical merit, it was due to the changing tide regarding outcomes when people are offended/mistreated. Rust has significant overlap with the community that gave way to this, don't think it is 100% open arms and welcomes, because that is not the case.

Every day we stray further from God.

Re:Criticizing Hare language approach for generic data struc... by Alekhine on Wednesday May 04, 2022 @08:32PM (#31267827)
Damn right I don't have the patience for C. Writing anything in C properly takes a long time, and even then bugs are usually found after.

Compare and contrast Rust, where the code I write will usually just work. I don't need to be extra careful with it because the compiler is strict. You can say that this is indicative of some flaw in my character or whatever, but, uh, I don't care.

Re:Criticizing Hare language approach for generic data struc... by staticassertion on Wednesday May 04, 2022 @11:49AM (#31262141)
Cool, so everyone can just ignore you then, since this is entirely incorrect.
Re:Criticizing Hare language approach for generic data struc... by antonvs on Wednesday May 04, 2022 @08:08AM (#31259355)
My understanding is that Go has several features that make it unsuitable as a Linux kernel language, e.g. automatic garbage collection, its concurrency model, and possibly the nature of its runtime dependency (which is related to the previous two items.)
Re:Criticizing Hare language approach for generic data struc... by 0des on Wednesday May 04, 2022 @08:24AM (#31259476)
Garbage collection is not mandatory, and the concurrency model is often hailed as one of Gos best features.
Re:Criticizing Hare language approach for generic data struc... by tialaramex on Wednesday May 04, 2022 @08:37AM (#31259579)
A best feature it may well be, but it requires infrastructure and the OS kernel provides that infrastructure it doesn't depend on it.

Rust for Linux relies on the fact that Rust is deliberately structured in layers so that the bottom layer doesn't need that infrastructure, this was needed to make embedded Rust practical, but it's also important for Linux. Actually, Linux needs even more than Rust had initially, but that's driven further improvements to Rust itself.

You could add a layer to do all this lifting (that's what e.g. a Java OS does) but that's not going to fly in Linux, which is one reason why Go for Linux isn't a thing whereas Rust for Linux is.

Re:Criticizing Hare language approach for generic data struc... by forgotpwd16 on Wednesday May 04, 2022 @09:40AM (#31260233)
>Garbage collection is not mandatory

What does that mean? Isn't GC a fundamental part of Go?

Re:Criticizing Hare language approach for generic data struc... by thegeekpirate on Wednesday May 04, 2022 @12:14PM (#31262475)
I'd never use Go to write a kernel in, but you can disable the GC using `GOGC=off`.
Re:Criticizing Hare language approach for generic data struc... by ddevault on Wednesday May 04, 2022 @08:30AM (#31259530)
I like Go and I use it often. I also work on kernels. Go is not suitable for writing kernels.
Re:Criticizing Hare language approach for generic data struc... by 0des on Wednesday May 04, 2022 @09:23AM (#31260024)
Im choosing to imagine that you typed this with one hand behind your back with some fingers crossed Drew.