news
Programming Leftovers
-
Chris ☛ Guessing Game: Haskell Style
For one thing, the purity in production Haskell in barely noticeable: most functions are in some kind of i/o context, meaning the code in them is similar to what it would look like in other languages. The difference is Haskell makes it easier to refactor code and express intent clearly.
But it might not be clear what it means that “most functions are in some kind of i/o context”, so let’s take a look. Porting the Rust book guessing game tutorial to Ada turned out to be rather popular, and we’ll do the same with Haskell. The program we create will generate a random number between 1 and 100, and repeatedly ask the user to guess which it is, while giving the user hints (like “too low, try again.”) When the user guesses the number correctly, the program will print a congratulatory message and exit.
-
Chris ☛ Guessing Game: Haskell Style
-
NVISO Labs ☛ Detection Engineering: Practicing Detection-as-Code – Documentation – Part 4
Sufficiently documenting our detections is essential in detection engineering as it provides context around the the purpose, detection logic, and expected behaviour of each detection rule. Just as important as documenting individual detections is tracking how the overall detection library evolves. In this part we are looking into how we can tackle both of those issues.
-
Ruben Schade ☛ Allan Jude on fault tolerance
At the risk of turning this blog into merely a transcript of 2.5 Admins, Allan was spot on: [...]
-
Rlang ☛ The birthday problem
The birthday problem is a classic counter-intuitive mathematical result concerning the probability that two people, in a group, have the same birthday. The formal solution is too complex for me but I can use simulations to find out…
-
Rust
-
Matt Palmer ☛ Matthew Palmer: StrongBox: Simple, Safe Data Encryption for Rust
Some time ago, I wanted to encrypt a bunch of data in an application I was writing in Rust, mostly to be stored in a database, but also session cookies and sensitive configuration variables.
Since Rust is widely known as a secure-yet-high-performance programming language, I was expecting that there would be a widely-used crate that gave me a secure, high-level interface to strong, safe cryptography.
Imagine my surprise when I discovered that just… didn’t seem to exist.
-