Re:Using Rust at a Startup: A Cautionary Tale
by Casperin on Wednesday November 23, 2022 @10:21AM
(#33720258)
You can? Imperative, strong type system (no null, adts), reasonably fast, compiles to a single binary. I'm genuinely interested.
[ Parent
| on HN ]
Re:Using Rust at a Startup: A Cautionary Tale
by 3a2d29 on Wednesday November 23, 2022 @12:30PM
(#33722073)
Go fits all of those, so does Ada.
Re:Using Rust at a Startup: A Cautionary Tale
by mtelgon on Wednesday November 23, 2022 @01:07PM
(#33722515)
go doesn't have null safety or adts though? (sum types)
Re:Using Rust at a Startup: A Cautionary Tale
by 3a2d29 on Wednesday November 23, 2022 @01:33PM
(#33722866)
I think you can have null safety in Go and you certainly can have adts.
But even then, what about Ada?
I’m also not an expert, but I assume between C#/Typescript/haskell/swift that you can find all those things in many GC/safer languages.
Re:Using Rust at a Startup: A Cautionary Tale
by kinjba11 on Wednesday November 23, 2022 @04:01PM
(#33724465)
Go does not have compile-time null safety or sum types :)
foo := Foo{"hello"}
fooPointer := &foo
fooPointer = nil
fmt.Println(fooPointer.Bar)
> panic: runtime error: invalid memory address or nil pointer dereference
In a language like Kotlin a compile time error would prevent `fooPointer.Bar`, and in Rust `nil` does not exist. Go also does not have sum types, see for instance https://making.pusher.com/alternatives-to-sum-types-in-go/
Re:Using Rust at a Startup: A Cautionary Tale
by Casperin on Wednesday November 23, 2022 @08:12PM
(#33726690)
Yes, Ada. Maybe. I will have to look at it.
The rest all are missing basic things. Like, I love TS, but it's absolutely bonkers because js is js. I once worked on a 250k loc project of js/ts, and we had nothing but trouble
Re:Using Rust at a Startup: A Cautionary Tale
by Casperin on Wednesday November 23, 2022 @07:08PM
(#33726202)
I've used Go for almost two years on a side project and its type system is exactly why I'm doing Rust now. In my book, it is not okay that I add a new field to a struct and then nothing happens. No compile warnings, nothing. It's just assumed that I then wanted the zeroth value whenever it's created. ... And no adts. You just can't make something as simple as
enum Foo {
Bar(String),
Baz(i32),
}
Why? It's such a fundamental thing to be able to say "this piece of data is either this or that.. and then have the compiler tell you if you missed a case.Ada is on my list of languages to look at. I'm cautiously optimistic about that one. But would you pick that over Rust as the simpler alternative? "Look guys! We're not moving fast enough with Rust because nobody seems to be proficient in it. Let's go with Ada instead!" .. I jest, but I will check it out and I really hope it hits the sweet spot for me
Re:Using Rust at a Startup: A Cautionary Tale
by bpicolo on Wednesday November 23, 2022 @05:51PM
(#33725533)
Kotlin has null safety, and there are plenty of ways to turn jvm into a binary
Re:Using Rust at a Startup: A Cautionary Tale
by Casperin on Wednesday November 23, 2022 @07:22PM
(#33726302)
It has no adts at all. Like I'm reading blog posts right now about how to do what should be the simplest thing
enum Foo {
A(String),
B(i32),
}
And it's.. not simple. And even if you manage to do it, it'll never be how Kotlin was meant to be written.