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.
Programmer Humor
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
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?
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.
my controller may be old, but i only pay 20 thousands eurodogs for a board support pckage ,per user per ip per nation per year. I dont even pay for their eclipse ide! C is the laand of free fuck yeah! My debug partner is compatible with only 200 euro per flexcable. Don`t tell em my debrugs parnter is not oem spec🐵.
Primitive, provincial knuckledragging Americans/Brits/Right-wing country's citizens don't want to learn C or understand how their computer truly works. 😆
Yeah. That tracks
C is not how a computer truly works.
If you want to know how computers work, learn assembly and circuit design. You can learn C without ever thinking about registers, register allocation, the program counter, etc.
Although you can learn assembly without ever learning about e.g. branch prediction. There's tons of levels of abstraction in computers, and many of the lower level ones try to pretend you've still got a computer from the 80s even though CPUs are a lot more complex than they used to be.
As an aside, I've anecdotally heard of some schools teaching Rust instead of C as a systems language in courses. Rust has a different model than C, but will still teach you about static memory vs the stack vs the heap, pointers, etc.
Honestly, if I had to write some systems software, I'd be way more confident in any Rust code I wrote than C/C++ code. Nasal demons scare me.
Do people still think, after all this time and so many different languages, that there will be one language to rule them all? I mean technically you can drive nails with a rock, but you don't see a carpenter using one. Right tool for the job. Always was, always will be.
Search for leak in sudo's changelog: https://www.sudo.ws/releases/changelog/
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.
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.
no general purposd language can guarantee a lack of memory leaks
You're going to summon every Rust enthusiast on the platform
Let's rewrite Linux kernel in Python
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!
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
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.
No in JavaScript
The prophets have foretold it: https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript
Yes and let us build the environment with conda, it's going to be a fun time!
Nobody's built a supercomputer powerful enough to run a python version of even Linux Lite Edition.
I mean, someone made a barebones Linux work in scratch
Redstone it is, then.
Just use brainfuck for everything. The entry barrier for the programming industry needs to be higher anyway.
Is brainfuck efficient ?
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.
For demonstrating to CS freshmen that Turing Completeness isn't that remarkable of a language feature: very highly efficient.
Can be compressed very efficiently. I do dread the thought of writing a driver in brainfuck.
Why specifically a driver ?
Hardware is complex and mysterious enough without added complexity of an esoteric language.
C is fun. Thats why I use it :P
The same way juggling chainsaws is fun I suppose. :)