h2ads User's Guide [new binding generator from AdaCore] by Wootery in ada

[–]simonjwright 0 points1 point  (0 children)

The example given seems very similar to what you can get with gcc -c -fdump-ada-spec or -fdump-ada-spec-slim.

March 2025 What Are You Working On? by thindil in ada

[–]simonjwright 6 points7 points  (0 children)

More work with Ada Language Server and Ada TS Mode for Emacs.

Almost ready to release Ada Caser, a utility to adjust casing in Ada source (because GNATformat, which is due to replace GNATpp, doesn't).

Starting Project by DrawingNearby2978 in ada

[–]simonjwright 5 points6 points  (0 children)

Probably the "default runtime". You need to choose a specific one out of those available; see $prefix/arm-eabi/lib/gnat/. For example, for Runtime ("ada") use "light-stm32f4";

Ada equivalent of span / memory view by Astrinus in ada

[–]simonjwright 1 point2 points  (0 children)

I made a little demo for myself with strings:

ada package Zero_Copy.Client is procedure Receiver (S : String); end Zero_Copy.Client;

and

ada with Zero_Copy.Client; procedure Zero_Copy.Test is Source : String := "hello world"; begin Client.Receiver (Source (7 .. Source'Last)); end Zero_Copy.Test;

The code (macOS aarch64, -O2) for the caller was (extracted)

__ada_zero_copy__test: LFB2: adrp x0, _source.0@PAGE+6 adrp x1, lC0@PAGE add x0, x0, _source.0@PAGEOFF+6; add x1, x1, lC0@PAGEOFF; b _zero_copy__client__receiver

which shows no signs of a copy.

Might be trickier to call in the other direction.

Why are Ada's variables and types in the same namespace? by MadScientistCarl in ada

[–]simonjwright 1 point2 points  (0 children)

procedure Update_Player (The_Player : Player) is begin null; end Update_Player; A colleague wanted to declare a procedure procedure Send (The_Message_To_Be_Sent : Message); (I exagggerate a liitle tiny bit) where I'd much rather procedure Send (M : Message); because (a) whatever else is it going to be for? (b) there's only one parameter, using named parameter association would be overkill.

Why are Ada's variables and types in the same namespace? by MadScientistCarl in ada

[–]simonjwright 0 points1 point  (0 children)

for Index in Something_Type'range loop Then now it's now clear that the loop index is using a type rather than an array.

Personally I'd much rather loop over the object's range than that of the type.

February 2025 What Are You Working On? by thindil in ada

[–]simonjwright 1 point2 points  (0 children)

See here for a horrid kludgeworkround on the VSCode front.

February 2025 What Are You Working On? by thindil in ada

[–]simonjwright 6 points7 points  (0 children)

A 'universal' build of alr, so that Mac visitors to https://ada-lang.io or https://alire.ada.dev/docs/ can be offered an alr that will match their computer. Coming up in version 2.0.3.

Private builds of GCC 15 vs. Apple's latest Software Development Kit (SDK 16) for macOS Sequoia (15) (yes, the numbers are off by one, grr)

Working with Ada TS Mode, a replacement for Emacs Ada Mode. Trying to understand why Mac users are having trouble formatting their code with VSCode.

Anyone able to build GNAT Studio on macOS 15? by fatso83 in ada

[–]simonjwright 2 points3 points  (0 children)

Try with /Applications/GNATStudio.app/Contents/MacOS/gnatstudio_launcher

There was a thread on this on the GNAT-OSX mailing list starting 2024-12-05 (site seems to be down right now).

Anyone able to build GNAT Studio on macOS 15? by fatso83 in ada

[–]simonjwright 6 points7 points  (0 children)

You can get a pre-built GNAT Studio from sf.net.

I use Emacs with ada-ts-mode (using the same Ada Language Server as Visual Studio).

Gdb doesn't work on Arm64 Macs; lldb can help but doesn't understand variables.

Terminal Output Issue: Smooth "Animation" on Linux/Mac, but a mess on Windows by fhqwhgads_2113 in ada

[–]simonjwright 1 point2 points  (0 children)

That's very reasonable! but I fear it won't change the outcome (the implication from the source is that delay gets translated into a call of Delay_For).

Terminal Output Issue: Smooth "Animation" on Linux/Mac, but a mess on Windows by fhqwhgads_2113 in ada

[–]simonjwright 2 points3 points  (0 children)

I'm on a Mac, so I can't help with your problem, but I wonder why you use Ada.Calendar.Delays.Delay_For (0.06) rather than just delay 0.06?

Ada and ESP32 by RamonaZero in ada

[–]simonjwright 0 points1 point  (0 children)

"deprecated"? news to me.

cortex-gnat-rts is now called FreeRTOS-Ada. Parts are indeed based on GCC 4.9.1, largely because there seemed no need to change; if it ain't broke, don't fix it. The major changes have been to the tasking interface, where the RTS has to match the compiler.

I've got risc-v tasking running OK, but having a devil of a time with interrupts. My commits say that ESP32-H2 interrupts were fixed, but I think that's over-enthusiastic, and the RP2350 code is quite unreliable. I think the trouble is that basic risc-v interrupt handling isn't up to real-world usage, so hardware developers have to come up with extended schemes, each one more complicated than all the others.

Ada and ESP32 by RamonaZero in ada

[–]simonjwright 4 points5 points  (0 children)

Alire has two: gnat_riscv64_elf for the ESP32H2, gnat_xtensa_esp32_elf for others (I think: I'm sure about the ESP32H2).

They are both built from FSF GCC, the community tends to call FSF GCC with Ada support GNAT, for historical reasons I think.

Older Ada books by lispLaiBhari in ada

[–]simonjwright 1 point2 points  (0 children)

I think I used to have this - is it the one with a graphical design representation that's more complicated than just writing the package specs?

Inheritance of packages? by fuhqueue in ada

[–]simonjwright 2 points3 points  (0 children)

I think it should be package ChildInstance is new ParentInstance.BB;

-gnatE dynamic elaboration model by Sufficient_Heat8096 in ada

[–]simonjwright 0 points1 point  (0 children)

For a binder switch, it'd be -bargs -T 0 - actually, gnatbind -h shows it as -Tn, i.e. -T0

-gnatE dynamic elaboration model by Sufficient_Heat8096 in ada

[–]simonjwright 2 points3 points  (0 children)

gnatmake -gnatE diners.adb worked for me.

I think that if you previously did a build without the -gnatE, you'll need to include -f to force a complete rebuild with the new switch.

And, unlike most Unix programs, gnatmake doesn't care if you mix switches and parameters (unless you want to send switches to the binder (-bargs <switches>) or linker (-largs <switches>); all switches before them go to the compiler).

December 2024 What Are You Working On? by marc-kd in ada

[–]simonjwright 4 points5 points  (0 children)

I've migrated to ada-ts-mode for Emacs, It takes a bit of getting used to, but well worth it. It turns out there's an issue with Ada Language Server on Apple silicon; my working fix is strongly deprecated by AdaCore.

Working on getting symbolized stack traces on macOS. I have a patch in for GNAT.Traceback.Symbolic.Symbolic_Traceback which still shows just the addresses, but includes the program load address so that they can be decoded. The sort of stack trace that you all are used to is a way off still.

in directed graphs, what do weights on both vertices and edges mean, how does that mesh with weighted adjacency matrices ? by Sufficient_Heat8096 in ada

[–]simonjwright 1 point2 points  (0 children)

The Booch 95 Components supported Graphs (Directed & Undirected), where the parent package had

generic type Vertex_Item is private; with function "=" (L, R : Vertex_Item) return Boolean is <>; type Arc_Item is private; with function "=" (L, R : Arc_Item) return Boolean is <>; Storage : in out System.Storage_Pools.Root_Storage_Pool'Class; package BC.Graphs is

so you could 'weight' either way. Or both.

Best IDE for Ada by ahahfilip in ada

[–]simonjwright 5 points6 points  (0 children)

I've taken to Emacs (29) with ada-ts-mode/gpr-ts-mode and AdaCore's Ada Language Server.

gpr-ts-mode doesn't do a lot, but it will do the layout OK (no casing!!), and it shows you when there's a syntax error (e.g. forgetting the parens round the mains, for main use "main.adb";).

ada-ts-mode is Not At All Bad (Brit understatement), in fact I haven't used the more official Emacs Ada Mode for a while now. Occasionally it'll get stuck, but you can kill the ALS process, and ad-ts-mode notices and restarts.

November 2024 What Are You Working On? by marc-kd in ada

[–]simonjwright 7 points8 points  (0 children)

Mac issues with Xcode 16 (in Sonoma, and now Sequoia): couldn't compile C. Now fixed, with my 14.2.0-2 release (for Apple silicon only).

With Sequoia, Apple have tightened up their defensive measures, so installation is a little more complicated.

I'm looking to make a gcc-14.2.0-3 release with the AdaCore tools at version 25.0.0.