arendjr

joined 1 year ago
[–] [email protected] 5 points 1 week 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.

[–] [email protected] 5 points 1 week 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.

[–] [email protected] 11 points 3 weeks ago* (last edited 3 weeks ago)

In fairness, this also happens to me when I write the bash script myself 😂

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

Thanks! I’d be happy to hear your thoughts.

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

Mostly the same reason why democracy worked for quite a while too. As long as people believe in a system and see the benefits to themselves as well, they can go quite a while with it.

In general I also think most people aren’t out to screw one another, no matter how much it may seem that way sometimes, so as long as that keeps for the monarchs in a majority of districts, the system could balance itself.

But yeah, I’m not going to say it’s perfect. Sooner or later it would collapse, and when it does my money would be on the same reason as yours.

So I think the main question is: would it be able to last longer than democracies can, especially in the face of mass media manipulation and other challenges. I can’t prove it, but I suspect it might have a decent shot, mostly because the monarchs would be more agile to respond against unforeseen threats.

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

Pray tell, what does it tell?

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

Your proposal is just an idealistic version of early US.

Thanks, I guess :)

You claim that corruption is fundamentally impossible, but assume that magically “the monarchs aren’t allowed to own property” without regard to enforcement.

I make no such claim, and I don't make assumptions regarding enforcement either. Constitutional enforcement is discussed in quite some detail.

You claim to have an alternative to democracy but still propose majority voting on replacing rulers and constitutions.

There is majority voting on deposal of rulers, to be specific. Their replacement isn't voted on by a majority of the population.

Constitutional changes are voted on through majority, but first require a majority of the monarchs to be on board.

Both these limitations are intentionally designed to mitigate manipulation of the population.

You simply assume that monarchs will keep each other in check and not devolve into the conspiring, warmongering tyrants that history is full of.

There is quite some detail about the enforcement mechanisms. The idea is very much not to assume, but to persuade the monarchs to act in a benevolent manner, by enticement through both the carrot (wealth for as long as they rule), but also the stick (deposal if the majority doesn't vote in favour of their actions, with a threat of assassination if they refuse to be deposed).

Power can always be abused to get more power and go against all your original ideals. The only way to definitely prevent corruption is to ensure power is never concentrated in the hands of few.

Ah. So it wasn't me that claimed that corruption is fundamentally impossible, it's you that claim to have the definitive answer.

For what it's worth, I agree power shouldn't be concentrated in the few. Which is why I split power across districts, and between citizens and monarchs, and why the group of monarchs for each district cannot be too small either. It's all there if you could try to be a little less dismissive.

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

:D

From your other responses I can see you're being sarcastic, but yeah, seems that many won't read any further after seeing the word monarchy :shrug:

[–] [email protected] 5 points 3 weeks ago (14 children)

There is a huge difference between how things should work and how they will though. Without any system of enforcement, I would call it nothing but wishful thinking.

In fairness, democracy was a kind of wishful thinking too, which is why I would propose a new form of monarchy instead: https://arendjr.nl/blog/2025/02/new-monarchy/

[–] [email protected] 1 points 1 month 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.

[–] [email protected] 1 points 1 month 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.

[–] [email protected] 1 points 1 month 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.

 

With this post I've taken a bit more of a practical turn compared to previous Post-Architecture posts: It's more aimed at providing guidance to keep (early) architecture as simple as possible. Let me know what you think!

 

After my previous post introducing Post-Architecture, I received a bunch of positive feedback, as well as enquiries from people wanting to know more. So I figured a follow-up was in order. Feel free to ask questions here as well as on Mastodon!

 

This post highlights my experience working with software architecture in startup environments. I think the approach is different enough from the traditional notion of software architecture that it may warrant its own term: post-architecture.

13
Biome v1.7 (biomejs.dev)
 

cross-posted from: https://programming.dev/post/12807878

This new version provides an easy path to migrate from ESLint and Prettier. It also introduces machine-readable reports for the formatter and the linter, new linter rules, and many fixes.

11
Biome v1.7 (biomejs.dev)
 

This new version provides an easy path to migrate from ESLint and Prettier. It also introduces machine-readable reports for the formatter and the linter, new linter rules, and many fixes.

 

I just had a random thought: a common pattern in Rust is to things such as:

let vec_a: Vec<String> = /* ... */;
let vec_b: Vec<String> = vec_a.into_iter().filter(some_filter).collect();

Usually, we need to be aware of the fact that Iterator::collect() allocates for the container we are collecting into. But in the snippet above, we've consumed a container of the same type. And since Rust has full ownership of the vector, in theory the memory allocated by vec_a could be reused to store the collected results of vec_b, meaning everything could be done in-place and no additional allocation is necessary.

It's a highly specific optimization though, so I wonder if such a thing has been implemented in the Rust compiler. Anybody who has an idea about this?

 

Just a progress update on a fun open-source project I'm involved with. Biome.js is a web toolchain written in Rust, and it provides a great excuse to play around with parsing technologies and other fun challenges :)

261
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

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
 

Today I'm sharing a little trick that I like to use to make switch statements cleaner and more type-safe. Happy to hear other ideas!

 

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.

view more: ‹ prev next ›