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

C++ is the last language I'd add to any list of languages used for correct-by-design - it's underspecified in terms of semantics with huge areas of UB and IB. Given its vast complexity - at every level from the pre-processor to template meta-programming and concepts, I simply can't imagine any formal denotational definition of the language ever being developed. And without a formal semantics for the language, you cannot even start to think about proof of correctness.

As with Spark, proving properties over a subset of the language is sufficient. Code is written to be verified; we won’t be verifying interesting properties of large chunks of legacy code in my career span. The C (near-) subset of C++ is (modulo standard libraries) a starting point for this; just adding on templates for type system power (and not for other exotic uses) goes a long way.

I don’t think this is a good comparison. Ada (on which Spark is based) has every safety feature and guardrail under the sun, while C++ (or C) has nothing.

There is a lot of tooling for C though, just not in mainstream compilers.

> The C (near-) subset of C++ is (modulo standard libraries) a starting point for this; just adding on templates for type system power (and not for other exotic uses) goes a long way.

In my experience, this is absolutely true. I wrote my own metaprogramming frontend for C and that's basically all you need. At this point, I consider the metaprogramming facilities of a language it's most important feature, by far. Everything else is pretty much superfluous by comparison


The phrase is striking but doesn't make a whole lot of sense to me.

Companies make dogfood and sell it and expect others (dogs, who aren't known for verbalizing dissatisfaction with their food) to consume it. The producers of dogfood don't really care what it tastes like or how nutritious it is.

But I can't imaging a business which involves collecting farts and selling them to others and where sniffing a small quantity of each bottled fart would help improve production processes to ensure a better experience for the customer. And most people are appalled at the smell of others' farts but can tolerate their own, so the "smell your own" test wouldn't really tell you anything.


  >The producers of dogfood don't really care what it tastes like or how nutritious it is.
Bingo. This is why "eat your own dog food" works so well. The best koans and parables include a contradiction, which is a teaching tool not a logic bug.

You may think you don't need to eat your own dog food (just like the dog food companies), but actually you should still do it.


I am surprised there are so many people on HN that completely miss the point. I am actually shocked. I am not shocked, however, that there are people who get offended. Getting offended is so 202x.

I think the metaphor is less about what you sell and more about the bullshit your customers have to endure to use the product you provide

If I were investing effort into acquiring knowledge in this domain, I'd skip straight to Polars. Before I made the switch, I had been using Pandas on and off for more than a decade. I'm not sure how representative this is, but most of the people I know who were Pandas users have also made this switch. I initially did it for the performance improvements but the API (according to my subjective opinion) is much more logical and has far fewer surprises compared to Pandas and it would be my default choice for this reason alone at this stage despite my years of Pandas experience.

I'd second this, especially if its just for personal use!

The data world owes a lot to pandas, but it has plenty of sharp edges and using it can sometimes involve pretty close knowledge of how things like indexing/slicing/etc work under the hood.

If I get stuck in polars, its almost always just a "what's the name of the function to use?" type problem rather than needing lots of knowledge about how things are working under the hood.


Ehhh, there are still plenty of pandas idioms for which there is only a clunky polars equivalent. Sure, I like the strictness of polars, but it is missing some day-to-day functionality. Which might never change - the polars team is trying to be disciplined about having a consistent and performant API, which does mean some functionality may be left behind.

Thanks, I'll look into this in the future. I don't need the most performant script, but this could change.

It's less about performance and more about ecosystem lockin. It's a bit like imperial vs metric units. Why would you ever chose to learn imperial if you had the option to only ever use metric to begin with?

That's exactly why I am reluctant to do anything with Polars. They are actively running a company and trying to sell a product. At any point they could be acquired and change the license for new releases. Sure you could fork it, or stay on an older version, but if what they offer isn't compelling enough for you then why take the risk?

Pandas on the other hand has been open source for almost two decades, and is supported by many companies. They have a governance board, and an active community. The risk of it going off the rails into corporate nonsense is much lower.


I would broaden the list of risks:

- Pandas is interwoven into downstream projects. So it will be here to stay for a long time. This is good for maintenance and stability. Advantage: Pandas.

- OTOH, the Pandas experience is awful; this was obvious to many from the outset, and yet it persisted. I haven't tracked the history. But my guess would be the competition from Polars was a key pressure for improvement. Edge: Polars.

- Lots of Python projects are moving to Rust-backed tooling: uv, Polars, etc. Front-end users get the convenience of Python and tool-developers get the confidence & capabilities of Rust. Edge: Polars.

- Pandas has a governance structure not tied to one company. Polars does not. (comment above said this) Advantage: Pandas.

But this could change. Polars users could (and may already be?) pressing for company-independent governance.


For short scripts and interactive research work, pandas is still much better than polars. Polars works well when you know what you want.

When you are still figuring out things step by step, pandas does a lot of heavy lifting for you so you don't have to think about it.

E.g. I don't have to think about timeseries alignment, pandas handles that for me implicitly because dataframes can be indexed by timestamps. Polars has timeseries support, but I need to write a paragraph of extra code to deal with it.


Because these are silly personal scripts. I'm not going to make sensible architectural decisions on something I run every now and then on my laptop. That's optimising too early.

DuckDB and SQL FTW.

> [Polars] is much more logical and has far fewer surprises compared to Pandas

A kind understatement imo. For me, the following experiences are highly coupled in my brain: "I'm using Pandas" + "I'm feeling a weird combination of confusion and pain" + "This is a dumpster fire".


It’s called TCO - tail call optimization - and gcc and llvm are supposed to implement it although tail recursive style code is probably uncommon in C or C++. Outside of that it’s common in functional languages where recursive functions are obviously idiomatic and so it has more potential to provide performance benefit.

It’s not a purely local optimization - affecting the call structure so debugging is a pain point. Which is probably why most imperative language compilers don’t bother given the lack of utility for the vast majority of code bases.

It feels like something that would need to be specified at the language spec or semantics level to make it useful rather than just making it optional for the compiler - otherwise the developer is probably just going to do the transform manually - to be safe - if stack explosion was a possibility if the compiler decided on a whim to not perform TCO.


Tail call optimization optimizes the situations where the recursion doesn't actually need any stack space, but I think the parent poster is asking about situations that aren't tail recirsive.


Just like many languages have annotations for inlining functions they could have annotations for tco. From an usability pov i would like annotations for must, must not, should, and should not. Where the "must" versions error if the compiler can't do the optimization


Scala and Kotlin have 'tailrec' annotation/modifier, though not as sophisticated as you describe.


It's simply a fact that common law jury trials are time-consuming and expensive and cause long delays and bottlenecks in the justice system.

Different common-law countries have addressed this issue in various ways. Restricting jury trials for more serious offenses (in this case for more serious charges - ones that could potentially result in a sentence of more than 3 years) is one way than many common law jurisdictions have taken.

It's not ideal but it's infinitely better in my mind than the practice used in the US to reduce jury trials. To avoid the cost/expense of a jury trial, public prosecutors threatens to press for a large number of charges or some very serious charges - carrying the potential of very long sentences - a sort of Gish-gallop approach.

Even if the chances of successful prosecution is relatively small for any one of the charges, the defendant is forced to take a plea-deal to avoid the risk of spending years or decades behind bars. Thus the defendant ends up with a guilty record and often a custodial sentence without any access to a trial or the chance to present their case at all.


The thing is, the reason for the delays and inefficiencies is not really juries. It's mostly much more mundane things like the prison service not sending defendants to court at the right time, translators not turning up when they are supposed to, buildings which are falling apart, technology not working properly, and court time being double-booked. It's an administrative failure, not a problem with the system.

Alongside removing the right to trial by jury, perhaps more alarmingly the government are also planning to remove appeal rights from "minor" cases (from magistrates to the Crown Court). The current statistics are that more than 40% of those appeals are upheld.

The planned changes won't fix any of these things, but it will cause fundamental damage to trust in the system and result in many miscarriages of justice.


The plan is not to "remove trial by jury" but to "remove trial by jury for some types of offense".


Yeah, ones that can yield imprisonment. Not OK!


I feel it is important to point out that the UK doesn't have freedom of speech, has never had freedom of speech and at this point doesn't look like it ever will. The idea of freedom of speech actually comes from the Netherlands and was first codified in the US. The UK never adopted it.

The person floating this idea (of removing jury trials) would gain the power to imprison people simply for criticizing the government (and anything he didn't like really). But sure, plea bargaining isn't a perfect idea so whatever the British government does is fine.

PS A few more sacred cows while I'm at it (just for fun): - The stereotypical British accent was formed after the US Revolution, before that Brits sounded like Americans (and visa versa) - Richard the Lionheart didn't speak English but instead spoke French - Churchill was lousy at military strategy and opposed the Normandy landings


You probably know this - but in most jurisdictions in the US, including federal, charges have to be approved by a grand jury of your peers.

There’s an old adage “a prosecutor could indict a ham sandwich”* implying that the grand jury is easily mislead - but in my anecdotal experience of serving on a grand jury - this isn’t really true. We definitely said no to overreaches.

And you can also see this happening in high profile cases with the Trump administration:

https://www.nytimes.com/2025/08/27/us/politics/trump-sandwic...

Ignoring that, it’s not clear to me why removing jury trials would reduce the likelihood of a prosecutor throwing a larger number of charges at a defendant. Prosecutors want to demonstrate a record of convictions. That career pressure is still going to exist without jury trials - they’re going to throw anything they can and see what sticks.

*Fun Fact - Sol Wachtler, the judge who coined this, was later convicted of multiple felonies, including blackmailing an ex-lover and threatening to kidnap her daughter. A bit more substantial than a ham sandwich.


I'm getting a lot of downvotes for the comment you're responding to so will likely withdraw from this discussion. But to be clear, I deliberately talked of prosecutors threatening charges, not actual indictments.

Conviction through plea-bargaining is almost exclusively a phenomenon in the US. It just doesn't feature in the normal process of public prosecution in countries like Ireland, the UK or Australia. Also as an aside, the grand jury system is exclusively an American feature.

And every common law country (including the US) has a bar in terms of seriousness of the crime, below which you are tried without a jury. Yes the bar is lower in the US (potential sentence of more than 6 months?) but this bar exists nonetheless without sensationalist claims that jury trials have been eliminated - which is what was stated in the comment I originally responded to.


Also, I feel like there is something important you don't understand about the US system. A grand jury isn't a jury trial. A grand jury just allows a jury trial to happen (for a defendant to be charged at all). The defense isn't part of a grand jury. That's why the quote is what it is. It isn't talking about jury trials, just that a prosecutor can charge someone with a crime (the outcome them winning at a grand jury) pretty easily. Hope this helps.


that's not true - it's also common in Canada and Japan


American Bar Associaton agrees. ABA Plea Bargain Task Force Report is sad read. US criminal justice system is horrific and plea bargaining is big reason for it.


So you are telling me that the people who make money from criminal trials don't like the part of the system that would make a trial not necessary. Weird huh...its almost like they have a significant monetary reason to get rid of plea bargins.


Prosecutors are also members of the Bar and they don't make extra.

Is it so hard to understand that people don't like to work for a system where people are treated inhumanely and can't get justice?


Historically Lego was a construction toy. This is what it was in my youth. These days Lego sell model construction kits - most are constructed once and then the owner plays with the model. This represents a radical and fundamental change. I’m not sure when it happened or how suddenly it happened as there is a large (decades) gap in time since I played with Lego as a kid and my current exposure to Lego via my own kids. Our home is full of Lego models but I don’t recall seeing my kid using his vast amount (compared to the shoe box I used to store my Lego as a kid) of Lego to actually construct something. The “studless” change - with its inside-out building technique makes it virtually impossible to alter a model once built - unlike the old bottom-up approach where it’s trivial to alter. It makes me sad because I remember with nostalgia the hours I spent building all sorts of fanciful constructions with my box of generic Lego pieces but I also acknowledge that model building — which I do with my kids - is also fun. But it’s just not the same play/toy as it was years ago.


> As with any religion, environmentalism

Calling something a religion is a lazy and disingenuous way to dismiss it. The effects of airborne and waterborne pollution on human health has been the focus of scientific investigation for centuries at least. Ecosystem destruction is not "a religious belief" - it's something which has been measured, carefully recorded and studied using scientific methods.

> at 1/1000th the cost of re-wiring our entire energy system around renewables

This is alarmist hyperbole. Renewables now account for about 35% of the global electricity generation mix. There are countless examples of countries that run grids where renewables account for more than 80% of the electricity mix. Even if you just consider wind and solar, many countries are approaching 50% penetration in the space of 20 or 25 years without "re-wiring their entire their entire energy systems".

Yes NG generation is the only fossil tech still standing in terms of being able to compete at any level with modern generation tech but it is being squeezed. Batteries surpassed NG in terms of economics for peaking sometime around 2020/2021 - which is reflected by the share of new capacity investment since then.

> industrializing 3B+ people using windmills

A windmill is a device used to mill materials that happens to be powered by wind, like a watermill, or a pepper mill or a paper/wood/etc mill. I'm not sure what that has to do with electricity generation.


I think they may be referring to “wind turbines”.


By what measure? Coal hasn't been competitive for decades and the only way it had remained competitive in terms of cost per MWh even back then was if you burned it in huge (> 1GW) plants. 1GW plants are the very opposite of what you want to electrify rural areas - construction is slow and expensive, operating large plants requires considerable and qualified head-count, logistics is an issue and they require high capacity and expensive transmission systems.

And if your minimum unit size is 1GW then you lose the flexibility to roll out the tech incrementally - the average modern coal plant requires 3 to 5 weeks per year for scheduled downtime for maintenance - so your first 1GW coal plant requires a bunch of other generation sources to cover demand during these periods.

Solar and batteries are the obvious solution for rural electrification: scaleable, cheaper/simpler to deploy - no large scale civil engineering involved, trivial to "operate", effective without the support of big transmission systems and it's possible to buy everything off-the-shelf.


This is a strange claim. During its peak years - in the mid 1990s - Moneypoint (the only coal plant in the country) provided 25% or more of the electricity mix while wind generation consisted of a few tiny pilot plants - contributing a miniscule.

In 2026, coal now provides 0% of the mix while wind provides 30% or more. Peat burning has also been fully phased out while oil (Tarbert) is in the process of being shut down while Moneypoint has been converted to oil but only participates in the capacity market - i.e. as an emergency/backup source - and so barely registers in the mix.

And even if coal was supplanted one-for-one with NG, it would still be a net win - by halving the CO2 intensity of generation as well as being far more flexible, scalable and much cheaper to deploy.


This is the fundamental idea behind git - to fully compute/derive diffs from snapshots (commits) and to only store snapshots. While brilliant in some ways - particularly the simplifications it allows in terms of implementation, I’ve always felt that dropping all information about how a new commit was derived from its parent(s) was wasteful. There have been a number of occasions where I wished that git recorded a rename/mv somehow - it’s particularly annoying when you squash some commits and suddenly it no longer recognizes that a file was renamed where previously it was able to determine this. Now your history is broken - “git blame” fails to provide useful information, etc. There are other ways of storing history and revisions which don’t have this issue - git isn’t the end of the line in terms of version control evolution.


I agree with this, I just don't think I agree with the Beagle approach (CRDT on AST as the source of truth) vs. the Git method (bytewise files as the source of truth) with something alongside.

Like, I think it's way easier to add a parallel construction to Git (via a formal method or even a magic file) which includes the CRDT for the AST than it is to make that the base unit of truth. It still lets you answer and interact at the higher level with "oh, this commit changed $SYM1 to $SYM2" without also destroying byte-level file information that someone finds important, and without changing the main abstraction from the human-space to the computer-space.


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

Search: