AdaCore Blog

Announcing Updates to learn.adacore.com

by Gustavo A. Hoffmann Guest Author

Some time ago, we announced some updates to the learn web­site. In the mean­time, we pub­lished the Intro­duc­tion To Embed­ded Sys­tems Programming course and the ini­tial parts of the Advanced Jour­ney with Ada course. Today, we’d like to announce some updates that have been made to the learn web­site since then.

New con­tents #

We added two chap­ters to the Advanced Jour­ney With Ada course, both cov­er­ing access types:

These two chap­ters belong to the new part on Resource Man­age­ment. In addi­tion to this, we added a new sec­tion on address­es.

This is actu­al­ly a sub­stan­tial increase in the course’s size — although it might not seem to be that much at first glance. In fact, the PDF ver­sion of the course increased from 455 to 651 pages, which cor­re­sponds to an increase by 43%.

E‑books #

A cou­ple of changes were made to the e‑books:

  • Sup­port for the MOBI for­mat was removed because Ama­zon has dropped sup­port for this for­mat. From now on, the EPUB for­mat should be used instead for Kin­dle devices.

  • We replaced the fonts in PDF books for bet­ter sup­port of Uni­code char­ac­ters. This is an exam­ple that is ren­dered cor­rect­ly now:

  • We revised all code exam­ples of the Intro­duc­tion to Ada course to fit into a 50-col­umn lim­it. (This lim­it was empir­i­cal­ly assessed on a Kin­dle Oasis with a typ­i­cal con­fig­u­ra­tion.) Now, the code exam­ples of that course fit the screen nice­ly on small devices.

Zip file with code exam­ples #

We now offer a zip file con­tain­ing source-code files of each code example on the main page of the web­site. This includes not only the typ­i­cal .ads and .adb files of each source-code exam­ple, but also the project files for GPRbuild. Down­load­ing this zip­file is very use­ful for local, offline exper­i­ments. For exam­ple, on Lin­ux, you can sim­ply run:

## Get and unpack the zip file
wget https://learn.adacore.com/zip/learning-ada_code.zip
unzip learning-ada_code.zip

## Change to the directory that contains the code example
cd projects/Courses/Intro_To_Ada/Imperative_Language/Greet/cba89a34b87c9dfa71533d982d05e6ab/

## Build and run the code example
gprbuild -Pmain.gpr
./greet

Web­site updates #

We made sev­er­al improve­ments to the web­site. Let’s review the main changes!

Google Trans­late #

We fixed an issue that pre­vent­ed using the web­site with Google Trans­late. Now, you can trans­late the web­site to your pre­ferred language:

Improved side­bar #

Pre­vi­ous­ly, menu items of the side­bar were a bit dif­fi­cult to read. This has been improved by bet­ter col­or selec­tion, so that menu items are now more readable.

Dark mode #

The web­site now sup­ports dark mode — in addi­tion to the stan­dard light mode. This mode is select­ed accord­ing to the oper­at­ing sys­tems or the brows­er settings.

Code examples with no “run” button #

Due to restrictions, some code examples of the learn website don’t have a run button. For those code examples, we now display the compile / runtime information that we would see if a button was available. For example:

(Snapshot taken from this example.)

Wid­get: non-tabbed view #

The non-tabbed (sequen­tial) view of source-code exam­ples wasn’t work­ing cor­rect­ly after a major refac­tor­ing of the wid­get. This is now fixed, so you can select this option in the wid­get set­tings if you don’t like the stan­dard tabbed view.

Wid­get menu: com­pil­er switch­es #

The wid­get now gives you access to com­pil­er switch­es. This allows you to view the com­pil­er switch­es that were used for a spe­cif­ic code exam­ple and set com­pil­er switch­es for exper­i­men­tal fea­tures. Apart from two com­pil­er switch­es that are always active by default and can­not be changed (-g and -O0), you can basi­cal­ly select any con­fig­u­ra­tion that you want.

Note that you can get more infor­ma­tion about each com­pil­er switch by click­ing on the but­ton next to the com­pil­er switch or hov­er­ing above it with the mouse pointer.

Wid­get menu: glob­al set­tings #

Pre­vi­ous­ly, chang­ing the set­tings of a wid­get (for exam­ple, select­ing dark mode”) didn’t affect the oth­er wid­gets. Now, the wid­get set­tings are glob­al, and the set­tings you select are avail­able the next time you vis­it the learn website.

Posted in

About Gustavo A. Hoffmann

learn.adacore.com coordinator / co-author