calcopiritus

joined 1 year ago
[–] [email protected] 1 points 5 days ago

Hardware signing stuff is not a real solution. It's security through obscurity.

If someone has access to the hardware, they technically have access to the private key that the hardware uses to sign things.

A determined malicious actor could take that key and sign whatever they want to.

[–] [email protected] 1 points 6 days ago

Editor/IDE, whatever. People claim both about jetbrains.

If you want a purely editor-thing:

Whatever vscode does with Ctrl+D (I don't know the name). Ctrl+D is probably the hotkey I use most in vscode (probably more than Ctrl+S), yet CLion doesn't have that. I've searched multiple times the whole settings for it.

Those two examples are just the ones that most recently occurred to me, it has a lot more issues. For example the lack of a staging area. You can't "git stage" in CLion.

And I don't think that the git integration is free from criticism. Git integration is one of the most important features of IDEs. It's absolutely valid to criticize it.

The autoformatter also doesn't work correctly when developing in remote. Which means that unless I want my PRs to have thousands of lines of whitespace changes, I can't use the auto formatter.

Now I don't know if this is a CMake issue or CLion. But at one point It was "#include"ing a struct from a header file I had deleted 1 hour previous to the build failing. The only way to fix that was to create the file again and delete it again.

These complaints might seem small. But put together they are hours of wasted time that you don't expect from the "best" of something.

[–] [email protected] 1 points 1 week ago* (last edited 1 week ago) (4 children)

Don't need to go all the way there. I always heard that jetbrains make the best editors. Yet when my job forced everyone to use CLion I saw that it was just a lie. The editors aren't good, they are just expensive.

There are 2 easy examples:

  1. Remote developing sucks. Loading a remote cmake project takes ages. Yet if you remove the temp directory it's almost instantaneous. Except when you do it too often and clion refuses to sync the files, then you're fucked because there isn't a "sync" button, it only happens automatically.

  2. The commit log is awful. It doesn't by default show you the commit/branch you've checked out, it shows the chronologically most recent commit. There's no "go to checked out commit" button either, you have to write the hash in the search field. Which btw the search is trash. If you write 6 of the characters of the hash it shows "there are no results", yet when you write the 7th, suddenly your commit appears.

[–] [email protected] 2 points 1 week ago* (last edited 1 week ago)

In Spanish, chupa means either suck or lick depending on context.

Chupa chups are lick licks.

[–] [email protected] 21 points 1 week ago (1 children)

Damn. Alacritty has no features?

[–] [email protected] 2 points 2 weeks ago

The thing about UB is that many optimizations are possible precisely because the spec specified it as UB. And the spec did so in order to make these optimizations possible.

Codebases are not 6 lines long, they are hundreds of thousands. Without optimizations like those, many CPU cycles would be lost to unnecessary code being executed.

If you write C/C++, it is because you either hate yourself or the application's performance is important, and these optimizations are needed.

The reason rust is so impressive nowadays is that you can write high performing code without risking accidentally doing UB. And if you are going to write code that might result in UB, you have to explicitly state so with unsafe. But for C/C++, there's no saving. If you want your compiler to optimize code in those languages, you are going to have loaded guns pointing at your feet all the time.

[–] [email protected] 2 points 2 weeks ago

I recently came across a rust book on how pointers aren't just ints, because of UB.

fn main() {
    a = &1
    b = &2
    a++
    if a == b {
        *a = 3
        print(b)
    }
}

This may either: not print anything, print 3 or print 2.

Depending on the compiler, since b isn't changed at all, it might optimize the print for print(2) instead of print(b). Even though everyone can agree that it should either not print anything or 3, but never 2.

[–] [email protected] 3 points 2 weeks ago

If you want to use instructions from an extension (for example SIMD), you either: provide 2 versions of the function, or just won't run in some CPUs. It would be weird for someone that doesn't know about that to compile it for x86 and then have it not run on another x86 machine. I don't think compilers use those instructions if you don't tell them too.

Anyway, the SIMD the compilers will do is nowhere near the amount that it's possible. If you manually use SIMD intrinsics/inline SIMD assembly, chances are that it will be faster than what the compiler would do. Especially because you are reducing the % of CPUs your program can run on.

[–] [email protected] 2 points 2 weeks ago

They should be paid though

[–] [email protected] 1 points 2 weeks ago (2 children)

Spaniard here. Not only does my company not pay me for lunch time. It also demands it to be at least 30 minutes long. How is it even legal to force my unpaid time to be a minimum amount?

[–] [email protected] 0 points 2 weeks ago (3 children)

5:30 h/day? My man living the dream

[–] [email protected] 4 points 2 weeks ago

So the top exports are: medicines and medicines. Got it

 

I want to do basically this:

struct MyStruct < T> {
    data: T
}

impl < T> for MyStruct < T> {
    fn foo() {
        println!("Generic")
    }
}

impl for MyStruct < u32> {
    fn foo() {
        println!("u32")
    }
}

I have tried doing

impl < T: !u32> for MyStruct < T> {
    ...
}

But it doesn't seem to work. I've also tried various things with traits but none of them seem to work. Is this even possible?

EDIT: Fixed formatting

view more: next ›