• 1 Post
  • 630 Comments
Joined 1 year ago
cake
Cake day: June 12th, 2023

help-circle
  • if you use a garbage collector which is perfectly suitable unless you write low level embedded systems or oses

    Or games, or realtime systems, or high reliability/mission critical systems, or high performace systems. There’s a long list of programs that GC isn’t suitable for for one reason or another.

    and even if you use something like C or C++ where you manually allocate or deallocate, if the app is properly tested memory issues won’t happen.

    There’s about four decades of security vulnerabilities in extensively tested and widely used software that says this is absolutely false.


  • Cargo is doing too many things at once. It’s a build system but also a package manager but also manages dependencies? Idk what to even call it.

    Somewhat agreed, but it’s a very difficult problem to solve. No language has yet come up with the perfect build tool. JS is on what, like the 12th build tool in as many years now? Some serious throwing stones in glass houses vibes here.

    Syntax is very confusing for no reason. You can’t just look at rust code and immediately know what it does.

    Strongly disagree on this point. Those extra glyphs in Rust are not just cosmetic, each one means something very specific and conveys very important information.

    Having to pollute your code &, ? and .clone() everywhere to deal with ownership

    You don’t “deal with” ownership, it’s an incredibly powerful tool you use. This just sounds like you haven’t really understood what the borrow checker is actually doing and the hundreds of problems it solves for you. I can not count how many times now I’ve been working in another language and had the thought “I could solve this with the borrow checker”

    Js is way more readable.

    JS is not more readable, JS is just far less detailed. It omits a vast swath of information such that you have almost no idea what it’s actually doing. It feels easier to you because you don’t care about any of the details, but those details become vitally important when things stop working and you’re trying to figure out why. This sounds to me like you’ve never had to write any actually complicated code. If all you’re trying to do is chain together a series of HTTP calls and maybe parse a tiny bit of JSON, yeah, Rust is like using a nuke to kill an ant.

    Similarly, Async code starts to look really ugly and overengineered in rust.

    A little bit, but mostly because doing async right is really complicated. Once again no language has a really great solution to this problem yet, they all involve tradeoffs.

    Multiple string types like &str, String, str, instead of just one “str” function.

    Once again it seems you don’t really understand the difference between owned and borrowed values or stack vs. heap allocation and why it matters. Really there’s only one type of String which is String, the others are just different ways of borrowing a String (with different tradeoffs).

    i32 i64 i8 f8 f16 f32 instead of a single unified “number” type like in typescript. Even in C you can just write “int” and be done with it

    If all you want is a “int” you can just use i64 for everything and “be done with it” as you say, you’ll just be adding a ton of wasted memory and needless overhead for no good reason. Seems like you just don’t like strong typing. I’m surprised you even bother with TypeScript instead of just using JavaScript.

    Having to use #[tokio:main] to make the main function async (which should just be inbuilt functionality, btw tokio adds insane bloat to your program) yet you literally can’t write code without it.

    You absolutely can write code without using #[tokio:main], you can even use tokio without that, it just saves you having to write a bunch of boilerplate to initialize tokios executer and pass your async functions to it. You can even use async functions without tokio, you just need to provide your own executor. Async in Rust is still pretty new and some of the rough edges are still being worked out, it will get smoother, but honestly the things you’re complaining about aren’t even the annoying parts about it.

    Speaking of bloat, a basic get request in a low level language shouldn’t be 32mb, it’s around 16kb with C and libcurl, despite the C program being more lines of code. Why is it so bloated? This makes using rust for serious embedded systems unfeasible and C a much better option.

    I have no idea what you’re doing to generate code sizes like that, but I guarantee you could get a significantly smaller program in Rust that does exactly what the C code is doing. As for embedded this is patently false. I personally use Rust regularly on embedded devices that don’t even have 32mb of RAM on them.

    With cargo you literally have to compile everything instead of them shipping proper binaries. Why???

    This isn’t a cargo thing, this is a Rust compiler thing. The Rust ABI hasn’t been standardized which means currently there’s no guarantee that Rust code compiled by one version of the compiler can successfully link against code compiled by a different version. Until not that long ago C++ actually had the same problem. This will eventually get fixed, but the language team feels things are still moving too fast to define a concrete standard yet.

    Another major issue I’ve encountered is libraries in Rust, or lack thereof. Every single library in rust is half-baked.

    Rust is still pretty new, so a lot of libraries are still in active development, but there are already many excellent and very well documented libraries. Axum is literally one of the newest web frameworks in Rust and didn’t even exist that long ago. I’ve seen far worse documentation for JS libraries (and don’t even mention C, the gold standard there is practically a man page that’s just a glorified header file).

    As for “memory safety”, it’s a buzzword. Just use a garbage collector.

    Memory safety is not “just a buzzword”, there’s a reason all the top vulnerabilities for decades now are all memory safety issues. As for a garbage collector, good luck with that when writing embedded software or a kernel.

    The rest of your rant basically boils down to “my particular simple use case doesn’t see much value from what Rust provides”, which is fine. If you don’t need the power of Rust, use something weaker, not every problem needs the nuclear option, sometimes you just need something quick and dirty that will run a few times before it falls over. Hell, sometimes a quick Perl script is the right solution. I mean, not often, but it does sometimes happen. When you do find a problem that your quick and dirty approach isn’t working on then you’ll see the value in Rust.


  • Another important point that occurred to me on reflection is why they can simultaneously hold the belief in their head at the same time that all politicians are corrupt, and yet still have complete faith in Trump. They treat politicians like they’re some foreign species, like they’re not just normal people. In their mind there’s a clear distinction between “us”, and “politicians”. But they don’t consider Trump to be a politician, they’ve internally classified him as “business man”, hence he’s not corrupt, because he’s not a politician.




  • I think that goes hand in hand with the attacks on education. They’ve painted themselves as being the voice of “working class” Americans and discredit experts that provide knowledge that runs counter to their propaganda as out of touch “liberal elites”. It’s truly ironic that they’re implying that your average American is stupid with that statement and yet their supporters fully agree with it. They point to the correlation between higher education and disbelief in their propaganda as proof that the highly educated are wrong in a weird cyclic argument. Their stance is basically if the intellectuals don’t agree with me, it’s because they’re wrong, not because I am.

    Basically this:



  • Absolutely, but it’s also easy to see how the change happened. The original goal was to prevent autocracy, so power was distributed and checks and balances were created to prevent any one person or branch from being able to have too much authority. The message was corrupted into distrust of all government and combined with the debunked trickle down capitalism theory (thanks Reagan) that wealthy companies would lead to a wealthy public. The GOP then ran on a platform of eliminating “corrupt government” and removing “government interference” that was supposedly preventing that sweet free market capitalism they had been promising from working and trickling down to everyone. This then allowed them to re-frame stripping regulations and power from various government bodies and centralizing it within the executive branch as removing “wasteful and corrupt government”, and removing checks and balances as removing laws and regulations that “protected corrupt government officials”.

    This also explains the “he’s not hurting the right people” crowd, as they were sold on the idea that the autocrats would be using their power to attack government institutions and politicians, not the public. They never bothered to follow things to their logical conclusion and ask “once you’ve established an autocrat, and removed all government regulations, what happens next?”, with the obvious answer “you have a dictatorship”.


  • One point I disagree on is that the country was founded on distrust of government. I’d say rather it was founded on distrust of dictatorships and autocracy. From the outset it was designed in a way that attempted to distribute power in such a way that no single individual or group had absolute power. It was one of the reasons why several of the founders were highly skeptical of political parties and considered banning them outright but instead settled for voicing warnings about them. They feared that a single political party could eventually become dominant and become the de facto ruler of the country.

    In recent years there has been an effort to re-frame distrust of autocracy into a general distrust of government. I believe this has been primarily driven by powerful business interests in an attempt to remove regulations that get in the way of their maximizing profits at the expense of the public. They have rather successfully hijacked the anti-communism propaganda of the 50s and 60s and twisted it into an anti-government propaganda.




  • Because the Republicans have spent the last 40 years slowly demolishing public education. That combined with a steady feed of propaganda on AM radio and Fox News, plus mild lead poisoning from leaded gas usage prior to the 90s has resulted in multiple generations that lack even the most rudimentary critical thinking skills or scientific knowledge and are primed to believe whatever absurd conspiracy reinforces whatever their pastors and favorite talking heads are saying.

    They’re absolutely convinced that the US government has been infiltrated by “communists” that are engaged in grand sweeping conspiracies to destroy the US, and the only solution is to remove all power from the US government. They’ve been steeped in propaganda for decades that tells them all governments are corrupt and only corporations can be trusted, that the “free market” is the solution to all problems.




  • Those serving sizes actually make sense though. The ones that don’t are for instance a small bag of chips with a serving size like 1.5 servings where it’s very obvious the serving size was picked not based on the expected consumption (I’m certain the expectation is that the entire bag will be eaten in one sitting), but in order to make the nutritional information seem more reasonable. Or a single candybar with a serving size of 2.5.

    There needs to be a distinction between single serving packaging vs. multi-serving packaging (which should be resealable), and that should be based on actual consumption not attempts to massage the nutritional into.


  • Right, I mean the issue isn’t necessarily the smaller serving size, it’s the much higher price per quantity of product. That said it isn’t all upside since the volume of a container increases faster than its surface area and therefore larger packages use less packaging material per quantity of product leading to less trash (assuming the product is fully consumed and not partially thrown away).

    There’s a balancing act in play where the ideal size is the average amount that a person would consume within the products shelf life (once opened). That minimizes food waste and excess packaging material.

    Since averages when applied to people are notoriously bad (see E.G. attempts at making an average fighter pilot seat) it’s best to offer a variety of package sizes so that consumers can purchase the one that best meets their consumption needs. So as to not encourage over consumption though, the cost of packaging materials should probably be averaged and applied to the quantity of product such that price per quantity of product remains linear instead of being cheaper as the volume of the container increases.