# SWI Prolog ABI versions

**URL:** <https://swi-prolog.discourse.group/t/swi-prolog-abi-versions/2254>\
**Category:** General\
**Created:** [April 30, 2020, 6:03pm UTC](https://swi-prolog.discourse.group/t/swi-prolog-abi-versions/2254 "2020-04-30T18:03:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![swi](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@swi](https://swi-prolog.discourse.group/u/swi)\
**Post date:** [April 30, 2020, 6:03pm UTC](https://swi-prolog.discourse.group/t/swi-prolog-abi-versions/2254/1 "2020-04-30T18:03:49Z")

</div>

Hi Jan,

I just noticed you added the `PL_version()` foreign interface function to get information about the abi versions, as well as the `--abi_version` command line option to get the same information.

Just a couple of suggestions (since I know you are ready to make the stable version)

1. Could you also provide a prolog predicate (or maybe prolog flags) to return the ABI versions? This will allow access to ABI versions from within prolog.

2. Perhaps the command line option `--abi_version` should be renamed to `--abi-version` to be consistent with other command line options which use `-` as the word separator (such as `--dump-runtime-variables`

Thanks for all the good work you do!

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [April 30, 2020, 7:07pm UTC](https://swi-prolog.discourse.group/t/swi-prolog-abi-versions/2254/2 "2020-04-30T19:07:14Z")

</div>

> [@swi](#):
>
> Could you also provide a prolog predicate (or maybe prolog flags) to return the ABI versions?

Thought about that, but I’m not really sure what the use case is, so for now I thought to wait and see until someone comes up with a use case.

> [@swi](#):
>
> `--abi-version`

Not sure. It is already inconsistent. There is also --stack\_limit and --stand\_alone, etc. Some of this is because they map directly to Prolog constants and these are typically written using an underscore. Possibly option names should handle - and \_ as equivalent?

---

<div class="post-metadata">

**Author:** ![swi](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@swi](https://swi-prolog.discourse.group/u/swi)\
**Post date:** [April 30, 2020, 9:31pm UTC](https://swi-prolog.discourse.group/t/swi-prolog-abi-versions/2254/3 "2020-04-30T21:31:49Z")

</div>

> [@jan](#):
>
> Thought about that, but I’m not really sure what the use case is,

The idea is to manage releases of binary packs from within prolog itself, so we can control the generation of binary compatible packs (e.g. including `qlf` files and/or `.so` files) from a prolog program that is responsible for compiling and generating a binary pack release. The prolog program will then be able to start, if necessary, older versions of SWI-Prolog to provide an array of binary releases of packs.

There is another use case, but I can’t talk much about it. It involves generating binary compatible SWI-Prolog data structures directly from prolog (bypassing the C api, with the exception of some special basic foreign functions that allow direct memory writing/reading). This is, obviously, out of the realm for normal prolog programming.

> [@jan](#):
>
> Possibly option names should handle - and \_ as equivalent

That is a good idea, certainly will improve cli usability.

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [May 1, 2020, 2:20pm UTC](https://swi-prolog.discourse.group/t/swi-prolog-abi-versions/2254/4 "2020-05-01T14:20:37Z")

</div>

Thanks. Makes sense. Took care of both.

> [@swi](#):
>
> Prolog data structures directly from prolog

Guess you mean **C data structures**? How is that different from pack [ffi](https://www.swi-prolog.org/pack/list?p=ffi)? Unfortunately this pack stopped working for MacOS as they put a lot of C extensions in their header files (should still work if you do not rely much on the system headers).

---

<div class="post-metadata">

**Author:** ![swi](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@swi](https://swi-prolog.discourse.group/u/swi)\
**Post date:** [May 1, 2020, 4:40pm UTC](https://swi-prolog.discourse.group/t/swi-prolog-abi-versions/2254/5 "2020-05-01T16:40:47Z")

</div>

> [@jan](#):
>
> Guess you mean **C data structures**?

I actually meant SWI-Prolog raw data structures, but can’t talk about it much.

> [@jan](#):
>
> Took care of both.

Thanks!!
