• 1 Post
  • 64 Comments
Joined 3 years ago
cake
Cake day: June 11th, 2023

help-circle
  • Sure, but many languages do that,

    I wrote several paragraphs and talked about three languages, so I’m going to have to guess about what “that” refers to. I’m guessing it’s Lisp macros. Your other comment offers template metaprogramming in C++ as an alternative.

    Template metaprogramming Gets maybe a third of the way to what Lisp macros offer. It can do compile-time syntax transformations, but it doesn’t provide the full C++ language with which to do so, doesn’t operate on the actual parse tree, and isn’t Turing-complete in practice because of fixed limits on recursion depth in real compilers. Rust macros get much closer, providing the full power of Rust and the option to get at a real AST by parsing the token stream they operate on.

    If you mean something else, please elaborate. It’s an interesting topic.

    There are more modern and better ways, IMO.

    I’m not sure what “more modern” means in this context. If it just means young, I can probably find a Lisp family language with its first release this year, though that wouldn’t be the one I would recommend to a beginner. If it means recently-updated, Racket, the Lisp I recommended learning had its latest stable release nine days ago. If it means something else, please say so.

    “Better” probably can’t be measured objectively, but by all means, make the case for something else.


  • Some people want to learn programming to get a job, though perhaps not as many in 2026. Some people want to do a project that happens to requiring programming. Some actually want to understand programming and get good at it. The last group will benefit from learning Lisp and Haskell even if they don’t end up using those languages much. I thought my first comment explained why and I think Corngood elaborated on it, but I’ll add more.

    The reason to use programming languages instead of machine/assembly languages is that they add abstractions, and allow the programmer to add more abstractions. An abstraction is a name and implementation for a repeated pattern in code, which documents the programmer’s intent when it is used, allows all invocations to be modified in one place, and substantially shortens programs. In most languages, there’s a distinction between abstractions the language designer can add and those the programmer can; in Lisp, there is not.

    If most languages didn’t have if or class, you couldn’t add them in a library; you’d have to modify the interpreter or compiler. Here’s if defined in a Lisp-like language I’m working on:

    (defmacro if (test then else)
      `(cond ~test ~then true ~else))
    

    This is possible because Lisp code is made of Lisp data structures which it can easily manipulate, and because it has the ability to control when evaluation occurs. Here, we need to splice three blocks of code into a cond expression, which is a more generalized form of conditional evaluation that takes an unlimited number of test/then pairs. We must also prevent the premature evaluation of the branch not chosen, which is why if and cond can’t be regular functions. In Common Lisp, the entire object system can be implemented as a library.

    Haskell and similar languages also offer significant power for abstraction with its sophisticated type system and lazy evaluation, but the more important lesson they can teach is the gurantees they can make at compile time. Once a Haskell program compiles, it has a much greater chance to work as expected than any other language I’ve used.

    SQL teaches thinking in data. Most programs exist to store and manipulate data, so that’s pretty relevant.


  • I question the suggestion that Zig and Go are not “serious” programming languages. They certainly weren’t designed to be “easy” beginner languages.

    I don’t think it matters a whole lot which language you start with. Learning to program is largely separate from learning a particular language, and if you do programming for a while, you’ll probably learn several. I do think someone who wants to understand programming deeply should learn each of:

    • A lisp, probably Racket, but others will do. This teaches a lot about how computation works, and is at least a local maximum for abstractive power.
    • C, an assembly language, or something similar where the developer must manage memory manually and has the ability to mismanage it. This teaches how computers work.
    • A statically typed functional language, probably Haskell. This makes programming more math-like and probably represents a local maximum for what can be proven about a program’s behavior without solving the halting problem.
    • SQL. I wish there was something prettier with a modicum of popularity that does what it does (PRQL is my favorite recent attempt), but there isn’t. This teaches thinking about data in sets and relations, and you will almost certainly use it in practice.




  • I had an inverse experience after an adult beverage or two and talking to someone about a third party’s script they found unsatisfactory. It went about like this:

    Zak: filename.py sucks

    Claude: What’s wrong with it? Bugs? Code quality? Features?

    Zak: yes

    Claude rewrote it, claiming it had “multiple issues”. It found and corrected a major bug, added error handling, and improved command line argument handling.


  • A senior engineer obviously needs (and knows how to handle) considerably more access to their workstation and company IT infrastructure than the average employee. On the other hand, I’ve occasionally read complaints from IT security types about engineers being way too eager to install sketchy stuff.

    There’s some truth to those complaints. I might need to try out several libraries and tools to see what works best for a certain use case. Is that new one with 15 stars on Github actually safe? Are all of its dependencies? How many developers perform a task like that in a sandbox? How many of those perform a thorough audit before taking it out of the sandbox?


  • Why?

    It makes sense to try to give users an idea of how robust a project is, but the exact details of the tools involved in its creation rarely add much to that. It gets a little weird with LLMs because they allow someone with no programming skill to create software that appears to work, which ought to be disclosed; “I don’t know what I’m doing and I asked a robot to make this” does indicate unreliable code. A skilled developer having an LLM fill in some extra test cases, on the other hand can only make the project more robust.


  • Well-behaved server software honors delete requests, but there are a bunch of ways for that to fail without anyone doing anything malicious:

    • If your instance shuts down, there is no way for you to generate delete requests
    • If a server admin has to restore a backup from before your request, the deleted data will be restored
    • Immature or experimental software may not work as designed; Lemmy itself has a version number starting with 0
    • Archiving services may keep snapshots of pages from fediverse servers; here’s your user page on lemmy.world on archive.org
    • Fediverse servers often make content available by RSS, and RSS clients may store that content; there’s no way for them to receive a signal that it should be deleted

    And then there’s malicious activity. It wouldn’t be hard to run a server that speaks ActivityPub, subscribes to a bunch of stuff, pretends to honor delete requests, and actually keeps everything.

    Deletion will always be unreliable on the fediverse as long as it runs on technology that looks anything like current implementations.