Hacker Newsnew | past | comments | ask | show | jobs | submit | up2isomorphism's commentslogin

I am always skeptical about making anything useful "free". Because unless there is no cost associated with that, "free" is a fake term, which only means someone else absorbs the cost. There are cases which makes sense, but not sure "civic tech" is one of them.

Another dev who doesn’t show respect to what has been done and expect a particular language will do wonders for him. Also I don’t see this is much better in term of readability.

Where do you see the lack of respect? The author wanted to learn how gzip works and chose to implement it in a language they like to do so. As a learning tool, not because the world needs another gzip decompressor.

Chose to paste the C into an LLM and said 'make it rust'?

What is your source for that accusation?

Original zlib code: https://github.com/madler/zlib/blob/develop/contrib/puff/puf...

The code of the article: https://github.com/ieviev/mini-gzip/blob/main/src/main.rs

Top level declarations of the C code:

    #define MAXBITS 15   
    #define MAXLCODES 286
    #define MAXDCODES 30
    #define MAXCODES
    #define FIXLCODES 288

    struct state

    local int bits(struct state *s, int need)
    local int stored(struct state *s)

    struct huffman

    local int decode(...)
    local int construct(...)
    local int codes(...)

    local int fixed(...)
    local int dynamic(...)
    int puff(...)
Top level declarations of the Rust code:

    const MAXBITS: usize = 15;
    const MAXLCODES: usize = 286;
    const MAXDCODES: usize = 30;
    const FIXLCODES: usize = 288;
    const MAXDIST: usize = 32768;
    struct State<'a> 
    struct Huffman<'a>

    fn decode
    fn construct
    fn codes
    fn fixed
    fn dynamic
    fn stored
    pub fn inflate

..that doesn't proves anything.

it's just convenient configuration macros and generic procedures names being reused to implement the steps for the DEFLATE algorithm.

There are only finites ways for you to express a piece of code in a language.


he does mention https://github.com/trifectatechfoundation/zlib-rs not just https://github.com/madler/zlib, but it would be interesting to hear from those developers also

Yeah, just because you can grab from your refrigerator a piece of raw meat and put it in a cup of milk in 10 secs and it tastes bad doesn’t mean the refrigerator should be blamed because of this.

Yeah, but if the refrigerator is built in a way that makes it very easy to grab some refrigerant when you want to pour yourself a glass of milk (to the point that one has to be careful and skilled to safely drink milk), maybe we should get a new refrigerator.

Go Generic? It sucks.

Why would someone want to learn Unix Programming using OCAML? Not a smart choice. Also this does not look easier to read than a shell script either.

let rec copy_rec source dest = let infos = lstat source in match infos.st_kind with | S_REG -> file_copy source dest; set_infos dest infos | S_LNK -> let link = readlink source in symlink link dest | S_DIR -> mkdir dest 0o200; Misc.iter_dir (fun file -> if file <> Filename.current_dir_name && file <> Filename.parent_dir_name then copy_rec (Filename.concat source file) (Filename.concat dest file)) source; set_infos dest infos | _ -> prerr_endline ("Can't cope with special file " ^ source)


OCaml is a weird teaching choice for broad Unix programming, but it makes more sense than bash once the code stops being toy-sized and starts touching files, processes, and error paths in more than one place. Shell scripts let typos turn into state changes, and C gives you the usual memory footguns.

That snippet is ugly. Cleaner OCaml is easier to maintain than the average bash blob if you care more about finding mistakes before prod than saving ten minutes on ML syntax.


IMHO modern C (with modern tooling) is very reasonable.

Even agree with most of the stuff he said, however in real life, you won't be able to win a fight using these arguments. You can only create a environment to execute these strategies first to get a good product and them use them as a propaganda afterwards.

US economy data is not even WORM data anymore, lol. Let alone to be accurate.


Are you talking about the data revisions organization publish or is the data really changing silently between views?


Even GPL never seems to be great idea to me. But at least it considers a core problem of any knowledge sharing seriously. Can you just steal other people’s work? I would rather trust GPL folks than this guy.


I think it is literally easier for Anthropic to make a fivetran in stead.


Yeah, “rewrite in rust” strikes again, this time equipped with a AI slop generator.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: