I disagree as well. It’s more of a clutch to make inexperienced people complain that their lockless algorithm is slow and find a reputable third-party library instead.
Unfortunately web-inspired TUI toolkits start to lose that property. Hit a key too fast, before the next screen runs code to attach its event listener? Sorry your key is lost.
> Atomic variables can be used simply and safely, as long as you are using the sequentially consistent memory model (memory_order_seq_cst), which is the default.
A lot of companies’ in-house guidelines then say you are allowed to use acquire/release if you are implementing a lock, relaxed if are implementing a counter.
This IMO probably reflects most companies’ distrust in their own developers to develop lock free data structures.
If I remember correctly, EDG was the only C++ implementation that actually attempted to implement the export keyword for templates in old C++. It was this implementation experience that informed the deprecation of export. EDG is a major influence in the development of C++.
I think the style guides I’ve seen only permit acquire/release memory orders for locks, and relaxed for simple counters. Anything more complicated including lockless hashtables or RCU, using seq_cst is required by the style guide.
The restriction is a good thing because there are very few humans who can reason about acquire/release semantics in situations other than locks.
Operators not only have precedence, but also associativity. Building a parser that works for arbitrary precedence and associativity is a standard school project that takes only a few lines more code than a parser that deals with operators with a single precedence level.
Here is an example in Haskell for operator parsing that uses nothing no more than the standard library: https://hackage-content.haskell.org/package/parser-combinato... Excluding comments it’s less than 50 lines of code, and it handles arbitrary precedence, prefix and postfix, ternary operators, infix operators with all three kinds of associativity.
Long ago I changed the default commit message to include headers “Why?” and “How?” to remind myself that I need to explain why a change is made (what this article focuses on), and how it is made (different implementation approaches considered). I followed this format for a long time. I was in the top 1% for commit message length at the company.
Omarchy is a hyped up Arch Linux configuration tool with one specific kind of user in mind (namely its creator). It’s not beginner friendly if your brother hasn’t used Linux before. In fact Arch Linux itself is not beginner friendly. It’s better to stick with Ubuntu.
Why is the Cross Bronx Expressway scary? I read the Wikipedia page and understood how it tore through the neighborhoods and caused many social ills, but I didn’t understand why the road is scary. I have driven on this road once or twice, but I couldn’t recall anything remarkable from that drive.
This article really reminds of how the Golden Gate Bridge was one of the most suicide-prone bridges in the country, and the locals resisted making the barriers higher or add a protective net beneath. The reasoning was basically the same: it’s too expensive, it’s a matter of personal responsibility, know the risks yourself, etc.
No. I’m not saying all international treaties and bodies shouldn’t exist. That’s a wild misinterpretation of what I said. I said that international treaties that establish a supranational court system should not exist. The emphasis is on court system. Conflicts between countries on anything including crimes should ideally be dealt with using diplomatic means, not a court trial. That’s why the United Nations Security Council works. It’s not a court.
The United States has never recognized the jurisprudence of ICC anyways. So to the United States these judges are just regular foreigners making decisions they don’t like. Sanctions are an appropriate tool for the United States to meddle in foreign affairs anyways. For countries that support ICC, avoiding United States is also appropriate.
Personally I don’t really have much faith in the ICC; its premise is flawed since great powers will never be deferential to a foreign court system anyways.
At work with token-based pricing I haven’t even breached $200 in a single month, so I just use Opus for everything. Some colleagues get close to the spending limit so they choose cheaper models; not me.
Have you used the highway library? It’s portable SIMD done right. It does not rely on auto-vectorization. Instead it gives you a nicer API than using intrinsics, plus machinery to do dynamic dispatch.
That is frankly not a problem at all. People rarely bat an eye when your Python function ends by having eight simultaneous levels of dedent. People definitely don’t bat an eye when your HTML ends with </span></span></div></div></td></tr></table></section></body></html>. All you need is just good indentation, which is enforced in Python but optional in Lisps; then lazy programmers take shortcuts and don’t indent at all.
They might have an early model with a really small battery pack like the Model S 60. That car charges from 10% to 90% in about 40 minutes: very slow by modern standards.
It makes perfect sense when you think about the order of doing name lookup and type checking. In Haskell name lookup happens strictly before type checking. In more conventional 90s languages like C++ that’s obviously impossible because to compile `foo->bar()` the compiler must first know the type of `foo` before it can begin the name lookup for `bar` in the class hierarchy; in fact in C++ `bar(foo)` also requires knowing the type of `foo` before being able to look up `bar` due to the amazing feature of ADL. In Haskell the type checking was meant to be a research playground for new ideas, such as the idea of type classes, so naturally it was a bad idea to couple name lookup with type checking.
You have the choice of not doing any automatic updates in iOS. I do it, partly because I want to read the release notes of every app I use, partly because if I like using an app I don’t have the designers to redesign my UI.
Yup. That’s because cancellation isn’t native, but part of the context object and requires cooperation. In a language where goroutine switching is preemptive rather than cooperative, I find it odd to have cooperative cancellation, until I realize that Go doesn’t have exceptions and probably will never have them.
Yup. A popular way to get proper cancellation is to build exceptions into the language and specifically async exceptions so one goroutine can throw an exception into another goroutine. And Go does not have exceptions. Doing so would require all regular Go code to be exception safe, and really requires some form of try/finally or RAII but not defer. Anyways exceptions are quite far from the Go creators’ vision of the language.
These are fine for bike commuters, and I’ve had them before. But they are in general not fine for recreational bicyclists; these people would gladly pay a hundred dollars for a new tire to shave off three watts and are not about to add any unnecessary human-powered accessories.
Template Haskell is actually pretty cool. Using it to generate lenses in a type is a perfectly fine use case (of course hand-writing lenses is just one line anyways). Running computation at compile time is really a great feature; people rave about comptime in Zig but of course Haskell has had it earlier.