2,940 karma · joined Oct 16, 2020 (6y ago) · 2,890 submissions
----------------------------------------------------
comment 2y ago · link · parent
That isn’t to say we shouldn’t protect the rest of society, but neither punishment nor retribution — especially in the name of “justice” — are justifiable. If anything, such responses only [temporarily] satisfy one’s desire for bloodlust. They cannot undo the harm done and they cannot relieve us of the pain.
comment 2y ago · link · parent
Rust can take it a bit further. In rust, fields must be aligned to a multiple of their size, and structs/tuples must be aligned to a multiple of their largest element. This combination makes it very easy to handle memory offsets, or reusing the same representation in a way that reduces memory usage (these are called niches)[1].
This is why dynamic linking is a bit more complex in rust. Alternatively you can offer a C bridge via `extern "c"`. C will act as a bridge between rust and different languages, and at that stage you need to take care of ordering and padding.
comment 2y ago · link · parent
My comment was mostly calling out the hypocrisy of some EAs, Long-termists, and the likes. It points out the myopic, self-centered, irrational, and too self-important view, the often exhibited messiah complex, and of course the absence of humility.
comment 2y ago · link · parent
> By default, composite structures have an alignment equal to the maximum of their fields' alignments. Rust will consequently insert padding where necessary to ensure that all fields are properly aligned and that the overall type's size is a multiple of its alignment. [...]
> There is no indirection for these types; all data is stored within the struct, as you would expect in C. However with the exception of arrays (which are densely packed and in-order), the layout of data is not specified by default.
struct A {
a: i32,
b: u64,
}
struct B {
a: i32,
b: u64,
}
> Rust does guarantee that two instances of A have their data laid out in exactly the same way. However Rust does not currently guarantee that an instance of A has the same field ordering or padding as an instance of B.Here is my source: https://doc.rust-lang.org/nomicon/repr-rust.html
comment 2y ago · link · parent
> There is no indirection for these types; all data is stored within the struct, as you would expect in C. However with the exception of arrays (which are densely packed and in-order), the layout of data is not specified by default.
struct A {
a: i32,
b: u64,
}
struct B {
a: i32,
b: u64,
}
> Rust does guarantee that two instances of A have their data laid out in exactly the same way. However Rust does not currently guarantee that an instance of A has the same field ordering or padding as an instance of B.comment 2y ago · link · parent
Something something effective altruism.
It doesn't even need to be altruistic. One would expect that out of sheer self-interest, one would look into propelling humanity forward by elevating and liberating as many people as possible, enabling the brightest of our species to solve the hardest problems and elevate humanity. Though accepting that one needs others to solve problems one does not understand, that they play a supporting role, takes a great deal of humility.
comment 2y ago · link · parent
That's a very narrow program.
> The analogy in terms of languages is that my language might just happen to have a short keyword that represents a given sequence of heads and tails.
The sequence still needs to be generated "somehow". Either by executing the program and producing the sequence, or by explicitly stating it. Even if you have it "cached" and "represented" in your language, you still need to generate the sequence. The resources spent here is the Kolmogorov complexity.
The easiest way to expand your little program is to say that you have a seed s.t. any consecutive generation results in a consecutive sequence that matches up to the period of the generator. Now it is more generic, but has a period. You can then expand this to accept multiple seeds and once it has reached a period, to simply take the next seed.
Should this sequence be finite, you are in luck. Your program can have length O(generator + N/P) where N is length of sequence, and P is the period of your RNG.
All this is is just compression which plays into the whole Kolmogorov complexity.
comment 2y ago · link · parent
I am commenting because I want to express my support for that statement.
Unless you can write down all the steps from start to finish, and then reduce them via the necessary abstractions ( what's a theorem if not a correct abstraction ), you can't claim to "know math". Just as you don't "know" physics if you can't do the math, you don't "know" whatever technical field if you don't know the underlying mathematics.
Hunches, intuition, and everything else can be fooled and are imprecise.
The knowledge one has is — in my opinion — evident in the precision one has when speaking about a subject.
comment 2y ago · link · parent
I don't follow this. Could you elaborate?
I think the current culture is that tooling must be smart, accessible, and very well written, e.g rust (cargo, rustc, clippy, rust-analyzer), go coming with everything, same for gleam. Even zig is a better build system for C programs than most buildsystems for C.
comment 2y ago · link · parent
The gripe is that after using them for a while, anything else like java, python, c++ or C is underwhelming, boring and tedious, an exercise in how long you can uphold standards until you fall back to language defaults.
comment 2y ago · link · parent
What is left is to account for the ABI in any monomorphizations that occur at the boundary, i.e. when your own structures monomorphize generic functions in the dependency.
When the compiler creates this monomorphic variant, and lowers down, it can provide the necessary details of the ABI.