Normal view

There are new articles available, click to refresh the page.
Before yesterdayAda: When the software HAS to work

Custom widget

Hi, I’m trying to create a simple custom widget with Gtkada: a double slider range widget (one cursor for the lower bound and one for the upper bound).

I found some references online, but it’s sparse and confusing, either they use some deprecated base widget or they all implement a custom widget in a different way.

Is there somewhere a simple and up to date exemple of a custom widget written from scratch?

Thanks.

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

Announcing Ada binding to the wolfSSL library

On the WolfSSL blog I saw the following announcement today:

Today we are happy to announce the availability of an Ada/SPARK binding that enables Ada applications to use post-quantum TLS 1.3 encryption through the wolfSSL embedded SSL/TLS library.

It opens the door to obtaining FIPS 140-3 and DO-178C certifications for Ada and Spark applications that use TLS for their encrypted communications and also makes them quantum-safe.

Check out the Ada/SPARK binding on GitHub here: https://github.com/wolfSSL/wolfssl/tree/master/wrapper/Ada

The Ada port is suitable for anything from IoT, embedded systems to Desktop and Cloud systems.

Contact us at[ [email protected]](mailto:[email protected]), or call us at +1 425 245 8247 with any questions, comments, or suggestions.

URL to blog post:
https://www.wolfssl.com/announcing-ada-binding-to-the-wolfssl-library/

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

August 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]

Return constant access to a indefinite vector

Hi,

I have an indefinite vector (Ada.Containers.Indefinite_Vector) with a 'Class as element. I have a tagged record that holds an instance of this vector which can hold a lot of elements.

I would like to avoid a copy of this vector at any cost, so I'm trying to create a getter to this instance (a function returning a vector makes a copy of it... right?) Ideally, I would like it to be a not null access constant type.

This is the simplest example I could make:

with Ada.Containers.Indefinite_Vectors; procedure Hello is type Foo_Type is tagged null record; package Foo_Vectors is new Ada.Containers.Indefinite_Vectors (Natural, Foo_Type'Class, "="); type Foo_Vector_Access_Type is access all Foo_Vectors.Vector; type Bar_Type is tagged record Foos : aliased Foo_Vectors.Vector; end record; function Get_Foos (Bar : Bar_Type) return Foo_Vector_Access_Type is begin return Bar.Foos'Access; end Get_Foos; begin null; end Hello; 

I get "access-to-variable designates constant". I have no ideas what it means...

How can I achieve what I need?

Thanks for your answers.

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

NRF5340-DK Board

Hello, could someone tell me please if I can use Ada to program this board? If so in theory, what difficulties may I encounter in practice?

https://www.digikey.fr/en/products/detail/nordic-semiconductor-asa/NRF5340-DK/13544603 2

I’m really new to programming embedded devices, so any advice, suggestions, comments would be highly appreciated.

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

Article: The Power and Potential of the Ada Language

I stumbled upon this article. Keep in mind the website is geared towards the medical field, which is why I was surprised to even see any mention of the Ada programming language. Still nice to see a positive article about it.

https://naomedical.com/info/the-power-and-potential-of-the-ada-language.html

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

Cashe: A Money library for Ada

Introducing Cashe: a Money library written in Ada!

There's quite a bit of examples in the readme, but I also gave full code examples for almost all of the functions in the API Documentation.

The purpose of Cashe is to give Money its own high-precision datatype taking advantage of Ada's fixed type decimal system. This allows storing money, associated with a currency, at a defined precision with the choice of utilizing fuzzy or exact equality (see readme for more details).

It supports ISO Currencies as well as Custom-defined currencies, and even a working Currency Exchange.

While this is technically in pre-release, it's passing all of my unit tests and I'm working on getting the version 1.0 out and into Alire soon.

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

Introducing the Seed7 programming language

Seed7 is a programming language that is inspired by Ada and other programming languages. I have created Seed7 based on my diploma and doctoral theses. I've been working on it since 1989 and released it after several rewrites in 2005. Since then, I improve it on a regular basis.

Some links:

Seed7 follows several design principles:

Can interpret scripts or compile large programs:

  • The interpreter starts quickly. It can process 400000 lines per second. This allows a quick edit-test cycle. Seed7 can be compiled to efficient machine code (via a C compiler as back-end). You don't need makefiles or other build technology for Seed7 programs.

Error prevention:

Source code portability:

  • Most programming languages claim to be source code portable, but often you need considerable effort to actually write portable code. In Seed7 it is hard to write unportable code. Seed7 programs can be executed without changes. Even the path delimiter (/) and database connection strings are standardized. Seed7 has drivers for graphic, console, etc. to compensate for different operating systems.

Readability:

  • Programs are more often read than written. Seed7 uses several approaches to improve readability.

Well defined behavior:

  • Seed7 has a well defined behavior in all situations. Undefined behavior like in C does not exist.

Overloading:

  • Functions, operators and statements are not only identified by identifiers but also via the types of their parameters. This allows overloading the same identifier for different purposes.

Extensibility:

Object orientation:

  • There are interfaces and implementations of them. Classes are not used. This allows multiple dispatch.

Multiple dispatch:

  • A method is not attached to one object (this). Instead it can be connected to several objects. This works analog to the overloading of functions.

Performance:

No virtual machine:

  • Seed7 is based on the executables of the operating system. This removes another dependency.

No artificial restrictions:

  • Historic programming languages have a lot of artificial restrictions. In Seed7 there is no limit for length of an identifier or string, for the number of variables or number of nesting levels, etc.

Independent of databases:

Possibility to work without IDE:

  • IDEs are great, but some programming languages have been designed in a way that makes it hard to use them without IDE. Programming language features should be designed in a way that makes it possible to work with a simple text editor.

Minimal dependency on external tools:

  • To compile Seed7 you just need a C compiler and a make utility. The Seed7 libraries avoid calling external tools as well.

Comprehensive libraries:

Own implementations of libraries:

  • Many languages have no own implementation for essential library functions. Instead C, C++ or Java libraries are used. In Seed7 most of the libraries are written in Seed7. This reduces the dependency on external libraries. The source code of external libraries is sometimes hard to find and in most cases hard to read.

Reliable solutions:

  • Simple and reliable solutions are preferred over complex ones that may fail for various reasons.

It would be nice to get some feedback.

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

Gtkada embedded web browser

Hi everyone, i am building a GUI application with gtkada. The app will embeddes a web browser to visualize stream of data comming from web server. I can't find a way to do it even with gtkada examples. I trully want to develop this app with Ada if is not possible i think i will go for java.

Any suggestions will be very welcome.

Thank you in advance

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

IBM RTRT for ada

I'm starting to use IBM rational test realtime to start some low level testing of Ada code at work (Aeronautics sw company) but I am having quite some trouble figuring it out. Anyone used it or knows of any tutorials? I know how to use the tool for C code unit tests, but using it for Ada is turning out to be a big challenge!

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

VS Code doesn't find source files outside project directory while debugging

I've setup VS code (1.80.1) and the "Language support for Ada" extension (23.0.19) on Windows according to the tutorial here https://github.com/AdaCore/ada_language_server/wiki/Getting-Started

While debugging, when I try to step into a function whose source is outside the project directory, VS code fails to find it, tries to open a non-existent file instead and a pop-up shows up with an error.

As an example, when I try to step into the Put_Line function of Ada.Text_IO, I get the following pop-up

https://preview.redd.it/i506rjsmdxbb1.png?width=461&format=png&auto=webp&s=2f55dfb0f804b82558af31e31670b024c02ffae1

And it tries to open the following file which doesn't exist: C:\aaa\GNAT-FSF-builds\sbx\x86_64-windows64\gcc\build\gcc\ada\rts\a-textio.adb

I have the following tasks in my tasks.json file (I've tried both options, they both have the same issue with debugging):

{ "type": "gnat", "taskKind": "buildProject", "problemMatcher": [ "$ada" ], "group": { "kind": "build", "isDefault": true }, "label": "ada: Build current project", "args": ["-gargs", "-q"] }, { "label": "Alire Build", "type": "shell", "command": "alr build -- -cargs -gnatef", "group": { "kind": "build", "isDefault": true }, "problemMatcher": { "base": "$ada" } } 

And in my launch.json file:

{ "preLaunchTask": "ada: Build current project", "name": "Ada - Build & Debug (Windows)", "type": "gdb", "request": "launch", "target": "./obj/main.exe", "cwd": "${workspaceRoot}", "valuesFormatting": "parseText" } 

What am I doing wrong? How can I fix this?

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

New release of vscode extension For Ada 23.0.20

We just released a new version of the VS Code extension for Ada with several new features and bug fixes:

  • Add onTypeFormatting request initial implementation. To try edit settings.json with:

 "[ada]": { "editor.formatOnType": true, }, "ada.onTypeFormatting.indentOnly": false, 
  • Fixes and improvements in syntax highlighting
    • Do not apply semantic tokens to unresolved identifiers
    • Highlight True and False like 'null
  • Fixes and improvements in hovers
  • Basic .gpr language support: document symbols and diagnostics
  • Support more architectures and platforms in VS Code
    • Change executable location to <arch>/<platform>/
    • Add arm64 as a supported architecture
    • Add initialization code that checks specific combinations of architectures and platforms (e.g. arm64-darwin is supported even though it actually uses the x64-darwin executable, will use x86_64 target by default however)
    • But no native ALS for arm64 is provided for now
  • Accept task bodies and packages for subprogram box command
  • Publish diagnostics when a refactoring fails.

Here is a screenshot of GPR editing:

https://preview.redd.it/hrrdvwztwkbb1.png?width=866&format=png&auto=webp&s=f0eeee475f2e1c0d0d881adbfd454cdccaad05b9

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