Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider rewritting bussiness logic in Ada #38

Open
hurufu opened this issue Dec 30, 2021 · 3 comments
Open

Consider rewritting bussiness logic in Ada #38

hurufu opened this issue Dec 30, 2021 · 3 comments
Labels
refactoring Internal code refactoring which doesn't depend on nexo

Comments

@hurufu
Copy link
Owner

hurufu commented Dec 30, 2021

Ada is a strongly typed language that is well suited for describing Nexo specification.

Pros:

  1. Very-strong type checking
  2. Well defined bit fields that are used a lot in EMV and Nexo.
  3. Preconditions and postconditions that actually are there in the nexo specification, and it would be nice to have them. They usually state which variables must change their value or must only be read.
  4. Maps well from Drakon
    1. it has goto which is needed for blazing fast implementation
    2. high-level looping constructs compared to C
    3. nested function which may be used to implement procedures/functions with multiple entry points

Cons:

  1. I have to implement Ada generator from Drakon diagram
  2. I have to learn Ada well enough to be able to design this generator properly
  3. There aren't many free and open source ASN.1 compilers for Ada.

References:

@hurufu hurufu added the refactoring Internal code refactoring which doesn't depend on nexo label Dec 30, 2021
@hurufu
Copy link
Owner Author

hurufu commented Dec 30, 2021

Additionally this request is similar to #36, but arguably is harder to implement. As a side note, I had an idea long time ago to write the diagrams in specifically crafted language (like haxe) that should be easily convertible to other languages (like C, C++, Java, Ada, Zig, or JavaScript).

@hurufu
Copy link
Owner Author

hurufu commented Dec 30, 2021

Licensing is also a topic that is needed to be considered. It looks like Ada code compiled by gnat compiler from FSF (gcc-ada package) adds an explicit GPLv3 exception that permits to use their runtime library in proprietary software. It is located at /usr/share/licenses/gcc-ada/RUNTIME.LIBRARY.EXCEPTION for default Arch Linux installaion. And is available online at https://www.gnu.org/licenses/gcc-exception-3.1.html.

@hurufu
Copy link
Owner Author

hurufu commented Jan 29, 2022

Link to comp.lang.ada conversation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Internal code refactoring which doesn't depend on nexo
Projects
None yet
Development

No branches or pull requests

1 participant