Hacker Newsnew | past | comments | ask | show | jobs | submit | qalmakka's commentslogin

If you use the shunting yard algorithm or similar for infix binary operators it's trivial to define a table with operator precedence values and use that. You can have a bunch of operators all at the same priority but it is the same complexity really, the algorithm is pretty trivial

The point here is that not all operators should have a concept of precedence. Expressions like "a & b + c >> d" should be invalid, as no human actually understands them unless they spend a lot of careful focus. Instead, such an expression must be written as "((a & b) + c) >> d" explicitly. On the other hand, "a + b + c" and even "a + b * c" are fine, as addition and multiplication (and subtraction and division) are so drilled into everyone in early education.

> Expressions like "a & b + c >> d" should be invalid

When read procedurally (left to right) it is quite okay though, and no parens are needed (but could be added).

The catch is that `1 + 2 * 3` becomes 9 instead of 7 as math eyes expect. I guess there are things to unlearn and unlearning is always hard. But consider the rules other languages have, like C regarding signed and unsigned, and Javascript regarding comparisons, compared to them this is almost trivial.


> When read procedurally (left to right) it is quite okay though,

Except that there are almost no circumstances in which "((a & b) + c) >> d" is a sensible expression. The only reasonable interpretation is "(a & b) + (c >> d)", and even then that plus is suspicious.

In practice, the worst offenders are "a & b >> c" and "a & b << c". The first expression is usually intended to mean "(a & b) >> c" — it's a bitfield extraction; the second one is usually intended to mean "a & (b << c)" — it's clearing of all but one bitfield. As you can see, those semantics are impossible to achieve with << and >> having the same precedence.


> > When read procedurally (left to right) it is quite okay though,

> Except that there are almost no circumstances in which "((a & b) + c) >> d" is a sensible expression.

That doesn't seem like a convincing argument to me. The question is whether or not the rules set you up for scenarios where misunderstandings are likely. Strict left to right does not - for example, given a & b << c it is immediately clear that the desired interpretation is not the actual one while b << c & a will unmistakeably do what you want.


> The question is whether or not the rules set you up for scenarios where misunderstandings are likely.

No, this is a misleading statement of the problem because it tacitly assumes that programmers write arbitrary expressions with almost the same probability, so the rules should accommodate them all, at the same expense. This is patently false, and is a horrible policy for any UI/UX/DevEx/etc. designer. The very existence of linters and static analyzers, hell, even the warnings in the modern compilers about suspicious operator precedence and "this expression doesn't mean what you probably think it does" — all that suggests that some kinds expressions are more probable than others; ergo, those should be accommodated for at the expense of the unlikelier ones. So, the precedence levels and PEMDAS it is, instead of the abstractly-pure, from-the-first-principles, strictly left-to-right order which makes only its inventor, with a very peculiar kind of mind, happy at the expense of most of the actual programmers and users of the language.


honestly speaking, I think that shifts would almost always be better represented with functions, like lsl(a, 4), which solves the shenanigan between arithmetic/logic shift too.

In that case, I'd rather just have explicit bitfield getter/setter functions à la

    slct(var, 6, 2) = expr;  // var = (var &~ (0b111111 << 2)) | ((expr & 0b111111) << 2);
    var = slct(expr, 6, 2);   // var = (expr >> 2) & 0b111111;
Freaking BCPL had those in 1976, and that language was more primitive than C (it didn't even have any types beyond "machine word, reinterpreted accordingly to the operation applied to it").

Yes but if you read the EULA the two VM limit it does sound like you can't really sell access to VMs:

> except as otherwise provided in writing, signed, or issued by an authorized representative of Apple, to install, use and run up to two (2) additional copies or instances of the Apple Software, or any prior macOS or OS X operating system software or subsequent release of the Apple Software, within virtual operating system environments on each Apple-branded computer you own or control that is already running the Apple Software, for purposes of: (a) software development; (b) testing during software development; (c) using macOS Server; or (d) personal, non-commercial use.

In section 3 they also say that if you're renting access to a Mac you can only run one VM, which sounds kinda like that

> Except as expressly permitted in Section 3, the grant set forth in Section 2B(iii) above does not permit you to use the virtualized copies or instances of the Apple Software in connection with service bureau, time-sharing, terminal sharing, relay service or other similar types of services.


I'm puzzled about why people were so vehement at roasting Joe Biden for his clear advanced age, while Trump is blatantly suffering from dementia or some similar mental impairment. His speech is way more rambling and incoherent that anything Joe Biden ever went through, and it doesn't get better when he's in a more familiar setting - quite the opposite, he gets more and more nonsensical whenever is giving an interview to anybody

> His speech is way more rambling and incoherent that anything Joe Biden ever went through

Yes, even bringing into scope the debate which did Biden in, he was more coherent than Trump.


Joe Biden also wasn't a cruel person, and that's the main reason you have what you have today.

The people complaining about Biden never gave two shits about the president's mental capacity.

Trump sounds the same today as he did 10 years ago, delusions can see past obvious warts.

IMHO the current contracts are a half-baked feature that I suspect will immediately end up in most coding styles as "do not use contracts".

I understand the concept but having a feature that's not consistent among compilers, targets, ... all while doing absolutely nothing to solve the _real_ problems with C++. Like that the build model is still the obsolete TU model of C, while adding multiple compile-time features that inevitably end up causing build times to skyrocket considerably. Or that modules are still DOA after 6 years. Or that the syntax is full of bullshit anti-features that could be at least fixed by having a proper build model (like Rust) and editions (like Rust).

Having yet another feature that only works sometimes with quirky semantics is dumb and I understand why many people feel like it should be shelved to prioritise the features people _really_ care about, like meta


> the features people _really_ care about

And what are those? You seem to assume that "everyone" (except the committee) is in agreement about them.

I like the editions idea. We could have a memory-safe C++ successor without being weighed down by old mistakes.


> And what are those?

I'd start with the basics: A scanf() replacement would be nice, having a ostream/printf() alternative, but not something for input feels very unfinished.

Basic Unicode support is also still a mess.

Another thing I don't get: Why is uninitialized memory still the default? Why haven't they made the uninitialized state explicit in any of the numerous language updates?


Hopefully we will get P1729R5 in 29.

But then input handling is much more complex than output handling.

Also, 26 now initialises trivial variables with erroneous values, and is no longer undefined behaviour to act on them.


> and is no longer undefined behaviour to act on them

This is only partially true. From the proposal [0]:

> Moreover, a variable that has a well-defined, erroneous initial object representation under this proposal can still lead to undefined behaviour later on:

    void f(T&);
    void g(bool);

    void h() {
      T* p;    // uninitialized, has erroneous value (e.g. null)
      bool b;  // uninitialized, erroneous value may not be valid bool

      f(*p);   // dereferencing has undefined behaviour
      g(b);    // undefined behaviour if b is invalid
    }
[0]: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p27...

Fair.

<meta> is the feature people really care about.

We have one. It's called Rust.

Sadly it misses many features in C++, it's not really a replacement:(

Any C++ replacement language should support all the features of C++ to be suitable...


Unfortunately C++ is full of very dubious features that I argue may not make much sense or may make sense in a different form that's not how C++ implements them.

C++'s features are the reason everyone hates it.

Except it still drags unsafe legacy APIs into the future as part of its core library. std::env for example isn't some safe take on how to deal with a system provided program environment in a modern multithreaded language, it is a thin wrapper around an ancient C POSIX API that is not threadsafe and cannot be fixed.

Rust can't magically fix how Unix works. On Windows, the unsafe APIs in std::env are merely unsafe, if you use them carefully you're fine. On Unix, these APIs can cause chaos if you use them in multi-threaded context because Unix never provided any mechanism, even in a modern Linux, to do better.

Rust is doing everything it can here, these APIs are labelled unsafe, and on a system where they can work, they will work. You can see similar in the filesystem code. On Windows, or a modern Linux, you get what you'd like to have, and on somebody's SysV clone where that's not possible it's still not possible from Rust.


> Rust can't magically fix how Unix works.

Rust has no reason to touch the original Unix API. Take a snapshot of the values at startup and write an API around that, any runtime modification of the Unix environment is suspect anyway and anyone who wants to deal with that rotten mess can jump through half a dozen hoops.

> Rust is doing everything it can here, these APIs are labelled unsafe

Unix gave us C, clearly Rust should have just labeled every C standard library function like malloc and free unsafe and thrown up their hands instead of introducing ownership semantics and all that messy compiler logic around it. After all Rust can't fix how Unix works, so they shouldn't have tried in the first place.


> Rust has no reason to touch the original Unix API.

As a systems language, Rust must provide access to the APIs of the underlying system, and on UNIX, that’s, well, UNIX.


> and on UNIX, that’s, well, UNIX.

Let me clarify. There is no reason for std::env to be dragged down by UNIX, it could be its own, modern, safe thing with the Unix API living in std::pet_cemetary or some comparably clear namespace for people who have to pass runtime information to a C library through absolutely unsafe ways. Environment variables are usefull, the unix limitations make them less so.


> it could be its own, modern, safe thing

It could be a completely separate "modern, safe thing" which roughly nobody has any use for and which would be confusing since what people want are environment variables and this would instead be its own "modern, safe thing" for some reason.

Mutex<HashMap<String,String>> is probably a reasonable "modern, safe thing" for the handful of people who actually would get value out of this, and the fact it's not labelled "Environment variables" because that's not what it is probably also avoids people who needed the actual environment variables cursing because they were hidden down the back of the sofa.


> because that's not what it is

Why not? Is it the lack of race conditions? The lack of crashes or memory leaks? Is it the fact that you came up with it in five seconds and it is still a million times better than what we have? Or is it the fact that the holy book of Posix spells out how to do it badly in C and because of that we are never allowed to replace it with something better?


That's a feeling I've been also feeling for the last year or so. Turns out the means was what I cared about, and I didn't care about the ends that much. LLMs robbed me of that in a way I couldn't see coming.

I think that we as a society fail to see that the speed we built things was rarely the problem. The real shortage was in the ideas - having them, finding the motivation to act on them, sharing them, and the biggest driver was the desire of showing off, being told you are great and your idea was great.

I am afraid that by removing the ick to fix things, to challenge everything and being rewarded for that, we will end up with less innovation, not more. Why bother? Why do anything if everything is cheap, why start a new project only to be shrugged away as being yet another thing any machine could have done? Why show off when the merits are the machine's?

HN went from being a constant stream of Show HN to AI news after AI news. The most interesting projects AI have enabled are to run old stuff onto other things.

Rehashes of old ideas keep sprouting out of everywhere, keeping new ones at bay. I think we are probably entering a long winter and all that will be left is permutations of what we did before '23


Jesus H Christ these guys had literally the number 4 as their secret and they call telling them they're incompetent an "out of proportion" reaction?


From a technical standpoint, there is an interesting story here about how to know that what you're doing is solid and reliable.

I have to assume the fact this didn't get discovered suggests they weren't investing in trying to break their own crypto. A good takeaway for anyone else who wants to be in this space.


yeah anyone wise migrated away from PHP ages ago. The fact it got lipstick on back with PHP7 doesn't make it a well designed programming language. At least in my experience the vast majority of PHP websites nowadays are old abandoned PHP5 projects, which aren't much worse than just slopping a rewrite in something else


> Run Android apps natively on Apple Silicon Macs. No emulator, no virtual machine, no Linux underneath.

God damnit Dario fix Claude already so that it stops using this sentence structure once and for all. Opus is so annoyingly recognisable that it has started to irk me badly lately


Why does it matter if it's easy to recognise? I prefer to know when I'm reading AI writing.


I always do my best to emulate AI writing - just to keep you guessing.


You did you a hyphen rather than an emdash here though


Well they did say "emulate" and emulators are always slightly off the mark


It's just overused and cliche now


I think you meant to say:

It's not just overused — it's a cliche now.


That's the GPT style writing, there are subtle differences between it and Claude if you know where to look.


I've recently asked claude to be concise in writing documents. It's brilliant for me. You get things like:

  <cmd> force-off  # pull the plug
No faffing around.


It may not be verbose, but it's still faffing around by using an idiom


Yes, I think the appropriate thing to do here would have been

  <cmd> force-off  # force off
All the brilliance of the original, but also no inappropriate idioms.


Idioms can be much more dense than otherwise.


Darmok and Jalad at Tanagra


It's also not even correct. The diagram in README says the app is run on "built-in Java runtime" after it is converted, which, as I recall, is a virtual machine.


Maybe it is intended for LLMs? For writings of more than a page, most readers are going to use LLM summarizations anyway.


> For writings of more than a page, most readers are going to use LLM summarizations anyway.

Citation very much needed. And I sure hope you’re not right, or we’re already beyond fucked.


Feature, not bug


It's not a bug, it's PR!


At least it's short and every "no" clause adds critical information.

This one is fine.


Hey, at least it didn't call it "beautiful" or "elegant".


Too late, people already talking like this too


I remember the first time I heard a young girl talking to her friends in the TikTok pattern. That was a clear sign we were doomed.


> girl talking to her friends in the TikTok pattern.

https://en.wikipedia.org/wiki/Influencer_speak


why are we doomed, it sounds like normal language change pursuant to pop culture influence, just like literally always


pop culture is quite new. It has what 3 to 4 human generations?


We're at probably a century and a half, and then I feel like we're quibbling over semantics, but the Coliseum seems like a pretty good example of a manifestation of pop culture.

But this is a digression. Language changes. It always has. What's the big deal? That it's not your generation controlling it this time?


I was only making a comment about pop culture.

Languages have always evolved and will always evolve, I agree and am ok with that.


You're absolutely right!


Some call it a triple construction.


How would you prefer it. Does it not get the point across? Why does it even matter to you?


"Why does it matter to you?" Many Claudisms are grating to many people. Annoying is enough of a justification.


> Many Claudisms are grating to many people.

Would they be grating to them in the pre-LLM days?


They would be nowhere near as prevalent. All claude-user output is in the same style, which is really annoying.


Precisely. Regis Philbin, Paris Hilton, Charles Barkley - they each have a pretty distinctive way of speaking and I have always actually enjoyed hearing each one's way of phrasing things. But it would quickly become hell if each week an additional 1% of the things we read was written exactly how Regis would phrase it.

(I purposely picked people with pretty specific speaking habits because yup, the Claude output is 100% that distinctive).


Then tell Claude to speak in a Regis voice???


I don’t get to customize the prompts used by others. I’m sure if I generated a lot of prose with Claude I could convince it to talk differently. It’s all the content others make that is so annoying.


I said several months ago that bots like your coworker, personal assistant, search engine, and customer service are now all the same person. They also write all the blog posts and articles you read and scripts for YouTube videos.


> Would they be grating to them in the pre-LLM days?

No, same way "synergy" wasn't grating before every middle manager started saying it.


You probably won't see this, but yes they would - that is why they're grating, the syntax is just awful


Imagine if everything in the world you read was written by one author - and you didn't particularly like that author's writing style. Or even if you did like the author's style, it began to grate on you simply because there was no reprise from it.

That's the world we are shifting to.


For one, say what it does instead of what it doesn't do


> When you say "don't do X" and end up with a README saying: "achieved by using Y, not X"


Or more like, "achieved by not doing X"


"Run Android apps natively on Apple Silicon Macs."


Yes I got that, but afterwards it doesn't explain how until you get all the way down into the diagrams saying that it translates the code one-time. It's once again like no emulators, no virtual machine, no Android, no Linux kernel, no items, Fox only, final destination, whatever


"Run Android apps natively on Apple Silicon Macs. Uses translation instead of emulation."

No, slop generally doesn't get the point across efficiently.

It's hard to parse, it's grating, and in addition to the strange language you have to apply additional skepticism due to gross inaccuracy being more likely than in human-written text.


Variety is the Spice of Life


If you run a readability analysis on slop it scores very poorly. LLMs generally continue to be mediocre with the veneer of quality without context to guide them.


Cliches annoyed people before LLMs. There is a whole microgenre of essay ranting about the proliferation of various annoying cliches, bits of jargon, etc. the proliferation of Claude prose is simply rendering certain turns of phrase into annoying cliches, which people are reacting to in the normal way. Cliches also get the point across but nonetheless lots of people find them grating.


Vkd3d is a PE executable, if wine works and Vulkan works then it works too, as long as the required extensions are present


> CEF

Ah that's the reason why they came up with an instant speedup. Optimising CEF is basically like docking a zero from your speedup loop [1]

[^1] https://thedailywtf.com/articles/The-Speedup-Loop


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: