Better HN
topnewbestaskshowjobs
Log inSign up

PartiallyTyped

2,940 karma · joined Oct 16, 2020 (6y ago) · 2,890 submissions

me [at] [$handle].dev

----------------------------------------------------

Submissions

comment 2y ago · link · parent

It's amusing. The older I grow, the more to "the left" I move.

comment 2y ago · link · parent

Clippy and the rust project as a whole.

comment 2y ago · link · parent

> Classic case of evil hiding behind the guise of good.

Could you elaborate?

comment 2y ago · link · parent

Quite a few things actually, but the biggest one is that I believe that [almost] nobody is beyond rehabilitation. Even in cases where the person is beyond, it doesn’t mean we ought to make them suffer for their circumstances.

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

Does numpy have a cuda backend without numba?

comment 2y ago · link · parent

I suppose to also keep the meow out of the homeöwner (ho-meow-ner)

comment 2y ago · link · parent

I think zig fits what you've described. It doesn't try to be a new C++, it only tries to be a modern C.

comment 2y ago · link · parent

I am trying to learn type theory and get into grad school.

comment 2y ago · link · parent

I found that it is extremely difficult for me to set habits and keep them. I used to go running 4-5 times a week for months, and I couldn't make it stick.

comment 2y ago · link · parent

That's right, you can pack things with a pragma directive in C and C++ for some compilers.

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.

[1] https://doc.rust-lang.org/nomicon/repr-rust.html

comment 2y ago · link · parent

I don't associate myself with that particular group of people, nor did I in any way condone such behaviour, nor do I support long-termists and so on.

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

I don't understand the reaction.

> 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

That's a special case and sits at the boundaries / bridge of languages.

> 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.

https://doc.rust-lang.org/nomicon/repr-rust.html

comment 2y ago · link · parent

In general, Rust fields are padded such that they aligned to a multiple of their size. Rustc does not offer guarantees on the ordering of the fields. This holds for all types, not just 128bit values.

This allows rust programs to actually use less memory than C programs.

comment 2y ago · link · parent

The world could always use more people like that.

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

> What does "strategy" mean here? I might just happen to have a strategy which involves betting on the exact sequence of heads and tails in a given sequence.

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

Recommendation; instead of "cheap alternative", you could use "more affordable" as that has a positive connotation whereas the former has a negative connotation.

comment 2y ago · link · parent

> It is important not to bullshit yourself when learning Maths. If you don't do exams, there are so many ways to fool yourself into thinking you know what you're talking about.

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

> enthousiast realized they were using insane cooling to get it there.

Didn't they use a chiller?

comment 2y ago · link · parent

I just noticed. Thanks for this friend. Much appreciated!

comment 2y ago · link · parent

This is the first time I encountered this, and I wish I had seen it earlier. It's a great read!

comment 2y ago · link · parent

We saw that succeeding once isn't sufficient, you need to keep improving a-la NVDA fashion. Has intel learned this?

comment 2y ago · link · parent

I can certainly tell you that AZ had unregulated water usage which was exploited to grow alfalfa and ship that to Saudi Arabia.

comment 2y ago · link · parent

> Without the culture that tooling much be hard, rather developers are users as well.

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

Why am i not surprised and even find this amusing? :D

comment 2y ago · link · parent

I have a big gripe with rust and other modern languages like zig, and it’s difficult to reconcile it.

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

I read about this around and tbh I respect it a lot. Somehow Jensen has managed to scale the company and still keep it focused on the product with high eng practices.

comment 2y ago · link · parent

If you do the compilation locally, you know the structure of the ABI for the compiled code. You know that regardless of the backend you are using. At this stage, no functions with generics are compiled, only what is non-generic.

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.

comment 2y ago · link · parent

I am fairly certain that ClosedAI has shown that training agents in robotics simulation generalises to reality rather easily.
1
141516
97