91 karma · joined Jul 19, 2021 (5y ago) · 36 submissions
comment 1w ago · link · parent
* Resilient
* Cheap
Pick 2
With the advent of individual computers/disks/networking equipment not breaking as much, we optimised for Efficient+Cheap software. This results in systems prone to cascading failures.
The most resilient systems I've worked (mostly telecom) on we built from crappy parts which broke all the time, and they sure weren't cheap.
comment 1mo ago · link · parent
https://louissven.xyz/article/how_I_do_container_types_in_C....
Feel free to flag/delete if this isn't the place.
comment 6mo ago · link · parent
He told me he found AI to make him really productive and said something along the lines of: "It's really good at summarizing long reports and it saves me time when I have to write end of quarter status updates".
I'm convinced about 50% of management decisions come from Claude now.
comment 9mo ago · link · parent
comment 1y ago · link · parent
Same for font rendering, there is a reason why harfbuzz is used everywhere. Getting an 80% working renderer is easy but the remaining 20% can take years.
It really "handling text correctly"should be a masters, and I'd sign up in a heartbeat.
comment 1y ago · link · parent
struct Vec {
void *data;
size_t len;
size_t cap;
size_t sizeof_ty;
}
I then use a macro to define a new type IntVec {
struct Vec inner;
int ty[0];
}
Using the zero sized filed I can do typeof(*ty) to get some type safety back.All of the methods are implemented on the base Vec type and have a small wrapper which casts/assets the type of the things you are trying to push.
comment 1y ago · link · parent
A truly robust C program will generally be much larger than the equivalent Rust program.
comment 1y ago · link · parent
Regex searches and code highlight might introduce some hitches due to all of the seeking.
comment 1y ago · link · parent
The core data structure (array of lines) just isn't that well suited to more complex operations.
Anyway here's what I built: https://github.com/lorlouis/cedit
If I were to do it again I'd use a piece table[1]. The VS code folks wrote a fantastic blog post about it some time ago[2].
[1] https://en.m.wikipedia.org/wiki/Piece_table [2] https://code.visualstudio.com/blogs/2018/03/23/text-buffer-r...
comment 1y ago · link · parent
And yeah it seems to be missing a few connections but the ones that are there are correct line.h depends on str.h which links str.c which depends on xmalloc.c/h.
But had I been a new contributor to the project I would have found the missing links between modules pretty frustrating.
My guess is that the graph is only good enough to give and overview of what things are dependent on what if I were working on a monorepo and I had to justify to my manager that team B needs to do something for us.
I like the idea though, a lot of direct code to graph tools are too noisy and that tends scares non technical people away.
comment 1y ago · link · parent
Might be a bug, so here's the repo. https://github.com/lorlouis/cedit
comment 2y ago · link · parent
We ended up not using it in production because the worst cases were absolutely terrible compared to our dumber skippable zstd.
comment 2y ago · link · parent
comment 2y ago · link · parent
comment 2y ago · link · parent
<https://cedardb.com/blog/german_strings/>
You could probably write a C++ implementation based on the article.
Note that it's not all that useful if you don't plan on searching for text based on their prefix. From my understanding, this is mostly a better way to store SStables in RAM/partially on disk if you mmap.
comment 2y ago · link · parent
comment 2y ago · link · parent
Very interesting blog post about graphemes that parallels my experience writing a terminal text editor: https://mitchellh.com/writing/grapheme-clusters-in-terminals
* Event that is not a proper description of a grapheme
And don't even get me started on regexes