Hacker News new | ask | show | jobs
by jeff-davis 833 days ago
It looks like Ada 2022 has a way to track at compile time whether functions block or not. Seems cool for async programming.

http://www.ada-auth.org/standards/22over/html/Ov22-2-2.html

1 comments

I don't think any compiler implements that yet.
Do you believe it was designed and standardized as a reasonably implementable feature?
I'm far from an expert on compiler development, but I think it's just a matter of walking the AST to ensure that there aren't any calls to procedures with the Global or Nonblocking aspects inside a parallel block.

The bigger issue is that the `parallel do` and `parallel for` blocks added in Ada 2022 [1] haven't been implemented and as far as I know, nobody's working on it.

I suspect that if we ever do get parallel support, it'll come from the GNAT-LLVM project [2], rather than GNAT-GCC. In the meantime, there's a CUDA compiler [3].

[1] http://www.ada-auth.org/standards/22over/Ada2022-Overview.pd...

[2] https://github.com/AdaCore/gnat-llvm

[3] https://github.com/AdaCore/cuda

Only recently have compilers started catching up to Ada 2012 and SPARK, outside Ada Core, thus this will take a while.