One weird consequence of having '() and nil being the same in elisp: the following function is legal:
(defun foo nil 1)
It kinda makes sense, but it does read strangely.
miniblog.
I'm a big fan of history-based fuzzy directory switchers like autojump. I used fasd until recently, but I've started playing with zoxide and it's been good so far.
This is such an established niche that zoxide can import history from other tools! https://github.com/ajeetdsouza/zoxide#step-4-import-your-data-optional
I'm really excited about the possibility of using tree-sitter in difftastic. I get accurate JSX parsing for free!
$ tree-sitter parse -- '/home/wilfred/.emacs.d/**/*.el' --quiet --stat
Total parses: 2272; successful parses: 2271; failed parses: 1; success percentage: 99.96%
It's super easy to test a tree-sitter parser against a large corpus, and to iron out the details!
Playing with my elisp grammar has exposed some interesting corners of the syntax that I haven't seen before.
This is a legal character:
?\C-\M-\S-\H-\s-\A-i
Actually pressing ctrl-meta-shift-hyper-super-alt-i might be a little challenging though :)
I've released tree-sitter-elisp: https://www.npmjs.com/package/tree-sitter-elisp
It supports most of Emacs Lisp, and it should enable you to take advantage of the tree-sitter ecosystem.
(You could even edit elisp in neovim if you really wanted!)
My ideal programming language would have an elegant core that makes reading the implementation a joy.
It would also have one intentional wart, so users write code rather than their own implementation.
(Sometimes I wonder if some languages have already taken this approach!)
I tried tree-sitter today and it's exceptionally good.
The tooling is wonderful: the basic tutorial shows you how to define a grammar, a test suite, and provides a convenient CLI for generating efficient C parsers!
https://tree-sitter.github.io/tree-sitter/creating-parsers
Including poetry in your database protocol, to prevent competing implementations! https://dacut.blogspot.com/2008/03/oracle-poetry.html
I'm still trying to get a good solution for side-by-side display in difftastic. I'm experimenting with .. for line numbers, so it's more obvious when a hunk begins and ends.
(I toyed with -- instead of .., but - really risks confusion in a diff tool!)
If function f1 is unused, and f2 is only called from f1, Rust complains that both f1 and f2 are unused.
I find this confusing: it's useful to know that I can remove both functions, but removing f2 alone gives a compile error.
Not sure what the best tradeoff is though.
Exciting to see Google advocate for a standard linear smear for leap seconds! Smearing feels like the best solution, we just need consensus on how to do it.
https://developers.google.com/time/smear
prism.el is an excellent highlighter that uses nesting depth: https://github.com/alphapapa/prism.el
It has some really compelling screenshots (e.g. it makes the funcall more obvious here) and even works for non-lisps!
On the nuances of Rust inlining, crate boundaries, and what gets inlined by default: https://matklad.github.io/2021/07/09/inline-in-rust.html
Good news: it's super easy to add LTO to Rust projects, and only added 60 seconds to difftastic's link time:
[profile.release]
lto = true
Bad news: It only reduces the difftastic runtime by ~5%.
At least it didn't require much wrangling to try :)
I've started experimenting with inline displays for difftastic. It handles long lines way better, and your eyes don't need to jump around as much.
Here's a mockup of the display I have in mind, along with today's side-by-side display.
I used to think repositories with multiple packages were a niche feature (cargo workspaces in Rust, Lerna in JS), but they're really valuable for the ecosystem.
Large projects will naturally develop mature, reusable code. Making it easy to release their helpers is worthwhile.
rust-analyzer has a really cute feature "highlight related". It will highlight the enclosing loop when cursor is on `break`, or the enclosing `async` when cursor is on `await`: https://github.com/rust-analyzer/rust-analyzer/pull/9678
I've just released difftastic 0.6!
Comment diffing is now much smarter, output alignment is way improved, several major crashes have been fixed, and I've even added Go support :)
A cute feature in Pharo 9: dynamic rewriting of deprecated methods! The code and runtime are so closely integrated that you can use test execution to automatically update call sites.
https://github.com/pharo-project/pharo-changelogs/blob/master/Pharo90ChangeLogs.md
Showing 1,001-1,020 of 7,508 posts