Hacker News new | ask | show | jobs
by csb6 2060 days ago
This seems useful. One thing Ada has been lacking is a central place to upload and use dependencies.

However, I’ve found that pure Ada code without a package manager is pretty easy to integrate using the gprbuild tool; you just copy the dependency’s .ads and .adb files into your project and add their enclosing folder to the list of source directories. gprbuild figures our how to build them pretty much automatically.

So I wish that instead of using TOML files, the dependencies would be specified in the gprbuild project files themselves. The syntax/options of GPR files would probably have to be extended, but it would be nice to have only one layer of config files that contains everything needed to build an Ada library/project.

4 comments

> So I wish that instead of using TOML files, the dependencies would be specified in the gprbuild project files themselves. The syntax/options of GPR files would probably have to be extended, but it would be nice to have only one layer of config files that contains everything needed to build an Ada library/project.

There are several problems with GPR. The first is that it's GNAT-only and no other compiler would recognize it. The second is more technical: GPR is more "stringly-typed" than it ought to be, and thus despite a somewhat Ada-like syntax it isn't nearly as nice as Ada-source.

I've been mulling the idea of leveraging Ada's generic-system for a method to use as a Project specification/definition -- if you could have an Ada generic as a project-file, then you could [re]use the compiler/syntax-checker... I've also sketched out a way that Generic-parameters could be used by a project-builder program, generating an appropriate menu.

I agree, put it all in GPR files, no more makefiles, bash scripts. I'd go even further, make project extensions able to define build variables, so I have no more to type -X options...

And with the GPR handling libraries and Libadalang there's already so much you can do...

Another options would be to only have the TOML files and generate gprbuild file on the fly. I think that is something we will consider.
How do you deal with versioning, etc?
GPR project files are just a kind of config file. Their syntax is different than TOML files, but they could easily be given the capability to list dependencies and versions.