Gnat 2021 GPL Community Edition Ada 202x compiler released

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • gcc

  • Take as an example the gnat.sockets package from upstream gcc:

    https://github.com/gcc-mirror/gcc/blob/master/gcc/ada/libgna...

    Compare with the same file from the GNAT 2021 CE install:

    GNAT/2021/lib/gcc/x86_64-pc-linux-gnu/10.3.1/rts-native/adainclude/g-socket.ads

    you will find there are a bunch of blank lines where the runtime exception was.

  • inotify-ada

    An Ada 2012 library for monitoring filesystem events using Linux' inotify API

  • The C interoperability of Ada is very good, you can import/export functions and specify whether records (structs) and arrays must have a C convention. I use it often to access libc and Linux kernel functions/syscalls [1][2].

    [1] https://github.com/onox/inotify-ada

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • evdev-ada

    An Ada 2012 library to read input events and use force-feedback using Linux' evdev API

  • notcursesada

    Ada bindings for the notcurses text user interface library

  • * Is there a way to declare data layouts to have compatibility with C, similar to #[repr(C)] in rust?

    Yes, and if you have a C header file, gcc can even translate most struct definitions for you. Here's an example of a "thin" binding generated that way: https://github.com/JeremyGrosser/notcursesada/blob/master/sr...

    * Is there a way to catch C++ exceptions?

    Yes. https://www.adacore.com/gems/gem-114-ada-and-c-exceptions

    * Is there a way to catch C longjmps()?

    By default, the GNAT runtime uses setjmp/longjmp to implement exceptions. I'm not sure how you'd connect that to a C library's setjmp though.

    * Is there a way to have some kind of custom control over ABI issues, e.g. define custom FFIs to langauges with a different ABI? Or anything close to this? For that matter, does any language have something like this or does it not make sense?

    ABIs are selected with the Convention aspect. Conventions are implementation defined and would require patches to the compiler to add new ones. GNAT currently supports Assembler, C, CPP, COBOL, and Fortran calling conventions.

  • adaspark

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts