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

Ann: HAC v.0.1

HAC (HAC Ada Compiler) is a quick, small, open-source Ada compiler, covering a subset of the Ada language. HAC is itself fully programmed in Ada.

Web site: http://hacadacompiler.sf.net/

From there, links to sources and an executable for Windows.

Source repositories:

#1 svn: https://sf.net/p/hacadacompiler/code/HEAD/tree/trunk/

#2 git: https://github.com/zertovitch/hac

* Main improvements since v.0.0996:

  • packages and subpackages are now supported
  • modularity: packages, procedures and functions can be standalone library units, stored in individual files with GNAT's naming convention, and accessed from other units via the WITH clause
  • validity checks were added for a better detection of uninitialized variables.

Package examples and modularity tests have been added. Particularly, a new PDF producer package with a few demos is located in the ./exm/pdf directory.

Enjoy!

Gautier

__

PS: for Windows, there is an integrated editor that embeds HAC:

LEA: http://l-e-a.sf.net

PPS: HAC will be shown at the Ada-Europe conference (presentation + tutorial)

http://www.ada-europe.org/conference2022/

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

Ann: HAC v.0.1

14 May 2022 at 13:19

HAC (HAC Ada Compiler) is a quick, small, open-source Ada
compiler, covering a subset of the Ada language.
HAC is itself fully programmed in Ada.

Web site: http://hacadacompiler.sf.net/
From there, links to sources and an executable for Windows.

Source repositories:
  #1 svn: https://sf.net/p/hacadacompiler/code/HEAD/tree/trunk/
  #2 git: https://github.com/zertovitch/hac

* Main improvements since v.0.0996:

  - packages and subpackages are now supported
  - modularity: packages and subprograms can be standalone
      library units, stored in individual files with
      GNAT's naming convention, and accessed from other units
      via the WITH clause
  - validity checks were added for a better detection of
      uninitialized variables.

Package examples and modularity tests have been added.
Particularly, a new PDF producer package with a few demos
is located in the ./exm/pdf directory.

Enjoy!

Gautier
__
PS: for Windows, there is an integrated editor that embeds HAC:
LEA: http://l-e-a.sf.net
PPS: HAC will be shown at the Ada-Europe conference (presentation + tutorial)
http://www.ada-europe.org/conference2022/

Who should OpenSSF / OWASP talk with Ada package management?

I’m in the OpenSSF Stream 10 “Enhance the 10 Most Critical OSS Build Systems, Package Managers, and Distribution Systems With Better Supply Chain Security Tools and Best Practices.” Workshop atm.

This is to address the USG EO on secure supply chain. The stream needs direct access to the maintainers / owners of the build system and/or package management.

Who should we reach out to?

Andrew van der Stock, ED OWASP Foundation

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

What's the best starter language for a beginner programmer?

There’s a survey on Twitter sent by @davefarley77 about What's the best starter language for a beginner programmer?

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

SweetAda 0.10 released

Hi all,

I've just released SweetAda 0.10.

SweetAda is a lightweight development framework to create Ada systems on a wide range
of machines. Please refer to https://www.sweetada.org.

Downloads available also @ https://sourceforge.net/projects/sweetada.
GitHub @ https://github.com/gabriele-galeotti/SweetAda

This release comes with a huge cleanup of the whole system, with many changes in all areas. The build system seems pretty efficient and stable, with no redundant actions, and is able to accomodate a large set of configuration.

The profile agrees with Ravenscar, and all platforms tested run OK, albeit many of them in a very simple manner. Interrupt handling is for some CPUs still only a placeholder, but many of them are able to handle at least a simple timer in order to have a raw notion of time.

There is a Monitor module (very exemplary) to do user interaction and the Srecord module that could be used as a built-in tool to execute fragments of code. The Time module should provide basic capabilities in order to manipulate a datetime.

Many other changes, large cosmetic refinements and an improved documentation. Syntax changes to adhere Ada 2012/202x and some generics removed from I/O layers to simplify the code and gain speed.

With SweetAda 0.10, I provide also new toolchains based on GCC 11.3.0 (release-20220429), you can found them at SweetAda home or at SourceForge. QEMU emulators are bumped at 7.0.0 (release-20220504).

Unfortunately, I cannot longer provide OS X toolchains due to increasing difficulties in building the software (GCC and LLVM disagree on the syntax of some CPU instructions), and lack of time, sorry. But this shouldn't be a problem since SweetAda should be toolchain-agnostic.

G

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

Ada Gnat project which includes differently-named files for different build configurations

I have a Gnat/Gprbuild project with several build configurations. I have a main source file and an secondary ads file which the main source file includes:

with Secondary_File; use Secondary_File;

The problem is that in each configuration, the secondary file has a different name. For example, it may be called Secondary_File_1.ads for one config and Secondary_File_2.ads for another. This makes it impossible to use the above with statement.

In C, I would do something like this:

#ifdef BUILD_CFG_1
#include "secondary_file_1.h"
#else
#include "secondary_file_2.h"
#endif

Is there a clever way to do something like this in ADA, using the Gprbuild system?

Ada programming is like creating sculpture

After taking a long break from programming, I got back to work on my Ada project. I am surprised how I instantly got back to speed from where I last left off and how clear, precise, and intelligible my code is after committing only a month to learn Ada programming! I credit it all to Ada since this is an atypical experience.

There is a quirky and unique feel to Ada programming. It is like sculpting a program out of malleable, digital clay. Writing a program is a matter of slapping down big slabs of clay to build up the structure. Bits and pieces can be formed independently, such as a nose or an eye, and then tacked onto the main structure. What is often perceived as excessive Ada verbosity, is merely fettling out the details to refine the sculpture. Other languages, on the other hand, demand a more linear process where each part is written in situ to ensure it correctly integrates into the rest of the program. Even so, it is not uncommon to get lost in the endless merry-go-round of refactoring.

https://preview.redd.it/f33ytj0qyuy81.jpg?width=394&format=pjpg&auto=webp&s=c8355e16624d50a9e8a5445d72d53ed062408232

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

Is AWS (the Web server) good for production?

Hi.

I'm trying to teach myself Ada. As an exercise, I want to implement PyPI server (a Web server that handles Python packages). It has a fairly simple Web interface, and I'm quite familiar with the subject in general.

Things I don't know: how well is AWS suited for real-world Web? When I saw the numbers suggested for maximum simultaneous connections (30-50) it made me a little bit afraid, as I expected these numbers to be significantly larger.

If not AWS, is there a suggested way to deal with Web?

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

HAC, packages and PDF

10 May 2022 at 20:51

In order to illustrate a feature, what is better than a visual example?
In our case, the feature is the modularity, recently implemented in HAC (the HAC Ada Compiler).
So, a nice exercise was to try with a "real" visual package, PDF_Out (project Ada PDF Writer, link here).
Of course, HAC is still a small compiler project which doesn't cover all the sexy features of Ada - even those of the first version of Ada, Ada 1983, which already had extensive generics, aggregates (on-the-fly composite objects as expressions), default values in records or in subprogram parameters, exceptions or user-defined operators.
The easy way of down-stripping PDF_Out for HAC was to open the source code in the LEA editor (link here), and do frenetically and iteratively:

loop
  punch the compile key (F4)
  exit when the package compiles!
  make the code HAC-compatible (sometimes, it hurts!)
end loop


A few things that needed a downgrade for the HAC 0.1 language subset were:

  • Object-oriented type extension (tagged type for PDF stream). In the simplified version, PDF files are the only supported PDF streams.
  • Object.method notation
  • Default values in records, replaced by explicit initialization.
  • Inclusion of raster images (NB: the removal of that feature was unnecessary).
  • User-defined exceptions (PDF_stream_not_created, ...).
  • User-defined operators ("+", ...).
  • Indefinite page table and offset table.

The result can be seen here:


Click to enlarge

 

You can experiment it yourself by checking out or cloning the latest version of HAC:

#1 svn: https://sf.net/p/hacadacompiler/code/HEAD/tree/trunk/
#2 git: https://github.com/zertovitch/hac

The new PDF examples are located in the subdirectory ./exm/pdf




Core ada tools in a container

all

Announcing a simple Ubuntu based development environment with gnat, all in a container:

https://hub.docker.com/repository/docker/vitarasrinivasan/ada

The intent is to make this an ada dev platform of sorts - installing key Alire crates, key documents and so on.

If you are interested in continued development of this platform, would invite you to participate at:

git clone https://[email protected]/ToprLLC/docker.git

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

When does the parent thread synchronize with an ada task type variable with a non-global scope?

I was working on some multithreaded Ada network code, which involved accepting and handling multiple connections in parallel. An ideal situation for the use of Ada tasks, no? Specifically, multiple task type variables, started in a loop.

Well, I did something like this:

with Ada.Text_IO;
use Ada.Text_IO;

Procedure foo is
   task type handler is
      entry Start(I: Integer);
   end handler;
   
   task body handler is
      task_index: Integer;
   begin
      accept Start(I: Integer) do
         task_index:=I;
      end Start;
      for I in 1..5 loop
         Put_Line("Task "&task_index'Image&": "&I'Image);
      end loop;
   end handler;

begin -- foo

   for t in 1..5 loop
      declare
         bar: handler;
      begin
         bar.Start(t);
      end;
   end loop;
end foo;

Expecting that the tasks, once they accepted the start entry, would execute in parallel. However, as in this example, the main task waited for each task to finish executing in turn:

$ gnat make foo
$ ./foo
Task  1:  1
Task  1:  2
Task  1:  3
Task  1:  4
Task  1:  5
Task  2:  1
Task  2:  2
Task  2:  3
Task  2:  4
Task  2:  5
Task  3:  1
Task  3:  2
Task  3:  3
Task  3:  4
Task  3:  5
Task  4:  1
Task  4:  2
Task  4:  3
Task  4:  4
Task  4:  5
Task  5:  1
Task  5:  2
Task  5:  3
Task  5:  4
Task  5:  5

Declaring all the tasks up-front, in an array fixed the issue, but left me curious about how this is actually working, why, and where this would be documented.

ARM2012 section 9.2 paragraph 6/3 seems to me to say that the main thread waits at the end of execution for it's child tasks to finish, but in practice it seems to be waiting when the tasks leave the current scope before continuing execution (i.e. looping around, and starting the next task).

Is this a compiler issue, a documentation issue, or a coding issue?

❌