HNHacker News
TopNewBestAskShowJobs

MaxBarraclough

11,154 karma · joined February 25, 2014

submissionscomments
MaxBarraclough··on LG denies TV spying claims, says tracking and snooping concerns 'not true'
From Nov 2013, but still related:

LG Smart TVs logging USB filenames and viewing info to LG servers https://doctorbeet.blogspot.com/2013/11/lg-smart-tvs-logging...

HackerNews discussion (178 comments): https://news.ycombinator.com/item?id=6759426

MaxBarraclough··on Flights cancelled at UK airports due to ATC issue
> I did not claim nobody's medical care was affected.

You said the flight doesn't contribute to preventing harm to anyone. Interfering with medical care is a clear form of harm, that's why I focused on it.

> it's not common to fly for medical care (yes, very rich people may have a different perception, but that's all it is)

That's incorrect on both counts: it's common, and it's not just rich patients. Please take a look at the Medical tourism Wikipedia article I linked above. Cost-reduction is a major motivation of medical tourism.

From [0] :

> in 2016 nearly 144,000 UK citizens travelled abroad for medical treatment. The survey suggests a steady increase since 2000, even though the 2016 sample of 250,000 travellers represent 0.23% of the total number of travellers entering or leaving the UK.

See also [1].

[0] https://doi.org/10.58248/PB38 Outward medical tourism (2020)

[1] https://pmc.ncbi.nlm.nih.gov/articles/PMC3812100/ Medical Tourism: A Cost or Benefit to the NHS? (2013)

MaxBarraclough··on Flights cancelled at UK airports due to ATC issue
No, it's as I said.

There was a famous case in 2017 where a surgeon was violently removed from an overbooked United Express airliner. He had refused to leave voluntarily, as doing so would have meant not seeing his patients the next day. [0] I'm not sure this strictly counts as travelling for work, but the points remains.

Plenty of people fly abroad for medical care. [1]

Over 2,000 flights were cancelled in this incident. Over 300,000 would-be passengers were affected. [2] It's implausible that nobody's medical care was affected.

[0] https://en.wikipedia.org/wiki/2017_United_Express_passenger_...

[1] https://en.wikipedia.org/wiki/Medical_tourism

[2] https://aerospaceglobalnews.com/news/uk-airport-disruption-f...

MaxBarraclough··on Flights cancelled at UK airports due to ATC issue
It's not uncommon to travel for medical care, or for medics to travel for work.
MaxBarraclough··on California lawmakers unanimously pass Linux exemption from age-verification law
Of course Bernstein isn't about to file lawsuits against his users, given his motives, but (prior to the public domain dedication) he might have stood a chance in court if people were downloading and using his copyrighted software without a licence. Under modern copyright law, all rights are reserved 'by default' (at least in the US). I'm not sure if a case like that has ever ended up in court, but I can't imagine any corporate lawyer signing off on acquiring and using software in that fashion.

An absence of lawsuits is not the yardstick for success here anyway. It's possible the public domain dedication deterred adoption compared to using a permissive FOSS licence. Consider Google's caution about public domain software for instance [0]. It could also be possible for software to be adopted but, if tested in future, this could be found to be legally murky.

If your intention is to make the code available to all, to do with as they wish, there's no legitimate reason to release it to the public domain rather than just using a permissive licence. If anyone with a deep knowledge of copyright law disagrees on this point, I'd be interested if you could post a link.

I'm not clear if you're doubting the correctness of what I said in my previous comment. I'm not making this stuff up, I already gave sources. The Creative Commons CC0 licence was created purely to address the legal complexities of the public domain. [1][2] (For other reasons of legal nuance, Creative Commons licences should not be used for software works, [3] but the point stands.)

[0] https://opensource.google/documentation/reference/thirdparty...

[1] https://creativecommons.org/public-domain/

[2] https://creativecommons.org/2008/04/16/cc0-betadiscussion-dr...

[3] https://creativecommons.org/faq/#can-i-apply-a-creative-comm...

MaxBarraclough··on California lawmakers unanimously pass Linux exemption from age-verification law
> entrenching a preference for one style of licensing over another.

Sure, that's true. The intent of the law is to give a special carve-out for, in essence, Free and Open Source software. It seems clear that it was deliberately written so as not to include proprietary freeware, say.

> We all know what set of licenses the FOSS zealots would prefer for us to release code under, and those who release license-free or public domain software anyway typically do it with full knowledge of such arguments.

Like what? Really, it's very rare for code to be released into the public domain like this. I've never seen a compelling argument for doing so. If your intention is to make the code available to all, to do with as they wish, the legal reality is that the best way to achieve this is to release the software under a permissive licence, rather than releasing it to the public domain.

If the exemption really doesn't cover public domain software, that presumably means that, as the copyrights on Free and Open Source software eventually expire and they enter the public domain, they will no longer be exempt. Again though this isn't of practical concern.

edit Come to think of it, publicly available software developed by the US federal government is released into the public domain, right? There doesn't seem to be much software like this though.

Direct link to the text of the bill: https://legiscan.com/CA/text/AB1856/id/3456513

MaxBarraclough··on California lawmakers unanimously pass Linux exemption from age-verification law
Sure, but of minimal practical impact. The Free and Open Source community has long discouraged releasing software into the public domain, as it has clear drawbacks compared to just using a permissive licence. The legal intricacies of the public domain vary between jurisdictions. Not all jurisdictions even allow copyrights to be surrendered in this way. [0]

Licence-free isn't a concern. That isn't even close to Free and Open source software, it's the opposite: software that you aren't permitted to acquire, use, modify, or distribute. [1][2]

[0] https://opensource.org/blog/public-domain-is-not-open-source

[1] https://choosealicense.com/no-permission/

[2] https://docs.github.com/en/repositories/managing-your-reposi...

MaxBarraclough··on We found a division by zero bug in FFmpeg with a vibecoded fuzzer
If it's possible for program execution with some particular input to lead to a divide-by-zero, that's a bug, especially if the program is expected to be able to handle malformed inputs, or perhaps even deliberately malicious ones. It's not trivial to determine whether a program does this correctly. If it was, program analysis would be easy.

Division can 'go wrong' for certain inputs, but it's not just division. In C, signed integer addition, subtraction, and multiplication, all give undefined behaviour on overflow.

As 'Someone' already pointed out, it's not helpful to just flag all uses of the division operator, or of other potentially dangerous operators. Minimising false positives is one of the core challenges of program analysis.

MaxBarraclough··on JIT Compiling Code in 5μs
For a project like Postgres could it make sense to use a JIT with no use of SSA form?
MaxBarraclough··on JIT Compiling Code in 5μs
Interesting, thanks for the link. LLVM isn't the only game in town though, nobody using it (or libgccjit) for JIT should be surprised to see relatively long compile times. I wonder if the postgres project will try a different backend.

There's a strong 'diminishing returns' effect in striking a balance between compile time and the performance of the generated code. I'd expect a more lightweight (less optimising) JIT engine to be able to produce code with pretty respectable performance while taking only a fraction of the time that LLVM takes. There's a follow-up to the blog post I linked above, which bears this out. [0] (I don't know if that JIT solution is production-ready or viable for merging into postgres, mind.)

The blog post [0] gives this performance comparison:

> So, on our stupid benchmark, doing 10 times a simple SELECT * FROM demo WHERE a = 42 on a 10 million rows table...

    PostgreSQL             No JIT          LLVM JIT               Copyjit
    ----------             ------          --------               -------
    Average time (ms)      120             106 (-12%)             101 (-15%)
    Compilation time (ms)  0               19                     0.06
    Instructions           13,350,766,209  10,643,820,667 (-21%)  12,769,013,536 (-5%)
    Cycles                 4,660,821,596   4,005,881,863 (-14%)   3,924,602,439 (-16%)
    Branches               2,322,470,659   1,798,221,785 (-23%)   2,031,456,214 (-13%)

[0] https://www.pinaraf.info/2025/12/jit-episode-iii-warp-speed-...
MaxBarraclough··on JIT Compiling Code in 5μs
Thanks, sljit looks somewhat similar to GNU lightning.

On reflection I wonder if I overstated the widespread use of JIT and of JIT compiler frameworks. All the 'major' well-resourced high-profile JIT-based interpreters I can think of don't use an off-the-shelf JIT framework for their backend, which makes sense as they want to carefully tune the code-generation. OpenJDK, OpenJ9, .Net, V8, SpiderMonkey, JavaScriptCore. LuaJIT and Python's new JIT don't use one either, nor does the Linux kernel's BPF engine.

The Guile Scheme interpreter uses a fork of the GNU Lightning JIT library. [0] Julia and (as mentioned) Postgres use LLVM for their JITs. I'm trying to think of other projects that use a JIT framework/library.

Similarly, I can't think of many problem domains where it makes sense to use JIT. The ones that spring to mind are interpreters (of course), regex engines, and DBMSs. JIT can also help in high-performance computing, to tailor the code to the particular problem and the particular CPU. [1] I don't think there are many other contexts where it makes sense to use JIT though.

JIT compilation brings its own drawbacks in portability (both between hardware platforms and operating systems), complexity, and perhaps cybersecurity, which might also limit its adoption, even if a good JIT framework could help with all three.

[0] https://doc.guix.gnu.org/guile/latest/en/html_node/Just_002d...

[1] https://www.intel.com/content/www/us/en/developer/articles/t...

MaxBarraclough··on JIT Compiling Code in 5μs
Reminds me of the 2024 blog post Look ma, I wrote a new JIT compiler for PostgreSQL [0]. Both articles lament that Postgres's LLVM-based JIT [1] takes a while to generate code.

> The rarity of JIT compilers makes me believe that implementing a JIT compiler historically was too difficult for it to be worthwhile.

That's only true of writing a JIT from scratch. There's no rarity of JITs, it's just that LLVM (and other frameworks) are often used. Every major interpreter has a JIT compiler. PCRE2 has a JIT compiler. There are JIT frameworks out there with much faster code-generation than LLVM: Cranelift, GNU Lightning, Mir. I doubt they could do code-generation faster than a custom copy-and-patch JIT, but they'd be much faster than LLVM.

[0] https://www.pinaraf.info/2024/03/look-ma-i-wrote-a-new-jit-c... , discussed: https://news.ycombinator.com/item?id=39742916

[1] https://www.postgresql.org/docs/current/jit-reason.html

MaxBarraclough··on Oracle bans AI-generated code from OpenJDK
> The people up thread who replied to my original message give some other references for why this is the case

I'm afraid I'm not seeing it. Which comments specifically? Please link directly, rather than describing them.

> From the techdirt piece, seen above: [...]

My question was specifically about surveillance footage. The law doesn't work on perfect logical consistency, we can't infer an ironclad answer where there's no explicit law or legal precedent.

Another web search turned up a reddit discussion [0] which says that in the case of US law it's unclear, but that under UK law it explicitly is subject to copyright, under a special non-creative films category.

This Quora thread (sorry, couldn't find better sources) supports this. [1]

> You may feel inclined to call bullshit on this, but it’s actually the ongoing revenue model for "revised" editions of Beethoven, Bach and older."

Sure, I'm aware of that, but it's not the same question.

[0] https://old.reddit.com/r/COPYRIGHT/comments/1j7y8i0/cctv_foo...

[1] https://www.quora.com/Can-one-claim-copyright-on-CCTV-footag...

MaxBarraclough··on Oracle bans AI-generated code from OpenJDK
Thanks for the link but:

> The tldr is you really can't copyright raw surveillance video, but you can apparently lightly edit to turn it into a creative work that is copyrightable.

The article doesn't say that, it doesn't speak to CCTV surveillance footage. It discusses rare cases like cameras falling from aircraft, or animals pressing the button to take a photo.

I can see your line of reasoning about there being zero creative input in the video's creation, but if surveillance footage isn't subject to copyright, I'd expect there to be plenty written about it.

MaxBarraclough··on Oracle bans AI-generated code from OpenJDK
Do you have a source for raw surveillance footage not being subject to copyright? I'd not heard of this, and a web search didn't turn up anything.
MaxBarraclough··on Rust project goals: Immobile types and guaranteed destructors
For what it's worth Ada currently has RFCs for constructors in destructors closer to the C++ way. They're currently supported in the GNAT (GCC Ada) compiler.

https://github.com/AdaCore/ada-spark-rfcs/blob/master/featur...

https://github.com/AdaCore/ada-spark-rfcs/blob/master/featur...

https://gcc.gnu.org/gcc-16/changes.html#ada

MaxBarraclough··on Quadrupling code performance with a "useless" if
I was wondering the same thing. Also, could profile-guided optimisation help here?
MaxBarraclough··on Notes on Software Quality
Agreed. The quality of a software package doesn't change when its last user stops using it. We don't say that the Apollo Guidance Computer software is of low quality these days given that nobody's using it.

Software quality is, roughly speaking, intrinsic to a software product. Its usefulness is not intrinsic, it can depend on any number of external factors. Quality is not the same as usefulness.

MaxBarraclough··on Notes on Software Quality
I'm not sure about that definition. If your software solves a problem that many users face, that makes it useful and, presumably, valuable, but it doesn't mean it's of higher quality than niche software of relatively little use.
MaxBarraclough··on Notes on Software Quality
> I think a "resilience to hardships" would be a better definition of quality

Does this refer only to program behaviour? I figure readability should count toward quality, but it doesn't directly affect program behaviour.

MaxBarraclough··on Why low-latency Java still requires discipline?
I recommend his recent appearance on the Inside Java podcast, where these topics are explored well. The episode is number 59, titled Java *is* Memory Efficient.

https://www.youtube.com/watch?v=M_HCG1JPMQE (or any podcast application)

MaxBarraclough··on Why low-latency Java still requires discipline?
> There is no possible way even in theory for a GC to outperform schedule-aware allocation from a fixed pool.

You mean in the absence of any reference-counting overhead? That doesn't sound like a fair comparison.

> In most cases the GC is just generic C++ code anyway; that indirection is unnecessary.

You can't use the JVM's GCs from C++. C++ heavily relies on RAII, so it doesn't seem like a good fit anyway. I'm not aware of any serious efforts at a high performance GC for C++.

As Herb Sutter points out, moving GCs require non-stable pointers, which C++ isn't suited to. [0]

> the schedulers require predictable execution at ~1µs granularity for throughput optimization purposes, which is difficult to guarantee in Java

Can't say I know much about that kind of issue, how does it work in C++ code?

[0] https://herbsutter.com/2011/10/25/garbage-collection-synopsi...

MaxBarraclough··on Why low-latency Java still requires discipline?
> Am I the only one who thinks "pebkac" is a self-own?

There's no such thing as a programming language that guarantees excellent performance regardless of programming competence.

> why does it take so much extra effort to build these systems in Java compared with other languages?

They didn't say that.

MaxBarraclough··on A Post-Quantum Future for Let's Encrypt
This concern doesn't apply if a hybrid approach is used. From https://www.openssh.org/pq.html :

> all the post-quantum algorithms implemented by OpenSSH are "hybrids" that combine a post-quantum algorithm with a classical algorithm. For example mlkem768x25519-sha256 combines ML-KEM, a post-quantum key agreement scheme, with ECDH/x25519, a classical key agreement algorithm that was formerly OpenSSH's preferred default. This ensures that the combined, hybrid algorithm is no worse than the previous best classical algorithm, even if the post-quantum algorithm turns out to be completely broken by future cryptanalysis.

MaxBarraclough··on Asserts in Zig
> DbC is the Policy (i.e. what/why) and Asserts are the Mechanism

The ideal way to do runtime-checked DbC is not with simple asserts, it's with proper first-class preconditions and postconditions at the language level.

It wouldn't be nice to have to manually ensure that both old and new states of variables are in-scope for postcondition checking. I can imagine that being not just tedious, but error-prone.

> An Assert merely validates the state of a program at a particular point during execution.

Some aspect of the program's state, yes, and hopefully that's all it does.

Interesting to think about the edge-cases here though. Depending on the language, it could accidentally side-effect, or even invoke undefined behaviour, and so actively derail the program. Can't blame DbC for that though, that's a question of language safety.

> You use it to steer the program to go through only the correct subset of the state space of the program

I'm not sure I follow here. You don't use asserts to steer flow-control, you use them to check aspects of program state.

> You could do this pre/post every executable statement (i.e. write proof of correctness)

That doesn't constitute a proof of correctness, no more than last time you and I discussed this. [0] Depending on the language, it wouldn't even necessarily prove the correctness of that particular trace, as you haven't proven that you haven't accidentally invoked undefined behaviour.

You hold a minority opinion on this, please stop presenting it as settled fact.

> The point is that when using asserts you think about correctness w.r.t. specifications and nothing else. To think of it as simply validating arguments or in terms of effects on optimization is quite the wrong thing to do.

I'm not sure why you'd think I don't already know that.

[0] https://news.ycombinator.com/item?id=44675668

MaxBarraclough··on Asserts in Zig
There's more to design-by-contract than asserts, and DbC isn't the only way to use asserts. Most languages lack proper support for design-by-contract.

(For what it's worth I didn't downvote you.)

MaxBarraclough··on KDE at 30
> and it's open source because KDE's license made it that way

Chromium is open source, but Chrome isn't. Blink, WebKit, and for that matter KHTML, are available under permissive licences.

MaxBarraclough··on Int a = 5; a = a++ + ++a; a =? (2011)
> Apparently signed integer overflow UB helps with loop optimizations because it makes it easy to prove the loop always terminates

I tried googling but couldn't find hard numbers on the performance impact of GCC's -fwrapv flag. As you'd imagine, it forces wrapping for overflowing arithmetic on signed integer types. [0]

I also have to wonder how instructive that would be anyway. The GCC devs presumably don't prioritise the performance impact of that flag. If the C language mandated it, they might find other ways to achieve similar optimisation.

This page [1] looks at the related flag for trap-on-signed-overflow, and found an impact of very roughly 6%.

See also: John Regehr's posts on this topic. [2][3] He dislikes Java's implicit wrap behaviour, as it's rarely what the programmer wants to happen. Java programmers almost never use the addExact method, [4] as it's so syntactically clumsy.

> surely it's UB because some systems trapped on overflow, or produced different results due to using 1's complement, and the optimization side of the rule was a happy accident

Per this StackOverflow answer [5] I think you have it right.

[0] https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html

[1] https://danluu.com/integer-overflow/

[2] https://blog.regehr.org/archives/1401

[3] https://blog.regehr.org/archives/1154

[4] https://docs.oracle.com/en/java/javase/25/docs/api/java.base...

[5] https://stackoverflow.com/a/18195756

MaxBarraclough··on Int a = 5; a = a++ + ++a; a =? (2011)
> It's worse than that, the behavior of the entire program is unconstrained by the language standard beforehand too. Raymond Chen discusses how things can go wrong once you're going to reach UB even before you get to it

Heh, yes that's exactly what I was thinking when I put roughly speaking.

> where a kind C compiler might just mess with your numbers a bit, an evil C compiler can legally make demons fly out of your nose

Yes, signed integer overflow being another. Presumably it's defined that way as it's simpler than trying to spell out all the behaviours the compiler is permitted to implement, and on top of that there are trap representations to worry about. I doubt modern compilers get much optimization benefit from it though. There's a StackOverflow thread discussing the reasons it's defined this way: https://stackoverflow.com/q/1860461

MaxBarraclough··on Int a = 5; a = a++ + ++a; a =? (2011)
> The fact that the ordering of those more primitive operations with respect to other operations isn't very tightly constrained is something you'd just have to know about the language, I suppose.

No, that's not right. It's undefined behaviour, not merely an unspecified order of evaluation. Roughly speaking, the behaviour of the entire program is unconstrained by the language standard after execution of that statement. It could crash the whole process, for instance, or go haywire.

(Again, that's in C, apparently, but not in C++.)

← PreviousPage 2 of 34Next →