HN user

Rendello

2,216 karma

gaven@<user>.ca

Posts54
Comments763
View on HN
duckdb.org 4mo ago

Lightweight Compression in DuckDB

Rendello
1pts0
archive.nytimes.com 5mo ago

I Know What You Think of Me

Rendello
3pts1
www.gutenberg.org 6mo ago

The Anatomy of Melancholy (1621)

Rendello
3pts0
hn.algolia.com 7mo ago

Please Don't

Rendello
37pts9
www.youtube.com 8mo ago

Bryan Cantrill – The Complexity of Simplicity [video]

Rendello
7pts1
news.ycombinator.com 9mo ago

Ask HN: The most powerful use of macros / code generation you've had

Rendello
1pts2
dl.acm.org 9mo ago

A Simple Guide to Five Normal Forms in Relational Database Theory (1983)

Rendello
1pts1
swatinem.de 9mo ago

Optimizing Rust Enum Debugging with Perfect Hashing (2023)

Rendello
2pts0
ericlippert.com 10mo ago

Persistence, façades and Roslyn's red-green trees (2012)

Rendello
1pts0
languagelog.ldc.upenn.edu 10mo ago

Polysyllabic Characters in Chinese Writing

Rendello
2pts0
old.reddit.com 1y ago

What script and language is this? Reddit thread

Rendello
3pts0
www.youtube.com 1y ago

Rediscovered forgotten Viking spear bows [video]

Rendello
1pts0
news.ycombinator.com 1y ago

Ask HN: What are your Unicode woes?

Rendello
5pts11
0x80.pl 1y ago

SIMD-friendly algorithms for substring searching (2016)

Rendello
223pts35
www.unicode.org 1y ago

Re: Unicode in the Curriculum?

Rendello
2pts4
saharan.github.io 1y ago

GraphSynth

Rendello
2pts0
news.ycombinator.com 1y ago

Tell HN: macOS is currently detecting Docker as malware

Rendello
7pts1
news.ycombinator.com 1y ago

Ask HN: Stuck on a project, strategies to progress?

Rendello
4pts2
games.digipen.edu 1y ago

Igneous

Rendello
2pts1
news.ycombinator.com 1y ago

Ask HN: Other websites using HN's forum software (news.arc)?

Rendello
22pts7
unicode.org 1y ago

Unicode Character Properties, Case Mappings and Names FAQ

Rendello
1pts0
github.com 1y ago

Show HN: The Canada census data in a SQLite file; advice appreciated

Rendello
6pts6
www.sqlite.org 1y ago

SQLite: Outlandish Recursive Query Examples

Rendello
201pts54
news.ycombinator.com 1y ago

Ask HN: More courses like Math Academy?

Rendello
1pts0
en.wikipedia.org 1y ago

List of partitions of traditional Japanese architecture

Rendello
1pts0
gist.github.com 1y ago

UTF-8 characters that behave oddly when the case is changed

Rendello
72pts63
hackaday.io 1y ago

Mental-1, a Brainfuck CPU

Rendello
41pts3
webonastick.com 1y ago

Routed Gothic Font

Rendello
208pts32
en.wikipedia.org 2y ago

List of Generation Z Slang

Rendello
43pts44
www.newyorker.com 2y ago

The Coach in the Operating Room (2011)

Rendello
1pts0

One of my favourite articles is "SIMD-friendly algorithms for substring searching" by Wojciech Muła [2]. If you were unfamiliar with SIMD and just jumped into the code, it'd be incomprehensible due to the intrinsics, but the generic algorithm description at the top is pretty simple if you take some time understand it.

It blew my mind once I understood what was happening, because it's quite clever but one of those "I could've thought of that" algorithms. There was some pretty good discussion on it last year (feat. ripgrep). [2]

1. http://0x80.pl/notesen/2016-11-28-simd-strfind.html

2. https://news.ycombinator.com/item?id=44274001

Vectors (in C++) at least aren't necessarily the best fit either

I'm not sure if you use a different allocation strategy or if you're advocating allocating as much as possible up-front, but I'm curious if you have any thoughts on this:

I always end up using (Rust) vectors despite looking at a bunch of slab/arena allocation libraries. Preferably I'd know how much memory I need up front, but barring that I see three options for any allocation that needs to grow:

- Fail;

- Reallocate; or

- Put the overflow in a new allocation, keeping track of where all the "pages" are internally.

In 2, you can't use references/slices (anything with a pointer) because the potential reallocation invalidates those. In 3, it seems ideal because references can stay stable, but you wouldn't be able to have any array-like data cross the "page" barrier as the pointer jump would not be stable. (Although, am I correct in thinking the OS does something like this, and that's why pointer addresses are virtual?).

So, you can't really internally reference data in this sort of context by reference/pointer, it's preferable to use an integer index. In that case, what's the point of the allocator libraries at all? Your standard Vector would have the same reallocation/access characteristics, and you can set a reasonable initial capacity to try and avoid reallocations.

A good introduction to SoA (for anyone curious) are the two most famous Data-Oriented Design talks by Mike Acton (game engine dev) [1] and Andrew Kelley (Zig lead dev) [2] respectively.

I read a book book about DoD [3] really which confused me at first with all its talk about database table design (in a book about a high-performance C++ game engine?), but when it finally clicked it was amazing. The point is that you want to think hard about your access patterns and what could constitute good "primary keys", then model it accordingly. SoA ends up being useful a lot of the time, because having your data in homogeneous arrays/vectors is great for cache locality and branch elimination. Even without SIMD you can get huge speedups from that, but that's also where your compiler (or you as a programmer) can get incredible SIMD gains.

SoA is not a silver bullet as it may not align well with your access patterns, but it can great to add to your toolkit.

---

Mike Acton: Data-Oriented Design and C++: https://www.youtube.com/watch?v=rX0ItVEVjHc

Andrew Kelley: A Practical Guide to Applying Data Oriented Design: https://www.youtube.com/watch?v=IroPQ150F6c

Richard Fabian: Data-Oriented Design: https://www.dataorienteddesign.com/dodbook/

I like SIMD, but before super-optimizing your code with SIMD and the like, really consider your data structures and access patterns.

I've been singing Data-Oriented Design's praises, so I'll just collect all my comments here [1], but I think it's a good approach to optimization. I played around with SIMD in my old code (in Zig), but my approach to modelling datastructures was so antithetical to optimization, it was like putting high-performance racing tires on a lemon with a broken engine.

It was the root-of-all-evil-type-premature-optimization, because I wasn't measuring performance, and I wasn't thinking about where the allocations were, etc. Now, I try to model my data as if it were SQL tables, see what my potential "primary keys" could be, and build my data structures around my access patterns.

For example, I used to model trees as structs pointing to other structs on the heap:

    struct Tree {
        tag: TreeTag,
        children: Vec<&Tree>
    }
Now my tree has all the bad characteristics of a linked list (* n nodes * m children), all the fragmentation of multiple heap vectors (* n nodes), and terrible set-up / tear-down time (in this case, Drop alone was taking up a good chunk of runtime).

But a tree can be represented a million ways, and can always be linearized. So now I really consider my access/insert patterns of the tree, whether it's really a tree or some other sort of graph, whether I can store it in a Vec or a Struct of Vecs, etc. Since really looking at things through their access patterns and "primary keys", my code has been much faster and simpler.

This has the added effect that a lot of your data ends up in homogeneous arrays / vecs, which means that the compiler can do its SIMD magic, the CPU can read it from your L1 cache a million times faster, etc. And then when you need to drop down into SIMD yourself, you can write some awesome branchless code.

1. https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...

offers a more overwhelming MC Escher-like experience

That reminds me of one of my favourite games of all time, Knossu [1]. It's a short game from the peak of the indie era, written by Jonathan Whiting (whose post "Why I write games in C" made the rounds a few times here [2]). It's not anything like a train station, but it's non-Euclidean, labyrinthine, and surreal. My favourite part is that despite it being extremely simple (WASD only), and despite having beat it, I still don't really understand the core mechanic. It feels like a dream.

Actually, hell, that reminder reminds me of another similar looking game, LSD: Dream Emulator [3]. One of the many surreal Platstation 1 & 2 "games" from Japan. I haven't played it, but I've been thinking about it lately as it's the cover art for Alt-J's album Relaxer [4].

Which reminds me of another *--STACK OVERFLOW--*

1. https://jonathanwhiting.com/games/knossu/press.html

2. https://hn.algolia.com/?q=Why+I+Write+Games+in+C

3. https://en.wikipedia.org/wiki/LSD:_Dream_Emulator

4. https://en.wikipedia.org/wiki/Relaxer_(album)

I thought the horror game "Exit 8" was going to be like that when I bought it: having to navigate through a labyrinthine nightmare version of Shinjuku or Shibuya station, trying to remember the passageways and —hey wait... was that escalator there before?

Turns out is was the opposite since the whole game takes place in a single hallway. It was still a lot of fun though!

https://en.wikipedia.org/wiki/The_Exit_8

Homeric Question 2 days ago

I've been interested in ancient Roman and Greek texts of late, and although I can't imagine dedicating myself to learning an ancient language when there are so many living languages to learn, I do find them very cool.

Just yesterday I just came across this reading of the Iliad in the original Homeric Greek:

https://www.youtube.com/watch?v=u1KkZH6hWyU

It's amazing that we have texts from 8 centuries BC, and also that the Hellenic identity and culture has survived such a long time.

SQLite is slightly different from Rust in that it is a data container.

I think this is the key.

From sqlite.org [1]:

[Since 2004], the file format has been fully backwards compatible.

By "backwards compatible" we mean that newer versions of SQLite can always read and write database files created by older versions of SQLite. It is often also the case that SQLite is "forwards compatible", that older versions of SQLite can read and write database files created by newer versions of SQLite. But there are sometimes forward compatibility breaks. Sometimes new features are added to the file format

---

Given editions (A) and (B), what does backwards compatibility look like? Must (B) be backwards compatible with (A)?

If yes -> editions are backwards compatible but not necessarily forwards compatible, which is the current status quo:

    -------(A)----(B)--
If no -> editions are not backwards compatible, the edition space is bifurcated:
    ---+----(A)--------
        \
         \--(B)--------
Now you may have to worry about backwards compatibility with (A)..(Z). What happens when you import a file from edition (Y)?

1. https://www.sqlite.org/formatchng.html

---

Interesting PS, grepping sqlite.org for "backwards compat": https://pastebin.com/Q7b7h4eM

It might be worth bringing this up on the forum [1]. The developers are quite active there, and it's possible they've never considered this option, or they have considered it and have reasons to not go for it. The original design followed Postel's Law (see my comment from the other say [2]), it would (theoretically) be nice if that mess could be avoided by specifying an edition.

Today I noticed I could do `pragma foreign_key = ON`, and despite the pragma being wrong (it should be foreign_keys, plural), it reported nothing. In fact, it reports nothing with the correct pragma either. So check your pragmas!

1. https://sqlite.org/forum/forum

2. https://news.ycombinator.com/item?id=48900625

N+1 9 days ago

I should've been clear that I was responding more to the comment than the article or N+1. I skimmed it and agreed with the root comment "[I've] heard nothing about anything this article references".

N+1 9 days ago

today's high culture all seems to be predicated upon feigning enlightenment

That must be the marker of "high" culture throughout history generally, right?

I like this quote from a funny video on ancient Greek philosophy (although I'd probably be less amused by the layers of nonsense if the people around me were deep into it):

Philosophy is known for being equal-parts Pretentious and Needlessly Confusing, and that’s definitely true, especially after Descartes shows up, but there is one thing that Philosophy is not, and that is “Boring”, because it is WAY too stupid. Anybody who tells you that Philosophy is the unflinching pursuit of objective truth is lying to you and to themselves — Philosophy is a mess where everyone is competing for the most galaxy-brained take on the world, and that’s why I Love It, dammit.

https://www.youtube.com/watch?v=f9ve3BARdFI

I've read that Japan had some crazy pollution and littering until regulations and campaigns in the 70s. Alright, I'll admit, I saw it on a Youtube short [1].

There doesn't seem to be a lot of information on the change on the Internet (at least not the English Internet), but this Japanese guy's anecdotes seem to corroborate it [2]. It makes sense, a lot of countries started taking pollution and littering more seriously around the 70s. It looks like that's when Japan started regulating it seriously [3]:

from 24 November to 18 December 1970, 14 pollution control bills were passed into law [...] overnight, Japan was transformed from a country with meagre environmental regulations, to one of the strictest in the OECD.

1. https://www.youtube.com/shorts/PP60G-lMiDA

2. https://tour-hiro.com/blog/culture/5721/

3. https://en.wikipedia.org/wiki/Pollution_Diet

The SQLite docs have a great "quirks" page [1], which contains this telling quote:

The original implementation of SQLite sought to follow Postel's Law which states in part "Be liberal in what you accept". This used to be considered good design - that a system would accept dodgy inputs and try to do the best it could without complaining too much. More recently, people have come to prefer software that is strict in what it accepts, so as to more easily find errors.

There are now millions of applications that take advantage of SQLite's flexible and forgiving design choices. We cannot change SQLite to follow the current preference toward strict and dogmatic behavior without breaking those legacy applications.

1. https://sqlite.org/quirks.html

Abraham Lincoln used to write angry letters and stow them away, unsigned and unsent [1]. The book "How to Win Friends and Influence People" claims he stopped harshly criticizing people publicly after being challenged to a duel [2] by a government official he had attacked anonymously in the press.

1. https://www.battlefields.org/learn/primary-sources/lincolns-...

2. https://www.battlefields.org/learn/articles/abraham-lincolns...

Perhaps there's a U-curve. When I worked in a hotel in a metropolitan city, almost all workers there were multilingual. People from lower-income countries tended to do the unskilled work, whereas people with higher education tended to work at the front desk and in office roles, both having a mix of temporary and permanent residents.

It makes sense to me that the great in-between has less incentive to learn another language, if they're in a monolingual milieu. They don't have the economic push to find better opportunities elsewhere nor the means (or at least the idea) to travel and explore.

Shin-hanga is one of my favourite art movements, it was the confluence of traditional Japanese woodblock carving and contemporary Western painting. Unlike the latter, you can actually buy authentic prints for a reasonable price, given that the medium of print blocks was made for mass-production (though on a much smaller scale than modern printing).

That's the cool part about woodblock printing, you can use different palettes to make multiple editions of the same print. You have to reset the gradients on each pass, in either case.

I first took sun exposure seriously after backpacking and spending time with other young travellers in hostels. It was apparent who spent their time exposed to the sun, I remember a girl my age who was in the middle of a multi-year cycle tour, and although I envied her journey, her skin looked quite rough. I decided that if I ended up doing that, I'd get one of those cycle helmet brim visors and would probably just cover my face during a lot of the riding portions.

Then I met a man who did kayak tours of a city. He was awesome, but really leathery due to the 20 years in a boat without shade and having the UV reflections off the water. Your skin cancer risk is off the charts at that point.