News for hackers. Stuff that matters.
Re:Destroying C with 20 lines of Haskell: wc by 0xd34df00d on Tuesday February 04, 2020 @12:50PM (#22238616)
This is a great point about handling printable vs non-printable characters that I originally missed when I read wc code. Thank you for pointing this out!
Re:Destroying C with 20 lines of Haskell: wc by eesmith on Tuesday February 04, 2020 @01:30PM (#22239144)
Could you elaborate on how you read the wc code?

I ask because the essay and your comments until now show no insight from reading the code.

I find it difficult to understand how anyone could miss that (rather significant) part of the core algorithm, and then assert the differences are due to only "modulo intended Unicode space handling" and the like.

Until now I had assumed you had a lay understanding of wc, and had not read the code.

Re:Destroying C with 20 lines of Haskell: wc by 0xd34df00d on Tuesday February 04, 2020 @01:57PM (#22239533)
I was mostly curious about how wc handles spaces and whether ignoring non-ascii spaces brings me closer or farther from what wc does. So I focused on that, and this specific printable characters handling didn't caught my eye.

On a meta level, I wasn't even considering that the notion of a word might be different from "a sequence of characters that aren't space characters".

Live and learn indeed.

Re:Destroying C with 20 lines of Haskell: wc by eesmith on Tuesday February 04, 2020 @02:37PM (#22239999)
Thank you for the clarification.