Live data from Hacker News

Making C++ safe without borrow checking, reference counting, or tracing GC

verdagon.dev

221–226 of 226 posts

Re: Making C++ safe without borrow checking, reference counting, or tracing GC

#221
post #111

Earlier quoted context omitted.

Sure but you're missing the > so long as you are diligent about checking invariants part. Could you go through and check all the parts of a huge C++ codebase to make sure invariants are held as opposed to a few hundred lines of unsafe Rust code?

Sure, but I think the point here is the degree. Presumably if it takes a lot of unsafe rust lines to build something, it won’t matter if it’s 30% safe or whatever. I just see the point of “unsafe is fine” a lot when the whole point of rust is that memory safety issues are never worth the cost.

It almost never takes a lot of unsafe to build something. Even the redox OS kernel is only like 10% unsafe.

Re: Making C++ safe without borrow checking, reference counting, or tracing GC

#222
> Stack objects are safe too

"I'd like to have the same drink this gentlemen has."

Of course stack objects are only fast (that'd why rust likes them) but entirely unsafe. You cannot return them, you cannot reference them from outside, and you cannot have too many or too big of them.

Re: Making C++ safe without borrow checking, reference counting, or tracing GC

#223
I use tools like Valgrind/Helgrind etc. to ensure that million+ line C++ code used in production by large international corporations has zero memory leaks, no buffer overruns etc. It’s easy. It works. No need to rewrite in any other language.

Re: Making C++ safe without borrow checking, reference counting, or tracing GC

#224

I read the note 9 easter egg! Hope someone believe me.

I had it too today. I saved the page in my bookmarks a few days ago, looked at it this evening. I suspect it is visible to anyone, and the joke is to have you make a comment on HN ;) XD. I checked IWA: It is visible here: https://web.archive.org/web/20230629052606/https://verdagon.... but not on the first snapshot here: https://web.archive.org/web/20230622185954/https://verdagon....

Re: Making C++ safe without borrow checking, reference counting, or tracing GC

#225

I read the note 9 easter egg! Hope someone believe me.

I had it too today. I saved the page in my bookmarks a few days ago, looked at it this evening. I suspect it is visible to anyone, and the joke is to have you make a comment on HN ;) XD. I checked IWA: It is visible here: https://web.archive.org/web/20230629052606/https://verdagon.... but not on the first snapshot here: https://web.archive.org/web/20230622185954/https://verdagon....

Yep not even a random display in JS. I looked at the source code of the webpage. There is nothing curious. Custom JS is here: https://verdagon.dev/components/annotated.js and does only trivial things. Not a real easter egg for the client part. Maybe the easter egg is in server part that sends the HTML with or without it depending on hour or something. No need to waste more time on it, there is no funny code behind :)

Re: Making C++ safe without borrow checking, reference counting, or tracing GC

#226

Earlier quoted context omitted.

I really love parts of rust and kinda hate other parts. but this is what really ruins it for me. I want to play. I want to knock something together and work with it and see what kind of shape it is. rust demands that I cross every last t before I can run it at all. which is great if you already have a crystal notion of what you are building

This is definitely true, but I also don't know what a reasonable alternative is at this point for systems dev (aka places where a GC is a Bad Idea). I wouldn't unleash C or C++ onto a new project like that? I'd just feel icky. And Zig's type system IMHO isn't good enough, I'd really miss pattern matching for one. I do think many people are using Rust in the Wrong Places(tm). It seems like torture to me to be applying…

Async is badly needed in systems programming, more so than at the application level: handling events in embedded/low level components is incredibly tedious without it.
Post reply on HN