Live data from Hacker News

Yes-rs: A fast, memory-safe rewrite of the classic Unix yes command

github.com

161–170 of 170 posts

Re: Yes-rs: A fast, memory-safe rewrite of the classic Unix yes command

#162
post #2

Lines of Code yes (GNU) 50 Yes-rs 1,302 (26x more) The cost benefit analysis on this will be interesting given this is 26X more code to manage, and could also introduce a whole new toolchain to build base.

A few days ago I had the very foolish notion of trying to learn assembly for x64 Linux. It came out to 73 lines of code and weighs in at 288 bytes. It doesn't support the --help or --version arguments. https://gitlab.com/mcturra2000/cerbo/-/blob/master/x64-asm/0... Some people seem to revel in assembly, but I now know why C exists.

[deleted]

Re: Yes-rs: A fast, memory-safe rewrite of the classic Unix yes command

#166

Earlier quoted context omitted.

Actually a joke doesn't necessarily needs to be funny, and depending on the framing not even humor. Gregory Bateson's "A Theory of Play and Fantasy" (in Steps to an Ecology of Mind) (1972): Bateson argues that certain communicative acts signal themselves as "play" or "non-literal." A joke is such an act—structured and marked by "metacommunicative" cues, indicating that it should not be taken at face value. Regardless…

so bad joke then??? good joke must be funny

A joke should be funny.

Satire doesn't have to be funny; it just needs to make commentary through irony.

Re: Yes-rs: A fast, memory-safe rewrite of the classic Unix yes command

#167
post #2

Lines of Code yes (GNU) 50 Yes-rs 1,302 (26x more) The cost benefit analysis on this will be interesting given this is 26X more code to manage, and could also introduce a whole new toolchain to build base.

A few days ago I had the very foolish notion of trying to learn assembly for x64 Linux. It came out to 73 lines of code and weighs in at 288 bytes. It doesn't support the --help or --version arguments. https://gitlab.com/mcturra2000/cerbo/-/blob/master/x64-asm/0... Some people seem to revel in assembly, but I now know why C exists.

As an experiment I tried

yes | pv > /dev/null

and was getting about 5.4GiB/s

On the fasm code, I was getting a meagre 7.3MiB/s. Ouch! The non-assembly version is considerably faster. I wonder if it is because I make a syscall for every write I want to perform, whereas C uses buffering, or something.

Re: Yes-rs: A fast, memory-safe rewrite of the classic Unix yes command

#168

Nicely done but not enterprise ready if you ask me (which you did not but let's assume you did). Where is the 'y' factory factory factory method? Do you really think I can present this code as being ready for company-wide deployment (me and my virtual friends) without the solid foundation of all 26 design patterns clearly being implemented? Where is the code diversity statement, where is the code code of code coding…

This is rust, not Java.

And? Just because you're using a rusty language does not mean you can produce sloppy code. Those design patterns were designed by design experts to expertly design expert designs, using code factory factories factoring in factors your newly hired team has not factored in. That is time tested battle ready insert-rocket-emoji wisdom which you better use if you want to survive the next right-sizing after the next code spurt.

Re: Yes-rs: A fast, memory-safe rewrite of the classic Unix yes command

#169

Earlier quoted context omitted.

So basically they also introduced the complexity of respecting --help and --version.

They did, because it is written somewhere that all GNU programs must conform to having --help and --version. I forgot where I read it.

The GNU Coding Standard: https://www.gnu.org/prep/standards/standards.html#Command_00...

Re: Yes-rs: A fast, memory-safe rewrite of the classic Unix yes command

#170

Nicely done but not enterprise ready if you ask me (which you did not but let's assume you did). Where is the 'y' factory factory factory method? Do you really think I can present this code as being ready for company-wide deployment (me and my virtual friends) without the solid foundation of all 26 design patterns clearly being implemented? Where is the code diversity statement, where is the code code of code coding…

Exactly this. For a genuinely web-scale implementation, these days in an enterprise context you really need to be thinking about a “yes” microservice that can be run in an autoscaling kubernetes framework. Doesn’t need to be fancy just a couple of helm charts and a security sidecar with ingress and egress filtering, a rate limiting API gateway and a logging component of course. And metrics. Put it behind an applicati…

yes-as-a-service might be a compliance liability due to popularity with authoritarian leaders.
Post reply on HN