Pinned toot

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

prophetlabs.de/posts/insttypes

Prophet boosted

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

Show thread
Prophet boosted

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

prophetlabs.de/posts/insttypes

Prophet boosted
Prophet boosted

== 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:
gist.github.com/chshersh/42bc0

I also used the new \cases keyword from GHC 9.4 which is perfect for such cases (pun intended).

Happy coding! 🍀

Prophet boosted

Haskell
OCaml
Polaris
Rust
C
C++
x86_64 Assembly
Agda
Java
SQL

Prophet boosted

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.

gist.github.com/Innf107/ebc0cd

(Also thanks to cohost.org/leftpaddotpy for the nerdsnipe)

Prophet boosted

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. ↵

Prophet boosted

re: cw: stallman epstein take 

"I use Linux as my operating system," I state proudly to the unkempt, bearded man. He swivels around in his desk chair with a devilish gleam in his eyes, ready to mansplain with extreme precision. "Actually", he says with a grin, "Linux is just the kernel. You use GNU+Linux!' I don't miss a beat and reply with a smirk, "I use Alpine, a distro that doesn't include the GNU coreutils, or any other GNU code. It's Linux, but it's not GNU+Linux."

The smile quickly drops from the man's face. His body begins convulsing and he foams at the mouth and drops to the floor with a sickly thud. As he writhes around he screams "I-IT WAS COMPILED WITH GCC! THAT MEANS IT'S STILL GNU!" Coolly, I reply "If windows was compiled with gcc, would that make it GNU?" I interrupt his response with "-and work is being made on the kernel to make it more compiler-agnostic. Even you were correct, you wont be for long."

With a sickly wheeze, the last of the man's life is ejected from his body. He lies on the floor, cold and limp. I've womansplained him to death.
Show thread

Update: apparently, init depends on libcrypto as well, so rebooting caused a fucking kernel panic

Show thread

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?

Show thread
types.pl

A Mastodon instance for programming language theorists and mathematicians. Or just anyone who wants to hang out.