I occasionally see people debate whether important functions should occur first, or helper functions first.
I've not seen it enforced though. It's hard to programmatically enforce.
OCaml takes a side: you have to put helper functions first!
miniblog.
I've hacked together a black-and-white syntax highlighter for difftastic. Here's it running on a historical commit, showing keyword and comment highlighting.
@Azure I've never noticed that before, but now you point out, it feels really inconsistent!
I've been experimenting with black-and-white syntax highlighting in difftastic. Comments are dim gray, keywords are bold. Here's a mock-up.
I'm trying to avoid garish colour combinations or distracting from the red/green of what's changed.
What do you think? Too subtle?
My favourite page in the difftastic manual is the Tricky Cases discussion.
Syntactic diffs/tree diffs have a completely different set of corner cases to textual diffs. It's a useful resource for anyone exploring this space.
https://difftastic.wilfred.me.uk/tricky_cases.html
Neat cargo plugin I haven't seen before: https://crates.io/crates/cargo-expand
`cargo expand` will expand macros so you can see the regular Rust code produced. For example, println!(); expands to this (even syntax highlighted!).
TIL some operating systems do not provide a stable syscall interface, and expect you to use libc. Go 1.16 is switching to libc on several platforms due to this: https://utcc.utoronto.ca/%7Ecks/space/blog/programming/Go116OpenBSDUsesLibc
It's such a tiny thing, but I really like the Python or Lisp convention of putting the doc string inside the definition.
I find I write the signature first anyway, and figure out what I want to call my function, before I know how I want to describe it.
I've released difftastic 0.10!
This version adds four new languages: C, C++, C# and Haskell! See screenshots for examples.
The manual is also substantially expanded, discussing other tree diffing projects and code samples that are hard for tree diffs.
TIL that JetBrains has a product Spaces that competes with both GitHub (source hosting, CI) and Teams (chat): https://www.jetbrains.com/space/
It's an incredibly ambitious project.
Program slicing for Rust in VS Code, allowing you to see which parts of your program affect the current expression!
Pursuit is Javadocs equivalent for Purescript, and it's one of the best looking API docs sites I've seen in a long time. It features versioning, links to individual functions and even links to repo and specific source code.
This screenshot is from
Programming languages usually try to minimise undefined behaviour.
What if you did the opposite?
How much UB could you have whilst still being (theoretically) usable?
StarScan: https://source.chromium.org/chromium/chromium/src/+/master:base/allocator/partition_allocator/starscan/README.md
Really interesting idea for improving manual memory management security: quarantine free()'d value until you can see all references are gone!
An esolang that exclusively uses characters and grammar from traditional Chinese! There are very few languages that are purely non-ASCII, it's interesting to see other examples in this space.
https://wy-lang.org/
(Great looking landing page too.)
Adding C++ support to difftastic!
The change shown here is src/dynamics/b2_distance_joint.cpp in https://github.com/erincatto/box2d/commit/3d92ed4ec487b8e2aff3fc7dc58663870b17c534?branch=3d92ed4ec487b8e2aff3fc7dc58663870b17c534&diff=split and I think it compares pretty favourably with GitHub (second image).
Today I learnt that .cxx is an extension used in some C++ projects because "xx" vaguely resembles "++" rotated! It makes sense, but I'd never spotted the similarity before.
I shared difftastic on /r/rust, and received some great feedback, some feature requests, and two generous people even read the code and suggested optimisations!
https://old.reddit.com/r/rust/comments/pp6y3d/difftastic_a_syntactic_diff_tool/
Showing 941-960 of 7,508 posts