6 ms·
I program MCUs as a hobby. I wish I could use something better than C. Even C++ with RAII would be better. But somehow, even C++ support is spotty, with unsuppo
by yau8edq12i 2y ago
I program MCUs as a hobby. I wish I could use something better than C. Even C++ with RAII would be better. But somehow, even C++ support is spotty, with unsupported features, broken debugging, etc. for seemingly no reason. And all device-specific libraries are written in C, so I'd have to write C++ wrappers for every little thing. Send help...
- pdimitar 2y agoThat's why I said "almost anything". I am aware that f.ex. kernel development and embedded work is still firmly in the C domain. I am not evangelizing for Rust, Golang or anything in particular. I am evangelizing for periodically asking yourself "Am I still using the best tool for the job?" which most people never do.
- nottorp 2y agoActually, maybe Rust would get more people interested if it didn't sound like a religion...
- pdimitar 2y agoMaybe it's you and some other curmudgeons projecting -- worth to consider if that's the case. Maybe it's normal for people to praise something that legitimately solved their problems. I know that happened with me.
- glass-z13 2y agoThere is a difference between praising and preaching, the latter happens more often with rust
- pdimitar 2y agoIf you say so. ¯\_(ツ)_/¯ But even if it was true (I'd contest it's not) can't you ignore it and judge the language on its merits? We are not teenagers for a long, long time now, we should be making up our own mind about things.
- nottorp 2y ago> we should be making up our own mind about things But you denied my right to make up my own mind about Rust based on what its proponents say. I believe you even attempted to insult me, too bad I don't know what curmudgeon means :)
- pdimitar 2y agoI have not done either. "Curmudgeon" is a "get off my lawn, kids!" grandpa btw. :) I have not denied you anything, I implored you to ignore the zealots that exist IN EVERY ECOSYSTEM and judge the thing based on what it can actually do. Please don't misrepresent what I said, that's not arguing in good faith.
- nottorp 2y agoHeh, this grandpa has written like 3x more python than C this year. And the C part was no choice - that was all I had on these devices. Edit: from what I hear from my peers (translation: other programmers that I have coffee or drinks with), if I started a new server application today and I needed the performance of a compiled language, I should use Go not Rust. I believe servers are where the propensity of C like languages to allow you to shoot yourself in the foot is the problem, isn't it?
- pdimitar 2y agoServers and many CLI tools, yes. Buffer overflows and memory unsafety are really easy to allow there for everyone but absolutely Godlike C/C++ devs. Golang, Rust, Nim, Zig, and a few others are a much better fit nowadays.
- nottorp 2y agoBefore the current "AI" hysteria, HN was full of "I've rewritten this thing that was working just fine in Rust". No mention of how it's better, has more features - or even has all the original's features - or anything about why you should use the rewrite instead of the original. Am I supposed to use a tool just because of what it's made of, or because it solves a problem for me?
- pdimitar 2y ago> No mention of how it's better No embarrassing buffer overflow CVEs is a very good start. To me that's an actual selling point and I've migrated from almost all UNIX coreutils to Rust alternatives for that reason alone. > Am I supposed to use a tool just because of what it's made of, or because it solves a problem for me? No, as an adult you are supposed to not frame the discussion unfairly and ask the right questions.
- nottorp 2y agoThe right questions according to who? Are your coreutils replacements 100% drop-in?
- pdimitar 2y agoI don't need a 100% drop-in. Barely anyone does. I've observed at least 80% of all of the coreutils features are not used by 90% - 99% of programmers and sysadmins. Ask people if they used all flags of `sort` and report back results as a test of my hypothesis. > The right questions according to who? This is tiring. I told you twice that I'd prefer you engaging in technical merits. You keep drawing attention to what is annoying you but you'll have to talk to your friends and family about that because I am not interested. Bye.
- nottorp 2y agoBut the only "technical merit" seems to be "omg it's more secure". I've literally never seen any other argument in favor of Rust.
- devjab 2y agoIt’s a cult, but you don’t have to join the cult. I use Rust both privately and more and more frequently professionally and I don’t really notice the cult community outside of smiling at it once in a while when it blows up on HN. We’re mostly adopting rust to replace our C, to protect us from ourselves. It’s just so much easier to hand off these sort of projects to developers who mainly work with things like Java or C#. Partly because of the memory “safety” but also because things like enums work the way they expect them to being sum types, and so on. It’s also very clear when something is intended not to be mutable. The borrow checker is probably the biggest struggle, where with C, everything is a struggle. Rust still has a long way to come though, and maybe it’ll never get there. I do think we’ll see an uptake as performance increasingly matters due to cloud costs and ESG. Right now though, I’d argue that unless you know why you “want” to use Rust then maybe you shouldn’t.
- pdimitar 2y agoMostly agreed with your comment though I still have to remark that every community has zealots and it's mystifying to me why are people so annoyed by Rust's. So it's hard to agree that "Rust is a cult". As you said, it's a pragmatic but also kinda niche language. I don't reach for it unless I can't do the job with others, easier and quicker to work with languages.
- flohofwoe 2y agoThe C sphere is actually refreshingly free of zealotry (mainly I guess because there isn't such a thing as a "C community" and even despite C being the main attack target of language zealots - funny enough nobody complains about those pesky assembly coders and their hippie attitude towards memory safety lol). The "religious zeal" was also an important reason why I switched back to C from C++ and why I don't have much interest in Rust. I can't quite stand the "holier than thou" attitude in.parts of those communities.
- pdimitar 2y ago> This was an important reason why I switched back to C from C++ and why I don't have much interest in Rust. I can't quite stand the the "holier than thou" attitude in.parts of those communities. This is 100% baffling to me. Let me explain. 1. Every single area has zealots. Yours included. And we're not talking only work. Every hobby area as well. 2. What the attitude of the most toxic 0.1% of the users of a thing is has exactly ZERO correlation with whether the thing is good and worth using. 3. By resisting only those 0.1% toxic zealots you are only demonstrating meaningless rebelliousness. As a supposed adult you should be immune to what are people hyping up and form your own opinion. INFORMED opinion. Not one based on the "many people praise it hence I, the intellectual, will stay far away from that obvious nonsense" stance. 4. Have you considered that maybe, just maybe, Rust is praised because it's actually good? Have you considered that the Rust community is not trying to cheat its way into your heart, and that the love Rust gets is justified by the people who need its features? Seems like you did not, and that's disappointing. In other words, I have zero clue of your thought process here, maybe you can help me understand? Back in my home town the VW Golf had an ardent fan base, yet one of my friends still bought one after he graduated. He didn't call the people who loved VW Golf zealots. He did his research and concluded that with his budget and mechanic skills the VW Golf is the ideal option. Food for thought?
- pjmlp 2y agoMikroe is still in business selling Pascal and Basic compilers for all kinds of tiny CPU and MCUs since 1997, so some people do value their products.
- MrBuddyCasino 2y agoRust only works for a few popular targets, but if it is just a hobby then Zig might be an option. C interop is pretty seamless, so you don't face the problem of having to reinvent the universe.
- GoblinSlayer 2y agoIn my experience interop is rarely a language problem, lion share of time is consumed by reading the docs, testing if you understood the docs correctly, testing what's implied but not written in the docs and figuring out how to cope with idiosyncratic interface.