Do commas ever appear in idiomatic Clojure? It's syntactically legal but I don't think I've ever seen them in the wild.
miniblog.
The Indian supreme court has ruled that Google must allow third party app stores on the Google app store under antitrust laws: https://www.reuters.com/world/india/indian-startups-rejoice-android-ruling-against-google-upheld-2023-01-19/
Cases where it makes more sense to use concrete types rather than generics, even if you can be generic: https://matklad.github.io/2020/08/15/concrete-abstraction.html
Rust's RFC 3191 will let libraries package debugger scripts so you get a better experience when using gdb or windbg: https://rust-lang.github.io/rfcs/3191-debugger-visualizer.html
Defining a separate tests module so rust tests compile faster: https://matklad.github.io/2021/02/27/delete-cargo-integration-tests.html#Assorted-Tricks
What's the best keyword for function definitions?
My current hypothesis is that you want it to be short, but still pronounceable, so `fun` is the sweet spot.
I've really come to appreciate OCaml's notion of generics. It doesn't have subtyping, so e.g. you have an `int list` or an arbitrary `'a list`, but nothing inbetween.
As soon as you add constraints like Java's `List<? as Foo>` it become incredibly hard to produce good errors.
Switching between Rust and TypeScript, I really miss the Result type in TypeScript. I can kludge something with nullable types or exceptions, but it's not as nice for the caller.
The Servo browser has funding for active development again! https://servo.org/blog/2023/01/16/servo-2023/
Today I learnt about crossterm, a Rust crate for interacting with terminals in a cross-platform way: https://docs.rs/crossterm/latest/crossterm/
It handles things like is_tty() and terminal::size(), which are hard to support correctly in both Linux and Windows. I might port difftastic.
I have mixed feelings about the equality trait in Rust.
I have types where sometimes I want to compare by structure, and sometimes compare by reference.
I can only implement Eq for one, so which do I pick?
I feel like in-code docs are an underexplored design space.
Do you use comments or string literals? Before the function (e.g. JSDoc) or inside it (e.g. Python)?
Which is best? Which is the easiest to write, has the easiest tooling, or the most readable (code/HTML) artifacts?
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).
Showing 201-220 of 235 posts