News for hackers. Stuff that matters.

MaxBarraclough

Re:AlpineBSD on Thursday October 29, 2026 @05:08AM (#50286322)
They cannot. Linux success has nothing to do with GPL is in direct contradiction with I really think the license has been one of the defining factors in the success of Linux.
Re:AlpineBSD on Wednesday October 28, 2026 @05:54PM (#50281481)
> Linux success has nothing to do with GPL

Linus doesn't agree. He once said in an interview that making Linux GPL'd was definitely the best thing I ever did, [0] and has said that I love GPLv2. I really think the license has been one of the defining factors in the success of Linux because it enforced that you have to give back. [1]

[0] https://web.archive.org/web/20070826212454/http:/www.tlug.jp...

[1] https://www.zdnet.com/article/linus-torvaldss-love-hate-rela...

Re:Gemini 4 Carbon on Wednesday October 28, 2026 @04:19PM (#50280300)
It does more than merely being different, it also collides with the name of another Google project: the Carbon programming language.
Re:Gforth 1.0 on Wednesday October 28, 2026 @07:36AM (#50271941)
> That’s because Gforth is a threaded-code VM that saves dictionary images rather than compiling to native code.

That's not correct. Gforth features a JIT compiler, although they don't call it that, they call it dynamic superinstructions. It will be enabled if you run gforth-fast. If I understand correctly, the native code sequences are always generated at runtime, and cannot be baked into an image file.

• Dynamic Superinstructions https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Dyn...

• [PDF] Code-Copying Compilation in Production An Experience Report (2025) http://www.euroforth.org/ef25/papers/ertl.pdf

Re:Gforth 1.0 on Wednesday October 28, 2026 @07:22AM (#50271817)
> Mark my words

We will also compile them, and reference their execution tokens from the dictionary.

Re:Gforth 1.0 on Wednesday October 28, 2026 @07:19AM (#50271792)
Factor looks like a more conventional language, with dynamic typing, automatic memory management, etc. It sounds quite far from Forth's roots as a compact assembly sequence that enables interpretation of a minimal language just barely atop the bare metal.

fallat said they were interested in teaching a 'grassroots' language. By that I think they mean something with a minimal core language and compact interpreter, so Forth seems like the better fit.

Re:Gforth 1.0 on Wednesday October 28, 2026 @07:04AM (#50271645)
Like many languages, Forth can get complicated if you really get into the weeds. These 2 papers [0][1] (both by one of Gforth's creators) illustrate the sorts of intricacies you can run into. The trickier subtleties have to do with Forth concepts like interpretation and compilation (which have their own meanings in Forth), and have little to do with Forth's use of stacks.

In Forth's defence, other languages also have tricky subtleties, e.g. C++. Neither language prioritises theoretical purity, of course. They would be very different languages, with different drawbacks and advantages, if they did.

Both papers touch on whether the behaviours of certain unusual Forth constructs are well-defined according to the ANS Forth language standard. This sort of discussion should be quite familiar to C++ programmers.

[0] State-smartness - Why it is Evil and How to Exorcise it (Ertl, 1998) http://www.euroforth.org/ef98/ertl98.pdf

[1] State-smartness: Applications, Pitfalls, Alternatives (Ertl, 2001) https://www.complang.tuwien.ac.at/papers/ertl01state.pdf

Re:11 year old unsoundness bugs found in Rust borrow checker on Thursday October 15, 2026 @03:26PM (#50108940)
> I've experienced a huge amount of friction trying to enable features that cost something resembling 0.5% of fleet performance, even when they provide massive benefits. 12% loss would be laughed out of the room.

A 12% difference in performance between two compilers, for some given application, is possible even between two of the best optimising compilers available. A 12% performance lag does not necessarily relegate a compiler to obscurity.

The long-entrenched MSVC compiler is still a major player despite that, for at least some applications and for at least some compiler versions, Clang outperforms it by far more than 12%. [0][1]

If a new Rust compiler really could offer significantly fewer compiler bugs, that would of course need to be weighed against any performance penalty, and the proper tradeoff would of course depend on the project.

> I agree that this is an impressive feat. I also don't see why an equivalent for rust would be adopted.

I imagine it wouldn't be widely adopted for most applications. CompCert itself is pretty niche. It's not Free and Open Source software, which I suspect is a factor, alongside its technical drawbacks.

Unless you're working on ultra-low-defect software, such as in a safety-critical domain, compiler bugs are unlikely to be a major factor in your software's quality. If the compiler lacks support for interesting language features, it becomes an even harder sell for 'ordinary' projects that are able to tolerate an ordinary number of compiler bugs.

[0] https://lemire.me/blog/2023/02/27/visual-studio-versus-clang...

[1] https://discuss.python.org/t/using-clang-cl-for-better-perfo...

Re:11 year old unsoundness bugs found in Rust borrow checker on Wednesday October 14, 2026 @03:20PM (#50093457)
> That's a big gap

I wouldn't say so. The gap between GCC and Clang/LLVM is bigger than that on some benchmarks, [0] although the gap between their overall performance (using geometric mean) is much less. [1]

It's a very impressive result considering how much effort has gone into GCC. It highlights how compiler optimisation work can face diminishing returns.

> the norm for releases being O2 if I understand correctly

Agreed, but the difference isn't that great. From the article:

> CompCert code is 7% slower than gcc-01 and 12% slower than gcc-02 on average.

Reminds me of how the cproc/qbe C compiler gets very roughly 50% of the performance of Clang/LLVM in 0.1% the lines-of-code. [2]

[0] https://www.phoronix.com/review/gcc-16-vs-clang-22/3

[1] https://www.phoronix.com/review/gcc-16-vs-clang-22/6

[2] https://drewdevault.com/talks/qbe/ (and see the linked slideshow PDF, as the abstract is a little misleading)

How could the specifics of TLS help deter/block bots?
Re:11 year old unsoundness bugs found in Rust borrow checker on Tuesday October 13, 2026 @02:40PM (#50076543)
CompCert produces surprisingly fast native code.

This 2022 article [0] says it generates binaries that run about 7% slower than what GCC produces with -O1.

[0] https://www.cs.cornell.edu/courses/cs6120/2022sp/blog/compce...

Re:Unikernels were hard. key word: were on Sunday October 11, 2026 @10:03AM (#50043421)
> VM breakouts are becoming trivial

They are not. When discovered, they are still big news. With few exceptions, businesses (and other institutions) continue to treat the cloud providers' VM-as-a-service offerings as secure. AI can aid the defenders too.

> So everyone should be considering how to bake better security into the their runtimes.

If VM isolation is not trustworthy, my first concern would be whether the other VMs on the physical host machine might do something malicious and break into my VM.

Re:Beating the Compiler on Monday October 05, 2026 @03:52PM (#49969741)
If it were practical and if there were significant performance benefits (on modern heavyweight CPUs) to tailoring the calling convention on a per-function basis, I'd expect to see it done in optimising JIT engines like Java HotSpot. As far as I know, they don't bother.

I'm no expert but I suspect jcranmer's comment has it right that you end up doing cross-function register-allocation while foregoing the other benefits of just inlining. I also suspect the payoff would be minimal on modern heavyweight hardware. I can see it making more of a difference on a very minimal embedded processor, or if optimising for the smallest binary possible.

Re:New PlayStation 5 Console Jailbreak Released on Tuesday September 29, 2026 @04:19PM (#49899802)
They could apply a different policy to their web-based dashboard GUIs (if these do exist) than to the web browser.
Re:Optimizing x264 settings and per-title ladders on Tuesday September 29, 2026 @02:46PM (#49898421)
Interesting, thanks.
Re:New PlayStation 5 Console Jailbreak Released on Tuesday September 29, 2026 @02:44PM (#49898390)
At a glance, it looks like it exploits a bug in WebKit's JavaScriptCore JavaScript engine.

Does the PS5's WebKit use JavaScriptCore with JIT enabled? Have to wonder if Sony will respond by disabled its JIT, to narrow the attack surface.

Re:Writing Efficient C++ Code on Tuesday September 29, 2026 @02:40PM (#49898324)
I think that's fair. It's neat that it's possible through C++'s template system. It wouldn't be possible in many other languages.
Re:Writing Efficient C++ Code on Tuesday September 29, 2026 @01:40PM (#49897264)
> unlike a lot of high level languages, there isn't an extra allocation for a node structure. The node structure is a member of the structure being linked.

That's good, but it seems like how-hanging fruit. Boost offers intrusive_prt for this. [0]

make_shared goes half way, and performs a single allocation to return a shared_ptr to a new object. It eventually made its way from Boost to the standard. [1][2]

See also [3] which contrasts the two. (As you can imagine, intrusive_prt is slightly more efficient.)

[0] https://www.boost.org/doc/libs/latest/libs/smart_ptr/doc/htm...

[1] https://www.boost.org/doc/libs/latest/libs/smart_ptr/doc/htm...

[2] https://en.cppreference.com/cpp/memory/shared_ptr/make_share...

[3] https://stackoverflow.com/a/13913161

Re:Optimizing x264 settings and per-title ladders on Tuesday September 29, 2026 @01:28PM (#49897011)
I don't know that much about video codecs, could decoding performance improve, given the reduced input size?
Re:Writing Efficient C++ Code on Tuesday September 29, 2026 @01:25PM (#49896953)
The compiler no longer guarantees to generate confirming code, so correctness could be affected. If this weren't the case, there would be no need for a flag, it would be GCC's default behaviour.

(I'm not creata, but I imagine this is what they had in mind.)

Re:Writing Efficient C++ Code on Monday September 28, 2026 @02:41PM (#49882523)
Allocation and deallocation are fairly expensive with or without modern caches though, surely?

Or are pools used to avoid that?

Re:Writing Efficient C++ Code on Monday September 28, 2026 @10:19AM (#49878408)
Yes you're right. Here's an alternative that behaves the way I had in mind but doesn't support deletions, as handling deletions the way std::vector does would naturally mean relocating elements. [0]

I figure it would be possible to add support for deletions, but it would cost us: we would lose guaranteed contiguous placement of elements with neighbouring indices, and (unless no deletions are made) we'd need a private data structure to correspond vector indices to addresses, and to determine where to locate new elements. This would of course bring us back to continually paying the price of indirection overhead, and simple lock-free modifications would not be possible.

My completely unsupported guess is the cache behaviour wouldn't be too bad unless deletions (of elements that aren't at the end of the vector) are common. I imagine the cache behaviour of a linked list must depend greatly on what the allocator gives you. Presumably using a pool, specific to that particular list, could help there.

[0] https://github.com/david-grs/stable_vector

Re:Writing Efficient C++ Code on Monday September 28, 2026 @08:03AM (#49876685)
I'm not sure I follow the second point. Array-based solutions are able to guarantee that an element is never relocated, it's just that std::vector doesn't offer this guarantee. The Boost libraries offer this though, they call it stable_vector.

https://www.boost.org/doc/libs/1_92_0/doc/html/container/non...

Re:Writing Efficient C++ Code on Monday September 28, 2026 @07:46AM (#49876536)
Naturally the mind races to think of where linked lists are used.

The Linux kernel uses them, at least some of the time they're used with their lock-free RCU pattern. I'm not sure if it's for performance reasons though, I think they're using it in contexts where correctness requires the absence of blocking operations.

I'd expect a lock-free non-linked-list solution would also be possible, but I don't know enough to state that definitively.

https://docs.kernel.org/RCU/listRCU.html

Re:Writing Efficient C++ Code on Sunday September 27, 2026 @02:56PM (#49869697)
I'm no expert in this stuff but:

creata's comment [0] mentions the works of Agner Fog, which seem very good, and are freely available.

I haven't read C++ High Performance [1] but it looks like it covers the sorts of topics you'd expect, although it looks like it doesn't cover computer architecture in detail e.g. branch prediction. There are books on that too, of course.

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

[1] https://www.packtpub.com/en-us/product/c-high-performance-97...

Re:Writing Efficient C++ Code on Sunday September 27, 2026 @01:33PM (#49868851)
I've not read Fog's Optimizing software in C++ but I see it's freely available there as a PDF (182 pages). Looks like a great resource on these topics.

https://www.agner.org/optimize/optimizing_cpp.pdf

Re:Writing Efficient C++ Code on Sunday September 27, 2026 @01:14PM (#49868641)
That has a similar problem to the article, it's trying to fit far too much into too small a format.

What you've written mostly makes sense to someone who already has a solid understanding of SIMD and of C++ (although I can't say I follow all of it), but the target audience is people who don't. For them, each point needs a much lengthier explanation.

Re:Writing Efficient C++ Code on Sunday September 27, 2026 @12:34PM (#49868246)
There's no mention of branch prediction, or context switching, or synchronisation. Depending on what you're doing, they could be very consequential. There's only very brief mention of parallelisation with threads and with SIMD.

High-performance programming is a big topic. The scope is far too broad for a single blog post, which naturally gives only cursory discussion of C++ and computer architecture. The article isn't bad considering, but I do think it's the wrong format. A blog series, or even a book, would be more fitting.

Re:"They had no concept of a duty of care to their users." on Sunday September 27, 2026 @12:16PM (#49868043)
Vim's persist undo is disabled by default, perhaps for privacy reasons. edit: I see sebzim4500 got there first.

* https://news.ycombinator.com/item?id=49867678

* https://bastian.rieck.me/blog/2015/persistent_undo_vim/

The linked video is Planning a Heist - Key & Peele.

Please include a description of what you're linking to. People aren't likely to follow a link to an unknown YouTube video.

Older »