HNHacker News
TopNewBestAskShowJobs

Panzerschrek

465 karma · joined September 10, 2025

submissionscomments
Panzerschrek··on A few good ideas in programming languages
> Borrow Checking

It's very confusing name for this feature. It suggest that some sort of borrowing takes place and that it's just an optional check, which isn't the case. It should be named something like "enforced static usage analysis" instead.

In my programming language I have similar mechanism. But it isn't just checking, since it affects code generation by tracking which variables are still in use and which can be destroyed.

Panzerschrek··on Generating the P3 Tiling
Once I have implemented such tiling using shadertoy. Source code: https://github.com/Panzerschrek/shader_bits/blob/master/penr.... No recursion is really needed (which isn't supported in shaders), but a plain loop with N iterations to achieve tiling of depth N.
Panzerschrek··on C*: Unifying Programming and Verification in C (2025)
> We claim that C achieves real-time program verification, i.e., the user can carry out verification as they program the implementation code incrementally. It achieves this goal by orchestrating the symbolic-execution engine and the LCF-style proof kernel together, creating a proof-supporting runtime that runs proof-code blocks and symbolic execution of program segments in an interleaving manner

That's why such thing is mostly useless. C is used in places where performance is important and nobody want to sacrifice performance for such proofing. Even more, if such proofing is too slow, it's better to use something like Fil-C.

Panzerschrek··on Cloud in a Bottle: making self-hosting accessible to everyone
"white IP address" is an address that your internet provider gives you and which is accessible from the whole internet, not just some address local for the provider's network and hidden behind NAT. Since IPv4 addresses are scarce, most providers don't allocate them directly to their customers.

An unique IPv6 may be theoretically assigned to each end device and thus solve the accessibility problem for locally-hosted servers, but I doubt internet providers do this in practice and I am afraid that many providers don't support IPv6 at all.

Panzerschrek··on Visualizing Rust's Vtables: How dyn Trait Works In Memory
> you can choose at use site

This is possible in C++ too, but it may require extra work. But is it really needed that often to use both kinds of polymorphism for the same type?

> the size of the objects do not pay for dynamic dispatch because the vtable pointer is kept together with the object pointer, not within the object.

You have identical memory overhead in Rust and C++ if you store a single pointer to a polymorphic object. But if more than one such pointer is stored (if it's shared), Rust uses more memory, since it stores N virtual table pointers (together with each object pointer), where C++ stores exactly one virtual table pointer within the object itself.

Panzerschrek··on Visualizing Rust's Vtables: How dyn Trait Works In Memory
> A trait must follow so-called object safety rules to be used as a trait object

This seems for me to be a major design flaw of Rust. It tries to repurpose traits for dynamic polymorphism, even if this doesn't fit perfectly. C++ is more honest, it has two separate mechanisms for static polymorphism (templates) and dynamic polymorphism (inheritance).

Panzerschrek··on Visualizing Rust's Vtables: How dyn Trait Works In Memory
I once faced a tricky bug involving fat pointers (containing virtual tables) in Rust. Two such pointers may be distinct, even if they reference to the same object, because (for some reason) the compiler may create two (or even more) copies of the virtual functions table and use them in different places.
Panzerschrek··on Cloud in a Bottle: making self-hosting accessible to everyone
Making self-hosting really accessible isn't that easy, even if it's easy to setup the server machine itself. One needs to make their server machine accessible to everyone, which isn't generally possible due to how networks work, one needs a white IP address and making sure no incoming connections are rejected by the internet provider. Also one needs a domain. Obtaining it requires some bureaucratic burden, costs money and pricing isn't always transparent.

These barriers are high enough, so that common people can't create/host their own sites. Only skilled enthusiasts or professionals can afford having their own site.

Panzerschrek··on Show HN: asciiQuake
Nice, but particles (smoke, blood) are not ASCII.
Panzerschrek··on Vermell – Minimal, dependency-free C++ web framework using epoll
It looks suspicious. It has only 18 commits, the majority of code was added via single initial commit. is it LLM-generated?
Panzerschrek··on Casey Muratori – The Root of the Root of All Evil – BSC 2026 [video]
It's a common situation for many quotes of such kind. Taken out of context they loose or completely change their initial meaning.
Panzerschrek··on Show HN: Flint – A minimal C/C++ package manager and build tool written in C
This can work only for toy projects with no complex build scripts and without dependencies fetched not via git.
Panzerschrek··on Creating Teensy ELF Executables for Linux (Or, "Size Is Everything") (1999)
The program described in this article is as simple as possible. What about something more complex, like basic "hello world"? It requires at least one more syscall and several bytes more data.
Panzerschrek··on Indirect Calling of Nested Functions on GCC Without Executable Stack
It was maybe cool 50 years ago or so. Nowadays it's no longer needed. Possible performance gains of such code are marginal and modern programming languages allow generating many specialized and optimized code pieces using the same template, so that self-modification is no longer needed.

There is also JIT (like in regexp engines), but it's different story.

Panzerschrek··on Bootstrappable Builds: How and Why
Are chain-of-trust attacks real? Is it necessary to make so much effort to avoid what supposedly never happened?
Panzerschrek··on Double-double: 31 digits of precision without leaving the FPU
Such trick looks interesting. But I think for many cases it would be better to use fixed-width arithmetic based on 128-bit integers. Operations for them are much cheaper if done right (and assuming compilers are smart enough to optimize them). For the Mandelbrot set one don't need huge range, maybe 4 bits of range or so, the remaining 124 bits of precision can increase quality significantly.
Panzerschrek··on Malicious Rust crate Arrayref runs a build-time payload
Sandboxing for build scripts can't work properly. If you sandbox too much, some necessary stuff can't be done. If you sandbox too little, it has no practical value.
Panzerschrek··on Malicious Rust crate Arrayref runs a build-time payload
> In the end it is your decision to use unaudited or refuse unaudited crates.

It should be the default behavior of the package manager to allow downloading only audited/trusted packages. Forcing end-users of the language to be responsible for audit of all dependencies is impractical.

Panzerschrek··on Malicious Rust crate Arrayref runs a build-time payload
Languages like Rust have sources of income to be able to finance such audit.

You don't need to audit all the crap is being uploaded right now. Only really necessary and widely-used packages should be managed in a centralized way, so, auditing all of them isn't that huge task.

Panzerschrek··on Malicious Rust crate Arrayref runs a build-time payload
Why this still happens? Why after many previous supply-chain attacks maintainers of package repositories still allow anyone uploading packages and pushing updates without security audit?
Panzerschrek··on SIMD in the 90s: Programming Intel's Pentium MMX
John Carmack promised that Quake II will use MMX, but this wasn't done. That's why software rendering in Quake II is so boring, it doesn't even support colored lighting. In the other hand Unreal did use MMX, which allowed it to work in 32-bit color mode with colored lighting and a bunch of other effects.
Panzerschrek··on Show HN: C# Game Engine with its own scripting language and IDE
It seems for me fundamentally wrong to use C# to write some scripting language, since C# itself is pretty high-level and is used widely for scripting (like in Unity).
Panzerschrek··on Moving integer division to floating-point is trivial
> Typically very long latency and poor throughput.

Recently I have been investigating what operations modern compilers for modern CPUs can optimize. I fond, that for floating-point types there are vector division instructions (which compilers use if they can vectorize), but for integers there are still only scalar instructions. It's unclear for me why no vector instructions exist for such basic arithmetic.

Panzerschrek··on I want extern "fil-C"
Extern "fil-C" can't be compatible with Rust code or something similar. It requires a metadata block attached to each allocation. So, if a memory block has been allocated in Rust and a pointer to it is passed to a fil-C function, it can't access it correctly. The only way to allow such cross-langauge-and-abi calls is to compile Rust code itself like fil-C, which requires doubled memory consumption, expensive runtime checks and GC overhead.
Panzerschrek··on To save C, we must save ABI (2022)
The root cause of all C ABI problems are shared libraries. They give so much trouble with little to no benefits. Ideally no application should use them. All dependencies should be compiled from sources with the same compiler and standard library. System libraries aren't needed either, it should be possible to perform syscalls directly. In such approach no ABI incompatibility can happen.

One may say, that shared libraries can save some space for both disk storage and RAM. But such savings aren't that huge and in some cases are even negative - if a library is linked-in, it's possible to discard unused functionality and even inline many library functions.

Panzerschrek··on To save C, we must save ABI (2022)
> // Proposed: Transparent Aliases > _Alias g = f;

I think defining a constant function pointer should work. As long the compiler doesn't store this pointer in the result executable and optimizes-out all calls via it into calls to the source function.

Panzerschrek··on The State of Google
Google Earth is likely not profitable to keep it alive. This probably happened with many other services killed previously.
Panzerschrek··on Show HN: Modern C++ Build Tools for Module Feature
> mcpp.toml ← project manifest

It's a fatal flaw. A declarative language isn't powerful enough to be able to describe complexity of typical C++ project. That's why cmake language (Turing-complete) exists.

Panzerschrek··on Show HN: Wyzer Programming Language
Is it memory safe? Can I cause a memory-related bug writing normal (safe) code in this language?

> The one rule is that once you use a resource, you cannot use it again

What about data structures which need to be shared? Can I use some sort of mutex for them?

Panzerschrek··on Show HN: Modern Browsers Don't Need the Cookie Anymore
> You're inside a virtual machine.

It's wrong. I have Hyper-V and VirtualBox installed on my machine, maybe it has some effect?

> You use Microsoft Office

No, I don't. It was installed previously, but my license expired.

← PreviousPage 4 of 16Next →