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

There are a few interesting places where Galois Theory touches on compilation/programming.

Abstract interpretation models a potentially infinite set of program behaviors onto a simpler (often finite) model that is (soundly) approximate and easier to reason about (via Galois connections); here the analogy is to Galois Theory connecting infinite fields with finite groups. I often think about this when working on Value Numbering for instance.

Also (perhaps a bit of stretch) it's interesting to think of extending a computational domain (say integers) with additional values (say an error value) as a kind of field extension, and as with field extensions, sometimes (perhaps unexpectedly) complications arise (eg loss of unique factorization :: LLVM's poison & undef, or NaNs).


To extend on this, while abstract interpretation may sound a bit "abstract" (pun not intended), it is the basis for many techniques for software verification and compiler optimizations. At its core it basically allows you to soundly approximate the set of reachable states in a program, which in turn can be used to check that no "bad" state can be reached (for software verification) or that e.g. some checks are useless and can be removed (for compiler optimizations). Other applications include the new borrow checker for the Rust programming language, which is built on various dataflow passes to determine at each program point which variable is "live" and/or "borrowed".


you must be writing lisp


Not these days, but yes, years ago.


Something closer to a "pure codegen/runtime" example perhaps: I have data showing Roslyn (the C# compiler, itself written in C#) speeds up between ~2x and ~3x running on .NET 8 vs .NET 4.7.1. Roslyn is built so that it can run either against full framework or core, so it's largely the same application IL.


Feel free to open an issue for this over at github.com/dotnet/runtime, if you have code you can share.


IIRC with .NET 7 we will be able to improve this as we can now dump the jit-generated assembly from official builds.

.NET 7 will be officially released in a month or so.

Currently C#/F#/VB support in Compiler Explorer relies on prejitting which has various issues.


Please let us know how well (or poorly) it works for you.


I will, thanks!

Am I correct in thinking that PGO documentation will be coming later as part of the official release? Searching for DOTNET_TieredPGO (mentioned in Stephen's post) doesn't turn up much.

Might give it a spin on Preview 7 this week regardless, Stephen's post has more than enough to get started :)


Yes, we need to provide more guidance.

For now, you might find more info by searching for COMPlus_TieredPGO. The DOTNET_ prefix is a recent addition.


FWIW [peachpie](https://www.peachpie.io/2020/09/peachpie-1-0-preview1.html) is a fairly complete PHP stack running on top of .NET core, leveraging the .NET runtime and jit. It can do things like host WordPress.

It fares pretty well in [techempower](https://www.peachpie.io/2018/06/performance-progress-report....).


FWIW, MSVC has had this ability for a few years now. It helps with both normal compilation unit compiles and with link-time code generation. See for instance Bruce Dawson's notes: https://randomascii.wordpress.com/2014/03/22/make-vc-compile... .


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

Search: