❌ About FreshRSS

Normal view

There are new articles available, click to refresh the page.
Yesterday — 27 March 2023Ada: When the software HAS to work

Since MSys2 dropped support for Ada (!), how can I build Ada projects such as sdlada and gprbuild-bootstrap that require command-line tools (e.g. makefiles or bootstrap.sh) on Windows?

I'm several levels down a rabbit hole here, but if you'll bear with me I want to outline the whole chain in case there's a better way to achieve my original goal that I missed.

  • I want to port some old embedded-device Ada code to run in a gtkada application.
    • I have installed GNAT Studio and can build/run simple gtkada projects with it.
  • I downloaded the "sdlada" project to learn more about interfacing Ada with C code
    • Also I might want to use SDL visuals in my GTK app
    • However I can't directly open sdlada's .gpr files with GNAT Studio
      • Because it's missing some Ada source code that's generated in the build
      • Apparently you must use the makefile to build sdlada
      • When I try on MSys2, the makefile fails because my system is missing gprbuild
  • So I tried to follow the Bootstrapping instructions for gprbuild
    • https://github.com/AdaCore/gprbuild/
    • But the gprbuild bootstrap.sh script fails because my system doesn't have gnatmake
      • Facepalm - because MSys2 dropped Ada support
      • "There's a hole in the bucket"
  • On an MSys2 issue it was suggested a user might build gcc from source to get back Ada support
    • I have built gcc before (for a cross-compiler) so... maybe? I could try this...
    • However if the MSys2 maintainer can't get it to build for him why would it work for me?
  • But this is getting off in the weeds considering - I have GNAT Studio and can already build+run Ada programs
    • But how do I run a makefile with gprbuild from GNAT Studio on Windows?
      • Is there a "GNAT Studio Command Line" (terminal) available somewhere? (Like how an install of Visual Studio includes shortcuts to open a command line preloaded with paths to MSVC tools.)
      • Is it possible (and advisable) to try to MSys2 make refer to the tools in "C:\GNAT\2021\bin"?
submitted by /u/valdocs_user
[link] [comments]
Before yesterdayAda: When the software HAS to work

"Union" types in Ada

Dear Ada community,

I've just picked up Ada (again) and try to implement a little API client as a first learning project. Currently I'm creating model classes for the entities returned by a JSON API. In the API specs, there is a JSON field, which can contain different data types, which are an ISO timestring *or* an ISO time interval.

Now I'm trying to find out, what is the "Ada way" to define a field, that can handle multiple types. The only thing that comes into my mind for my example is a variant record. Something like

type Time_Or_Interval (Has_End : Boolean) is record Begin_Date : Ada.Calendar.Time; case Has_End is when True => End_Date : Ada.Calendar.Time; when False => null; end case; end record; 

Is this the preferred way?

submitted by /u/dubst3pp4
[link] [comments]

New release of vscode extension For Ada 23.0.15

VS Code Extension for Ada 23.0.15

In this release we improved Alire integration. Now you don't need the compiler to be in the PATH (only alr) when you are working with a crate, because Alire will configure it for you. Suppose you setup a crate for Rasperry Pico, if you open it in VS Code, then navigation should work out of the box. Also any Alire configuration is skipped altogether if the VSCode was launched with alr edit or alr exec.

We also change auto-detected tasks, so they are use alr exec -- prefix to run gprbuild, gprclean, gnatprove in the correct environment. You can also pass extra option using args property in the tasks.json file.

Renaming tool leaves found renaming problems in the diagnostics, so you can examine them in the "Problems view".

You can install newer version from the marketplace, OpenVSX or download it from GitHub release.

Happy codding!

submitted by /u/max_rez
[link] [comments]

New to GNAT Studio and Ada, looking for any big open source codebases I can study that demonstrate aggregate projects, mixed C/C++ and Ada linked together?

I'm an experienced C++ developer, Ada newbie, trying to port a mixed C and Ada legacy codebase to GNAT Studio. I want to compile the C and Ada sources to multiple static libraries and use them from a GtkAda executable. Actually it's a pretty complicated situation as I'll detail below.

Initially I was going to ask what is the GNAT Studio equivalent of a workspace or solution file, because I wasn't finding it. But just before posting that question, I stumbled upon the documentation section for "aggregate project" in .gpr file. Yahtzee. ("Aggregate" was the one synonym I hadn't thought to google for!)

But, I still want to see this in use before I'm comfortable using it from scratch. My learning style is I learn best from examples. First I mimic, then I understand. The syntax seems simple enough, but the documentation on aggregate projects doesn't (for instance) devote any words to common conventions like whether the .gpr file is usually mixed in with the sources or at a directory level above, etc.

And the same applies to linking and calling the C code from the Ada code (or even calling the Ada lib from the exe, for that matter). As a C++ programmer (and also C#) I'm familiar with the issues (e.g. name mangling and ABI/calling conventions) with cross-language marshaling. I still want to look at a big (real) Ada project that does it.

Finally, I read that the aggregate project feature in GNAT Studio supports the same source file being included - perhaps with different interpretations - in multiple different projects. That's good news because this legacy codebase uses that model heavily to actually build EPROM (firmware) images for multiple similar-but-different circuit boards. I actually want to run all of them within the one Gtk executable (it will be a simulator or emulator, depending how you term it), so I'll have multiple different Ada libs, that used to build independent .hex or .bin files, now being combined into one executable.

Actually it's even more complicated than that. There's two legacy codebases, the second for a still-old but newer generation of the equipment, and I'm hoping to put both of those together too. (You'd select which version of the equipment you want to simulate with a radio button.) The codebases for those have different versions of the same files. If I had to I can just make that two different GtkAda programs.

Because of both combining what were multiple different EPROM images into one executable, and the possibility of combining two similar-but-different sets of EPROM images, I'm wondering if and how namespace collisions are manageable in an aggregate project. I solved a similar problem combining C++ codebases associated with these two equipment generations into one application by segregating the codebases by DLL. Since a DLL only exports the names you tell it to, it doesn't matter if the same name is used for different things internally; they can still be linked into the same program.

submitted by /u/valdocs_user
[link] [comments]

Alire - inability to install some packages from the repository

I am currently learning to program in Ada and I use Alire to set up my projects. As part of my testing, I occasionally install a crate and investigate it, I found a bug with Honki_tonks_zivilisationen:

https://alire.ada.dev/crates/honki_tonks_zivilisationen.html

Create exists, if I try to find it using the web interface I am successful:

https://alire.ada.dev/search/?q=Honki_tonks_zivilisationen

or

https://alire.ada.dev/search/?q=stefan

However, I don't see the game in the Linux command line:

$ alr search --crates Honki_tonks_zivilisationen

No hits

$ alr search --crates Honki

No hits

$ alr search --crates honki

No hits

$ alr search --crates stefan

No hits

Another crate, e.g. Eagle lander, is OK:

$ alr search --crates eagle

eagle_lander Apollo 11 lunar lander simulator

Using the command to display all available Alire packages I also don't see it.

alr search --list --full

I am using Arch Linux with Alire 1.2.2 version.

Can I ask to check if I am making a mistake somewhere? Alire is a great tool like Cargo and I would like to use it in my teaching and in the future for all projects.

submitted by /u/Krouzici_orel
[link] [comments]

Ada developer looking for a job as software developer

Hi everyone my name is Joseph . I write this post because i want to be involve in a carrier as Ada developer. I love working with Ada. It first start as hobby writing scripts and gui. Bc i was already involve with Arduino i start embedded project now i am capable to work with stm32 boards.

Recently i start an open source projet ( write ada drivers for common used arduino components ).

I also make an 3DOF robotic arm with Ada.

I am currently located in Senegal and there are no Company using Ada. I Feel useless over here. That's why i want a position in Canada, France or any place where i can work with very talents developers and improve my knowledge.

If you have informations that can help me it will help me out a lot bc i am bout to be a father and my family deserve a good life.

Thank you.

submitted by /u/Yossep237
[link] [comments]

Libadalang

Has anyone here shareable experience with Libadalang for more than the examples that come with it?

What I'm looking for is to extract - for each subprogram in a spec - the name, the parameters (name & type), and the return type if any. I'm finding it really hard to understand the API reference.

At the moment I'm looking at the Ada API, having had grief with the Python version (to do with shared libraries on macOS) and with the Python API.

Seriously missing ASIS.

submitted by /u/simonjwright
[link] [comments]

Porting old firmware written in Ada to modern program

I work on an MFC application (C++, Windows) that communicates over serial port to an embedded system. This piece of equipment has firmware written in a combination of assembly, C, and Ada code. Although it is an x86 processor (80196 to be exact, with about 32Kb memory), it's custom hardware and not PC based. Also the underlying OS is a unique RTOS developed by the equipment vendor, not based on any other OS or RTOS.

I'd like to run the actual firmware in a Windows program, either in an emulator or port the code to run as a Windows program so I can debug it and see where data goes as my MFC application communicates with it. Emulating the system so it runs the binary firmware is one possible avenue, but I'm writing this post to ask about the second - porting the source code so I can make a Windows program out of it.

I am experienced porting C to other operating systems, and the assembly language and RTOS functions I believe I could implement or stub out myself. (This would considerably easier than the original development of the RTOS, as I could use a higher level language and as much resources as I want.)

What I'm less strong on is the Ada code. I'm more of a C++ developer. So I'm not sure the best approach here. Is Ada more like Java (write once run anywhere) so that Ada code written in the late 80s through the 90s can also be compiled on a modern Ada compiler for different OS? Or is it like VB6 to VB.NET transition where the old style of the language is hopelessly out of date? Or kind of in-between like C where there's a lot of backward compatible support, but porting it I might have to fix places where it makes assumptions about the word size of the hardware, etc.?

What tools or compilers would you use if you were me? I'm evaluating a long-abandoned open source Ada to C++ translator (if I just transpired all the Ada code to C++ once and compiled that, it would meet my needs), but I don't know whether it was fully functioning or barely implemented before the project was abandoned.

I also thought about writing an Ada interpreter as then I could handle details of emulating virtual hardware within the interpreter. (Lest that sound crazily ambitious, or a non sequitur since Ada is typically compiled, allow me to point out writing a compiler or an interpreter that only needs to work for ONE given program is a significantly less general task than writing a full one. And C interpreters exist.)

As I write this, I'm realizing building a mixed Ada and C++ program is probably the less masochistic way to approach this (if only because finishing an abandoned translator or writing an interpreter are even more so). I think I was mostly scared of finding gcc not supporting this dialect or vintage of Ada (they used an old version of the DDCi compiler), or difficulty stubbing out the hardware support.

submitted by /u/valdocs_user
[link] [comments]

Logo on Wikipedia article

I looked at the Wikipedia article about Ada) and noticed that the community logo previously used in the article has been swapped with the one unilaterally proposed by AdaCore, which erroneously has the description "as defined by the Ada Community" in the article. Many people will read about the language from that article. I think it's a shame that the logo designed by Leah Goodreau in 2015 is no longer visible, especially considering that it was decided in a community competition and considering that not everyone agrees with the simplified logo trend.

I would make an edit on the article so that both logos are shown, along with subtexts such as "Community logo designed by Leah Goodreau" and "Logo designed by AdaCore" but my IP is banned, even though I have never edited anything on Wikipedia. If someone reading this agrees that both logos should be visible (and is not banned on Wikipedia), then please make this edit on the article. Thank you.

submitted by /u/SororitasEU
[link] [comments]

AdaOgg and VulkAda - Ada2012 Bindings to OggVorbis and Vulkan

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

AdaOgg - https://phasercat.com/adaogg/

VulkAda - https://phasercat.com/vulkada/

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

  1. https://phasercat.com/the-vulkada-project/
  2. https://phasercat.com/the-vulkada-project-ii/

[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.

submitted by /u/micronian2
[link] [comments]

March 2023 What Are You Working On?

Welcome to the monthly r/ada What Are You Working On? post.

Share here what you've worked on during the last month. Anything goes: concepts, change logs, articles, videos, code, commercial products, etc, so long as it's related to Ada. From snippets to theses, from text to video, feel free to let us know what you've done or have ongoing.

Please stay on topic of course--items not related to the Ada programming language will be deleted on sight!

Previous "What Are You Working On" Posts

submitted by /u/marc-kd
[link] [comments]
❌
❌