❌ About FreshRSS

Normal view

There are new articles available, click to refresh the page.
Before yesterdayNews from the Ada programming language world

ADA code help (beginner)

By: Harsha
23 March 2023 at 08:56

Hello,
I am learning ADA language at my university and need help with the following question.

  1. Write the iterative version and recursive version of a program that determines whether a given word is a palindrome. For instance, eve is a palindrome

  2. write a program that reads a given word by the user and prints whether it is a palindrome on the screen.

Your help is very much appreciated! Thank you

3 posts - 3 participants

Read full topic

wolfSSL Ada/SPARK language bindings

17 March 2023 at 05:35

I was looking for DTLS libraries and found this recent post on the wolfSSL website.

Exciting news in wolfSSL language bindings: we are currently exploring the possibility of adding bindings for the Ada and Spark languages!

Ada is a programming language known for its explicitness, strong typing, and abundance of compile-time checks. It is widely used in safety-critical and high-integrity software. Spark, on the other hand, is a smaller subset of Ada that offers the invaluable ability to formally prove the correctness of your software.

We believe that wolfSSL bindings would be immensely valuable to the Ada and Spark communities. These bindings would provide a production-ready, robust, and well-tested TLS stack that supports the latest protocols (TLS1.3/DTLS1.3). Additionally, it would open the door to obtaining FIPS 140-3 and DOI-178C certifications for Ada and Spark applications that use TLS for their encrypted communications, or that want to use our wolfCrypt implementation for their cryptographic operations, such as encrypting data at rest.

As wolfSSL already supports post-quantum TLS 1.3 and DTLS 1.3, these bindings would also naturally allow you to make your Ada and SPARK applications quantum-safe.

Are you interested in an Ada/Spark wrapper? If so, please do not hesitate to contact us at [email protected] with any questions, comments, or suggestions.

Source: wolfSSL ADA/Spark language bindings – wolfSSL

1 post - 1 participant

Read full topic

AdaOgg and VulkAda - Ada2012 Bindings to OggVorbis and Vulkan

3 March 2023 at 06:50

Hi, I just happen to stumble upon these Ada2012 bindings developed by Phaser Cat Games (https://phasercat.com/) during some Google searching.

AdaOgg - AdaOgg - Phaser Cat

VulkAda - VulkAda - Phaser Cat

For VulkAda, there are two blog entries from the author:

  1. The VulkAda Project - Phaser Cat
  2. The VulkAda Project (II) - Phaser Cat

[UPDATE] For those unfamiliar with OggVorbis and Vulkan, these are descriptions from Wikipedia:

Vorbis is a free and open-source software project headed by the Xiph.Org Foundation. The project produces an audio coding format and software reference encoder/decoder (codec) for lossy audio compression. Vorbis is most commonly used in conjunction with the Ogg container format[10] and it is therefore often referred to as Ogg Vorbis.

Vulkan is a low-overhead, cross-platform API, open standard for 3D graphics and computing. Vulkan targets high-performance real-time 3D graphics applications, such as video games and interactive media, and highly parallelized computing.

2 posts - 2 participants

Read full topic

Who exstinguished Alire's SPARK? ;-)

By: cantanima
1 March 2023 at 01:31

I just ran alr edit to try something with SPARK and… gps had no SPARK menu! What happened to it?

I wondered if I don’t have the gnatprove crate installed. Neither alr get nor alr toolchain -i seemed to help, and alr show gnatprove gave a very unhelpful error message.

It somehow occurred to me that alr with might work, and sure enough, within moments gnatprove was being added to a project, and SPARK showed up in the gps menu! :grin: :dark_sunglasses: :grinning: :sunglasses: :fireworks:

But… it does not show up in other projects! Apparently I have to alr with spark in every project I want to use it in.

  1. Is that what’s supposed to happen?
  2. Is this documented somewhere? I didn’t see it if so.
  3. Will it install a new gnatprove bin every time I install it, or is it just installed once, and set up in the projects where we use it?

5 posts - 3 participants

Read full topic

Build order with gprbuild

28 February 2023 at 21:09

When a GNAT project A depends on project B, is there a simple (*) way to make gprbuild build project B before starting the build of A?
It would be useful when project B generates Ada sources…
Example:

with "code_generation.gpr";

project Main is
  for Source_Dirs use (".", "gen");
  for Object_Dir use "obj";
  for Create_Missing_Dirs use "True";  --  Flips by default the "-p" switch
  for Main use ("main.adb");
end Main;

(*) By “simple” I mean simpler than the way described here:

3 posts - 3 participants

Read full topic

Do colored subprograms exist in Ada?

By: cantanima
24 February 2023 at 17:08

I was reading today about a proposal regarding the Rust language’s use of async and await. which are related to colored subprograms. If you’re familiar with them, read on; if not, click the blurred text at bottom for a hopefully-correct explanation.

I naturally wondered how this issue affects Ada. I’m not as familiar with task types as I should be, even though I used them a few years ago, and Ada 2022 brings the new parallel keyword, which I have yet to use. After refreshing my memory:

Is my impression correct that Ada’s approach to concurrency and parallelism circumvents “colored” subprograms altogether? After all, task entries are called just like regular subprograms, and subprograms with parallel blocks are called just like other subprograms.

My apologies if I’m being unclear; please don’t hesitate to correct or scold me if I’m babbling nonsense. I know what I’m trying to say, but I’m not used to talking about these particular issues.

6 posts - 4 participants

Read full topic

Starting Ada - It has to work

By: Tom
18 February 2023 at 19:13

When you buy a new car you just get in and drive. When you try to set up to program in Ada this doesn’t happen. A am now 2 years in using GNAT Studio, I have 20,000 lines of code to my name so I have persisted and I was not put of by the faults in the compiler which suggest that the concept of Total Quality Management may not be at the heart of Ada. True its better than C or C++ and I spent a lot less time chasing bugs the compiler should have told me about. So over all I like it. At first glance it appears more readable than Rust and it doesn’t get too excited about OO either which really holds back beginners. I need a language I can train people on and not have them crash the code base.

There is some very good material out there supporting Ada and a lot from Ada Core but still trying to get a novice to install the IDE and take their first steps, is a mess. Such a mess that I created www.adaworks.it to try to help others through that mess. Its not that I wanted to start providing Ada services but I usually keep notes by creating websites. I hope the installation help given there is an improvement given that I did it for free and I would rather Ada Core had done it.

Well in the last day I attempted to put GNAT Studio on Fedora 37 and it won’t link libc properly so gives up. I like writing code, not fixing operating systems! Then I learn about this thing Alire and download it, the version for Linux. I get a Zip file with a directory bin and in it a file air of 30.9 MB. Great. So then I click on “Get Started” and rather than “How to install what you just downloaded I get “Why Ada?” Do you know what? If I just downloaded something to use Ada I probably have already made that choice. I look desperately for some instructions and give up. Join this forum. Write this post down to here and then…Ah Oh if I click next at the bottom of the page what will that do? Oh “Hello World” well if I had an IDE running that would be a possibility but eventually I decide to take a look. Oh I read a bit " If you haven’t set it up, you can follow the instructions on the Alire site” What I had to get to page 2 to find this hopeful link. Lets try it. Ah “Installation” I can download the latest release from the GitHub repository. But I thought I just downloaded it. I just want to install it. Oh no:
export PATH=<PATH_TO_EXTRACTED>/bin/:$PATH
it says. Well I don’t know where I should extract it? Is it important where I extract it? What do I care about toolchains I just want a working IDE so I can carry on programming. I hate toolchains I don’t care how it works I just want to write code and get out working executables. If this was an instruction manual well… So how do we get past this sloppy way of working…I guess I just have to spend the next few days guessing my way through this or alternatively give up programming in ada to sit and learn all about linux OS from the ground up. At what level is there a nice clean user interface I can work with. This is real “Glass box” approaches. Here is your new car but before you start it you just need to put on the wheels to some unspecified place. I want to do better than this Ada deserves it. How do we expect to bring people onboard with Ada and talk about mission critical systems development when we can’t even get the most important mission of all working:

  • Mission 1 “Starting”.
  • Mission 2 - Testing the IDE before shipping it, on fresh installed systems.

If lives depended on getting people programming in Ada then we arn’t doing to well. Any ideas, I want to help get this right.
Tom
P.S. www.adaworks.it is served from a server written in Ada by me and serving about 9 other sites. 2 of the sites are active sites using a database written in ada by me. The active pages are generated from Ada written by guess who? Correct. Also served from that site is www.tomdehavas.com all about “Oh god not again. Me” I only tell you this to prove that I have a long history of programming and at least some experience in C, C++ and Ada. So its just that I like working on code not trying to make my tools work.
Well if you have read this far than thanks for listening. Yes I am passionate about Ada to and I am happy to help with getting the entry points improved i.e. these first missions.

45 posts - 11 participants

Read full topic

AEiC 2023 - Ada-Europe conference - Final Deadline Approaching

16 February 2023 at 10:04

http://www.ada-europe.org/conference2023/cfp.html

27 February 2023: deadline for industrial-track and work-in-progress-track papers, tutorial and workshop proposals.

The 27th Ada-Europe International Conference on Reliable Software Technologies (AEiC 2023) will take place in Lisbon, Portugal, in the week of 13-16 June.

More info: Ada-Europe 2023

#AEiC2023 #AdaEurope #AdaProgramming

2 posts - 1 participant

Read full topic

SPARK vs codepeer with regard to volatility

By: kevlar700
15 February 2023 at 18:18

In general Spark mode can be straight forward (atleast for Silver) but appears to be more work than it is worth for any file that withs a lot of volatiles like those generated by svd2ada.

Would you agree or encourage me to persevere across the learning curve?

Is codepeer a good alternative in this case?

5 posts - 2 participants

Read full topic

Advent of Computing Podcast

6 February 2023 at 05:25

This podcast did an episode about the origins of Ada.

I don’t like the way he pronounces Ada and I could be pedantic about some of the broad generalizations he makes, but overall I think this is a nice summary. Sounds like it’s going to be the beginning of a series, with a future episode about tasking. I’m looking forward to it!

8 posts - 6 participants

Read full topic

Architecture dependent representation clause

2 February 2023 at 21:43

I’m writing a wrapper around some Linux ioctl(2) calls and am using a representation clause to replace the macros in ioctl.h « asm-generic « uapi « include - kernel/git/stable/linux.git - Linux kernel stable tree

However, this header is architecture dependent and has different field sizes and constants for some older architectures: parisc, mips, powerpc, alpha, sparc.

   --  /usr/include/asm-generic/ioctl.h
   type IOC_DIR_Field is (None, Write, Read)
      with Size => 2;
   for IOC_DIR_Field use (0, 1, 2);
   --  parisc: Read and Write are swapped
   --  mips, powerpc, alpha, sparc: IOC_DIR_Field'Size = 3, Write is 4

   type IOC is record
      NR    : UInt8;
      TYP   : UInt8;
      SIZE  : UInt14;         --  13 bits on mips, powerpc, alpha, sparc
      DIR   : IOC_DIR_Field;  --  3 bits on mips, powerpc, alpha, sparc
   end record
      with Size => 32;
   for IOC use record
      NR    at 0 range 0 .. 7;
      TYP   at 1 range 0 .. 7;
      SIZE  at 2 range 0 .. 13;
      DIR   at 2 range 14 .. 15;
   end record;

Should I create a separate package for each architecture to define these fields, or is there a better way to make a representation clause architecture dependent?

6 posts - 3 participants

Read full topic

Help with memory allocation/deallocation and matrix/vector libraries for scientific computations

26 January 2023 at 23:50

Dear all,
No doubt that ADA since its very beginning got almost everything right as it regards syntax and semantics. If I start listing things I adore about this Language, it will be boring, so I would prefer to discuss with you a few things that might and I repeat “might” need improvement.

1. Pointers.
Deallocation could be made simpler and easier to remember without hurting overall functionality.
procedure Free is new Ada.Unchecked_Deallocation(…)

is probably too cumbersome. Perhaps Storage pool is the most elegant alternative. Are there any more modern approaches? I apologise for my ignorance here but the standard keeps changing and documentation with examples around the web is not that easy to find for ADA, free books are quite old.

2. Matrix/Vector libraries
Applications of Real_Arrays are limited due to static allocations by default, no easy/dynamic stack storage sizing, and temporary objects when overloading operators. Are any other library alternatives ?

Any plans from ADA headquarters for native support of Matrix/Vector operations similar to Fortran without temporaries and Fortran efficiency? Same for complex numbers?

Thank you all in advance.

12 posts - 4 participants

Read full topic

Gnu Emacs Ada mode 8.0.4 released

25 January 2023 at 13:33

Gnu Emacs Ada mode 8.0.4 is now available in GNU ELPA.

All Ada mode executables can now be built with Alire
(https://alire.ada.dev/); this greatly simplifies that process.

gpr-query and gpr-mode are split out into separate GNU ELPA packages.
You must install them separately (Emacs install-package doesn’t
support “recommended packages” like Debian does).

Ada mode can now be used with Eglot; this is controlled by new variables:

ada-diagnostics-backend - one of wisi, eglot, none

ada-face-backend - one of wisi, eglot, none

ada-indent-backend - one of wisi, eglot, none

ada-statement-backend - one of wisi, eglot, none

ada-xref-backend - one of gnat, gpr_query, eglot, none

The diagnostic, face, indent, and statement backends default to wisi
if the wisi parser is found in PATH, to eglot if the Ada LSP server is
found, and none otherwise. The xref backend defaults to gpr_query if
the gpr_query executable in PATH, to gnat otherwise.

ada-diagnostics-backend controls the source of compilation error
messages while editing.

ada-statement-backend controls statement motion; forward-sexp,
wisi-goto-statement-end, etc. ada-xref-backend controls
wisi-goto-spec/body and Emacs xref commands.

In addition, name completion is provided by eglot if any of the other
backends are using eglot; eglot completion is always better than wisi.

The current AdaCore language server (version 23) supports face but not
indent. The current version of eglot (1.10) does not support face. The
Language Server Protocol does not support statment motion. So for now,
eglot + ada_language_server only provides xref and completion.

The AdaCore language server ada_language_server is installed with
GNATStudio (which ada-mode will find by default), or can be built with
Alire. If you build it with Alire, either put it in PATH, or set
gnat-lsp-server-exec.

I have not tested ada-mode with lsp-mode. You can set ada-*-backend to
'other to expermiment with that, or tree-sitter, or some other
backend. tree-sitter will be fully supported in the next ada-mode
release.

The required Ada code requires a manual compile step, after the normal
list-packages installation:

cd ~/.emacs.d/elpa/ada-mode-7.3beta*
./build.sh
./install.sh

If you have Alire installed, these scripts use it.

23 posts - 6 participants

Read full topic

Discussion for the Distributed Systems Annex: Message Passing Interface

By: ethindp
23 January 2023 at 05:46

So, I thought I would post this idea hear before posting it to the ADA RFCs repo. I’ve read and heard roomers about the DSA being potentially deprecated, if not outright removed, from the spec. Though I understand the reasoning for this (the implementations of it are probably old, if GNAT’s allowance for XDR is any indication), but if implemented properly it could be a really powerful incentive to use Ada: free multi-process/distributed/parallel execution, built right into the language. Sure, you’ve got parallel loops and blocks, but that’s not as fun as being able to say “send this process this message, on this computer all the way over here in Germany from this computer in Canada” without really having to implement much of anything. Typically if you want to do something like this you have to implement all the networking (and potentially the protocols) yourself, which can lead to a lot of boilerplate code. In languages like C++, this has resulted in libraries like OpenMP, Boost.MPI, or HPX. HPX has even gone to the trouble of (supposedly) replicating the entirety of the C++ standard library, which is not an even remotely simple thing to do, all for HPC purposes. So, I was thinking: we have all these standards that are, well, supposed to standardize distributed communication of processes across program, operating system, hardware, and even network boundaries. The ARM pretty much plays fast and loose with the implementation of the DSA, leaving a pretty significant portion of the how up to the implementor, and essentially describing something like MPI in abstract details.

And, really, when you think about it (or, at least, when I think about it), the DSA literally describes MPI to a tee. It uses different terminology, perhaps, but things like the DSA were practically what MPI was designed for. To my knowledge, MPI offers everything that the DSA requires, and then some:

  • Point-to-point communication
  • Collective communication
  • process topology and management
  • one-sided communications
  • External interfaces
  • Distributed IO
  • Process groups, caches, etc.

And that’s just the MPI 3.1 specification. MPI 4.0 adds quite a bit:

Version 4.0: June 9, 2021. This version of the MPI-4 Standard is a major update and
includes significant new functionality. The largest changes are the addition of large-count
versions of many routines to address the limitations of using an int or INTEGER for the
count parameter, persistent collectives, partitioned communications, an alternative way
to initialize MPI, application info assertions, and improvements to the definitions of error
handling. In addition, there are a number of smaller improvements and corrections.

The full standard can be found here (for the latest version) and older specs are here. But what do you guys think? Would proposing the use of MPI-4.0 be a good idea (assuming there are any implementations of it)? I know that this would, most likely, add MPI as a run-time dependency of distributed applications, and might even need you to run it under a supervisor of some kind. But I don’t think that would be a lot to ask people who would use the annex, particularly since they most likely do that anyway. But I thought I would ask here to see what people thought first.

Edit: I know that the spec currently allows you to do whatever you want when implementing the DSA, but having a big Ada implementor company like AdaCore use MPI as the backend for something like the DSA as a modern replacement for the current implementation would probably go a long way to making it easier to use. Ultimately the proposal would be to keep the DSA and, perhaps, extend it with features that MPI has, if necessary to account for advancements in computing.

4 posts - 3 participants

Read full topic

Transfer of ada-lang.io domain

By: pyj
22 January 2023 at 21:33

I’m the current owner of the ada-lang.io domain.

I have a bunch of other things I’m doing and I’m not going to renew it, so I’m going to hand it off to someone who wants it. I’ve had trouble getting people to agree to this, so maybe making this public will help things. If no one takes it, the domain will lapse in August.

A few people helped with the main site and setting up this forum, but after two weeks, or the highest priority individual(s) contact me and gives an affirmative yes or no, the transfer will happen.

In priority order:

  1. @JeremyGrosser
  2. @onox
  3. @Max
  4. Whoever else who wants it

8 posts - 5 participants

Read full topic

Transfer of ada-lang.io domain

By: pyj
22 January 2023 at 19:50

I’m the current owner of the ada-lang.io domain.

I have a bunch of other things I’m doing and I’m not going to renew it, so I’m going to hand it off to someone who wants it. I’ve had trouble getting people to agree to this, so maybe making this public will help things. If no one takes it, the domain will lapse in August.

A few people helped with the main site and setting up this forum, but after two weeks, or the highest priority individual(s) contact me and gives an affirmative yes or no, the transfer will happen.

In priority order:

  1. JeremyGrosser
  2. onox
  3. Max
  4. Whoever else who wants it

1 post - 1 participant

Read full topic

❌
❌