• 1 Post
  • 547 Comments
Joined 2 years ago
cake
Cake day: June 20th, 2023

help-circle


  • Wait, if you have the old edition on your kindle, do they reach into your kindle and change what is there? Or do they just change the version in the store to the new edition, preferably with a new ISBN, if Kindles have ISBN’s?

    I remember about the Roald Dahl thing and it seemed pretty clear which edition people would be getting. And some of this stuff (according to another internet poster I mean) may have been intended to keep the books in copyright longer rather than to merely mess with the content. Blyton died in 1968 so her stuff could enter the public domain in the next few decades otherwise. That’s nefarious too.

    I remember for sure that Huckleberry Finn had the N word. Maybe little kids shouldn’t be reading it, I’m cool with that, though I read it as a kid myself. But grown-ups who do read it can deal with an unexpurgated version.





  • Concrete technical answer (one of many): imagine you have a list (“array”) of 5 numbers, and you try to print the 10th number in the array. A secure language will say “error! it’s a list of 5 numbers, there is no 10th one!!”. C will instead print some random garbage (whatever happens to be in the part of memory following the 5 element list), or maybe do something even crazier (try searching “nasal demon”), without indicating that anything has gone wrong. There are many other issues like this with C. You end up with programs going completely into the weeds, turning control over to attackers, etc.

    Abstract philosophical answer: Secure languages like Ada and (hopefully) Rust are designed to help you ensure the absence of unwanted behaviours, rather than just the presence of wanted ones. If you want behaviour X, the goal of old languages like C was to make sure you could write a program in which X was present. That was a big enough challenge in the old days that language designers stopped once they reached that point. If you don’t want behaviour Y (let’s say Y is a security attack), it’s up to you to just write the program without behaviour Y. 50+ years of experience have shown that to be inhumanly difficult once the program gets complicated, so you really do need help from the language. Accountants invented double-entry bookkeeping 700 years ago for similar sorts of reasons: to keep small errors in complicated systems from sending the system into a nose dive.

    Ensuring the absence of behaviours is the classic problem of proving a negative, so there are limits on how thorough the checking can be, and the technical features (like the notorious Rust borrow checker) can be difficult to use. But if you’re willing to endure a certain amount of pain and runtime inefficiency (requiring the program to do a little extra work at each operation to make sure the result makes sense, like the example of the 10th element of the 5-element list), you can make programs much safer than you can in C.

    Does that help?

    Added: Rust is getting some flak because it is pretty new, is still a work in progress, has various unmet goals, etc. It’s not fully baked yet but it is getting there (I’m studying it right now). Ada is an older language that is way more mature than Rust, but is more of a pain to use in many ways, so Rust is currently getting more attention.


  • I’ll probably have to read through it or maybe the Ferrocene standard, but for now, Comprehensive Rust is pretty good. I’ve been busy today but hope to finish it soon. Is it really true as someone mentioned that Rust binaries are always statically linked? That has its attractions but I would hope it’s controllable. Can you use the regular linker (ld) with it?



  • I know that the “project” approach to learning a language works for some people, but I’ve found l greatly prefer to read a book from beginning to end before undertaking any projects. It helps me start out with a clear picture. I’m finding “Comprehensive Rust” to be fairly good so far. Thanks for all the help, everyone.


  • Thanks, Rust by Example looks ok, and I’m acquainted with one of Programming Rust’s authors, which is cool. I’m currently looking at “Comprehensive Rust”. All these though seem to be about the Rust software ecosystem (compilers, package tools, libraries) as much as they are about the language. I had hoped to start by just reading about the language, if something like that exists. I don’t particularly want to write any Rust programs until I’ve finished reading some kind of language overview, which means that all the stuff about build tools are just a distraction during that stage. As another commenter in this thread said though, ecosystems and languages have become pretty much inseparable, so maybe that’s why the books are that way.

    This also looks interesting:

    https://dr-knz.net/rust-for-functional-programmers.html

    This says nothing about Rust, but it’s a humorous classic. I’d be interested to know how to describe Rust in these terms.

    https://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html







  • Thanks, Rustlings doesn’t sound like what I want either. I was hoping for a counterpart of Stroustrup’s C++ Reference Manual, or Riehle’s “Ada Distilled” or even K&R’s book on C. Something that systematically describes the language rather than distractions like the toolchain, mini projects, cutesey analogies, etc. I’m being too persnickity though, mostly because it hasn’t been important to me so far.


  • solrize@lemmy.worldtoTechnology@lemmy.worldRust is Eating JavaScript
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    2
    ·
    7 days ago

    Sure you can spawn threads but now you have all the hazards of shared memory and locks, giving the 2.0 version of aliasing errors and use-after-free bugs. Also, those are POSIX threads, which are quite heavyweight compared to the in-process multitasking of Golang etc. So I would say that’s not really an answer.


  • True about Google ;). Yes, there are programs that really don’t want GC. I consider those to mostly be niche applications since most of us are fine with using e.g. Python, which has automatic storage management (won’t quibble about whether it is GC per se) that has occasional pauses. SImilarly, tons of important programs are written in Java, which is GC’d. Of course Java is tied up with Oracle just like Go is tied up with Google.

    Go’s main problem from what I can tell is that the language itself is too old fashioned. I’ve used it but am not expert. It feels like an improved version of C, rather than a modern, type-safe language.


  • I had the impression Rust doesn’t handle concurrency particularly well, at least no better than Python, which does it badly (i.e. with colored functions). Golang, Erlang/Elixir, and GHC (Haskell) are way better in that regard, though they each have their own unrelated issues. I had believed for a while that Purescript targeting the Erlang VM and with all the JS tooling extirpated might be the answer, but that was just a pipe dream and I don’t know if it was really workable.