HNHacker News
TopNewBestAskShowJobs

3a2d29

633 karma · joined December 11, 2021

submissionscomments
3a2d29··on Porting 58k lines of D and C++ to Jai
Right that makes sense.

I’m curious if the gaming industry will switch languages, it feels like with the current game engines that it’s heavily entrenched in C and C++. Feels like something like Carbon has the best chance to break in.

3a2d29··on Porting 58k lines of D and C++ to Jai
It’s hard to find any material on Jai.

It seems to be a “better C”.

Isn’t that what D / Zig try to do? What’s the advantage?

3a2d29··on Using Rust at a startup: A cautionary tale
Go fits all of those, so does Ada.
3a2d29··on Using Rust at a startup: A cautionary tale
1. No citation needed. I can take rust and do unsafe things in it. I can’t in a GC language. Rust allows you to use unsafe.

2. No. It is not at the expense of safety. Again, Rust allows you to do unsafe things using the “unsafe” keyword. GC languages simply will not allow it.

3. Strong reference counting memory leaks is not easy to track down. Many embedded systems have been taken down by them.

3a2d29··on Using Rust at a startup: A cautionary tale
Fair, but again I think you can get all those things with a GC language.

Speed is the only one you may possibly not, but I think speed is an non-issue. Speed in programming never matters except in the systems space. No one is gonna be able to tell Rust vs Go in a web API and depending on how you do the benchmark, I think many GC languages can probably tie Rust.

3a2d29··on Using Rust at a startup: A cautionary tale
Right but my main point is this:

Rust comes with additional risk. It is easier to leak memory, it is easier to be unsafe (especially since you can't guarantee what future other devs will do), but you gain nothing.

You get all that risk, but fearless concurrency can be done in GC languages (like Elixir) and many people have created the Result type before. So you have added risk for no benefit. Not to mention its easier to hire devs (and train devs) for other GC languages cause not everyone knows or understands the borrow checker.

Is there any advantage?

3a2d29··on Using Rust at a startup: A cautionary tale
> borrow checker ensures that I don't leak memory when not using unsafe

Also to point out, you can 100% leak memory in safe rust

3a2d29··on Using Rust at a startup: A cautionary tale
I feel like the err != nil issue combines with GO using initialization to 0 values to be annoying.

If you forget err != nil, well your value does actually have a value and you would think your result was 0.

3a2d29··on Using Rust at a startup: A cautionary tale
What would you say to a C++ dev refusing to use rust because their code is memory safe and they have never had a memory safety issue?

"Can" is the whole thing. A rust dev risking can is like a C++ dev risking can.

I like rust and do what you want in personal projects, but introducing it to a GC space when there are langauges that "can't" be unsafe is irresponsible when a GC language can offer all the upside of rust.

GCs prevent memory leaks, which safe rust can do. So even if you somehow make sure no unsafe is ever used, you can still introduce a hard to debug issue just because you want to use rust.

3a2d29··on Using Rust at a startup: A cautionary tale
You can find a GC language that does all those things that rust does but without:

1. The risk of future unsafety (a GC language will always safer than rust)

2. Faster development that's easier to change on a dime.

3. No risk of memory leaks (which can happen in safe rust)

3a2d29··on Using Rust at a startup: A cautionary tale
> Easy test: Would you at least seriously consider using C/C++ for it? Only then should you use Rust.

This is a great point. I understand liking a language, but don't bring Rust into a GC space (in industry, personal projects can be what you like!) You can find a GC language with all the features of rust you like.

3a2d29··on Using Rust at a startup: A cautionary tale
I will die on the hill that Exceptions are absolutely terrible for readability and control flow and should die.

Result<> or Go returning many values is wayyyy better.

3a2d29··on Using Rust at a startup: A cautionary tale
I would say that using Rust for backend APIs seems a bit off. I like Rust, but introducing languages that can be made unsafe / can at a minimum memory leak seems irresponsible.

Its dumb when the C++ community refuses rust when it guarantees memory safety, so why would you bring in a language you prefer to an area that doesn't need it if it introduces that issue?

If you like Result<> or concurrency, use a GC language with those things. Go may not have them, but your choice isn't just Go.

3a2d29··on Introduction to Embedded Systems Programming (Ada)
Also I think Ada is more memory safe than both C++ and rust! (with SPARK!)
3a2d29··on Show HN: Buzz, strongly typed scripting language written in Zig
You could argue that hiding ints and floats behind “num” is implicit conversion
3a2d29··on Show HN: Buzz, strongly typed scripting language written in Zig
Reading this comment, I realized I always thought:

Scripting == interpreted

Is that not the case?

3a2d29··on You can fire 80% of software engineers and the company will survive
I mean you can certainly fire 80% of engineers and the software still runs.

Most workers if you fire 80%, there is an immediate drop in production.

I think the loss of engineers is felt on a more long-term basis.

3a2d29··on $477M FTX ‘hack’ was a Bahamian government asset seizure
Relevant comic: https://xkcd.com/538/
3a2d29··on Ask HN: What is the future of Swift on the server-side?
https://www.infoq.com/news/2021/11/rudra-rust-safety/

Over 200 memory safety issues were found in public crates in rust.

If code reviews were all it took to ensure memory safety, then we wouldn’t need the borrow checker in the first place.

3a2d29··on Ask HN: What is the future of Swift on the server-side?
Swift is also more memory safe than rust, which I imagine is another big reason to use it.
3a2d29··on Ask HN: What is the future of Swift on the server-side?
> performant, statically-typed, systems programming language

And then OP lists only C++ and Rust. Both known well for having no garbage collector. I think my comment is still valid.

3a2d29··on Ask HN: What is the future of Swift on the server-side?
Of those languages, only Go could be argued to be “systems” and even then not if the GC is a deal breaker.

OP wants a systems language.

3a2d29··on Mass of transactions leaving crypto.com wallets
I think you underestimate how attractive “get rich quick” schemes are, especially to new generations that didn’t experience the fad yet.
3a2d29··on NSA urges orgs to use memory-safe programming languages
I am not saying rust is unfit and I think your first sentence gets to sorta my point.

I agree no one writes actual kernels in GC languages. 100% Rust is the best choice where GCs can’t be.

I think my argument is that if you can use a GC, I think it’s considered best practice to use a GC. If you need thread safety, use a GC language like Elixir that handles concurrency well.

Like there’s no reason to act like Java community and try to force rust into every area. It’s very good at what it does, let it stay there.

3a2d29··on NSA urges orgs to use memory-safe programming languages
I don’t think Carbon will have a borrow checker. I am under the impression it’s just checking array bounds and adding nicer syntax
3a2d29··on NSA urges orgs to use memory-safe programming languages
It’s just a weird argument to hear someone argue “does GC buy you enough to balance out the complexity…”

Isn’t the whole argument rust vs C++ that rust gives you memory safety even though it’s more complex?

Like if you can tolerate memory issues all of the sudden to avoid complexity then there was no argument against C++ in the first place.

3a2d29··on NSA urges orgs to use memory-safe programming languages
I don’t think so, but I can’t find the answer. Either way, rust 100% does that.

Way easier in C# to avoid that issue. Just don’t use reference counters and use GC.

No way to avoid that in Rust. If you need many references, you must use ARC.

3a2d29··on NSA urges orgs to use memory-safe programming languages
Memory leaks are not memory safety.

Memory leaks in all languages are safe, they just slow performance and cause crashes.

Rust still memory leaks.

3a2d29··on NSA urges orgs to use memory-safe programming languages
It’s a lot harder to memory leak in Go and Java than rust.

Just like it’s harder to have a memory safety issue in rust than C++.

if you are worried about data races, use a language like elixir that’s more safe than rust and is great for concurrency.

If you are a rust dev that forces your language into areas where a GC would suffice, than you are just like C++ devs who refuse to use rust for memory safety.

You are introducing memory issues just cause you don’t want to use a better tool.

3a2d29··on NSA urges orgs to use memory-safe programming languages
“But they don’t use it as much” is not an argument?

It’s the whole case for Rust > modern C++ based on that?

Rust can have memory issues, but “it doesn’t use unsafe as much” as modern C++. Forbidding unsafe code doesn’t guarantee vulnerabilities are gone.

why is it that when talking about C++ memory safety, even a bit more is worth everything, but when talking about rust vs python, suddenly it doesn’t matter if it’s less.

← PreviousPage 2 of 7Next →