After *checks notes* 6 months, I finally finished another blog post!
This time I actually got it working without segmentation faults or undefined behavior.
I did discover a bug in GHC 9.2 though
Anyway these are the same people who brought you "the metaverse offers trillions in economic opportunities" so. Idk. I'm not sure how more people aren't catching on that these people are gormless dipshits
Fast Map Union and Local Instances Through Instance Types
https://prophetlabs.de/posts/insttypes.html
Discussions: https://discu.eu/q/https://prophetlabs.de/posts/insttypes.html
After *checks notes* 6 months, I finally finished another blog post!
This time I actually got it working without segmentation faults or undefined behavior.
I did discover a bug in GHC 9.2 though
The Onion is on a roll. https://www.theonion.com/evangelical-leaders-announce-j-k-rowling-finally-bigot-1850129128
== Structural Logging in Haskell, Part 1 ==
Okay, let's write some useful #Haskell content here for a change.
When you do logging in sophisticated applications, you're generally logging JSON objects instead of raw texts. Most logging query engines are optimized for searching and filtering JSON values.
However, often you get pieces of information from different sources, and it makes sense to combine them into a single JSON object.
On this note, I would like to introduce a function for merging two JSON objects.
I'm a bit confused why I haven't seen this function either implemented properly or at all in any of the projects or libraries I've seen. It looks like a natural way to merge two JSON objects losslessly.
**UPDATE:** As noted in the comments, the below function is not associative which makes its behaviour less reliable and predictable.
> Previously, I was worried too much about the performance of merging two JSON objects and I researched various logging optimizations, including dependently typed statically known maps for optimized merging. But after working on real projects for a while, I realized that performance here doesn't matter anyway.
The full code can be found here:
https://gist.github.com/chshersh/42bc097c8558aa12fd83bb06c4f455fd
I also used the new \cases keyword from GHC 9.4 which is perfect for such cases (pun intended).
Happy coding! 🍀
New blog post: Polygons from paragraphs: turning a 3D model into HTML and CSS
https://hikari.noyu.me/blog/2023-01-10-polygons-from-paragraphs-3d-model-html-css.html
Haskell
OCaml
Polaris
Rust
C
C++
x86_64 Assembly
Agda
Java
SQL
Honestly the state of the internet is miserable if you're trying to learn things.
Like, you want to learn how to care for an animal? Well, every Google result is a bot generated fake blog. Maybe try YouTube? Well, you have a few new options: there's the person who just got this animal for the first time talking like experts about them. Or there's the literal child telling you what they learned about caring for hamsters from the bot generated fake blogs they just looked up.
This goes for almost anything anymore. There's no expertise, the only advice is just from whoever is the best at SEO, which is often not an actual person. But if it is they probably know as much as you do.
In the last 6 or 7 years I've found myself more and more just digging up ebooks from people who know what the fuck they're talking about.
Haskell's monads can be used to implement CONEFROM
Today I woke up (went to bed actually) and chose violence apparently.
https://gist.github.com/Innf107/ebc0cda7173dde07b525dc3d8634ca0b
(Also thanks to https://cohost.org/leftpaddotpy for the nerdsnipe)
1/ Many will tell you why Python is great for teaching coding, so I'll tell you ways it's not.
State is a bad default. It should be legal but safe & rare. The arc of programming is long and bends towards immutability. Its early use creates messes (eg, "a variable is a box".)
2/ Rich and robust programming requires a strong understanding of data models and invariants. Python is weak at expressing either of those. You don't notice it until you miss it. ↵
re: cw: stallman epstein take
Update: apparently, init depends on libcrypto as well, so rebooting caused a fucking kernel panic
Orange Site... No, the other one! (Reddit)
Something really funny about Reddit is how for most popular subs there is a second, less popular subreddit with the same topic except the people on there are way more rude
r/Programming Languages - r/Compilers
r/programming - r/coding
r/compsi - r/computerscience
Awesome. SSH is broken as well now. I'm actually going to have to connect a keyboard and monitor and manually reinstall my server, am I?
This "person" has a superficial similarity to https://cohost.org/prophet but it is in fact a malevolent agent of chaos. It unpicks the seams of reality (and the Fediverse) so that the normal rules no longer apply. It lulls you into thinking it is reasonable, but when you are not looking it stabs you in the back and aliases all of your mutable buffers. The carcass of many a seasoned Haskell programmer lie strewn at its feet.
Do not talk about "safe"! You do not know what is safe!