- 2010: Introductory STL (10 parts)
- microsoft/nurikabe: I open-sourced and slightly modernized my Nurikabe puzzle solver.
- 2011: Advanced STL: Part 1, Part 2, Part 3, Part 4, Part 5, Part 6
- These videos weren't migrated
package main | |
import ( | |
"bufio" | |
"errors" | |
"fmt" | |
"io" | |
"log/slog" | |
"net" | |
"os" |
package cache | |
import ( | |
"sync" | |
"time" | |
) | |
// Cache is a basic in-memory key-value cache implementation. | |
type Cache[K comparable, V any] struct { | |
items map[K]V // The map storing key-value pairs. |
package main | |
import ( | |
"encoding/xml" | |
"flag" | |
"fmt" | |
"go-apps/pkg/flagx" | |
"go-apps/pkg/util" | |
"io" | |
"log" |
import math | |
import uuid | |
class BTree: | |
def __init__(self, order=3): | |
self.root = BTreeNode(order) | |
def insert(self, toinsert): | |
all_elements = self.list() |
At the beginning of 2030, I found this essay in my archives. From what I know today, I think it was very insightful at the moment of writing. And I feel it should be published because it can teach us, Rust developers, how to prevent that sad story from happening again.
What killed Haskell, could kill Rust, too
What killed Haskell, could kill Rust, too. Why would I even mention Haskell in this context? Well, Haskell and Rust are deeply related. Not because Rust is Haskell without HKTs. (Some of you know what that means, and the rest of you will wonder for a very long time). Much of the style of Rust is similar in many ways to the style of Haskell. In some sense Rust is a reincarnation of Haskell, with a little bit of C-ish like syntax, a very small amount.
Is Haskell dead?
#![feature(ip_addr, raw)] | |
extern crate pnet; | |
use std::net::{IpAddr, Ipv4Addr}; | |
use pnet::transport::TransportChannelType::Layer4; | |
use pnet::transport::TransportProtocol::Ipv4; | |
use pnet::transport::transport_channel; | |
use pnet::packet::ip::IpNextHeaderProtocols; | |
use pnet::packet::Packet; |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs