Seriously! According to the time command in fish, cldr (my program) takes around 4-5 ms to print files, tldr takes 80-100ms. (PS, on my server, cldr actually takes less than 1 ms to fetch the file, while tldr takes closer to 150 ms. That's 150 times faster!!!)

This started a couple days ago when a friend of mine alerted me to the fact that the official tldr repo now takes ai contributions for their pages (aka the cheat sheet files that are printed) and for the actual program code. She then showed me a repo called ethical-tldr which does not allow for the use of ai contributions in the pages or program code.

However, their even though their client doesn't allow vibe coding, it is still written in Python, which itself takes ai contributions.

So, I decided to learn C from scratch and make my own tldr client that's faster and better than theirs in *every way! Introducing cldr! I am especially proud of the list and search functionality because the interface is just gorgeous.

Note, ABSOLUTELY NO AI was used in the making of this, I learned and wrote everything on my own in just the past 3 days, I don't think I even copied much or any code from websites.

*There's still like two things I haven't implemented that the official client does, but they're very minor and I'd be willing to bet that 99% of you won't know the difference.

image

image

top 50 comments

sorted by: hot top controversial new old
[–] 75 points 5 days ago (4 children)

What your project desperately needs is a description of what it does. I had to follow the links to ethical-tldr back to the original tldr to see what it's supposed to do.

  • source
  • hideshow 4 child comments
  • load more comments (2 replies)
    [–] 51 points 5 days ago

    This is an instance of that recurring trope of coding something better out of pure spite

  • source
  • [–] 31 points 5 days ago (11 children)

    So, I decided to learn C from scratch
    ...
    on my own in just the past 3 days

    Really impressive, great job! What resources did you use for learning?

  • source
  • hideshow 11 child comments
  • [–] [S] 23 points 5 days ago (10 children)

    Mostly just w3. Occasionally I had to look up some stuff for more “niche” use cases, but for the most part I just learned from w3.

    I already have experience with programming in general, so the hardest part was learning the syntax, and strings… oh god strings are so bad in C, I had to make a new function called strfmt that works like printf but just for returning a formatted string.

  • source
  • parent
  • hideshow 10 child comments
  • [–] 3 points 5 days ago (6 children)
  • [–] 5 points 5 days ago (5 children)

    Those are method names in C, so I’m afraid you’ll have to take it up with a guy named Dennis who isn’t very talkative these days.

  • source
  • parent
  • hideshow 5 child comments
  • [–] 4 points 5 days ago (4 children)

    Not sure what you mean. You said that you had to make a new function and decided to call it "strfrm". The standard is actually the opposite afaik. You should be more verbose and not use contractions. Something like "string_format" is far easier to read.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 3 points 5 days ago (3 children)

    Ah I didn’t see OP’s strfmt you’re right I’m wrong

  • source
  • parent
  • hideshow 3 child comments
  • [–] 3 points 5 days ago (2 children)

    And I didn't notice that you weren't OP. I guess we're even? Haha

  • source
  • parent
  • hideshow 2 child comments
  • [–] 16 points 5 days ago* (last edited 5 days ago) (5 children)

    This looks like a colossally bad idea:

      if (!strcmp(platform, "windows") && !isSpecificPlatform) {
        debugLog("Falling back to rm -rf", 2);
        debugLog(strfmt("rm -rf exited with code %d",system(strfmt("rm -rf %s", path))), 3);
      }
    

    In addition,

    However, their even though their client doesn’t allow vibe coding, it is still written in Python, which itself takes ai contributions.

    Per the Makefile, this project is built using GCC. GCC itself accepts AI contributions, provided that the code is "legally insignificant" (meaning less than around 15 lines of code) or is part of test cases: https://gcc.gnu.org/ai-policy.html

  • source
  • hideshow 5 child comments
  • load more comments (5 replies)
    [–] 18 points 5 days ago
    [–] 19 points 5 days ago
    [–] 25 points 5 days ago (14 children)

    So... C code is faster than python. We knew that. Thanks for the better performing rewrite. Now do it in rust 🤓

  • source
  • hideshow 14 child comments
  • [–] 27 points 5 days ago (5 children)
  • [–] 27 points 5 days ago (3 children)
  • [–] 20 points 5 days ago (2 children)

    In all distros I've recently used this is what gets installed when you install the "tldr" package with the package manager. And for good reason.

  • source
  • parent
  • hideshow 2 child comments
  • load more comments (1 reply)
  • load more comments (6 replies)
    [–] 21 points 5 days ago (3 children)

    Consider using a different name for the project if you care for searchability. There's already Unicode CLDR Project.

  • source
  • hideshow 3 child comments
  • [–] [S] 11 points 5 days ago (2 children)

    damn! I guess I should have looked it up before going with the name. I just liked the play on tldr, cldr.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 20 points 5 days ago (3 children)

    You might want to have a glance at the OpenSSF compiler hardening guide, and maybe try out ASAN (-fsanitize=address).

    E.g. I get

    [nobody@bb14e99a9c8e cldr]$ ./build/cldr --update --language C.
    caution: filename not matched:  ethical-tldr/pages.C./*/*.md
    
    =================================================================
    ==454==ERROR: LeakSanitizer: detected memory leaks
    
    Direct leak of 4 byte(s) in 1 object(s) allocated from:
        #0 0x7fa48a32c0c1 in malloc (/usr/lib/libasan.so.8+0x12c0c1) (BuildId: b8a4241051a1621937fdc46e867ba7ecb56d96ea)
        #1 0x7fa489e8be0f  (/usr/lib/libc.so.6+0x8be0f) (BuildId: 503200d7fda94a5dc6058d7e0694e5d1dcb2e372)
        #2 0x7fa48a2f2761 in vasprintf (/usr/lib/libasan.so.8+0xf2761) (BuildId: b8a4241051a1621937fdc46e867ba7ecb56d96ea)
        #3 0x561d84213d8c in strfmt (/home/nobody/cldr/build/cldr+0x6d8c) (BuildId: 2a0f13efc2c9b12a67e7dd810a2cbdfd1866e53d)
    
    SUMMARY: AddressSanitizer: 4 byte(s) leaked in 1 allocation(s).
    
  • source
  • hideshow 3 child comments
  • [–] [S] 18 points 5 days ago*

    Ah damn! That's one of the things I had told myself I needed to make sure I checked, but I forgot! Thanks! I'll look into this tomorrow. Like I said, I literally learned C over the last 3 days to make this, so I'm always happy to learn more!

  • source
  • parent
  • [–] 9 points 4 days ago (1 child)

    I'm not sure why you did this when Tealdeer exists and has for years? https://github.com/tealdeer-rs/tealdeer

  • source
  • hideshow 1 child comment
  • [–] [S] 10 points 4 days ago

    My reasoning is simple: I had never heard of it.

    But also, this is an incredibly simple program and a really good way to help me learn C. Additionally, it seems like tealdeer accepts ai generated submissions, though generally discourages it. I aim to make my project as free of ai as I possibly can.

  • source
  • parent
  • [–] 6 points 5 days ago* (last edited 5 days ago) (4 children)

    I wish people still had shame.

    Python isn't for command line utilities that you intend to distribute to others. It's for personal one-off scripts.

    I mean, FFS, if you're gonna vibecode something, why not pick a fast language? The fact that they can't even tell the LLM to use the right technology shows that they are a complete imbecile

  • source
  • hideshow 4 child comments
  • load more comments (1 reply)
    [–] 6 points 5 days ago* (3 children)

    Dependancies

    [Optional] wget can be installed for less reliance on other projects using ai, if wget is not found, curl will be used instead

    1. Small typo: dependencies.
    2. Is curl using AI in its code now?

    Thanks for your work!

  • source
  • hideshow 3 child comments
  • [–] 3 points 5 days ago (1 child)

    Oh yeah this is bound to be maintained

  • source
  • hideshow 1 child comment
  • load more comments
    view more: next ›