Readit News logoReadit News
atilaneves commented on If you're going to vibe code, why not do it in C?   stephenramsay.net/posts/v... · Posted by u/sramsay
ModernMech · 10 days ago
It is still possible to write bugs in both Haskell and Rust.
atilaneves · 9 days ago
Yes, that's my point. I'm replying to claims that "if it compiles it probably works". My limited experience with both is "nah".
atilaneves commented on If you're going to vibe code, why not do it in C?   stephenramsay.net/posts/v... · Posted by u/sramsay
tome · 10 days ago
How did your tests pass if you didn't handle state?
atilaneves · 9 days ago
Because it is also possible to write tests that don't adequately capture real-life requirements.

It was an MQTT server, and the tests basically went "if we have these subscriptions, then...", but no subscriptions ever got actually stored by the server.

atilaneves commented on If you're going to vibe code, why not do it in C?   stephenramsay.net/posts/v... · Posted by u/sramsay
IshKebab · 11 days ago
> Rust doesn't prevent programs from having logic errors.

Nobody ever claimed that. The claims are:

1. Rust drastically reduces the chance of memory errors. (Or eliminates them if you avoid unsafe code.)

2. Rust reduces the chance of other logic errors.

Rust doesn't have to eliminate logic errors to be a better choice than C or assembly. Significantly reducing their likelihood is enough.

atilaneves · 10 days ago
Every language with a GC drastically reduces the chance of memory errors.
atilaneves commented on If you're going to vibe code, why not do it in C?   stephenramsay.net/posts/v... · Posted by u/sramsay
ModernMech · 11 days ago
Rust does not have manual memory management, and its type system also has the property that if your program compiles it probably works, IME.
atilaneves · 10 days ago
I hear this about both Haskell and Rust, and yet, when I tried both in the former I wrote a useless program because I didn't handle state (and yet passed all tests!) while in the latter I immediately wrote a deadlock.

So...yeah.

atilaneves commented on If you're going to vibe code, why not do it in C?   stephenramsay.net/posts/v... · Posted by u/sramsay
atilaneves · 10 days ago
I made the same comment last week upon learning of a redis clone entirely vibe coded in IIRC ~70k lines of Rust. Why Rust? Why does a computer need a memory safe language?
atilaneves commented on Pnut: A C to POSIX shell compiler you can trust   pnut.sh... · Posted by u/feeley
atilaneves · a year ago
I'm still figuring out why anyone would want to write a shell script in C. That sounds like torture to me.
atilaneves commented on Representing State as Interfaces in Go   emoses.org/posts/resolver... · Posted by u/todsacerdoti
tonyhb · 2 years ago
This seems similar to replicating substructural type systems like linear or affine types via interfaces.

I can't remember who gave this talk, but a prime example is a `File` type. A `File` type shouldn't have a Read() method until the file itself has opened. And calling `Close()` on the File should prevent further reads. Substructural typing - and this pattern - allows you to refine types based off of the type's instance state.

There's a ton possible here but I haven't really kept up to date with type systems in the last 5 years. Stuff like this has probably advanced a ton!

atilaneves · 2 years ago
Wouldn't the instance state here be "was constructed"? That is: you should always be able to call `Read` because the constructor opened the file, and you shouldn't have to call `Close` anyway because the destructor did.
atilaneves commented on OpenD, a D language fork that is open to your contributions   dpldocs.info/this-week-in... · Posted by u/mepian
bachmeier · 2 years ago
It's worth pointing out that Walter is one of two co-maintainers of the language. The other has not said anything at all. On the other hand, I'm not sure what there is to say if they're not going to make any changes in the process.

I'm far more concerned about community development of libraries, IDE support, and the beginner experience (especially on Windows) than I am about changes to the language, which is already pretty good. As a Linux user working on top of C libraries, the experience is incredible. That's not the case for everyone.

atilaneves · 2 years ago
I just posted on the forum about it, I didn't do it before because of surgery (I'm still nowhere near 100%).

What changes would you like to see happen?

atilaneves commented on C uses "&" for the address-operator because 'ampersand sounds like "address"'   softwareengineering.stack... · Posted by u/pkapka
masklinn · 2 years ago
> Otherwise "(*x).y" would have been needed, instead of "x->y". With a postfix "*", that would have been "x*.y", and "->", would not have been needed.

I mean technically the compiler could just have been less stupid and made `.` auto-deref, it’s not like C has operator overloading so the LHS is either a struct or a pointer, not both.

atilaneves · 2 years ago
Proof of the fact that this works is that D does exactly this.

u/atilaneves

KarmaCake day678December 5, 2013View Original