HackerTrans
TopNewTrendsCommentsPastAskShowJobs

artikae

no profile record

comments

artikae
·il y a 3 mois·discuss
Goodhart's Law vs the Turing Test! Can our humans accurately evaluate intelligence, or will they be fooled by fakes? Live this Sunday!
artikae
·il y a 9 mois·discuss
Yea, but, this is Rust. How is a moving GC supposed to handle an untagged union? Or a person who uses the now-stable provenance api to read/write pointer bits to/from disk.
artikae
·il y a 9 mois·discuss
A Gc<T> that can't give you a pointer inside seems almost unusable in the context of Rust. Pointers are not a narrow use case; references are pointers.

Rust APIs are largely built around references. If you were to put a Vec<T> (dynamic array) into a pointerless Gc<T>, you would be almost entirely unable to access its contents. The only way to access it would be swap it with an empty Vec, access it, then swap it back a-la Cell. You wouldn't even be able to clone the Vec without storing a dummy version in its place during the call.

https://doc.rust-lang.org/stable/std/cell/struct.Cell.html#m...
artikae
·il y a 12 mois·discuss
> those only apply to arrays of primitives

I guess you've not written much python, or just not used any custom types in lists if you have.

    class Thing:
        def __init__(self, a, b):
            self.a = a; self.b = b
        def __eq__(me, them):
            return me.a == them.a and me.b == them.b
    >>>[1, 2, Thing(6, "Hi")] == [1, 2, Thing(6, "Hi")]
    True
    >>>[1, 2, Thing(6, "Hi")] == [1, 2, Thing(6, "Hello")]
    False

In this case, the builtins are syntax, namely the `==` operator. There's a uniform syntax for comparing two objects for equality.
artikae
·l’année dernière·discuss
Are you blind or using Orca to interact with your computer? If the answer is no, then your recent experience with Debian is not particularly relevant to what the article is talking about, since you obviously wouldn't have run in to any of the issues discussed.
artikae
·l’année dernière·discuss
What about this: https://godbolt.org/z/xP9xG3Ee3

Here the compiler "register allocates" i for some reads but not for others.

i gets stack allocated, but some uses of it act as though they were register allocated.
artikae
·l’année dernière·discuss
assoc-in reminds me a lot of lenses in Haskell. I figure you could probably implement something like it using them. This is what I came up with:

  import Control.Lens
  baseLens --> nextIndex = baseLens . ix nextIndex
  assocIn structure keyLens newValue = set keyLens newValue structure
It works like so:

  setTo256 structure = assocIn structure (ix 0 --> 0 --> 0) 256
  -- setTo256 [[[1]], [[2]]] returns [[[256]], [[2]]]
artikae
·il y a 2 ans·discuss
All it takes for something to be replaced is something that does the job better. You can only really apply your definition in hindsight, after something has stood the test of time. You can't tell the difference between sails and wheels until after the rise of the steam engine.
artikae
·il y a 2 ans·discuss
The first line is already UB. `assume_init` requires the contents to be initialized, hence the name.