❌ About FreshRSS

Normal view

There are new articles available, click to refresh the page.
Before yesterdayCommunities

AEiC 2024 - Ada-Europe conference - grants for Open Access publication

21 December 2023 at 17:32

Season’s greetings from the organizers of the 28th Ada-Europe International Conference on Reliable Software Technologies (AEiC 2024), to be held 11-14 June 2024, in Barcelona, Spain!

Accepted Journal Track papers will be published in the conference’s Special Issue of the Journal of Systems Architecture (JSA). Note that the Ada-Europe organization will waive the Open Access fees for the first four accepted papers, which do not already enjoy OA from other agreements with the Publisher.

www.ada-europe.org/conference2024/cfp.html#cfpjournal

#AEiC2024 #AdaEurope #AdaProgramming

1 post - 1 participant

Read full topic

AEiC 2024 - Ada-Europe conference - grants for Open Access publication

Season's greetings from the organizers of the 28th Ada-Europe International Conference on Reliable Software Technologies (AEiC 2024), to be held 11-14 June 2024, in Barcelona, Spain!

Accepted Journal Track papers will be published in the conference's Special Issue of the Journal of Systems Architecture (JSA). Note that the Ada-Europe organization will waive the Open Access fees for the first four accepted papers, which do not already enjoy OA from other agreements with the Publisher.

www.ada-europe.org/conference2024/cfp.html#cfpjournal

#AEiC2024 #AdaEurope #AdaProgramming

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

2023 Day 12: Hot Springs

By: cantanima
13 December 2023 at 04:55

:scream:

just kidding. but this one took me a long time. We seem to have entered the fiendishly difficult phase. Fortunately, difficult problems are usually followed by not-so-difficult ones. Usually.

  • I first completed part 1 using a recursive algorithm that pruned failing branches. No problem, though it was a bit slow, so I knew what was coming next.
  • Yup, Part 2 inflates the input to an insane size. The first record completed quickly, to my surprise but I quit the program after it dawdled on the second record for several minutes.
  • I stared at it a while.
  • Finally, I visited the Reddit solutions page. People were mentioning spoiler. What the heck is spoiler, thinks I, feeling a little humiliated at not knowing. Scrolling down a little, I see that someone else has the wherewithal to ask. It means spoiler. Oh yeah, says I, albeit a little more colorfully. (i.e., :face_with_symbols_over_mouth:) I remember something about that from my Algorithms class. But… how?
  • Reading a bit more, I see what people say they are doing. Unfortunately, they are writing in languages like C++, D, Python, Rust. Excerpts range from illegible to incomprehensible out of their context. Probably doesn’t help that’s it’s 2am. Oooookayyyyy… time for a nap.

Thinking about it this evening, I realized that I could do the following.

  1. For each line, iterate over the contiguous groups from left to right. So, start with the leftmost.
  2. Assume the group records n damaged springs,
    • Determine spoiler.
    • For each i in 0 … spoiler A picture is probably worth 1000 words here: if n is 3, and spoiler, look at spoiler It is easy to tell whether this matches .#?#?.***
    • If it matches, take the next contiguous group and recurse (step 2) with an appropriate starting index for the next string. (Have I mentioned how I :heart: Ada’s custom indexing?.)
    • This is a key point. If you don’t want to wait forever, spoiler

A couple of additional complications I encountered:

  • The result in part 2 is larger than Natural'Last on my input, so you’ll likely need something larger.
  • If you use a hashed map for the spoiler, be prepared for some moding. I do wonder if I’d have done better with an ordered map.

There was more, but I can’t remember it now.

***I don’t recall reading this detail anywhere in the Reddit discussion of solutions, but then again, I don’t think so well at 2am. Either way, I’m pleased as punch that it seemed different.

3 posts - 2 participants

Read full topic

Using GNATTest with Alire and GNATStudio

Hi All.
For context, I am working on a small code challenge that saw online. Essentially, is implementing an Ulam Spiral, in CLI, using different languages. I did this for fun, and to learn new things on the way.

I am currently working on the implementation of the Ada language. Coming from Java/Python/Javascript backgrounds, was challenging and fun figuring out how Ada does things. I am also using Alire for some small dependency management I need.

In any case, I want to implement some unit testing, just for completion, and quick verification for other parts that may be wrong. I read some articles online, and found two things:

  1. This git repository: https://github.com/alire-project/ada_spark_workflow shows a basic library on Ada, and shows that Unit Tests can be implemented as a separate crate
  2. The documentation for AUnit (https://docs.adacore.com/live/wave/aunit/html/aunit_cb/aunit_cb.html) shows how to implement tests, suites, fixtures, etc, which seems easy enough.

However, I also came into GNATTest and how is integrated into GNATStudio (which I am using for this development). Seems that make it easier to just use it to generate the test files, while I have to provide the actual test code, asserts, etc.

I added the libadalang_tools crate as a dependency, and it compiles fine. I can even see the build binaries in a folder (location: ${project_root_folder}/alire/cache/dependencies/libadalang_tools_23.0.0_75f92679/bin). However, GNATStudio complains that the binary can not be found, which makes sense, as it is not in the PATH environment variable

Here are my questions then:

  1. Can Alire set those binaries to the path? that way, when I run `alr edit`, they will be already on the path, and all will run without any issues.
  2. If #1 is not possible, then how can I configure the path to the binaries for GNATest (and other tools if needed) in a way that is portable to others (or even a future me) who want to clone the repository and build/run the code?

As a workaround, I changed the command that is executed on the GNATtest generation window and hardcoded the path. It works, but did not feel that was the correct way.

Any help on this is very welcome. Let me know if you need other details.

Regards!

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

Generating Ada bindings for C headers (Gem #59) doesn't work any more

When I used this method a few years ago, with Ada from the Ubuntu repository, it worked fine. Now, with my installation from Adacore, not so anymore.

The method consists of 2 commands (time.h as example)

  1. g++ -c -fdump-ada-spec -C /usr/include/time.h
  2. gcc -c -gnat05 *.ads

While the first command executes without any problem, the second one returns:

gcc: fatal error: cannot execute ‘gnat1’: execvp: No such file or directory

It doesn't depend on the -gnat05 option. There is indeed no gnat1 in the bin directory of the Ada installation. Mine is version 2021. I am reluctant to install the GNU version in parallel, I might mix up things.

Any other idea?

AEiC 2024 - Ada-Europe conference - 2nd Call for Contributions

22 November 2023 at 17:16

The 28th Ada-Europe International Conference on Reliable Software Technologies (AEiC 2024) will take place in Barcelona, Spain from 11 to 14 June, and comprises different tracks and co-located events.

Submission deadlines: 15 January for journal track papers; 26 February for industrial track and work-in-progress track papers, tutorial and workshop proposals. Submit early: tutorial/workshop proposals will be evaluated ASAP, with decisions from 1 January 2024!

More information on the conference site, including an extensive list of topics, and details on the call for contributions for the various tracks.

www.ada-europe.org/conference2024

#AEiC2024 #AdaEurope #AdaProgramming

1 post - 1 participant

Read full topic

AEiC 2024 - Ada-Europe conference - 2nd Call for Contributions

The 28th Ada-Europe International Conference on Reliable Software Technologies (AEiC 2024) will take place in Barcelona, Spain from 11 to 14 June, and comprises different tracks and co-located events.

Submission deadlines: 15 January for journal track papers; 26 February for industrial track and work-in-progress track papers, tutorial and workshop proposals. Submit early: tutorial/workshop proposals will be evaluated ASAP, with decisions from 1 January 2024!

More information on the conference site, including an extensive list of topics, and details on the call for contributions for the various tracks.

www.ada-europe.org/conference2024

#AEiC2024 #AdaEurope #AdaProgramming

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

Gnatprove detailed counterexample trace outside GNAT Studio?

18 November 2023 at 02:46

When gnatprove is used with “–counterexamples=on” inside GNAT Studio it is able to present a detailed trace[1]:

counterexample

This nice trace only seems to work inside GNAT Studio, not inside the VSCode AdaCore.ada plugin. Is there a way to output this trace to a text console (e.g. by passing an option to the gnatprove command-line command) so that this trace feature can be used outside GNAT Studio?

[1] 7.2. How to View GNATprove Output — SPARK User's Guide 25.0w

2 posts - 2 participants

Read full topic

Lightweight Parallelism library based on Ada 2022 features

By: sttaft
4 November 2023 at 13:46

A full implementation of the parallel features of Ada 2022 is yet to be released. In the meantime, here is a light-weight-threading library that provides essentially all of the parallel features of Ada 2022, using various generics, etc. Scheduling is provided using a plug-in architecture. If no scheduler is plugged in, the light-weight threads are simply executed sequentially. If a light-weight-thread scheduler is plugged in, then the light-weight threads spawned by instances of the various generic packages are managed by that scheduler.

There are currently two LWT scheduler plug-ins:

  • a wrapper for the GNU implementation of OpenMP (lwt-openmp.ads)
  • a work-stealing based plug-in, written entirely in Ada (lwt-work_stealing.ads)

Below is a link to the “readme.md” documentation for the GitHub lwt library. It is currently part of the ParaSail GitHub repository, but the files in “lwt” are actually independent of ParaSail. ParaSail has its own work-stealing-based scheduler built-in, but at some point we plan to shift over to using the “lwt” library. But at the moment, there is no dependence either way between the ParaSail interpreter/compiler and the lwt library.

Feel free to open GitHub Issues if you find problems with the implementation, or have suggestions for improvements.

Enjoy!

-Tucker Taft

The ParaSail GitHub repository was created by my colleague Olivier Henley, and he has also helped to improve the documentation and testing scripts. Much appreciated!

2 posts - 2 participants

Read full topic

An interesting thing happened to me yesterday.

TLDR: Ada is a great language!

I thought I would share. So, a PLC (Mitsubishi FX5UC) was brought to my work table yesterday. I was supposed to try to establish communication with it. I wrote a Missubishi communication driver back in 2021 for our SCADA system. In Ada, naturally, as most of our system is in Ada :)

The communication can be either via UDP or TCP, somewhat similar but more complicated than Modbus (more addressing modes, more types of variables). In 2021, it took me some 10 man-days to write using the available Mitsubishi documentation (500 pages) which is so good it even contains packet samples (which I used for dry tests as at the time, I had no available Mitsubishi PLC). The result was some 80 kB source file (adb) with a small 3kB specification (ads). (I don't count changes needed to add a new communication protocol to the SCADA).

Now, after yesterday's testing I had to:

  • replace calling one socket-reading function with another (mistakenly I used 'read until the output buffer is full' instead of 'read what data is available')
  • add one line (multiplication by 2) handling the fact that a word register has 2 bytes
  • add 'else' branch to initialize a variable
  • modify 2 comments (a reference to a wrong page of Mitsubishi documentation)
  • to make writing to a bit variable work, change a constant (2#0001_0000" instead of 1 as a high nibble is used for the 1st bit, low for the second bit).

That's all. After 2.5 hours I was able to read/write all the required variable types. After another 2.5 hours, I checked all the types in our driver documentation (and discovered one more typo - one of the variable types was a word instead of a bit).

I'm no great programmer and I usually generate quite a lot of mistakes, so this time I was pleasantly surprised that with a few corrections, my code actually started to work quite quickly. I think the choice of a programming language has a lot to do with it ... ;-)

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

Ada interfacing C++: instance destroyed

I want to use a C++ library that implements the Factory Method design pattern.

Below you can see a minimal reproducibable example, including C++ sources and the Ada adapter.

  • Item.h:

    // Product interface
    
    #ifndef _ITEM_H_
    #define _ITEM_H_
    
    class Item {
    public:
    
      virtual ~Item() = default;
      virtual void do_something() = 0;
    };
    
    #endif
    
  • ConcreteItem.h:

    
    #ifndef _CONCRETEITEM_H_
    #define _CONCRETEITEM_H_
    
    #include "Item.h"
    
    class ConcreteItem : public Item {
    public:
      ConcreteItem();
      ~ConcreteItem();
      void do_something();
    };
    
    #endif
    
  • ConcreteItem.cpp:

    
    #include <stdlib.h>
    #include <iostream>
    #include "ConcreteItem.h"
    
    void ConcreteItem::do_something() {
      std::cout << "Doing stuff \n";
    };
    
    ConcreteItem::ConcreteItem() {
      std::cout << "Concrete Item created \n";
    };
    
    ConcreteItem::~ConcreteItem(){
      std::cout << "Concrete Item destroyed \n";
    };
    
  • Factory.h:

    
    #ifndef _FACTORY_H_
    #define _FACTORY_H_
    
    #include "Item.h"
    
    class Factory {
    public:
      static Item* get_configured_item ();
      Factory(Factory& other) = delete;
    
    private:
    
      static Factory* factory;
      static Item* config_item;
    
      Factory();
      ~Factory();
    };
    
    #endif
    
  • Factory.cpp:

    
    #include "Factory.h"
    #include "ConcreteItem.h"
    
    Factory* Factory::factory = nullptr;
    Item* Factory::config_item = nullptr;
    
    Item *Factory::get_configured_item() {
    
      if (Factory::factory == nullptr) {
        Factory::factory = new Factory();
    
        if (Factory::config_item == nullptr) {
          Factory::config_item = new ConcreteItem();
        };
      };
    
      return Factory::config_item;
    };
    
    Factory::Factory(){};
    Factory::~Factory() {
      delete Factory::config_item;
    };
    

And here I have the Ada files that imports C++ symbols, generated with a call to g++ -c -fdump-ada-spec -C ./Factory.h and doing some modifications to suite my taste:

  • Factory_h.ads:
    limited with Item_h;
    
    package Factory_h is
    
      type Factory is limited record
        null;
      end record
        with Import => True,
        Convention => CPP;
    
      function get_configured_item return access Item_h.Item'Class  -- ./Factory.h:9
        with Import => True, 
        Convention => CPP, 
        External_Name => "_ZN7Factory19get_configured_itemEv";
    
    end Factory_h;
    
  • Item_h.ads:
    
    with Interfaces.C;
    
    package Item_h is
      type Item is limited interface
        with Import => True,
        Convention => CPP;
    
      --  procedure Delete_Item (this : access Item) is abstract;-- ./Item.h:8
      --  
      --  procedure Delete_And_Free_Item (this : access Item) is abstract; -- ./Item.h:8;
    
      procedure do_something (this : access Item) is abstract;  -- ./Item.h:9
    end Item_h;
    

And finaly an Ada main to test this silly example:

with Factory_h;
with Item_h;

procedure main is
  
  configured_item : constant access Item_h.Item'Class :=
    Factory_h.get_configured_item;
  
begin
  
  configured_item.do_something;

end main;

Do you know why if I comment out the Item primitives Delete_Item and Delete_And_Free_Item the call to do_something is never done and the item is destroyed?

If I uncomment them everything works.

Thanks in advance!

Implementing Release for GNATCOLL.Refcount

19 October 2023 at 15:28

GNATCOLL.Refcount provides a procedure to run some code when the reference-counted element is released.

How do I implement this procedure?

I’m clearly missing something because Release is not visible as GNATCOLL.Refcount.Release and this doesn’t work

type Context_Contents is new GNATCOLL.Refcount.Refcounted with record
    Address : System.Address;
end record;

procedure Release is new GNATCOLL.Refcount.Release
   (Self => Context_Contents);

and gives me

usb.ads:29:47: error: "Release" not declared in "Refcount"

4 posts - 3 participants

Read full topic

Bridge returned error 500! (19645)

15 October 2023 at 04:06

Details

Type: HttpException
Code: 500
Message: https://groups.google.com/g/comp.lang.ada resulted in 500 Internal Server Error
File: lib/contents.php
Line: 106

Trace

#0 index.php(11): RssBridge->main()
#1 lib/RssBridge.php(113): DisplayAction->execute()
#2 actions/DisplayAction.php(71): DisplayAction->createResponse()
#3 actions/DisplayAction.php(106): XPathAbstract->collectData()
#4 lib/XPathAbstract.php(406): GoogleGroupsBridge->provideWebsiteContent()
#5 bridges/GoogleGroupsBridge.php(56): getContents()
#6 lib/contents.php(106)

Context

Query: action=display&bridge=GoogleGroupsBridge&group=comp.lang.ada&account=&format=Atom
Version: 2023-09-24
OS: Linux
PHP: 8.2.7

Go back

No maintainer

  • 15 October 2023 at 04:06

[ANN] Release of UXStrings 0.6.0

This Ada library provides Unicode character strings of dynamic length.

It is now available on Alire in version 0.6.0.

Changes:

  • Add string convenient subprograms: Contains, Ends_With, Starts_With, Is_Lower, Is_Upper, Is_Basic, Is_Empty, Remove, Replace.
  • Add list of strings with convenient subprograms: Append_Unique, Filter, Join, Remove_Duplicates, Replace, Slice, Sort, Is_Sorted, Merge and Split on strings.

So far in UXStrings, its API are similar to those of the strings Ada standard libraries. If you find some missing, make your proposals on Github.

NB: UXStrings3 is now the default implementation.

submitted by /u/Blady-com
[link] [comments]

AEiC 2024 - Ada-Europe conference - 1st Call for Contributions

26 September 2023 at 12:30

The 28th Ada-Europe International Conference on Reliable Software Technologies (AEiC 2024) will take place in Barcelona, Spain in the week of 11-14 June.

The conference schedule comprises a journal track, an industrial track, a work-in-progress track, a vendor exhibition, parallel tutorials, and satellite workshops.

Deadlines: 15 January 2024 for journal-track papers; 26 February 2024 for industrial-track and work-in-progress-track papers, tutorial and workshop proposals.

More information is available on the conference site, including an extensive list of topics; details on the call for contributions for the various tracks will follow shortly.

www.ada-europe.org/conference2024

#AEiC2024 #AdaEurope #AdaProgramming

1 post - 1 participant

Read full topic

AEiC 2024 - Ada-Europe conference - 1st Call for Contributions

26 September 2023 at 12:24

The 28th Ada-Europe International Conference on Reliable Software Technologies (AEiC 2024) will take place in Barcelona, Spain in the week of 11-14 June.

The conference schedule comprises a journal track, an industrial track, a work-in-progress track, a vendor exhibition, parallel tutorials, and satellite workshops.

Deadlines: 15 January 2024 for journal-track papers; 26 February 2024 for industrial-track and work-in-progress-track papers, tutorial and workshop proposals.

More information is available on the conference site, including an extensive list of topics; details on the call for contributions for the various tracks will follow shortly.

www.ada-europe.org/conference2024

#AEiC2024 #AdaEurope #AdaProgramming

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

AUnit - Usefullness of the `Test_Caller` package

There seem to be two different ways to do the same thing when using the AUnit library:

Using the AUnit.Test_Cases.Test_Case type, creating some function tests, then register each tests with the AUnit.Test_Cases.Register_Tests function. We can then add this Test_Case to a Suite using the function AUnit.Test_Suites.Add_Test.

There some example of this:

(Surprisingly, there no examples using this way in the AUnit repository.)

The other way is to use the AUnit.Test_Fixtures.Test_Fixture type, creating some function tests. These tests can then be added to a Suite using the generic package AUnit.Test_Caller with the functions AUnit.Test_Suites.Add_Test and AUnit.Test_Caller.Create.

I can see way of using Test_Caller in:

The only difference I can see is that, when using the AUnit.Test_Cases.Test_Case, you can override the Set_Up_Case, Set_Up, Tear_Down and Tear_Down_Case functions. While with the AUnit.Test_Fixtures.Test_Fixture you can only override the Set_Up and Tear_Down functions (because the tests are not group under a Test_Case).

Appart from that, I don't really see much difference.

So, what is the use of the AUnit.Test_Fixtures.Test_Fixture type with the generic package AUnit.Test_Caller ? Why would use this over the (simpler ?) AUnit.Test_Cases.Test_Case type ?

Every example I have seen in one format can be transformed into the other (the Set_Up_Case and Tear_Down_Case set appart). Could give an example which use one but cannot be done by the other ?

❌
❌