Hacker News new | ask | show | jobs
by matu3ba 374 days ago
> LLVM will improve to the point that we don't need further annotation to enable positive optimization transformations

That is quite a long way to go, since the following formal specs/models are missing to make LLVM + user config possible:

- hardware semantics, specifically around timing behavior and (if used) weak memory

- memory synchronization semantics for weak memory systems with ideas from “Relaxed Memory Concurrency Re-executed” and suggested model looking promising

- SIMD with specifically floating point NaN propagation

- pointer semantics, specifically in object code (initialization), se- and deserialization, construction, optimizations on pointers with arithmetic, tagging

- constant time code semantics, for example how to ensure data stays in L1, L2 cache and operations have constant time

- ABI semantics, since specifications are not formal

LLVM is also still struggling with full restrict support due to architecture decisions and C++ (now worked on since more than 5 years).

> At that point though, is there really a purpose to using a low level language?

Languages simplify/encode formal semantics of the (software) system (and system interaction), so the question is if the standalone language with tooling is better than state of art and for what use cases. On the tooling part with incremental compilation I definitely would say yes, because it provides a lot of vertical integration to simplify development.

The other long-term/research question is if and what code synthesis and formal method interaction for verification, debugging etc would look like for (what class of) hardware+software systems in the future.

1 comments

For constant time code, it doesn’t matter too much if data spills out of a cache, constant time issues arise from compilers introducing early exits which leaves crypto open to timing attacks.
Thanks for the info. Do you have a good overview on what other hardware properties or issues are relevant?