• slembcke@lemmy.ml
    link
    fedilink
    arrow-up
    10
    ·
    10 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
      2
      ·
      10 months ago

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

    • MojoMcJojo@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      10 months ago

      I know barely anything about programming languages and only ask as a fan, what are the real world usages of languages and what are their practical, pragmatic, or ideological measures that they are used for?

      • slembcke@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        10 months ago

        I guess by real world usage I mean what proportion of code is being made with them. You should be skeptical of their accuracy, but there are measures for that. Like there is this one: https://www.tiobe.com/tiobe-index/, but it describes it’s methodology as being about popularity based on articles, news, and other such things. Github publishes a very different chart as does RedMonk. Rust barely shows up on these charts, but Rust fans are very enthusiastic in threads like this. I like Rust well enough, but I also find the over-enthusiasm amusing.

        By practical/pragmatic I mean the ability to target a lot of hardware with C. Sometimes the tooling is crap, but it’s very universal. Being built on LLVM Rust can go onto plenty of hardware too, but it’s probably not the tooling given to you by a platform vendor. It’s also been around for a long time, so using Rust would mean a rewrite. Sometimes C is simply the choice. As for ideologically: Rust solves some pretty nasty programming issues, but sometimes I think it’s fans over-estimate the percentage of real world problems it actually solves while ignoring that Rust can be more expensive to write. (shrug) Sometimes there’s no such thing as a silver bullet.

  • mindbleach@sh.itjust.works
    link
    fedilink
    arrow-up
    4
    ·
    10 months ago

    Yesterday I tried using an honest-to-god pointer pointer pointer, and I think the compiler refused on moral grounds.

  • IndiBrony@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    10 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

  • MeanEYE@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    10 months ago

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

      • dejected_warp_core@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        10 months ago

        For the programmer? Very no.

        For saving space if run via interperter? No.

        For running compiled for conventional CPUs? No.

        Compared to CISC instruction sets? Absolutely no.

        BF might be highly efficient if crunched down to a bit-packed representation (3 bits per instruction) and run on an FPGA that understands it.

        • frezik@midwest.social
          link
          fedilink
          arrow-up
          1
          ·
          10 months ago

          For demonstrating to CS freshmen that Turing Completeness isn’t that remarkable of a language feature: very highly efficient.

    • Jordan_U@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      10 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
        1
        ·
        10 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
          1
          ·
          10 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.

  • HStone32@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    10 months ago

    I know I’m a fanboy, but I fell in love with C from the first time I tried it. I especially like its bare-bones grammar that never gets in your way. I appreciate how much it has taught me about how computers work. It helped me realize my aspirations to be an electrical engineer.

  • kbal@fedia.io
    link
    fedilink
    arrow-up
    1
    ·
    10 months ago

    C was a nice idea but I guess it just didn’t work out as well as everyone hoped. Ah well, back to BCPL then.