miniblog.

It's odd how lazy evaluation is generally seen as a niche design choice, yet the vast majority of languages treat `foo() || bar()` as short-circuiting.
It feels like rename is by far the most important refactoring operation. If I had an IDE with only one refactoring, I think I'd want rename.
@krinkle A surprising number of PL design workarounds are "just add another equals sign" 🙃
I really like the MELPA model of packaging directly from git. It solves the problem of forgetting to release something -- just merge a PR and you're done. It also makes version number bumps much less important. You could go even further in a statically typed language and also figure out when breaking changes occur.
TIL Tcl has a notion of 'safe interpreters', a mode where you can run untrusted code in a sandbox: https://www.tcl.tk/man/tcl8.4/TclCmd/safe.htm Not many programming languages have this, but it's way safer to include in the implementation than try to build as a userland library.
I'm adding a += operator to my programming language, because writing `x = x + 1` is tedious. This opens the tricky design question of which operators should support this. Is += and -= sufficient, or do you expect things like >>= and **= to be available?
I would *love* a terminal emulator that treated each command as an atomic unit, so I can efficiently scroll between them. Line-based scrolling is annoying when you've just run a command that output 1,000 lines. Do any such tools exist?
I travelled recently with six electronic devices, and every single one used USB-C for charging. It was wonderful, and not an experience I've had before.
Assertions are a surprisingly nuanced design space. In a test, if I assert `x < y`, I really want to see the values of x and y when it fails. Do you define an API for every possible predicate (Python's assertLess, expect.js) or try to support the native syntax (c.f. pytest)?
It's odd that games often show the hours played, but I've not seen this in other apps. "You've spent 20 hours talking to this person." Would this be a usage deterrent? If so, why do many games offer it by default?
I'm intrigued to see that Google has quantified that new code is generally buggier and less secure than code that has existed in your codebase for longer: https://security.googleblog.com/2024/09/eliminating-memory-safety-vulnerabilities-Android.html
C++ no longer considers trivial infinite loops to be undefined behaviour! https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2809r3.html Spotted in the release notes for the latest clang.
ASTs typically discard comments, and that's usually what you want. The only time (AFAICS) that preserving comments is useful is for writing a code formatter. Could you write a formatter in terms of a list of lexemes? A CST is a non-trivial bit of code for one use case.
I'm not a fan of the mastodon web UI behaviour where moving down with cursor keys 'snaps' to the next toot. Is it possible to disable this, so my cursor keys always move the page by a consistent visual amount? I've poked in the settings and didn't see anything obvious.
... and my third refactoring with Cursor changed some function calls that I didn't want it to modify. Subtle. I've had the most success with AI coding tools when I know exactly what I want the output to look like.
I'm pretty impressed with Cursor: I've successfully asked it to perform codebase transforms in English, and it's worked! E.g. "Replace all calls foo(..., true) with foo_immediate(...) define a foo_immediate function". I'm still reading the diff and checking tests -- it's still AI after all.
An ad hoc, informally-specified, bug-ridden, slow implementation of half of a text adventure game -- or as I like to call it, a compiler.
TIL Rust has an ambiguity `if Foo {}` -- is `Foo` a value of type bool, or a struct? Rust solves this by defining a grammar production 'any expression except struct literals' and using it in this position. https://rust-lang.github.io/rfcs/0092-struct-grammar.html
It's so strange that we talk about languages being slow, and have done for years. Computer performance has increased so much in this time. https://hbfs.wordpress.com/2009/11/10/is-python-slow/ (shared on HN in 2009) discusses Python being slow. My underpowered Thinkpad has 20x the single-threaded performance! https://www.cpubenchmark.net/compare/73vs3766/AMD-Athlon-64-4000+-vs-AMD-Ryzen-5-PRO-4650U Maybe *relative* performance of languages matters more?
I like that most LLM UIs show your previous queries prominently. When figuring out where LLMs are useful in your workflow, it's nice to see what worked well (or not) in the past. Web search doesn't have this property. I rarely look at what I've previously googled.
Showing 21-40 of 135 posts