❌ About FreshRSS

Normal view

There are new articles available, click to refresh the page.
Before yesterdayNews from the Ada programming language world

New release of vscode extension For Ada 23.0.14

VS Code Extension for Ada 23.0.14

In this release:

Draft support for Alire crates

If there are alr, gprbuild and GNAT compiler in the PATH, then alire.toml in the root of workspace folder, then the extension will use Alire to configure the Ada Language Server, so navigation, tooltips, code refactoring should work out of the box without any manual configuration of the project file and scenario variables. The Ada: Reload project command calls Alire again to update setting after possible changes in crates.

But tasks like "ada: Build current project", "ada: Check current file", etc. don't take alire into account for now. To be fixed... It's possible to create a new shell task to launch alr build or alr exec gprbuild instead.

New refactoring tool Replace Type

Replaces a type in the intire project by another type provided by the user.

​

https://i.redd.it/i4fs78luiija1.gif

New refactoring tool Sort Dependencies

Sorts all with and use clauses and their associated pragmas.

​

https://i.redd.it/5epcbjpyiija1.gif

See the complete list of available refactoring tools.

Don't hesitate to report any issues on GitHub.

submitted by /u/max_rez
[link] [comments]

New release of vscode extension For Ada 23.0.15

VS Code Extension for Ada 23.0.15

In this release we improved Alire integration. Now you don't need the compiler to be in the PATH (only alr) when you are working with a crate, because Alire will configure it for you. Suppose you setup a crate for Rasperry Pico, if you open it in VS Code, then navigation should work out of the box. Also any Alire configuration is skipped altogether if the VSCode was launched with alr edit or alr exec.

We also change auto-detected tasks, so they are use alr exec -- prefix to run gprbuild, gprclean, gnatprove in the correct environment. You can also pass extra option using args property in the tasks.json file.

Renaming tool leaves found renaming problems in the diagnostics, so you can examine them in the "Problems view".

You can install newer version from the marketplace, OpenVSX or download it from GitHub release.

Happy codding!

submitted by /u/max_rez
[link] [comments]

Enabling code navigation on GitLab

By: Max
30 March 2023 at 14:02

GitLab is a repository management system for storing software source code, you might say an analogue of GitHub. While the core features of GitLab are comparable to its counterparts, some implementation features can be useful for the Ada community. One of them is the code navigation directly on the repository site. GitLab understands (let’s face it, not very well) semantic information about the program in LSIF (Language Server Index Format) format, which allows you to enable code navigation, tooltips, etc. for any language. GitLab counterparts now only offer navigation support for a limited range of languages.

Having code navigation on your site is nice and makes it easier to get to know your code and conduct code reviews. To enable it in your repository, simply create a CI Pipeline which indexes the source code after changes and uploads the result as a special type of artifact. The prototype indexer program is already ready, it’s not hard to build with Alire. I prepared a script, which can be run with a one-liner:

curl -fsSL https://raw.githubusercontent.com/reznikmm/als-alire-index/main/make_lsif.sh | bash

To avoid having to build the indexer program every time you change it, you can add it directly to the image used by the pipeline, together with the compiler and alire. This is what the Dockerfile looks like:

FROM ubuntu:22.04
RUN apt-get update \
 && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
      python3 curl unzip git libgmp-dev libc6-dev make python3-pip python3-venv \
 && curl -fsSL https://raw.githubusercontent.com/reznikmm/als-alire-index/main/make_lsif.sh | bash \
 && mv -v alr lsif-ada /bin/ \
 && apt-get purge -y --auto-remove python3 python3-pip python3-venv \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/* /root/clean

I put the pushed image on the Docker Hub as reznik/gnat:alire and it can be used in any repository. As an example, I’ve enabled navigation in my TLS repository. You can now see where any identifier is defined with the mouse pointer.

defname

Would you like to give it a try?

3 posts - 2 participants

Read full topic

Machine learning in Ada (an ONNX runtime binding)

By: Max
16 April 2023 at 17:53

As an Ada enthusiast, I’ve always wanted to try my hand at machine learning, but was discouraged by the fact that Python seemed to be the only language supported by most ML frameworks. However, I recently discovered the Open Neural Network Exchange (ONNX) format, a universal way of representing machine learning models, and a library for working with it. One thing I love about ONNX is that there are many pre-trained models available for various applications.

I was excited to find out that I could use Ada to load and make inference with ONNX models, so I created a binding for the ONNX Runtime library and wrote a couple of example programs. These examples include handwriting digit recognition and English speech synthesis. Unfortunately, the speech synthesis example required converting text to phoneme sequences, which I haven’t yet implemented in Ada, in order to keep the examples compact.

Overall, I’m thrilled to have been able to dive into the world of machine learning using my favorite programming language, and I hope that other Ada enthusiasts will find this information useful. If anyone is interested in trying it out for themselves, I’m happy to share my code and provide more information on how to get started with Ada and ONNX.

5 posts - 3 participants

Read full topic

Ada Quality and Style update

The book Ada Quality and Style made a big impression on me when I started learning Ada. It made me look at the language in a different way and highlighted its strengths. Ever since, I've recommended it to anyone learning the language. To make the book more visible, I copied it from the Wiki-book to our new beautiful website ada-lang.io. However, it turned out that the 5th chapter on the Wikibook was not fully uploaded. I had to spend some time append the missing part of the chapter. The changes have not yet been approved on the Wikibook, but the full version is already available on ada-lang.io. Additionally, I made a more detailed breakdown of the chapters to make reading more convenient.

https://ada-lang.io/docs/style-guide/Ada_Style_Guide

submitted by /u/max_rez
[link] [comments]
❌
❌