miniblog.

I've released difftastic 0.42! In this release: * Faster textual diffing (over 10x if files have few lines in common!) * There's now a syntactic diffing option --ignore-comments, for when you only want to see code changes https://github.com/Wilfred/difftastic/releases/tag/0.42.0
Is Forth really a memory-unsafe language? I'm struggling to picture what e.g. a use-after-free would look like in such a minimal programming language.
Today I learnt about a cunning trick used by GNU diff to make Myer's algorithm faster: https://github.com/mitsuhiko/similar/issues/15 If you do an initial pass to find items that only occur on one side, you can discard them before diffing! They'll always be shown as changed.
The docs model for R packages is really interesting. Every package has docs as a PDF file, and the package server supports 'vignettes' (standalone tutorials) as a first class artifact! E.g. https://cran.r-project.org/package=dplyr
I like the concept of a REPL: an interactive environment where you can redefine code and evaluate snippets to see the result. I try to avoid the term "REPL" though. Most languages don't use "read" for parsing (the R) and it's confusing. Are there good alternatives?
What's your preferred granularity of docs? (a) A whole module on one page, e.g. https://pkg.go.dev/time, making search easy? (b) A function per page, e.g. https://www.php.net/manual/en/function.time.php, giving more space for examples and See Also sections? I'm torn, and I've seen both done well.
Interpreters versus compilers as a spectrum, and a fun worked example of optimising Brainfuck: https://tratt.net/laurie/blog/2023/compiled_and_interpreted_languages_two_ways_of_saying_tomato.html
https://www.youtube.com/watch?v=0DLdQ6yb7h8 is a really accessible introduction to programming workflows with Sly for Common Lisp. The notion of 'stickers' is novel to me: you mark places in the code where you want to remember values (essentially tracing) or pop to a debugger (breakpoints).
As shortform video grows in popularity, will we start seeing it in docs? I can imagine a docs page that starts with a 30-60 second video as being popular for some users.
What defines the *feel* of a programming language? I've heard JS described as "composing lego blocks" due to npm, and Common Lisp with Sly feels like a place you explore (e.g. docs from the REPL). All PLs have tools though. Which ones set the vibe?
Today I read the term "negative bus factor" to describe the situation where multiple libraries have the same single maintainer. Perhaps people measure bus factor logarithmically?
A function with three arguments of the same type is way easier to screw up than a function with ten arguments of different types. It's weird.
I've released difftastic 0.41 with a ton of quality of life improvements! * Better highlighting of words in comments and fallback textual mode * Better support of tabs (handy for Makefiles) * Support for nested syntax in HTML files (courtesy of Sesse) https://github.com/Wilfred/difftastic/releases/tag/0.41.0
Today I learnt that Cell<T> has the size of a pointer (i.e. probably 64 bits) in Rust, regardless of the size of T. It's a common pattern for making struct fields mutable, but the T isn't actually stored inside the struct.
A survey of parser generator usage in major language implementationss: https://notes.eatonphil.com/parser-generators-vs-handwritten-parsers-survey-2021.html Most have a handwritten parser. GCC and Go moved from generated to handwritten. SQLite and Python <3.10 built their own parser generators!
The next version of difftastic will support parsing CSS and JS syntax inside HTML! This makes a huge difference to HTML files. This support for tree-sitter sub-parsers was contributed by Sesse :)
Writing a programming language? Challenge the design status quo: https://joshondesign.com/2012/04/09/open-letter-language-designers
Zig has moved to a compiler bootstrap approach that uses webassembly: https://ziglang.org/news/goodbye-cpp/ They check in the wasm artifact and provide their own wasm compiler. wasm is the most portable backend supported by LLVM. OCaml does something similar! It includes a minimal VM.
Reading the beta 4 release notes for Haiku R1, it's striking how much work it is to support modern WiFi protocols: https://www.haiku-os.org/get-haiku/r1beta4/release-notes/ Previously, 802.11ac was only supported on Linux and OpenBSD! (Ignoring proprietary operating systems)
Is there any way to filter out toots that aren't in languages you understand? I see translation offered on some toots, so presumably there's at least some language detection.
Showing 461-480 of 7,506 posts