Mathematically, types are sets of possible values.
Any type (like in TypeScript; Rust doesn't have one) is a set of every possible value; a supertype of all types. Every expression regardless of type can be assigned to a variable of type any.
The opposite is the never type, which is an empty set; no value is of type never. Per set theory, an empty set is a subset of every set, which makes the never type a subtype of all types. An expression of type never can be assigned to every variable regardless of type.
If never type has no values, then how can an expression have never type? Easy: it must never evaluate. Infinite loops, unconditional panics/exceptions, process exit/abort, etc. Also, generics - you can have Vec that's always empty, Result that can never be an error, etc.
Why not? I mean if you refer to Rust specifically, yes, because there is no subtyping except for lifetimes, only coercion (and `Any` also cannot contain any type). But in general, why not?
Yes, in that it's primarily a linux thing as MS has gone the route of saving off basically all dlls for all their OSes for backwards compatibility (though they still backpatch).
No, in that other than Rust and Go (and maybe a few others that emit single binaries, zig?) this is how it works with OS distributed programming language packages. Python, ruby, java, perl, C#, the OS will for all of them control distribute and update the libs independent of the apps that use them.
Also, C/C++ still make up a huge percentage of all apps in pretty much any OS.
> so they're distributed in source or intermediate form, not as fixed-ABI-shared-libraries.
I agree. These languages all have the benefit of what an ABI provides due to their nature. Go and Rust are outliers because they don't send out intermediate versions.
My point was more that the effect of being able to hot-patch applications on a system is what makes an ABI desirable, not that an ABI is necessary for that. For a language like rust, it's pretty necessary. Though it would be interesting if you could send out an intermediate compiled form of rust and do a JIT on that. WASM is pretty close to doing that, but rust doesn't support dynamic linking of modules (AFAIK).
> Even C++ has wrinkles.
Yeah, I somewhat hesitate to say C/C++ as being ABI stable as it's really just C and C++ uses that. Once you use any C++ features you quickly get into realms where things are ill defined. You end up needing gross things like COM in order to properly use C++ shared libs.
> No, in that other than Rust and Go (and maybe a few others that emit single binaries, zig?) this is how it works with OS distributed programming language packages.
Uhmm... No? E.g.:
- Python has long strongly recommended virtual environments.
- Not to talk about JavaScript which of course manage things per project by default.
- I don't remember what was the state of things in .NET Framework, but in modern .NET NuGet packages are distributed as DLLs with your app.
I don't know other ecosystems well but I believe they aren't different.
How software is maintained by an OS is different from how software is maintained by 3rd party developers.
- Python has long strongly recommended virtual environments.
Yes, if you are developing a private application. But if that application gets adopted by the OS then you can expect all it's dependencies to be sent to a place like `/usr/lib/python3/dist-packages`.
> Not to talk about JavaScript which of course manage things per project by default.
I didn't bring it up because it's one I'm not familiar with. I expect OS maintainers will do similar things with it that they do with python but I'm not 100% on that.
> I don't remember what was the state of things in .NET Framework, but in modern .NET NuGet packages are distributed as DLLs with your app.
And if your .net application ends up installed as an OS package you can expect those dlls to be stored in /usr/lib.
If you are doing C/C++, as a 3rd party app, you aren't putting the .so files or the .dll files in /usr/lib or C:\Windows\System32. You are storing them in the same directory as your application. But if the OS decides to distribute your app, you can expect your .so files to get put into /usr/lib and even System32 (very very rare for MS to do that, but it does happen when, for example, we are talking about drivers).
I think we have reached the point in the thread where you concede that yes, there is somewhere where it's how it works and yes it does apply to languages that aren't C/C++.
So now you're shifting the goalposts and topic to
> almost nobody ships software via the OS today.
That was never something I was trying to debate. The topic was "why would you want ABI stability". And the answer is that if I wanted to rewrite coreutils in rust, then it'd be really useful to have synchronized crates with a stable ABI so I could potentially update those crates independent of the apps that depend on them.
I agree that sometimes other languages are packaged this way as well, and maybe I was moving the goalposts. My original meaning was that only for C/C++ (on Linux) the recommended method of distribution is via the OS, while other languages have their own mediums (not requiring stable ABIs). So when they are packaged like that that's mostly because the OS itself or its services need them.
That's not true. Scripting languages of course need no ABI. Managed languages like C# and Java often keep compatibility of the bytecode. Only AOT languages like Go and Rust cannot.
I agree that using the C ABI for interop between arbitrary non-C languages feels weird, but it's not like that wasn't a thing long before Rust ever existed. If you truly want a modern ABI for languages that are not C, something like the WASM component model is probably the closest thing that exists today.
Well yes, but then your interface is a C ABI. That's fantastic if the side using my library is any language where C is the only common ground. When the application side is Rust though, it leaves a lot to be desired. It would be delicious to actually interface in a way that respects Rust!
Hell, even if all exposed functions and types would need to be fully monomorphized at the interface, it would be a lot nicer to pass a `&'a [i64]` rather than a `const * int64_t` together with a `size_t n` and have to marshall the slice on both sides.
Another year or three of insane memory and disk prices and people will come around.
A stable Rust ABI would be nice for not just Rust, especially if they refine or extend (formally or de facto) the SysV ABI to optimize passing and returning of discriminants. That could then smooth the way for developing these features in C and C++, such as a primitive error-result type that saw some brief attention in both C and C++ WGs a couple of years ago. Doing it properly--absolute minimum cost, ABI stable, and cross-language--seemed to require too much orchestration across the ecosystem so enthusiasm and ambition seemed to peter out. The work required for a stable Rust ABI could provide the inertia to get that done.
Rust will almost certainly never have a stable ABI by default, and libraries will continue to be compiled from source by default. It might one day have an opt-in stable ABI.
Not really, all of law works that way. Everybody is allowed to demand pretty much anything from anybody for any reason, and include anything in any contract they're party of regardless of legality of any of the demands. It's the other party's responsibility to know which of these are legally valid and invalid.
Law most certainly does NOT work that way. If a business wanted to take you to court over contract violation then they’d have to tell you what you violated.
Likewise, a police officer cannot arrest you without telling you what law you broke.
Technically, Synaptics cannot sue without telling you what patents you violated either. But where patent laws get abused is businesses extorting others over threats of high legal costs.
Nobody is taking anybody to court. They're merely threatening to take to court. It's not illegal to threaten to go to court over bullshit claims, and words are cheap. That's why it keeps happening.
When I said all law, I meant there's nothing about tech patent law that makes it uniquely predisposed to this kind of extortionist behavior. All areas of economic activity have this exact same problem. Employment, debt collection, warranties, housing rentals, and many other things regularly involve pages upon pages of pointed threats written in legalese that don't have any actual laws behind them, but to people without legal experience are indistinguishsble from actual valid claims. There are entire businesses built around the fact most people can't ditinguish it. It's so deeply integrated in our lives that it's basically expected to happen every time a written contract is involved.
> It's not illegal to threaten to go to court over bullshit claims, and words are cheap.
In America it might not be. But the UK does have some protections against this kind of bullying. And this would fall under UK jurisdiction so UK laws apply
> All areas of economic activity have this exact same problem. Employment, debt collection, warranties, housing rentals, and many other things regularly involve pages upon pages of pointed threats written in legalese that don't have any actual laws behind them,
Again, in UK law this isn’t the case. For example the UK has significantly stronger employment laws than the US.
In short, not everywhere is governed by lax US laws, thankfully.
Of course, an American company can still threaten a Scottish citizen over bullshit patent claims if they wanted thought the individual didn’t have the finances to take the company to court. But that wouldn’t be lawful communication under Section 70B: Permitted communications of the Patents Act 1977. And thus not an example of your point about how all laws behave like that.
Which then comes right back to my original comparison of a protection racket. The one you originally objected to
Just to clarify, I mean specifically the act of putting words on paper that's then given to an employee to sign, not actually doing the things that these words say. In Poland for example, there are very strong employee protections and plenty of ways to go to jail or get fined as an employer, but crucially, putting illegal clauses in contracts are not one of them. Enforcing them, yes, but putting them in, no. Legally, illegal clauses are treated as if they're stricken out from the contract, and there's no law that makes it illegal to intentionally add clauses for the sole purpose of being stricken out later.
Do you happen to know the specific UK law that bans putting words on contracts that form illegal clauses (as opposed to banning the clauses themselves)? I love learning random trivia about other legal systems.
That’s a weird argument because you acknowledge that there’s no legal standing to those details yet you argue it’s part of law.
It’s like saying “hopping on one leg is part of law because there isn’t any laws that specifically disallow it”. You just end up down a rabbit hole of saying “everything is law” when you and I both know that’s not true.
I’ve cited UK law that makes a strong case for arguing Synaptics communication is unlawful. And you’re now asking for examples legislation for some other unrelated thing.
These two things combined suggest to me that you don’t actually care what I post, you just want bore me into a meaningless victory. So I’ll duck out now and let you have it. Enjoy :)
Thanks a bunch! This is exactly what I was looking for, Patents Act 1977 Section 70B. I missed it the first time when you mentioned it offhandedly in between calling me an idiot in 5 different ways.
And I never bored anyone down on purpose and never cared about any sort of "victory". Yet here we are, with you thinking I'm ignoring what you say and me thinking you're calling me an idiot. There's disagreement, and there's... whatever this is.
You literally admitted you ignored something I posted.
I never thought you were an idiot. What actually happened was I assumed you were a troll.
When I make the same point 3 times and it goes unnoticed but you make time to post multiple strawman arguments, it’s easy to see why one might suspect the other of trolling.
And the reason I cut the conversation short at the end was just because I didn’t want to waste time with someone who I thought was only trying to waste my time.
The person you responded said nothing about involving the formal legal system. The formal legal system is only involved in about ~1% of legal disputes. ~99% of legal disputes are settled outside of the formal legal system, where yes, anyone can whip open MS Word and type up whatever the fuck they want, and the burden is on the two parties communicating to check each other.
And they're right, most law is practiced outside of a courtroom. And essentially all civil disputes start outside of them. The vast majority of professional lawyers do not litigate at all.
Id already said civil disputes start outside the court room.
What I’m saying is that not all UK law works on the basis of accusations without evidence, like the GP argued.
Take this specific example, UK civil law does say the initial communication doesn’t have to include the patent numbers. However it does go on to say that if threats are then made then that information should be disclosed
If Synaptic require multiple weeks of work at $25,000 a week, to establish what patents are infringed, while also threatening to charge the developer for that time as well as further legal action, then it’s safe to assume that Synaptic didnt have enough confidence from the outset that their original claim was reasonably true.
In short, they are opening themselves up to litigation in return. But since their legal budget is vastly greater than this solo dev’s legal budget would be, they can skirt the fridges of what would be reasonable permitted communications.
BI doubt many UK judges would take favourable view with how Synaptics have handled their correspondence; if this ever were to reach the courts.
That is fair, I think what the above point was that formal technicalities matter only in so much as someone has the means and motivations to go to trial, which is rarely.
By all of, I meant all areas of, and by law works, I meant lawyers work. I could've been clearer on that.
And a funny thing happened. In the process of proving not all law is like that, you also proved that patent law is uniquely NON-extortionist (in the UK). Like you mentioned elsewhere, Patents Act Section 70B forbids certain kinds of patent-related threats. I'm assuming there's no general law applying to all such legal threats, or else there would be no need for this one. That would imply the law permits certain kinds of lawyers to be more extortionist than others, and patent lawyer are on the lower end of the spectrum. Is that so?
It depends on the jurisdiction (and there are quite a few in play for HN commentards)
In some jurisdictions, the "threat" describes the maximum possible payout that could be awarded so obviously you deploy a massive sum. I believe that is a US thing.
Law has rules and most of them are written down within most jurisdictions or can be inferred via case law, constitutions, or the distribution of tea leaves (as appropriate).
That's why it called the rule of law - the thing is you need to determine the rules in play. For example you said: "a police officer cannot arrest you without telling you what law you broke."
That is mostly true in the UK, unless you fall afoul of the Regulation of Investigatory Powers Act (RIPA) which involves some pretty wide ranging powers and effects.
It is unlikely to be even vaguely true in Russia or China or any other jurisdiction that doesn't really bother with nonsensical notions such as: demos kratos.
I shouldn't bother using words like "technically".
The article mentions the jurisdiction being the UK. so I don’t think we need to expand the scope to Russia and China.
in UK law, IP infringement falls under the category of civil law. While these can be settled out of court, you absolutely couldn’t take someone to court without disclosing what property has been infringed upon.
That's not universal, and it's why certain terms are nearly never brought to court because everyone knows they will be laughed out and then they will have to change lots of EULAs for regionally illegal claims
It is standard practice to include certainly illegal clauses in contracts. There is no penalty for including illegal clauses, they don't impact the rest of the contract, and there's always the chance the other party is not going to catch it.
If any part of the contract is found invalid that can invalidate the whole not just the in illegal parts. That is why many contracts have a clause that if any part is found invalid the rest holds - you can point to that clause and tell the court we agreed not to do that - but the judge need not agree. In some cases the judge can decide without the illegal part the whole makes no sense and invalidate the whole. Usually (In Practice always) most contracts make sense except for minor details that don't matter to the point of the contract and so the whole holds except for those details. However if any part of it doesn't hold the whole is open to be rejected.
The practical guidelines I received in my life so far said that usually entire contract is not tossed, at least not in Poland / EU, but if suit depends on clause deemed invalid the suit will be thrown and there might be order that a new contract be drafted (especially important for cases like EULAs where you have a 1:many fanout of people signing a standard form contract)
Unfortunately, smart internet users are outnumbered by not so smart users thousands to one. And the not so smart users aren't smart enough to know every time when a website is or isn't trustworthy. So while far from ideal, the world is a much better place since we gave control of the entire internet to a few aristocrats.
Of course that argument got heavily undermined by the existence of Let's Encrypt.
They kinda sorta do if the only way to obtain a trusted cert is to be vetted by a quasi-government entity with physical paper trail of who you are. But like I said, it's not how things work anymore thanks to Let's Encrypt.
For some reason, getting rid of autocomplete suggestions is harder than getting rid of all other browser data combined. I really don't know why. I've been wishing to clear autocomplete orders of magnitude more often than to clear history or cookies.
Not just in the browser. I somehow have my work account’s UPN somehow in my Google account history somewhere. So randomly Android will try to auto complete as that instead of the email address I used daily on forms, etc.
Have you tried WPF and XAML (I guess it's Avalonia and XAML now)? Personally I find it the only good use of XML ever, but it's really, really good. Though I've learned the hard way to keep the advanced features to the minimum and do absolutely any and all calculations in the viewmodel (which, admittedly, excludes 75% of XAML features.)
yes I have- i learned WPF before React (back in 2011) and immediately fell in love with JSX - JSX is what XAML should've been from the get go. Same for razer syntax in blazor.
till this day you can't use linq to render a sequence of elements. Like people.Select(p =>
{p.FullName}
);
it's such a shame XAML and Razer syntax haven't evolved.
Desktop app drag and drop is also a nightmare. Various frameworks can make it easier or harder, but regardless of what you choose, you have about 5 different states your draggable is in, and all of these states have at least 2 transitions to other states, and all your drop targets have to handle mouse-in/mouse-out/drop-end events, and those events need to expose enough data about the dragged object so that every drop target can not only execute the drop, but also tell you whether dropping is allowed without consuming the data.
It's not insurmountable by any means, but it does have enormous inherent complexity compared to almost every other UI action there is.
I used to run npm install unsupervised from a script on headless Debian that I deliberately chose dozens of times everyday. Later I moved my CI to Alpine.
Any type (like in TypeScript; Rust doesn't have one) is a set of every possible value; a supertype of all types. Every expression regardless of type can be assigned to a variable of type any.
The opposite is the never type, which is an empty set; no value is of type never. Per set theory, an empty set is a subset of every set, which makes the never type a subtype of all types. An expression of type never can be assigned to every variable regardless of type.
If never type has no values, then how can an expression have never type? Easy: it must never evaluate. Infinite loops, unconditional panics/exceptions, process exit/abort, etc. Also, generics - you can have Vec that's always empty, Result that can never be an error, etc.
reply