4,299 karma · joined March 20, 2012
https://github.com/lukechampine
https://twitter.com/lukechampine
http://lukechampine.com
I do not embed structs anymore. It is almost always a mistake. I would confidently place it in the "you should be required to import 'unsafe' to use this feature" bin.
Come decompile with us! https://github.com/doldecomp/melee
First is that, if the parsing library for your codec includes a compiler, VM, and PGO, your codec must be extremely cursed and you should take a step back and think about your life.
Second is that, if the parsing library for your codec includes a compiler, VM, and PGO, your codec must be wildly popular and adds enormous value.
A list is not a monad. A list is a data structure; a monad is more like a "trait" or "interface." So you can define a List type that "implements" the monad interface, but this is not an inherent property of lists themselves. That's the sense in which a list "is a" monad: the OOP sense.
Haskell's List monad provides a model for nondeterminism. But that certainly isn't the only way List could satisfy the monad interface! It was a deliberate choice -- a good choice, possibly the best choice, but a choice nonetheless.
...well?
type Foo struct{}
func (Foo) Bar() { println("weird...") }
func main() {
([...]func(){^^len(`
`): (&Foo{}).Bar})[cap(append([]any(nil),1,2,3))]()
} my_function (): Unit can AllErrors =
x = LibraryA.foo ()
y = LibraryB.bar ()
The first thing to note is that there is no indication that foo or bar can fail. You have to lookup their type signature (or at least hover over them in your IDE) to discover that these calls might invoke an error handler.The second thing to note is that, once you ascertain that foo and bar can fail, how do you find the code that will run when they do fail? You would have to traverse the callstack upwards until you find a 'with' expression, then descend into the handler. And this cannot be done statically (i.e. your IDE can't jump to the definition), because my_function might be called from any number of places, each with a different handler.
I do think this is a really neat concept, but I have major reservations about the readability/debuggability of the resulting code.
Yep, it's due to SIMD -- in the assembly for `using_map`, you can spot pcmpeqd, movdqu, and psubd, while `using_loop` doesn't have any of these.
Try it with this classic: https://vektroid.bandcamp.com/track/420
Getting to that point takes many years, to be sure. But the language is simple enough, and changes slowly enough, that it is not an unrealistic goal -- the way it would be in C++, or Rust, or just about any other mainstream language.
They frame it positively, of course ("now your data lives on your device!") but AFAICT it's all downside. I can't browse my location history on a nice big screen, and (very annoyingly) the app does not let you view your aggregate history over the span of a month or year -- only a single day. Plus, if you lose your phone, you lose all that precious data, unless you configure the app to automatically sync your history to Google's cloud...wait what? Wasn't not doing that the whole point? Just baffling.
If I need an escaped version, that's "shrgg": ‾\\\_(ツ)\_/‾
In the past I've implemented a form of the write-buffering you describe -- it was not fun. But it was a lot more important in that context, because flushing a write meant uploading many MB to remote servers. With 4 KB pages flushed locally, I'd wager it's not worth it.
What did I glean from it all? I don't know. It wasn't as mindblowing as I had hoped, frankly. Mostly I was struck by the sad reality that I had failed to predict what would be interesting to my future self. It reminded me of how, as a teenager, I had filled many pages of my journal talking about an MMORPG I was addicted to, rather than how I felt towards my siblings, or my spiritual beliefs, or a funny joke I heard at school, etc. Another sad irony was that the older I got, the more I wrote -- but when I read the letters, the more recent they were, the less interested I was in them. I wanted to read thousands of words written by my 15-year-old self, but all I got was a few sentences. Oh well. Maybe those longer passages will be interesting to 40-year-old me.
Is there a theoretical basis for this? It looks like the "fourth power law" comes from an empirical test conducted in the 50s: https://en.wikipedia.org/wiki/AASHO_Road_Test
However, that article says:
> ...critics point out that its data is only valid under the specific conditions of the test with regard to the time, place, environment, and material properties present during the test. Extrapolating the data to different situations has been "problematic".[3] Other studies have attempted to refine the results, either through further empirical studies, or by developing mathematical models, with varying success.
I have some intuition for why certain physical systems would scale quadratically or cubically, but where on earth is the quartic scaling coming from here??