Re: Even More Prolog Improvement Proposals (PIPs) [PIP301 - PIP303] (Was: More Prolog Improvement Proposals (PIPs) [PIP401 - PIP404])

Liste des GroupesRevenir à cl prolog 
Sujet : Re: Even More Prolog Improvement Proposals (PIPs) [PIP301 - PIP303] (Was: More Prolog Improvement Proposals (PIPs) [PIP401 - PIP404])
De : janburse (at) *nospam* fastmail.fm (Mild Shock)
Groupes : comp.lang.prolog
Date : 09. Oct 2024, 10:22:08
Autres entêtes
Message-ID : <ve5hvv$6l8q$1@solani.org>
References : 1 2 3 4 5 6
User-Agent : Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.19
Ok, Scryer Prolog calls it library(arithmetic).
I prefer library(math), since many other programming
languages have Math.random(). But if I remember
well Scryer Prolog has a separate library for
random numbers. The library(arithemtic) might
provide a popcount/2 predicate, but it doesn't
provide a popcount/2 evaluable function. I get this error:
?- ['gridn.p'].
    error(type_error(evaluable,popcount/1),load/1).
Thats a pitty, one more obstacle in portable Prolog code.
P.S.: I know it is hard to make evaluable functions
definable in modules or Prolog text more general.
Especially since executing a Prolog defined evaluable
functions can be non-trivial in terms of stack etc..,
since evaluable functions just like unification etc..
might use other stacks, and therefore mixing with
the Prolog stack can lead to bad performance, because
of some impedence mismatch. But there is a nice compromise,
for native libraries it might be easier to register
a new evaluable function.
Mild Shock schrieb:
And this one:
 PIP304: library(math)
Evaluable functions such as popcount/1, etc…
 The idea of a library(math) is brand new,
I first had it named library(random) and
then it got out of hands, exploded and
 had many bitwise operations.
 Mild Shock schrieb:
Also interesting development, there is something
like “Prologue to Prolog C”, where C possibly
stands for cryptography. So maybe a further PIP:
>
PIP301: library(crypto)
Predicates such as crypto_data_hash/3, etc…
>
PIP302: library(charsio)
Predicates such as open_memory_file/2, etc…
>
PIP303: library(format)
Predicates such as format/3, etc…
>
In the above I have also added charsio and format,
which is useful in many contexts. Some remark about
the 30x modules, they usually a more based on
>
additional native routines. This is unlike the 40x
modules, which can have a pure Prolog reference
implementation.
>
Mild Shock schrieb:
How about some of these PIPs:
>
PIP401: library(lists)
Provide predicates such as nth1/3, last/2, etc…
>
PIP402: library(sets)
Provide predicates such as union/3, subset/2, etc…
>
PIP403: library(sequence)
Provide predicates such as call_nth/2, limit/2, etc…
>
PIP404: library(aggregate)
Provide predicates such as aggregate_all/3, aggregate/3, etc…
>
There was once an effort Prolog Commons, which has
some overlap with the above PIPs:
>
The Prolog Commons Group - PART I - Library
https://prolog-commons.org/PrologCommons.html/part_library.html
>
But its more modularized than just a Prologue to Prolog,
which has a few list predicates and miscellaneous.
>
>
>
 

Date Sujet#  Auteur
28 Jul 24 * New milestone float formatting [LoL] (Was: Request for comments, Novacore the sequel to ISO modules)9Mild Shock
28 Jul 24 +* Re: New milestone float formatting [LoL] (Was: Request for comments, Novacore the sequel to ISO modules)4Mild Shock
28 Jul 24 i`* Re: New milestone float formatting [LoL] (Was: Request for comments, Novacore the sequel to ISO modules)3Mild Shock
24 Sep 24 i `* Re: Differences among the "bomb" and "xbetween" (Was: New milestone float formatting [LoL])2Mild Shock
26 Sep 24 i  `- New milestone time formatting (Was: Differences among the "bomb" and "xbetween")1Mild Shock
9 Oct 24 `* More Prolog Improvement Proposals (PIPs) [PIP401 - PIP404]4Mild Shock
9 Oct 24  `* Even More Prolog Improvement Proposals (PIPs) [PIP301 - PIP303] (Was: More Prolog Improvement Proposals (PIPs) [PIP401 - PIP404])3Mild Shock
9 Oct 24   `* Re: Even More Prolog Improvement Proposals (PIPs) [PIP301 - PIP303] (Was: More Prolog Improvement Proposals (PIPs) [PIP401 - PIP404])2Mild Shock
9 Oct 24    `- Re: Even More Prolog Improvement Proposals (PIPs) [PIP301 - PIP303] (Was: More Prolog Improvement Proposals (PIPs) [PIP401 - PIP404])1Mild Shock

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal