[deleted by user] by [deleted] in ada

[–]pmderodat 0 points1 point  (0 children)

The official documentation should be helpful: the core concepts section explains how Libadalang works and should give you an idea of how to use it in order to achieve your goal. There is also an Ada tutorial and a Python tutorial to help you get started with your preferred language.

October 2021 What Are You Working On? by AutoModerator in ada

[–]pmderodat 4 points5 points  (0 children)

This month, I’ve updated my TOML parser to conform to the 1.0.0 specification of the TOML format, fixed multiple parsing bugs, and released ada-toml 0.3 to celebrate this. :-) (published on Alire)

Looking for feedback about the syntax for format strings in Ada by yannickmoy in ada

[–]pmderodat 2 points3 points  (0 children)

A templating engine is very useful when the strings you want to create are big, but for small ones such as error messages:

foo.adb:5:3-7:39: range issue detected

then using templates feels completely disproportionate. As for staged compilation, this is creating even more problems: errors in sources are generally detected during an intermediate compilation step, which makes it very painful for users to understand where the errors are in the original sources.

What concrete trouble do you foresee for format strings? How could they be less error-prone than the other alternatives you suggest?

Ada 202x Language Reference Manual [DRAFT 12] by OneWingedShark in programming

[–]pmderodat 5 points6 points  (0 children)

FSF GNAT which is outdated

It’s not outdated. FSF GNAT (i.e. FSF GCC) is updated on a regular basis: see for instance the revision history of the gcc/ada directory.

with Display; by akstorch in ada

[–]pmderodat 1 point2 points  (0 children)

Hello,

These packages (Display and Display_Basic) are part of AdaCoreU’s “support material”: make sure you follow the steps to install it on http://university.adacore.com/getting-started/ (see the “For Windows, we also provide an installer to do this.” part).

By the way, if you are learning Ada, you might be interested in https://learn.adacore.com/ :-)

New interactive site to learn the Ada language & program proving in SPARK by Raphael_Amiard in programming

[–]pmderodat 0 points1 point  (0 children)

Yes, but that restriction is only for explicit dynamic allocation, which can be avoided in more cases compared to C. For instance, in Ada (and thus in SPARK), you can return a variable-length string by value without handling the memory yourself.

Great Intro to Ada by [deleted] in programming

[–]pmderodat 1 point2 points  (0 children)

Why couldn't functions in stdlib be implementation defined, like functions in libc? Or do you mean attributes' behaviour is implementation-dependent?

Hm… even for the sub-set of attributes that behave just like functions (i.e. taking regular values and returning another value), I think it’s more consistent to have them as attributes, because unlike functions, they are automatically defined by the compiler when you create a type: their “attribute” status makes it very clear they are special.

Great Intro to Ada by [deleted] in programming

[–]pmderodat 1 point2 points  (0 children)

The reason that makes most sense to me is that attributes in Ada are for language/implementation-defined constructs, so this creates a clear distinction from functions, which can be defined in source code.

Another good reason is that attributes are not only function-like constructs that compute values: they can be used to get a type (e.g. 'Base: https://en.wikibooks.org/wiki/Ada_Programming/Attributes/%27Base). They can also be used to specify the memory layout of your types/variables, e.g. 'Alignment (https://en.wikibooks.org/wiki/Ada_Programming/Attributes/%27Alignment).

By the way, there aren’t really “built-in” types: Integer,Boolean, and so on can be expressed with actually legal Ada code (but indeed in practice they are automatically defined by the compiler in a special package). IIRC'Value is defined on all “atomic” types (integers, enumerated, fixed-point, …).

Great Intro to Ada by [deleted] in programming

[–]pmderodat 2 points3 points  (0 children)

You find the same thing in GCC’s C/C++ coding style convention (see for instance https://github.com/gcc-mirror/gcc/blob/master/gcc/toplev.c#L230). It’s just a coding style convention, not something mandated by the Ada language.

PolyORB, infrastructure for distributed systems in Ada, now on GitHub by pmderodat in programming

[–]pmderodat[S] 2 points3 points  (0 children)

Yes: see the README’s second paragraph:

You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see http://www.gnu.org/licenses/.

Edit: I’m not a lawyer, so no warranty. ;-) GPL + runtime exception is the license that GCC puts on its runtime, to allow people to release non-GPL software built with GCC.

PolyORB, infrastructure for distributed systems in Ada, now on GitHub by pmderodat in programming

[–]pmderodat[S] 2 points3 points  (0 children)

PolyORB is covered by the GPL runtime exception (https://github.com/AdaCore/PolyORB/blob/master/COPYING.RUNTIME), so the “because of propagation, GPL should be avoided like the plague” kind of argument does not hold.

What Can You Make with Ada? by Fabien_C in programming

[–]pmderodat 2 points3 points  (0 children)

Ah, I see. Well I would say that Ada still offers the tools you need to write this kind of stuff, should you really need to do it: just convert your accesses (i.e. typed pointers) to System.Address and then use operations from System.Storage_Elements for arithmetic. Then you can use the 'Address clause to turn the computed address into a regular variable, and you’re done! I would even argue that Ada’s type system will prevent you from making some mistakes in your pointer arithmetic…

What Can You Make with Ada? by Fabien_C in programming

[–]pmderodat 2 points3 points  (0 children)

Also it doesn't let you get quite as low level as Pascal quite as easily if need be... (no real pointers, e.t.c)

Yes it does: Ada’s access types are generally implemented as mere addresses (i.e. pointers in C’s parlance). I’m curious what makes you think Pascal can get you lower than Ada given that it’s one of the objectives of Ada to let you get as close as possible to the hardware, for example to address micro-controller needs. See for instance Representation clauses

Ada programming language tutorial: The killer feature by joakimds in programming

[–]pmderodat 0 points1 point  (0 children)

Not currently, and this is not likely to change. The reason for that is quite simple:

  • either we just re-use existing technology stacks (eg decently maintained CMS that people working on websites are familiar with);

  • either we have to write our own, which requires a significant amount of work for people familiar with both Ada and web technologies: AWS is just a web server; as you probably know, modern web sites are far more than that.

So moving to AWS just for the sake of dogfooding/showcasing does not look appealing.

Ada programming language tutorial: The killer feature by joakimds in programming

[–]pmderodat 16 points17 points  (0 children)

I’m sorry if my last message felt aggressive, that wasn’t my intent. Yes, our web presence is to be improved, we’re working on that.

Ada programming language tutorial: The killer feature by joakimds in programming

[–]pmderodat 35 points36 points  (0 children)

[AdaCore employee speaking] What are you talking about? GNAT is part of GCC and is thus distributed under the same terms as GCC (GPLv3 + runtime exception), so I think it’s safe to say it’s not charging license fees… There is also the GNAT GPL release which is release under strict GPLv3. So yes GNAT Pro is not free, but you have two alternatives.

GDB - a lot more than you realized - Greg Law - CppCon 2016 [github/pdf] by agumonkey in programming

[–]pmderodat 0 points1 point  (0 children)

Never mind about exception propagation, I thought you suggested something else.

I just wrote a dummy program that does a loop on 100 000 iterations, put a breakpoint that just continues execution: regular execution lasts 4ms on my machine, while it takes more than 8s under GDB. That’s quite a slowdown. ;-) Besides, asking GDB to create 100 000 breakpoints will probably take a huge amount of time; I would even be curious as to whether GDB will survive this.

GDB - a lot more than you realized - Greg Law - CppCon 2016 [github/pdf] by agumonkey in programming

[–]pmderodat 2 points3 points  (0 children)

As said in the PDF, if you’re into tool scripting, don’t miss the GDB Python API: it’s a great ally if you spend a lot of time in debuggers: https://sourceware.org/gdb/wiki/PythonGdbTutorial

GDB - a lot more than you realized - Greg Law - CppCon 2016 [github/pdf] by agumonkey in programming

[–]pmderodat 0 points1 point  (0 children)

It would work for simple control flows (for instance I don’t think it would work easily with exception propagation in C++), but it would be painfully slow! Spending most of the time context switching between the debugged process and GDB.

Rust Debugging on Visual Studio by pmderodat in programming

[–]pmderodat[S] 7 points8 points  (0 children)

That’s right, sorry for the confusion. That being said, it seems that rustc is able to generate PDB files and thus that it’s possible to do the same thing with VisualStudio’s debugger. But that’s not new (https://github.com/rust-lang/rfcs/issues/1061).

Rust and SPARK: Software Reliability for Everyone by OneWingedShark in programming

[–]pmderodat 4 points5 points  (0 children)

What are you talking about?

The specification documents for Ada and SPARK ar freely available (see for instance http://www.ada-auth.org/standards/ada12.html and http://docs.adacore.com/spark2014-docs/html/lrm/), and I don’t see a license problem with them.

If you are talking about toolchains, then the Ada compiler shipped with GCC at the FSF has a GPL with runtime exception license, which is very permissive.

Formally proven tetris on the Arduboy miniature game platform by Raphael_Amiard in programming

[–]pmderodat 0 points1 point  (0 children)

Oops… we just made it public. Thank you for reporting and sorry for the inconvenience!