JS projects can accumulate a ton of dependencies, but TIL that npm can explain why you have them. `npm explain foo` or `npm why foo` shows the dependency path to foo.
Super handy when you weren't expecting to depend on something.
miniblog.
TIL that `cargo t` and `cargo r` work as `cargo test` and `cargo run` respectively. Several keystrokes saved!
Python is discussing an elegant approach to tracebacks, where the subexpression that caused the exception is highlighted: https://www.python.org/dev/peps/pep-0657/
How do you randomly sample from non-uniform distributions? This is a common problem when computing random numbers.
TIL about rejection sampling, where you randomly sample within an area that includes the distribution, until you hit a value inside: https://towardsdatascience.com/what-is-rejection-sampling-1f6aff92330d
How to make Rust code faster, including profiling, LLVM whole-crate optimisation, and avoiding costly error checks: https://likebike.com/posts/How_To_Write_Fast_Rust_Code.html
Would it make sense for compilers to have a gas model for optimisations? It would enable speculative execution of transforms that are sometimes expensive.
TIL that Rust's dbg! macro also works in release builds, so you can debug issues when you need the perf of a release build.
This differs from debug_assert! which is ignored in release builds.
Tectonic is a fabulous new implementation of TeX that doesn't require a large distribution, doesn't write intermediate files, and automatically loops TeX and BibTeX!
https://tectonic-typesetting.github.io/en-US/
Deep dive into netcode in the Apex Legends shooter, respecting fairness between players with different latencies, and choosing server tickrates: https://www.ea.com/en-gb/games/apex-legends/news/servers-netcode-developer-deep-dive
Bootstrapping a full GCC toolchain from an extremely minimal hex editor has an astounding number of steps: https://github.com/fosslinux/live-bootstrap/blob/master/parts.rst
I didn't realise just how many tools are self-hosting. Not just GCC, but also flex, bison, automake and even perl!
What languages have changed the most since their creation?
JS? IIFEs and prototypes to modules and classes.
C++? Plain pointers to smart pointers.
There must be more dramatic examples.
Pharo 9 will also be available as a Linux package in several major distros! https://thepharo.dev/2021/04/09/installing-pharo-in-linux-using-the-system-package-manager/
For most languages this is no big deal, but it's much harder for a deeply mutable image-based environment.
Pharo 9 refactoring demonstrates some clever analysis: if you extract a method from an expression, it can find other occurrences of that expression in the class hierarchy!
https://pharoweekly.wordpress.com/2021/04/01/pharo-90-refactoring-support-improves-steadily/
A clever approach to JS dependencies during development: Snowpack hosts npm libraries which you can reference directly!
https://www.snowpack.dev/guides/streaming-imports#how-streaming-imports-work
TIL you can return values from loops in Rust: https://doc.rust-lang.org/reference/expressions/loop-expr.html#continue-expressions
I've only ever seen this in Common Lisp / Elisp!
Renaming code often exposes further needs for refactoring: https://www.fluentcpp.com/2021/04/23/make-bad-code-look-bad/
(I found the example really compelling!)
It's amazing how quickly leaked credentials get harvested and used to create VMs mining cryptocurrencies: https://johnmathews.eu/i-leaked-credentials-onto-a-public-github-repo.html
TIL that &mut [T] in Rust means that you can modify the items in a slice, but you can't change its size. It's surprisingly handy: I'd just been using &mut Vec<T> everywhere previously.
Why Lisp?
It has its pros and cons.
Showing 1,101-1,120 of 7,508 posts