• 1 Post
  • 516 Comments
Joined 2 years ago
cake
Cake day: September 24th, 2023

help-circle





  • Yeah, I use Claude/ChatGPT sometimes for:

    • Throwaway scripts: “write me a bash script to delete all merged git branches starting with ‘foo’”
    • Writing functions that are tedious to look up but I can fairly easily evaluate for correctness: “write a C function to spawn a process and capture stdout and stderr merged”
    • Doing stuff in systems I’m not very familiar with: “write an OCaml function to copy a file”

    I haven’t got around to setting up any of that agentic stuff yet. Based on my experience of the chat stuff I’m a bit skeptical it will be good enough to be useful on anything of the complexity I work on. Find for CRUD apps but it’s not going to understand niche compiler internals or do stuff with WASM runtimes that nobody has ever done before.




  • This video confuses at least three different concepts - quantum uncertainty, ternary computers, and “unknown” values.

    Ternary computers are just not as good as binary computers. The way silicon works, it’s always going to be much much slower.

    “Unknown” values can be useful - they are common in SystemVerilog for example. But you rarely just have true, false and unknown, so it makes zero sense to bake that into the hardware. Verilog has 4 values - true, false, unknown and disconnected. VHDL has something like 9!

    And even then the “unknown” isn’t as great as you might think. It’s basically poor-man’s symbolic execution and is unable to cope with things like let foo = some_unknown_value ? true : true. Yes that does happen and you won’t like the “solution”.

    High level programming concepts like option will always map more cleanly onto binary numbers.

    Overall, very confused video that is trying to make it sound like there’s some secret forgotten architecture or alternative history when there definitely isn’t.



  • I would say:

    1. Just practice, do projects. Also if you can work on projects with other people because you’ll read a lot of bad code and learn how not to do things (hopefully).

    2. Learn lots of programming languages. They often have different and interesting ways of doing things that can teach you lessons that you can bring to any language. For example Haskell will teach you the benefit of keeping functions pure (and also the costs!).

    If you only know Python I would recommend:

    1. Learn Python with type hints. Run Pyright (don’t use mypy; it sucks) on your project and get it to pass.

    2. Go is probably a sensible next step. Very quick to learn but you’ll start to learn about proper static typing, multithreading, build tools (Go has the best tooling too so unfortunately it’s all downhill from here…), and you can easily build native executables that aren’t dog slow.

    3. C++ or Rust. Big step up but these languages (especially C++) will teach you about how computers actually work. Pointers, memory layouts, segfaults (in C++). They also let you write what we’re now calling “foundational software” (formerly “systems software” but that was too vague a term).

    4. Optionally, if you want to go a bit niche, one of the functional programming languages like Haskell or OCaml. I’d probably say OCaml because it’s way easier (it doesn’t force everything to be pure). I don’t really like OCaml so I wouldn’t spend too much time on this but it has lots of interesting ideas.

    5. Final boss is probably a dependently typed language like Lean or Idris. Pretty hardcore and not really of much practical use it you aren’t writing software that Must Not Fail Ever. You’ll learn loads about type systems though.

    Also read programming articles on Hacker News.




  • All three of those languages have library ecosystems at least as good as Python’s. Typescript is just as easy to learn and as fast to write as Python. I don’t see why you’d think Python is faster. If I add up all the time I’ve lost to Python’s terrible tooling it’s quite a lot slower!

    Rust is definitely harder to learn - I’ll give you that. But once you have learnt it it’s just as fast as Typescript and Python. Especially if your “fast to write” metric measures to when you program is correct.



  • I think it’s just because it is always recommended as an “easy” language that’s good for beginners.

    The only other thing it has going for it is that it has a REPL (and even that was shit until very recently), which I think is why it became popular for research.

    It doesn’t have anything else going for it really.

    • It’s extraordinarily slow
    • The static type hints are pretty decent if you use Pyright but good luck convincing the average Python dev to do that.
    • The tooling is awful. uv is a lifesaver there but even with uv it’s a bit of a mess.
    • The package system is a mess. Most people just want to import files using a relative path, but that’s pretty much impossible without horrible hacks.
    • The official documentation is surprisingly awful.
    • Implicit variable declaration is a stupid footguns.

    The actual syntax is not too bad really, but everything around it is.



  • pip is easily the worst thing about Python. But now that we have uv I would say the worst thing is the package/import system. I’m pretty sure only 1% of developers understand it, and it only really works properly if your Python code is a Python package.

    If you treat Python as a scripting language and just scatter loose files around your project and run them directly, it doesn’t work at all. Pain everywhere. Which is dumb as fuck because that’s like 80% of how people use Python.