This could be done almost trivially using the typestate pattern: https://zerotomastery.io/blog/rust-typestate-patterns/.
Person interested in programming, languages, culture, and human flourishing.
This could be done almost trivially using the typestate pattern: https://zerotomastery.io/blog/rust-typestate-patterns/.
I mean, the simple proof is that Rust has been growing by leaps and bounds in the embedded world, which is the closest to bare metal you get. It’s also being used in the Linux kernel and Windows, and there are several projects building new kernels in pure Rust. So yeah, it’s safe to say that it’s as close to the metal as C.
Also, the comparison to Java is understandable if you’ve only been exposed to Rust by the memes, but it doesn’t hold up in practice. Rust has a lot more syntax than C (although that’s not saying much), but it’s one of the most expressive languages on the market today.
My preferred variation of this is to make it an open question that leaves them in the position of authority, and assumes that they made a deliberate decision.
For example, instead of “Why aren’t you using StandardLib that does 90% of this?”, I would try “Could this be achieved with StandardLib? Seems like it would cover 90% of this”.
As with all things, there’s a trade off: how much do you value the [convenience/ecosystem/insert other thing that proprietary system offers you] compared to the ongoing cost - monetarily but also in terms of privacy, market manipulation, environmental impact, etc. of supporting and relying on the proprietary system.
You can’t do your work without connecting to Exchange because Microsoft has leveraged decades of monopolistic gains to make Outlook the default option for any “serious” business, and has invested even further in making inconvenient (or soon impossible) to connect to Exchange from outside their sanctioned walled gardens. Demanding that Linux solve that for you is akin to demanding that the person commuting on bike undo a century of automotive-centric urban expansion in the US so that they don’t interrupt your commute. It’s not their fault they can’t solve the problem and it doesn’t help anyone to get mad at them for doing their best to behave rationally in a system stacked to only serve the 1%’s corporate interests.
Proton Pass already supports passkeys: https://proton.me/support/pass-use-passkeys
I think you would be pleasantly surprised by the direction web dev is moving if you gave it a chance.
For example, I suspect that you think one of the ways the web has gotten shittier is because sites are too bloated and JavaScript frameworks are too heavy and slow.
One of the key takeaways is that, across almost all frameworks and stacks, web dev is moving back to doing as much work on the server-side as possible, while retaining the minimum necessary interactivity via Islands of Interactivity with much lighter JavaScript than what was pushed for the last decade.
Have you tried developing a GUI app for Windows in the last 5 years? All the official first-party frameworks are either mostly deprecated (WPF, WinForms), or half-baked and decided by every developer I’ve talked to about them (MAUI).
I’ll stick with nushell for terminal-first data interactions.
I think the point is that they don’t want to have to use a full JS framework (which is what HTMX is) for this behavior.
And this is where HTMX fits in. It’s an elegant and powerful solution to the front-end/back-end split, allowing more of the control logic to operate on the back-end while dynamically loading HTML into their respective places on the front-end.
But for a tech-luddite like me, this was still a bit too much. All I really want to do is swap page fragments using something like AJAX while sticking to semantically correct HTML.
EDIT: Put another way, if you look at HTMX’s "motivation"s:
motivation
- Why should only
<a>
&<form>
be able to make HTTP requests?- Why should only
click
&submit
events trigger them?- Why should only
GET
&POST
methods be available?- Why should you only be able to replace the entire screen?
By removing these constraints, htmx completes HTML as a hypertext
It seems the author only cares about the final bullet, and thinks the first three are reasonable/acceptable limitations.
If you dig the structured output of powershell, you might want to check out Nushell. It’s a cross-platform shell that builds on powershell’s structured data approach but is much less verbose and, in my opinion, more intuitive than both powershell and Posix shells.
There are several things I disagree with in this article, although I see where the author is coming from. I will never be onboard with “I’ll take my segfaults and buffer overflows.”, and I fundamentally disagree about concurrency. I also think that cargo is fantastic, and a lack of standard build tools is one thing that holds rust’s predecessors back.
However, a majority of the authors points can be boiled down to “C is more mature”, which doesn’t tell us much about the long-term viability and value of these languages. For example, in the author’s metric of stability and complexity, they use C99 as the baseline, but C99 is the state of a language that had already had almost 3 decades of development, whereas Rust has been stable for less than a decade. Talking about superior portability, stability, and even spec, implementations, and ABI is in some real sense just saying “C is older”.
That’s not to say those things aren’t valuable, but rather they aren’t immutable characteristics of either language. And given that safety is playing an ever more important role in software, especially systems software, I think Rust will catch up in all the ways that are meaningful for real projects more quickly than most of us realize. I certainly don’t think it’s going anywhere anytime soon.
Nushell is so great! I’ve been using it for a couple years. It has completely replaced my need for tools like grep, sed, awk, etc. and because it handles JSON and so many other data formats natively I rarely even need to think about parsing.
I really like Anytype.
It’s not just a proposal, it’s already fully defined and almost completely implemented - I believe they’re just waiting on a standards update from ISO for time zone stuff.
Ah ok I think I get you now. To be clear, fall through is implicit - when the case being fallen through is empty. I forgot that, if you want to execute some statements in one case, and then go to another case, you need gotos. To be fair, I’ve never needed that behavior before.
I absolutely see your point on break not being the default. It is sad, although I will say I don’t mind a little extra explicitness in code I’m sharing with a large team.
I’m not sure I understand your point about fall through having to be explicit, but I agree that switch statements are lacking ergonomics - which makes some sense considering they were added a looooong time ago. Luckily, they added recently the switch expression, which uses pattern matching and behaves more like Rust’s Match expression. It’s still lacking proper exhuastiveness checks for now, but that’s a problem with the core design of composition in C#’s type model and one they are looking to solve (alongside Discriminate Unions in all likelihood).
deleted by creator
I certainly see where you’re coming from, but I think the designers of C# have done fairly good job evolving the language to balance backwards compatibility, simplicity (in terms of having “only one way” to do things), and the ergonomics expected of modern languages. I think C++ and JS are great comparisons because C++ has at this point added everything and the kitchen sink to it’s language and standard library, whereas C# has gone much more like JS introducing features that evolve the best practices for writing but still feel and read like essentially the same language. For example, primary constructors still look just like regular C#, it’s just a nicer way to define simple POCOs when desired.
As far as important language features, I think it’s easy to pick on discriminated unions because it seems like C#’s users unanimously want that. However, if you read through proposals and discussions, it’s obvious that there’s a lot of nuance and trade offs in deciding how and what form of discriminated unions should exist in C# (and the designers are very active in working through that nuance and trade off - they said they have a working group that meets weekly to discuss it I believe*). And to be fair, they have introduced a LOT of other important features (like records and the vastly improved pattern matching) in just the last few years. Without those features, discriminated unions wouldn’t be nearly as appealing, and those features are great for the language even without DUs.
*Edit: Source for my claim is the recent Languages & Runtime Community Standup on the official dotnet YouTube channel. Mads talks about the working group at 21:05, but the discussion of discriminated unions begins at 7:09.
TypeScript React (although I like Svelte better, it’s hard to pitch for business projects), C# ASP.NET Core API, Postgresql.
I’ve heard it as a word, “Rustles”. Not sure how canonical that is though.