ciao-lang/ciao

ISO core standard compatibility of Ciao WASM

Jean-Luc-Picard-2021 opened this issue · 3 comments

Now I bumped my head:

  • (div)/2 is missing
  • current_prolog_flag/2 is missing
  • What else?

For the later I get:

?- current_prolog_flag(version, X).
WARNING: Predicate current_prolog_flag/2 undefined in module ciaowasm
{ERROR: No handle found for thrown exception 
error(existence_error(procedure,'ciaowasm:current_prolog_flag'/2),
'ciaowasm:current_prolog_flag'/2)}

Although "version" is not some standard flag, but current_prolog_flag/2 is
ISO core standard, isn't it? How do I obtain the version of the Ciao WASM
I am using. "version", "dialect" and "version_data" Prolog flags are

meanwhile widespread. Is there some equivalent to obtain similar data
in Ciao Prolog. Maybe this can be mapped to ISO core standard
current_prolog_flag/2 built-in predicate?

jfmc commented

Somehow the predicates to access prolog flags is not imported in the toplevel by default.
It can be done with:

?- use_module(engine(runtime_control)).

We'll fix that as soon as possible. Then you can use version, dialect, and version_data:

?- current_prolog_flag(version_data,X), writeq(X), nl.
ciao(1,21,0,commit_info('',ea466db6e04b0813271351c6c134ab96ff31d5da,'2022-07-05 00:13:44 +0200','1.21.0'))

Note that atoms are still not quoted properly in the output. We'll fix that soon too.

I am not sure if there is any widespread or standard way of asking the current architecture and operating system. We do it in Ciao in this way:

?- use_module(engine(system_info)).
?- get_os(OS).
?- get_arch(Arch).

(note again that atoms are not quoted properly in the output).

Many ISO compatibility bugs (mostly identified by Paulo Moura) has been in the bug queue for a long time and we plan to fix them soon too. Feedback on most urgent issues is really appreciated.

Don't worry. Especially when issues land on GitHub, they
can queue for years. Its rather a curse than a cure.

Some statistics:

  • PyPy, had recently 666 open tickets.
  • Scryer Prolog, has a wooping 234 open tickets
  • Dogelog has zero open tickes, I stopped using GitHub
    in favor of a better life work balance, I am trying to
    use an issueless approach.

I cannot describe the issueless approach exactly. Maybe
it doesn't work for existing systems that are already large.

jfmc commented

I'm closing this issue. 307815b should fixes everything except div/2 (#35)