arendjr

joined 1 year ago
[–] arendjr@programming.dev 1 points 1 month ago (2 children)

Because coming up with the same implementation independently is legal, while copying someone else’s implementation isn’t. Which method you used to arrive at your implementation can be difficult to prove either way, which is why it’s important for implementors to be able to say they never looked at the original. It’s a legal defence, in case you ever need to stand in front of a judge or jury who will question how you arrived at yours.

[–] arendjr@programming.dev 2 points 1 month ago (4 children)

Maybe not the best example then, but not the only example. If you unintentionally create something that resembles the original too much you may still become liable. It’s hard to draw the line, which is why many in such a position would prefer to be safe rather than sorry.

[–] arendjr@programming.dev 3 points 1 month ago (6 children)

It’s a gray area, legally. What you say is theoretically correct, but there’s practical issues once you’ve looked at the code that will open you up to legal liability anyway.


For instance, what if you need a utility function during your reimplementation for which there is really only one obvious implementation? You can no longer claim to have come up with it by yourself.


I doubt the FSF would sue over it, but companies are known to avoid the risk.

[–] arendjr@programming.dev 5 points 3 months ago

I’m not arguing against that. Merely providing some counterweight to the idea that the author was “flinging shit in the trenches” 😅

[–] arendjr@programming.dev 12 points 3 months ago (2 children)

I found the title of that section slightly triggering too, but the argument they lay down actually makes sense. Consistency helps you to achieve correctness in large codebases, because it means you don’t have to reinvent what is correct over and over in separate pockets of the codebase. Such pockets also make incremental improvements to the codebase harder and harder, so they do come back to bite you.

Your example of vendors doesn’t relate to that, because you don’t control your vendor’s code. But you do control your organisation’s.

[–] arendjr@programming.dev 5 points 3 months ago

Another data structure that you can consider is the red green tree: https://willspeak.me/2021/11/24/red-green-syntax-trees-an-overview.html

We use it in Biome too, and it’s great for building trees that are immutable and yet still need frequent updates, as well as traversal in all directions. Its implementation contains quite a bit of unsafe to make it fast, though as a consumer you’re not really exposed to that.

[–] arendjr@programming.dev 5 points 4 months ago (1 children)

There is a serious attempt for that actually: https://www.assemblyscript.org/

It doesn’t offer full compatibility with the regular TypeScript though, despite being very similar.

[–] arendjr@programming.dev 1 points 4 months ago

Ah, but that’s no reason to give into defeatism. Words and wisdom can survive our lifetimes, so it’s never too early to practice them.

[–] arendjr@programming.dev 1 points 4 months ago (2 children)

Preach.

You’re right a coup or revolution is probably the only way out for the US at this point. But when that day comes, reestablishing democracy with the rules of today would be a bad idea, since the capitalists know how to game the system. So if we acknowledge that democracy is broken, and authoritarianism isn’t the way, we need a new system. Hopefully this post helped to give some ideas what a new system could look like.

[–] arendjr@programming.dev 1 points 4 months ago (4 children)

Yeah, I think we’re pretty much aligned on that.

I also wish I could do more in those regards, but I’m neither an American nor a politician. The latter I could change, but even if I were successful, then by the time I could affect some change it would probably be too late.

Still refusing to sit idly by, I decided to have a thought on how this could be prevented. A system with similar values as democracy, but better resilience against corruption could theoretically prevent a lot of harm. I don’t when or if anyone would be willing and able to do something with these ideas, but I figured it was the best I could do for now.

[–] arendjr@programming.dev 5 points 4 months ago* (last edited 4 months ago) (3 children)

But he did step in, albeit privately. I actually agree an earlier public statement would have helped, but we don’t know the specifics of what went on behind the scenes.

In any case, I don’t think it’s fair to assign blame for Marcan’s burnout to Linus, as the post above did. Marcan himself mentioned personal reasons too when he announced his departure. I think we should show understanding and patience with both sides, and assigning blame isn’t helping with that.

248
submitted 1 year ago* (last edited 1 year ago) by arendjr@programming.dev to c/rust@programming.dev
 

Slide with text: “Rust teams at Google are as productive as ones using Go, and more than twice as productive as teams using C++.”

In small print it says the data is collected over 2022 and 2023.

 

I have a fun one, where the compiler says I have an unused lifetime parameter, except it's clearly used. It feels almost like a compiler error, though I'm probably overlooking something? Who can see the mistake?

main.rs

trait Context<'a> {
    fn name(&'a self) -> &'a str;
}

type Func<'a, C: Context<'a>> = dyn Fn(C);

pub struct BuiltInFunction<'a, C: Context<'a>> {
    pub(crate) func: Box<Func<'a, C>>,
}
error[E0392]: parameter `'a` is never used
 --> src/main.rs:7:28
  |
7 | pub struct BuiltInFunction<'a, C: Context<'a>> {
  |                            ^^ unused parameter
  |
  = help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`

For more information about this error, try `rustc --explain E0392`.
error: could not compile `lifetime-test` (bin "lifetime-test") due to 1 previous error
 

As part of my Sudoku Pi project, I’ve been experimenting with improving the Bevy UI experience. I’ve collected most of my thoughts on this topic in this post.

 

I wrote a post about how our Operational Transfomation (OT) algorithm works at Fiberplane. OT is an algorithm that enables real-time collaboration, and I also built and designed our implementation. So if you have any questions, I'd be happy to answer them!

view more: ‹ prev next ›