• MeanEYE@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    8 months ago

    Just use brainfuck for everything. The entry barrier for the programming industry needs to be higher anyway.

  • C is okay with good tooling. I wish it was possible to mix C and Rust code in the same project. I could be wrong but last I looked C code will have to sit outside in a library or something and called externally from Rust.

  • slembcke@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    8 months ago

    I enjoy the selection bias in the comments for these sorts of posts. >_< There’s a few people saying “I kinda like C”, a few saying “use Python instead”, and a whole lot saying “Rust is my lord and savior”. Completely disjoint from the real world usage of the languages for whatever practical, pragmatic, or ideological measures they are used for.

    • hangukdise@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      8 months ago

      This is why the post and the thread are so funny (assuming people are being intentionally funny)

    • Jordan_U@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      8 months ago

      Leaks aren’t usually security critical though, and I’ve never heard of sudo triggering the OOM killer.

      Also, no general purpose language that I’m aware of can guarantee a lack of memory leaks.

      • kevincox@lemmy.ml
        link
        fedilink
        arrow-up
        0
        ·
        8 months ago

        Especially since sudo is generally quite short lived. Unless it is leaking a significant amount of memory waiting for authentication that never comes it is insignificant. It would actually be pretty easy to argue that sudo just shouldn’t free memory at all. This would be better for security (all pointers live forever) and possibly faster as upon exec the kernel can just wipe all state rather than having free carefully account for the releases.

  • RubberElectrons@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    8 months ago

    I really like C because I can just get to the heart of an action and make it happen without much surrounding code.

    I could make classes and blah blah blah if I want to make a large, complex program but I’d rather write several small, simple to grok programs which pass information around so each program can do its one simple thing, quickly and easily. Chain the small programs together with bash or something, and bingo, you’ve got a modular high speed system.

    I’m not a programmer, actually a mechanical engineer. But the Unix philosophy of simple, modular tools is great, provided one properly checks and sanitizes inputs.

  • IndiBrony@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    8 months ago

    Fools haven’t even written it well! Translated:

    STOP WRITING

    • MEMORY WAS NEVER SUPPOSED TO BE AESSED DIRETLY

    • YEARS OF PROGRAMMING yet STILL ODE IS STILL WRITTEN with memory vulnerabilities

    • Wanted to aess memory diretly anyway? We had a tool for that: It was alled “ASSEMBLY”

    • “Yes please give me NULL of something. Please give me *&* of it” - Statements dreamed up by the utterly deranged

    LOOK at what Programmers have been demanding your Respet for all this time, with all of the omputers we built for them

    (These are REAL programs, written by REAL Programmers):

    ??? ??? ???

    They have played us for absolute fools

    • Jordan_U@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      8 months ago

      Fun fact!

      The Asahi Linux drivers for the Apple M1 GPU were originally written in Python: https://asahilinux.org/2022/11/tales-of-the-m1-gpu/

      GPU drivers in Python?!

      Since getting all these structures right is critical for the GPU to work and the firmware to not crash, I needed a way of quickly experimenting with them while I reverse engineered things. Thankfully, the Asahi Linux project already has a tool for this: The m1n1 Python framework! Since I was already writing a GPU tracer for the m1n1 hypervisor and filling out structure definitions in Python, I decided to just flip it on its head and start writing a Python GPU kernel driver, using the same structure definitions. Python is great for this, since it is very easy to iterate with! Even better, it can already talk the basic RTKit protocols and parse crash logs, and I improved the tools for that so I could see exactly what the firmware was doing when it crashes. This is all done by running scripts on a development machine which connects to the M1 machine via USB, so you can easily reboot it every time you want to test something and the test cycle is very fast!

      • I Cast Fist@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        8 months ago

        Good for testing and iterating, but what about performance? Though I guess getting everything right is more important right now, translating it into another language will probably require less work that way

        • Jordan_U@lemmy.ml
          link
          fedilink
          arrow-up
          0
          ·
          8 months ago

          It has already been translated into rust. Python wasn’t ever intended to be used in the “real” driver, but I thought it was a fun anecdote none the less.