❌ About FreshRSS

Normal view

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

AArch64 cross toolchain

By: Max
9 December 2023 at 10:42

The community has long expressed interest in supporting Ada on ARM64 and Apple Silicon platforms. Unfortunately, GitHub Action Runners are not available for ARM for open-source projects. The publication of the Ada extension for VS Code (as well as Alire) relies on GitHub Actions, limiting ARM support. However, it turns out that creating an ARM version is still possible, and I’d like to share my experience with using cross-compilers for this purpose.

Through the actions described below, I managed to obtain two cross-compilers for the aarch64 CPU (running on x86_64), one for Linux and the other for macOS. These proved sufficient to build ALS and VSCode extensions for these platforms.

I began by building the Ada Language Server version for ARM64/Linux since this platform is more familiar to me. Ubuntu provides cross-versions of dependencies for GNAT (glibc, binutils). Ubuntu even has GNAT GCC 13, but on newer versions than the one (20.04) we use for ALS building. The first thing I did was attempt to rebuild GCC 13 on Ubuntu 20.04 from the source package of the latest Ubuntu distribution (23.10). Although this might be the most correct method from a reuse perspective, it didn’t suit me - too many packages and installation steps.

Building GNAT from the GCC 13 source texts proved much simpler. The resulting script was just a dozen lines long.

If you unpack the resulting archive in /, gprbuild finds the cross-compiler and using it subsequently is straightforward: you just need to specify the option --target=aarch64-linux.

Mac OS also provides cross-versions of binutils and libc, which come with the standard installation of Xcode Command Line Tools. For example, /usr/bin/as can create object files for both x86_64 and aarch64, depending on the --target. Therefore, we only need to build GNAT using the GCC sources from the repository iains/gcc-13-branch.

If you need binaries for these cross-compilers or have ideas on how to use them, please leave a comment in this thread.

PS Thanks to Simon Wright for experimenting with Mac OS and providing advices.

2 posts - 2 participants

Read full topic

Ada VS Code extension 24.0.3

πŸŽ‰ We have just published new vscode extension version 24.0.3 🎁 with experimental Mac OS M1 πŸ’» native support! Don't hesitate sharing the feedback! Does it work for you? I hope

for Target use "aarch64-darwin"; 

isn't needed any more for native compiler (despite README says this). Also Linux ARM64 native support was added in 24.0.2, which wasn't published on Marketplace (but it's available on open vsx), so you can try it with remote mode is you have ARM64 server ⌨.

24.0.2 and 24.0.3 have many other improvements. Happy coding! πŸ”¨

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

New release of vscode extension For Ada 23.0.20

We just released a new version of the VS Code extension for Ada with several new features and bug fixes:

​

  • Add onTypeFormatting request initial implementation. To try edit settings.json with:

​

 "[ada]": { "editor.formatOnType": true, }, "ada.onTypeFormatting.indentOnly": false, 
  • Fixes and improvements in syntax highlighting
    • Do not apply semantic tokens to unresolved identifiers
    • Highlight True and False like 'null
  • Fixes and improvements in hovers
  • Basic .gpr language support: document symbols and diagnostics
  • Support more architectures and platforms in VS Code
    • Change executable location to <arch>/<platform>/
    • Add arm64 as a supported architecture
    • Add initialization code that checks specific combinations of architectures and platforms (e.g. arm64-darwin is supported even though it actually uses the x64-darwin executable, will use x86_64 target by default however)
    • But no native ALS for arm64 is provided for now
  • Accept task bodies and packages for subprogram box command
  • Publish diagnostics when a refactoring fails.

Here is a screenshot of GPR editing:

https://preview.redd.it/hrrdvwztwkbb1.png?width=866&format=png&auto=webp&s=f0eeee475f2e1c0d0d881adbfd454cdccaad05b9

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

VSCode extension for AArch64 Linux

I've built Ada VSCode extension for AArch64 Linux. It could be used with VSCode in the remote mode. So you can launch VSCode on the PC and connect over SSH to your AArch64 Linux board/host where you have an Ada project, GNAT and have very pleasant development environment. Here it is:

https://github.com/reznikmm/als-alire-index/releases/tag/23.0.18

​

Any comments are welcome!

​

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

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]

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

❌
❌