News for hackers. Stuff that matters.
Re:The Sail ISA specification language by wizzwizz4 on Wednesday August 12, 2020 @08:07AM (#24131190)
I wonder whether you could use Sail to make a compiler that figures out how to compile things. Then you could re-target it just by giving it a description of the new processor instead of a description of the old one.
Re:The Sail ISA specification language by Peter_Sewell on Wednesday August 12, 2020 @10:35AM (#24132409)
There's work along these lines (substantially predating Sail, but one could in principle do much the same starting from Sail specs) by Dias and Ramsey, e.g. the POPL 2010 and 2011 papers at https://www.cs.tufts.edu/~nr/
Re:The Sail ISA specification language by ampdepolymerase on Wednesday August 12, 2020 @11:51AM (#24133249)
This is how Go's assembler works.
Re:The Sail ISA specification language by GregarianChild on Wednesday August 12, 2020 @09:54AM (#24132083)
Difficult problem!

If you don't care about compiler performance, auto-generating a compiler backend from scratch is already highly non-trivial. Sail's constrained nature may help a little but not that much, as you essentially need to auto-understand an interpreter for a Turing-complete language. If you do want performance, the problem becomes much harder still. One of the biggest problems in compiler performance is the memory model: what reordering is permitted, what is prohibited to the optimiser? Sail does not address this. Instead, (like all similar languages) it 'handles' main memory access by two uninterpreted functions which are (roughly) "memory read" and "memory write" That's a polite way of saying: Sail (like all similar languages) leaves this particular problem to the user.

There are open research questions here.

Re:The Sail ISA specification language by R0b0t1 on Wednesday August 12, 2020 @11:51AM (#24133251)
If you get the compiler backend generated then that same description language could also provide optimization hints. If you look at the RISC-V spec a lot is left up to the implementation but certain optimizations leave e.g. instructions available for cache management and this would have to be exposed in the ISA description.

Save Intel's compiler, do any rely on implementation details? They rely on cache and fetch details, but only in broad, nebulous ways that seem very portable.

There may be open research questions but it seems to me the biggest thing is paying someone to do it.

Re:The Sail ISA specification language by wizzwizz4 on Wednesday August 12, 2020 @12:32PM (#24133726)
> highly non-trivial

I think you a word while reading.