Rosetta Code task/Find unimplemented tasks

Hi Simon,

It’s the “Find unimplemented tasks” task itself. On Windows 10, Alire 2.0.1, I can only get it to build if I first get the aws crate and build it separately.

Thank you very much.

Best regards,
Alexis.

Builds for me.

There’s some ugliness in the build of aws; 4 times,

sed: illegal option -- s
usage: sed script [-Ealnru] [-i extension] [file ...]
	sed [-Ealnu] [-i extension] [-e script] ... [-f script_file] ... [file ...]

I’ve come across this before, someone (at, I think, AdaCore) uses an option that’s available on Linux but not macOS. On Linux, -s or --separate means “consider files as separate rather than as a single continuous long stream”, but AFAICR sed was only being used to manipulate one file …

1 Like

Hi Simon;

It builds successfully for me on MacOS, I think, because I have the gnu variety of sed in my path taking precedence over the sed native to the Mac (?)

Retired_Build_Engineer

Just added the Poker Hand Analyzer task, it should appear soon.

I tried to go for clarity rather than cleverness :wink:

1 Like

Hi;

I tried to compile the Rosetta Code “Poker hand analyzer” Task. It complained about the left and right square brackets. When replaced with the left and right parenthesis, it compiled and executed without issues.

ALR 2.1.0
MacOS (Apple Silicon)
GNAT 14.1

Retired_Build_Engineer

I haven’t seen the code for it, but that sounds like an Ada22 vs Ada12 (and lower) thing. They introduced square brackets for iniitialization via aggregates. Try it with the brackets but also use the -gnat2022 switch

2 Likes

Hi Jere;

Yep, I missed the note " Works with : GNAT Ada 2022"

(SIGH)

Yep, it works as written.

Thanks for the correction.

Retired_Build_Engineer

1 Like

Indeed.

If building with Alire use…

[build-switches]
"*".ada_version = "Ada2022"
"*".style_checks = ["-gnaty-m"]

Thank you for the additional Alire settings information,

Or, pragma Ada_2022;, directly in the code

1 Like

Works fine, dropped it into a new crate and added the lines recommended by SMerrony to the alire.toml file.Alire 2.0.1 on Windows 10.

Would it be acceptable to add a few lines to the task on Rosetta with what is needed for using it with Alire? Like another “Works with”…

Thanks - didn’t know about that.

I would say not - for two reasons:

  1. It’s not the Rosetta way, build files/instructions are generally not included with examples.
  2. Rosetta is primarily an educational resource, I would hope that anyone learning Ada in 2024 (or later) would be starting from a base of Ada 2022.

However, now I’ve seen @simonjwright 's post, I’ll add that pragma into the code.

Just added the Musical Scale task - should appear soon, although Rosetta is a bit flaky today.

I added Play recorded sounds - Rosetta Code using ASFML and Idiomatically determine all the characters that can be used for symbols - Rosetta Code using Ada.Strings.Maps.

The “Find unimplemented tasks” program now says:

Numbers of tasks not implemented := 419

OK, I understand. I would think it’s also more kind of “the Ada way” to have the pragma in and just have it work correctly right out of the box if you have the right compiler.

If we’re keeping track of this here: I provided two different solutions to Weird Numbers, because my original approach is 10-50x slower than the algorithm most people were using (depending on language) and that annoyed me, so the second approach took some ideas from the Python and C++ implementations, which in all honesty I don’t quite understand, but then again staying up late in order to do that is probably not the most conducive to understanding them.

(I realize the Rosetta Code website may not be accessible until the certificate is renewed, but I was able to get into it using the Konqueror browser.)

Well, the Ada solution to Weird Numbers is also a Schrodinger’s task: it appears when I’m logged in, but not when I’m not… though the history shows it there, even when I’m not. Makes me wonder if it’s related to the certificate issue.

Probably, it’s related to the cache used for anonymous users. See Rosetta Code task/Find unimplemented tasks - #18 by mgrojo

Much as I’d like to hope that was true, I wasn’t anonymous when I submitted it. I was logged in with my old account (which I recovered immediately, or so I thought). In fact, the updates I made to my user page show up, and the changes I made show up in the history.

I could believe it’s related to cache; I’m just not sure it’s related to a cache for anonymous users.

In fact, if I log in, go to my user page, then log out, the link on my user page to Weird Numbers shows up, and even links to a page where they do show up. So maybe the Ada solutions show up now?