AdaCore Blog

Announcing Updates to learn.adacore.com

by Gustavo A. Hoffmann Guest Author

In July 2018, we launched the learn web­site. In the mean­time, many improve­ments have been made to the web­site. In this blog post, we’re going to review them.

Course updates #

When the learn web­site was launched, it includ­ed the fol­low­ing courses:

  • Intro­duc­tion to Ada”
  • Intro­duc­tion to SPARK
  • Ada for the C++ or Java Developer”

Since then, we added four courses:

  • SPARK Ada for the MIS­RA C Devel­op­er”: a course that presents the SPARK tech­nol­o­gy through an exam­ple-dri­ven com­par­i­son with the rules in the wide­ly known MIS­RA C sub­set of the C language.

  • Intro­duc­tion to GNAT Tool­chain”: a course that presents an intro­duc­tion to the GNAT tool­chain, includ­ing first steps to get start­ed with the tool­chain and some details on the project man­ag­er (GPRbuild) and the inte­grat­ed devel­op­ment envi­ron­ment (GNAT Studio).

  • Intro­duc­tion to Ada: Lab­o­ra­to­ries”: a col­lec­tion of inter­ac­tive exer­cis­es for the Intro­duc­tion to Ada” course.

  • Ada for the Embed­ded C Devel­op­er”: a course for C devel­op­ers with good knowl­edge of embed­ded appli­ca­tions; it intro­duces devel­op­ers to the Ada lan­guages by com­par­ing it to C and also intro­duces the SPARK sub­set, which removes a few fea­tures with unde­fined behavior.

Infra­struc­ture updates #

This is by far not every­thing! Many changes hap­pened to the web­site itself.

In May 2020, we inte­grat­ed a major refac­tor­ing of the web­site infra­struc­ture. The wid­get exten­sion plug-in for Sphinx, which is used for the source-code exam­ples on the web­site, has been refac­tored into mul­ti­ple files and mod­ules to allow bet­ter main­tain­abil­i­ty and read­abil­i­ty. Also, major parts of the website’s fron­tend have been rewrit­ten in Typescript.

This refac­tor­ing made it eas­i­er to improve the online edi­tor used for source-code snip­pets. For exam­ple, a new fea­ture that the edi­tor now has is the option to use tabbed view of source-code files.

Also, there’s a down­load but­ton on the edi­tor. Now, users can down­load indi­vid­ual source-code exam­ples as zip files for fur­ther exper­i­men­ta­tion on their machines. Even bet­ter: if they use the edi­tor to make changes to those exam­ples, they can down­load the changed ver­sion as well!

Offline read­ing updates #

While the learn web­site was launched as an inter­ac­tive web­site, we always had the vision of sup­port­ing offline read­ing as well. The first step in that direc­tion was made in Jan­u­ary 2020, when we added the option of down­load­ing cours­es as PDF files. This allows read­ers to read the con­tents when not con­nect­ed to the web­site or print cours­es on paper.

A major dis­ad­van­tage still exist­ed in those PDF files: as no run but­ton” was avail­able in those files, it was impos­si­ble to view the out­put of the source-code exam­ples. In many cas­es, this infor­ma­tion can be valu­able to bet­ter under­stand what the source-code is actu­al­ly doing. There­fore, in Feb­ru­ary 2021, we inte­grat­ed the build and run­time out­put of each source-code exam­ple to those PDF files.

Note that most books on Ada pro­gram­ming — or even on pro­gram­ming lan­guages in gen­er­al — usu­al­ly don’t include the build and run­time out­put of source-code exam­ples. In that sense, the PDF books offered by learn​.ada​core​.com are unique and, per­haps, eas­i­er to under­stand than oth­er books.

Read­ing PDF files on larg­er screens, such as com­put­er mon­i­tors, is accept­able in most cas­es. How­ev­er, on devices with a small screen — such as smart­phones, e‑book read­ers and some tablets — read­ing PDF books might be dif­fi­cult, for the font might be sim­ply too small. Because PDF files are pri­mar­i­ly cre­at­ed for print­ing, the font size is not adjustable. There are, how­ev­er, for­mats that tar­get elec­tron­ic read­ing, so that read­ers can adjust the font size — or even back­ground col­or and font type — to their lik­ing. There­fore, in Novem­ber 2021, we intro­duced sup­port for two e‑book formats:

  • EPUB, which is wide­ly used in many e‑book read­ers, includ­ing Google Play Books, and

  • MOBI, which is used on Ama­zon Kin­dle devices.

Now, read­ers can select one of those three for­mats when down­load­ing cours­es for offline reading.

A major draw­back of offline for­mats is that hyper­links don’t work well with­in the same appli­ca­tion. For exam­ple, if some­one is read­ing the PDF ver­sion of the Ada for the Embed­ded C Devel­op­er” course, and they click on a link that refers to a sec­tion of the Intro­duc­tion to Ada” course, that click will switch from the PDF read­ing appli­ca­tion to a brows­er, which will then open a page of the learn web­site. This process of switch­ing appli­ca­tions is sub­op­ti­mal. We can, how­ev­er, cir­cum­vent this issue by pack­ing all books into a sin­gle book. There­fore, in Decem­ber 2021, we intro­duced the Learn­ing Ada” book. This book con­tains the com­plete con­tents of the learn​.ada​core​.com web­site, and hyper­links between cours­es work fine as expect­ed. (Of course, Learn­ing Ada” is avail­able in all three for­mats: PDF, EPUB and MOBI.)

As you can see, many things have changed since the learn web­site was launched, and we’re work­ing on adding even more stuff in the future. Keep tuned!

Posted in #Teaching    #Ada    #SPARK   

About Gustavo A. Hoffmann

learn.adacore.com coordinator / co-author