❌ About FreshRSS

Normal view

There are new articles available, click to refresh the page.
Before yesterdayAda Forum - Latest topics

Gnu Emacs ada-mode - passing the torch

4 November 2023 at 21:47

8.1.0 is my last release as Emacs ada-mode maintainer; it’s time for
me to retire.

I’m not using Ada for any serious projects (other than ada-mode
itself), my health is declining, and all my available energy is taken
by my darling baby grandaughter (FIXME: attach photo).

So I’m looking for someone to take over as maintainer. Ideally, this
would be someone employed by a company that values Ada and Emacs, but
anyone with sufficient interest, energy, and time can do the job.

I’ll be available to teach the new maintainer what they need to know.

If you are interested, contact me via the Emacs ada-mode mailing list
(Emacs Ada mode - Mailing Lists [Savannah]) or directly at
[email protected].

What’s involved in being ada-mode maintainer?

  • Wisitoken parser generator and runtime

    • All Ada (very small amount of C in the lexer wrapper)
      • 92 files, 18k statements
    • uses re2c lexer generator (generates C code)
    • generalized LR, error-correction, incremental
    • very complex Ada code
    • User grammar source file is parsed by a WisiToken parser
    • full test suite
      • 52 Ada files, 3492 statements
      • 45 grammar files
    • some documentation of algorithms
  • gnat-compiler package

    • elisp wrapper to call gnat tools in various ways
    • 3 elisp files, 1938 lines
  • gpr-query package

    • Provides project-wide cross reference for Ada
    • mix of elisp and Ada
      • 1 Ada file 211 statements, 1 elisp file 1075 lines
    • The Ada code is evolved from an old AdaCore utility
    • it uses gnatcoll packages to query a database built from .ali
      files produced by the GNAT compiler.
  • wisi indentation, face, navigation package

    • mix of Emacs lisp and Ada
      • 19 Ada files, 2592 statements
      • 8 elisp files, 7097 lines
    • interfaces to wisitoken parser in a separate process
    • Uses rules in the grammar, and the syntax tree produced by parser,
      to compute indentation, face, navigation.
    • tested by the ada-mode test suite
  • ada-mode package

    • Uses wisi, gnat-compiler
    • uses gpr-query or ada_language_server via eglot for cross-reference.
    • some Ada code to customize wisi computations
      • 15 Ada files generated by wisitoken
      • 15 Ada files, 2361 statements
      • 7 elisp files 4102 lines
    • ada_annex_p.wy grammar file derived from ARM Annex P. (3037 lines)
    • also supports ada_language server via eglot
  • gpr-mode package

    • for GNAT .gpr files
    • uses wisi, gnat-compiler
    • small amount of Ada code to customize wisi computations
    • gpr.wy grammar file derived from gprbuild user guide.
  • wisitoken-grammar-mode

    • for .wy files
    • uses wisi
    • grammar file derived from that used to generate WisiToken grammar
      source file parser
  • ada-ref-man package

    • Provides info version of Ada Reference Manual as an ELPA package
    • Has Ada code that adds info capability to the official ARM formatting program

There could be one maintainer for all of the above, or several to
share the work as they see fit.

I’ve had a lot of fun maintaining ada-mode over the years (I’ve lost
track of when I started; sometime around 1995?). While I was working
at NASA writing Ada for dynamic simulators, it was very nice to be
able to just fix ada-mode to do what I wanted. Adding error correction
and incremental parsing to the parser was very challenging, and very
satisfying when it worked. The occasional thanks from users is also
very satisfying.

There are several paths forward for a new maintainer:

  1. Learn all the current code, and maintain it.

  2. Drop the wisitoken parser generator and runtime, use tree-sitter
    instead. This requires writing a wrapper for tree-sitter to match
    the wisitoken syntax-tree API; then the current wisi indentation
    code can be used.

    This maintains all of the ada-mode features, while reducing the
    maintenance burden significantly.

    I believe the tree-sitter error correction is less powerful than
    wisitoken, but it would be interesting to see if that matters in

  3. Drop everything except the grammar; use tree-sitter parser and
    emacs tree-sitter queries for indentation, face, navigation.

    It will not be possible to match the current ada-mode indentation
    styles, and some ada-mode features will be lost. Even more
    maintenance burden reduction.

  4. Just use eglot and AdaCore ada_language_server.

    Even larger deviation from current styles, even more features lost.
    But could work with AdaCore to improve things; that would also
    improve GNAT Studio.

If you are interested in handling all or part of this work, contact me
via the Emacs ada-mode mailing list
(Emacs Ada mode - Mailing Lists [Savannah]) or directly at
[email protected].

3 posts - 3 participants

Read full topic

Gnu Emacs Ada mode 8.1.0 released

27 October 2023 at 15:46

Gnu Emacs Ada mode 8.1.0 is now available in GNU ELPA.

wisi-incremental-parse-enable is now t by default; incremental parse
is always better than partial parse, except in really huge files.

The Ada grammar used by ada-mode is now compatible with tree-sitter; a
tree-sitter grammar source file is produced by the generate step.

ada-mode is tested with gnat 13 (current compiler in Alire).

gpr-query and gpr-mode are separate GNU ELPA packages. You must
install them separately (Emacs install-package doesn’t support
“recommended packages” like Debian does).

The required Ada code requires a manual compile step, after the normal
list-packages installation:

cd ~/.emacs.d/elpa/ada-mode-*

If you have Alire installed, these scripts use it.

1 post - 1 participant

Read full topic

Gnu Emacs Ada mode 8.0.4 released

25 January 2023 at 13:33

Gnu Emacs Ada mode 8.0.4 is now available in GNU ELPA.

All Ada mode executables can now be built with Alire
(https://alire.ada.dev/); this greatly simplifies that process.

gpr-query and gpr-mode are split out into separate GNU ELPA packages.
You must install them separately (Emacs install-package doesn’t
support “recommended packages” like Debian does).

Ada mode can now be used with Eglot; this is controlled by new variables:

ada-diagnostics-backend - one of wisi, eglot, none

ada-face-backend - one of wisi, eglot, none

ada-indent-backend - one of wisi, eglot, none

ada-statement-backend - one of wisi, eglot, none

ada-xref-backend - one of gnat, gpr_query, eglot, none

The diagnostic, face, indent, and statement backends default to wisi
if the wisi parser is found in PATH, to eglot if the Ada LSP server is
found, and none otherwise. The xref backend defaults to gpr_query if
the gpr_query executable in PATH, to gnat otherwise.

ada-diagnostics-backend controls the source of compilation error
messages while editing.

ada-statement-backend controls statement motion; forward-sexp,
wisi-goto-statement-end, etc. ada-xref-backend controls
wisi-goto-spec/body and Emacs xref commands.

In addition, name completion is provided by eglot if any of the other
backends are using eglot; eglot completion is always better than wisi.

The current AdaCore language server (version 23) supports face but not
indent. The current version of eglot (1.10) does not support face. The
Language Server Protocol does not support statment motion. So for now,
eglot + ada_language_server only provides xref and completion.

The AdaCore language server ada_language_server is installed with
GNATStudio (which ada-mode will find by default), or can be built with
Alire. If you build it with Alire, either put it in PATH, or set

I have not tested ada-mode with lsp-mode. You can set ada-*-backend to
'other to expermiment with that, or tree-sitter, or some other
backend. tree-sitter will be fully supported in the next ada-mode

The required Ada code requires a manual compile step, after the normal
list-packages installation:

cd ~/.emacs.d/elpa/ada-mode-7.3beta*

If you have Alire installed, these scripts use it.

23 posts - 6 participants

Read full topic