Ann: Easy_Graphics

I am almost embarrassed to announce my Easy_Graphics package.

Easy_Graphics is a simple library for generating graphical output from your Ada program.

Typical use cases might be educational projects, prototyping, programming challenges, or simply when you want to visualise something quickly in a larger system.

The Alire package is here: Alire - Easy_graphics
The Github repo is here: GitHub - SMerrony/easy_graphics: Easy_Graphics is a simple library for generating graphical output from your Ada program

I would welcome constructive feedback - but please be polite.

5 Likes

Some comments:

  • the alire page links to a non-working page (looks as if it needs an s at the end)
  • this is really cool. i was working on something similar but got hung up on png output. (i had ppm before then.) i’ll take a look & see if i can contribute something

Your github repo is down.

Hi Stephen;

I finally got a chance to experiement with your Ada package via the “Sierpinski pentagon” https://rosettacode.org/wiki/Sierpinski_pentagon#Ada Rosetta Code task.

Two small nits in my experience.

One: When NOT using Alire (on MacOS), I git an compile error (I’ve lost the exact message) regarding line 213 requiring double quotes (??) in easy_graphics.adb. I’ll try to reproduce this later.

Two: When using Alire everything seems to work fine except there is no gif file produced (anywhere that I can find).

Thanks,
Retired Build Engineer

Well, it works now! What did I do differently? Face-palm.

RBE

This is the error message that I got from running gnatmake directly:

gnatmake -I/opt/ext_ada_lib/easy_graphics/src ./sierpinski_pentagon.adb
gcc -c -I./ -I/opt/ext_ada_lib/easy_graphics/src -I- ./sierpinski_pentagon.adb
easy_graphics.ads:213:07: error: strings are delimited by double quote character
gnatmake: “./sierpinski_pentagon.adb” compilation error

Thanks,
RBE

Without looking at it, that error usually comes when you have an <apostrophe> something <apostrophe>. If it builds in Alire and not plain gnatmake, I would wager it is an attribute that is only supported in Ada22, so gnatmake doesn’t recognize it and thinks you are looking to make a string.

Hi Jere;

He has “pragma Ada_2022;” as the first line of the Ada program.

RBE

EDIT: It looks like the line in question uses a non ASCII character so you need a compiler switch to turn on UTF8 mode I think? try -gnatW8 with your gnatmake commands.

REF: easy_graphics_0.1.0_6284e085/src/easy_graphics.ads - Ada Code Search

1 Like

Yep, that was it!

Thanks,
RBE

1 Like