Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
assbuttbuttass
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
61.
▲
by
assbuttbuttass
2y ago
CPS is a cool technique, and makes advanced constructs like call/cc trivial to implement. Using CPS techniques in code can feel like magic. But CPS isn't really the state of the art for functional compilers anymore. It's comp
62.
▲
by
assbuttbuttass
2y ago
https://go.dev/ref/spec#Address_operators
63.
▲
by
assbuttbuttass
2y ago
> I think the penguin believes Joao is ... a penguin as well This idea seems completely ridiculous to me. Penguins have eyes, they can obviously see that a human is not a penguin. But it seems like this is a common idea for some reason.
64.
▲
by
assbuttbuttass
2y ago
I'm looking at the postgres docs now, and they certainly have the arcane formal syntax definitions, but they also have plenty of useful examples https://www.postgresql.org/docs/current/sql-altertable.html#...
65.
▲
Show HN: I created a minimalist pastebin clone using Go, Htmx, and PostgreSQL
(notepad.moe)
2 points
by
assbuttbuttass
2y ago
|
1 comments
66.
▲
by
assbuttbuttass
2y ago
Probably something like this already exists, but I wanted a simple and secure way to share snippers between machines, so I created https://notepad.moe ! All notes are securely encrypted with AES, and can only be accessed if you k
67.
▲
by
assbuttbuttass
2y ago
> it would be fundamentally incorrect to ever call a function marked as async from most points of your program flow For a language with async/await yes, you need to bifurcate your program into synchronous and asynchronous pieces, an
68.
▲
by
assbuttbuttass
2y ago
> if you don't need the result of the promise in the caller function you don't need to await and to make it a async function Why call it at all, then? In Rust, futures don't run unless you poll them, so just calling an asy
69.
▲
by
assbuttbuttass
2y ago
https://go.dev/tour/methods/16
70.
▲
by
assbuttbuttass
2y ago
No, the equivalent go code would be package main import "fmt" type Yer[T any] interface { Y() T } func foo[V any, X Yer[V]](x X) V { return x.Y() } type X struct { y int } func (x X) Y()
71.
▲
by
assbuttbuttass
2y ago
defer gets executed at the end of the current function
72.
▲
by
assbuttbuttass
2y ago
The downside of something like indexmap is now removal is O(n)
73.
▲
by
assbuttbuttass
2y ago
panic() already exists
74.
▲
by
assbuttbuttass
2y ago
> ignoring legal norms is neither stated, nor implicated position of conservative political movements The Republican candidate for president in the USA is a convicted felon
75.
▲
by
assbuttbuttass
2y ago
Spotify's recommendation algorithm sucks, but I have a lot of my favorite songs that I discovered through YouTube music's algorithm
76.
▲
by
assbuttbuttass
2y ago
Thanks, that makes sense. I think the bcachefs --replicas option does something similar
77.
▲
by
assbuttbuttass
2y ago
My understanding is that RAID1 is just a mirror, and all disks have identical contents. Are you talking about something else?
78.
▲
by
assbuttbuttass
2y ago
I don't necessarily agree that testability is the same thing as modularity. In my experience, tests that focus on one module in isolation and try to fake/mock all dependencies, including other modules in the same system, tend to b
79.
▲
by
assbuttbuttass
2y ago
People treat Github like social media
80.
▲
by
assbuttbuttass
2y ago
Fortunately you can use an options struct which retains most of the benefits of named parameters
81.
▲
by
assbuttbuttass
2y ago
rlwrap provides line-editing capabilities including ctrl-a, ctrl-e, and up and down arrows to recall previous commands
82.
▲
by
assbuttbuttass
2y ago
Rust has a similar problem, where any future can be dropped at any time in async code, effectively cancelling the future. This means all async code has to be ready to be unexpectedly cancelled at any await point, and implement any defensive
83.
▲
by
assbuttbuttass
2y ago
It's annoying. I just copy anything important from chat messages into a big text file
84.
▲
by
assbuttbuttass
2y ago
This maps UInt32Max input values to N output values, so there is guaranteed to be bias by pigeonhole, unless N divides Uint32Max
85.
▲
by
assbuttbuttass
2y ago
> The compiler knows better than the programmer what the hardware can copy fast This is true, but aliasing makes it extremely difficult to automatically decide between reference and copy. For example, suppose you have a function that tak
86.
▲
by
assbuttbuttass
3y ago
I have to say, I am not convinced by this article that async composes better. The nice thing about green threads/fibers is you can make concurrency an internal detail: a function might spawn threads internally, or block, but the caller
87.
▲
by
assbuttbuttass
3y ago
I TA'd for this course back in undergrad. Despite being in the CS department, it's structured like a math class, and all of the homework assignments are proof-based. I don't think I wrote code for that course a single time, e
88.
▲
by
assbuttbuttass
3y ago
IMO, any program using naive timestamps is probably doing something wrong. Same with fixed offsets (except UTC obviously). For local time zone, how often does the local time zone change, and you want to modify all timestamps in the system?
89.
▲
by
assbuttbuttass
3y ago
from whenever import ( # For the "UTC everywhere" case UTCDateTime, # Simple localization sans DST OffsetDateTime, # Full-featured IANA timezones ZonedDateTime, # The
90.
▲
by
assbuttbuttass
3y ago
I really like Go's "time" package. The only pitfall I can think of is that it doesn't really handle overflow at all. https://pkg.go.dev/time
More ›