• Streamable DOM and obsolete put_code/[1,2]

    From Mild Shock@21:1/5 to All on Wed Apr 2 11:51:20 2025
    Hi,

    The development of Novacore takes interesting turns.
    Originally more accidentially, because I observed it
    can serve a few interesting use cases, like atomic

    logging with some unspoken or spoken gurantees,
    I introduced put_atom/[1,2] in Novacore streams:

    put_atom(S, A):
    The built-in succeeds. As a side effect, it adds
    the atom to the stream S.

    Now because I am revising my streamable DOMs, the
    "HTML writer" part, I even went so far as to
    bootstrap put_code/[1,2] from it:

    put_code(Stream, Code) :-
    char_code(Atom, Code),
    put_atom(Stream, Atom).

    One can eliminate each put_code/[1,2] call such
    as put_code(S, 0'\n) by a put_atom/[1,2] call
    such as put_atom(S, '\n'). The performance is the

    same, in my case can be slighly better since under
    the hood put_code and put_atom called the same
    stream meachnism.

    But the main reason I eliminate put_code was
    to have a single point. Because the Prolog
    write_term/1 is 100% written in Prolog, in the

    end it only only uses put_atom.

    Bye

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mild Shock@21:1/5 to Mild Shock on Wed Apr 2 11:56:20 2025
    Hi,

    Streamable DOM in the form of a "HTML writer",
    can be a real miracle. SWI, Ciao, etc.. none
    of the Prolog systems have a "HTML writer",

    it seems the prospect of a HTMLParser inside such
    "HTML writer", and that it is a state machine
    confuses the world view of many people. But

    the idea was already pursued by Tau Prolog.
    Just take an element:

    <div id="writeme"></div>

    And then literally you only have to open it:

    :- use_module(library(dom)).

    output :-
    get_by_id(writeme, WriteMe),
    open(WriteMe, write, Stream),
    write(Stream, hello),
    write(Stream, world).

    But it didn't have much adoption, rather cause more
    problems than solved any:

    How getting all the sandbox output into html?
    joseph-vidal-rosset opened on Aug 2, 2022 https://github.com/tau-prolog/tau-prolog/issues/326

    I do not blame the Philosopher trying to be a
    Prolog programmer. It had not much utility since
    write/1 now accepted and inserted HTML.

    Bye

    Mild Shock schrieb:
    Hi,

    The development of Novacore takes interesting turns.
    Originally more accidentially, because I observed it
    can serve a few interesting use cases, like atomic

    logging with some unspoken or spoken gurantees,
    I introduced put_atom/[1,2] in Novacore streams:

    put_atom(S, A):
    The built-in succeeds. As a side effect, it adds
    the atom to the stream S.

    Now because I am revising my streamable DOMs, the
    "HTML writer" part, I even went so far as to
    bootstrap put_code/[1,2] from it:

    put_code(Stream, Code) :-
        char_code(Atom, Code),
        put_atom(Stream, Atom).

    One can eliminate each put_code/[1,2] call such
    as put_code(S, 0'\n) by a put_atom/[1,2] call
    such as put_atom(S, '\n'). The performance is the

    same, in my case can be slighly better since under
    the hood put_code and put_atom called the same
    stream meachnism.

    But the main reason I eliminate put_code was
    to have a single point. Because the Prolog
    write_term/1 is 100% written in Prolog, in the

    end it only only uses put_atom.

    Bye

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mild Shock@21:1/5 to Mild Shock on Wed Apr 2 12:03:51 2025
    Hi,

    But a "HTML Writer" as a statemachine shouldn't be a problem
    in the Prolog world. If you have a concept of engine,
    you can write a the HTMLParser as an ordinary parser,

    which yields to get its input:

    The HTMLParser service:

    /* some ordinary code that reads a stream
    and writes a stream, only the stream is
    read via the engine interface */

    parser_get_code(X) :-
    engine_fetch(X).

    The HTMLParser client:

    /* Basically the HTMLParser is used inverted.
    Just like in ordinary document.write() from
    the JavaScript world, one uses the parser as sink (sic!) */

    parser_put_code(ParserEngine, X) :-
    engine_post(ParserEngine, X).

    But from the above once can also develop statemachine,
    and eliminate the "engine", by modelling what happens
    between subsequent engine_fetch inside the ParserEngine,

    and have an inverted parser which doesn't need "engin",
    is pure Prolog code. An impurity can be the state changes,
    but you can delegate it to the DOM.

    But for streams you have always state changes, thats
    what streams do, they change the sink.

    Bye

    Mild Shock schrieb:
    Hi,

    Streamable DOM in the form of a "HTML writer",
    can be a real miracle. SWI, Ciao, etc.. none
    of the Prolog systems have a "HTML writer",

    it seems the prospect of a HTMLParser inside such
    "HTML writer", and that it is a state machine
    confuses the world view of many people. But

    the idea was already pursued by Tau Prolog.
    Just take an element:

    <div id="writeme"></div>

    And then literally you only have to open it:

    :- use_module(library(dom)).

    output :-
        get_by_id(writeme, WriteMe),
        open(WriteMe, write, Stream),
        write(Stream, hello),
        write(Stream, world).

    But it didn't have much adoption, rather cause more
    problems than solved any:

    How getting all the sandbox output into html?
    joseph-vidal-rosset opened on Aug 2, 2022 https://github.com/tau-prolog/tau-prolog/issues/326

    I do not blame the Philosopher trying to be a
    Prolog programmer. It had not much utility since
    write/1 now accepted and inserted HTML.

    Bye

    Mild Shock schrieb:
    Hi,

    The development of Novacore takes interesting turns.
    Originally more accidentially, because I observed it
    can serve a few interesting use cases, like atomic

    logging with some unspoken or spoken gurantees,
    I introduced put_atom/[1,2] in Novacore streams:

    put_atom(S, A):
    The built-in succeeds. As a side effect, it adds
    the atom to the stream S.

    Now because I am revising my streamable DOMs, the
    "HTML writer" part, I even went so far as to
    bootstrap put_code/[1,2] from it:

    put_code(Stream, Code) :-
    ;    char_code(Atom, Code),
    ;    put_atom(Stream, Atom).

    One can eliminate each put_code/[1,2] call such
    as put_code(S, 0'\n) by a put_atom/[1,2] call
    such as put_atom(S, '\n'). The performance is the

    same, in my case can be slighly better since under
    the hood put_code and put_atom called the same
    stream meachnism.

    But the main reason I eliminate put_code was
    to have a single point. Because the Prolog
    write_term/1 is 100% written in Prolog, in the

    end it only only uses put_atom.

    Bye


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mild Shock@21:1/5 to Mild Shock on Sat Apr 5 18:33:43 2025
    Hi,

    During my quick brainstorming on SWI-Prolog
    discourse concerning my library(markup) I worte:

    Disclaimer: I didn’t look into Trealla, Scryer
    or Ciao, what they support in this respect.
    I only had a look at SWISH and their concept of
    answer substitutions filters. I find this too
    restrictive, already the library(turtle) cannot
    be done in this setting.

    So my subc-consciousness told me there is nothing
    useful to expect from Trealla, Scryer or Ciao.
    Since they are total web virgins, probably never

    seen a DOM API and/or never generated production
    webpages. For example this could be abused, not
    something that should be promoted:

    document.write(`<p>Sudoku solver returns:</p><pre>${result}</pre>`);

    https://github.com/mthom/scryer-prolog?tab=readme-ov-file#building-webassembly

    Not only is the document.write() method deprecated.
    The document.write() method directly injects HTML
    into the page. This leads to XSS vulnerability:

    During the second half of 2007, XSSed documented
    11,253 site-specific cross-site vulnerabilities,
    compared to 2,134 "traditional" vulnerabilities
    documented by Symantec. XSS effects vary in range from
    petty nuisance to significant security risk, depending
    on the sensitivity of the data handled by the vulnerable
    site and the nature of any security mitigation
    implemented by the site's owner network. https://en.wikipedia.org/wiki/Cross-site_scripting

    Bye

    Mild Shock schrieb:
    Hi,

    But a "HTML Writer" as a statemachine shouldn't be a problem
    in the Prolog world. If you have a concept of engine,
    you can write a the HTMLParser as an ordinary parser,

    which yields to get its input:

    The HTMLParser service:

    /* some ordinary code that reads a stream
    and writes a stream, only the stream is
    read via the engine interface */

    parser_get_code(X) :-
       engine_fetch(X).

    The HTMLParser client:

    /* Basically the HTMLParser is used inverted.
      Just like in ordinary document.write() from
      the JavaScript world, one uses the parser as sink (sic!) */

    parser_put_code(ParserEngine, X) :-
       engine_post(ParserEngine, X).

    But from the above once can also develop statemachine,
    and eliminate the "engine", by modelling what happens
    between subsequent engine_fetch inside the ParserEngine,

    and have an inverted parser which doesn't need "engin",
    is pure Prolog code. An impurity can be the state changes,
    but you can delegate it to the DOM.

    But for streams you have always state changes, thats
    what streams do, they change the sink.

    Bye

    Mild Shock schrieb:
    Hi,

    Streamable DOM in the form of a "HTML writer",
    can be a real miracle. SWI, Ciao, etc.. none
    of the Prolog systems have a "HTML writer",

    it seems the prospect of a HTMLParser inside such
    "HTML writer", and that it is a state machine
    confuses the world view of many people. But

    the idea was already pursued by Tau Prolog.
    Just take an element:

    <div id="writeme"></div>

    And then literally you only have to open it:

    :- use_module(library(dom)).
    ;
    ;output :-
    ;    get_by_id(writeme, WriteMe),
    ;    open(WriteMe, write, Stream),
    ;    write(Stream, hello),
    ;    write(Stream, world).

    But it didn't have much adoption, rather cause more
    problems than solved any:

    How getting all the sandbox output into html?
    joseph-vidal-rosset opened on Aug 2, 2022
    https://github.com/tau-prolog/tau-prolog/issues/326

    I do not blame the Philosopher trying to be a
    Prolog programmer. It had not much utility since
    write/1 now accepted and inserted HTML.

    Bye

    Mild Shock schrieb:
    Hi,

    The development of Novacore takes interesting turns.
    Originally more accidentially, because I observed it
    can serve a few interesting use cases, like atomic

    logging with some unspoken or spoken gurantees,
    I introduced put_atom/[1,2] in Novacore streams:

    put_atom(S, A):
    The built-in succeeds. As a side effect, it adds
    the atom to the stream S.

    Now because I am revising my streamable DOMs, the
    "HTML writer" part, I even went so far as to
    bootstrap put_code/[1,2] from it:

    put_code(Stream, Code) :-
    ;    char_code(Atom, Code),
    ;    put_atom(Stream, Atom).

    One can eliminate each put_code/[1,2] call such
    as put_code(S, 0'\n) by a put_atom/[1,2] call
    such as put_atom(S, '\n'). The performance is the

    same, in my case can be slighly better since under
    the hood put_code and put_atom called the same
    stream meachnism.

    But the main reason I eliminate put_code was
    to have a single point. Because the Prolog
    write_term/1 is 100% written in Prolog, in the

    end it only only uses put_atom.

    Bye



    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mild Shock@21:1/5 to Mild Shock on Sat Apr 5 19:00:11 2025
    Hi,

    So there is something in the making concerning
    DOM Streaming, respectively HTML Writers, what Mozilla
    calls: Trusted HTML Sinks. It this document:

    Editor’s Draf, 10 January 2025 - Trusted Types https://w3c.github.io/trusted-types/dist/spec/

    Nowadays one is practically forced to abandon document.write().
    There are two behaviours. For example executing this on
    an a website via the JavaScript developer console:

    let result = '<script> alert("XSS"); </script>';
    document.write(`<p>Sudoku solver returns:</p><pre>${result}</pre>`);

    Gives a nice little XSS action:

    <Alert Dialog Shown>

    Then if I try the same on the Google search page I get:

    VM305:1 This document requires 'TrustedHTML' assignment.
    (anonymous) @ VM305:1
    VM305:1 Uncaught TypeError: Failed to execute 'write' on 'Document':
    This document requires 'TrustedHTML' assignment.
    at <anonymous>:1:10
    (anonymous) @ VM305:1

    Bye

    Mild Shock schrieb:
    Hi,

    During my quick brainstorming on SWI-Prolog
    discourse concerning my library(markup) I worte:

    Disclaimer: I didn’t look into Trealla, Scryer
    or Ciao, what they support in this respect.
    I only had a look at SWISH and their concept of
    answer substitutions filters. I find this too
    restrictive, already the library(turtle) cannot
    be done in this setting.

    So my subc-consciousness told me there is nothing
    useful to expect from Trealla, Scryer or Ciao.
    Since they are total web virgins, probably never

    seen a DOM API and/or never generated production
    webpages. For example this could be abused, not
    something that should be promoted:

    document.write(`<p>Sudoku solver returns:</p><pre>${result}</pre>`);

    https://github.com/mthom/scryer-prolog?tab=readme-ov-file#building-webassembly


    Not only is the document.write() method deprecated.
    The document.write() method directly injects HTML
    into the page. This leads to XSS vulnerability:

    During the second half of 2007, XSSed documented
    11,253 site-specific cross-site vulnerabilities,
    compared to 2,134 "traditional" vulnerabilities
    documented by Symantec. XSS effects vary in range from
    petty nuisance to significant security risk, depending
    on the sensitivity of the data handled by the vulnerable
    site and the nature of any security mitigation
    implemented by the site's owner network. https://en.wikipedia.org/wiki/Cross-site_scripting

    Bye

    Mild Shock schrieb:
    Hi,

    But a "HTML Writer" as a statemachine shouldn't be a problem
    in the Prolog world. If you have a concept of engine,
    you can write a the HTMLParser as an ordinary parser,

    which yields to get its input:

    The HTMLParser service:

    /* some ordinary code that reads a stream
    and writes a stream, only the stream is
    read via the engine interface */

    parser_get_code(X) :-
        engine_fetch(X).

    The HTMLParser client:

    /* Basically the HTMLParser is used inverted.
       Just like in ordinary document.write() from
       the JavaScript world, one uses the parser as sink (sic!) */

    parser_put_code(ParserEngine, X) :-
        engine_post(ParserEngine, X).

    But from the above once can also develop statemachine,
    and eliminate the "engine", by modelling what happens
    between subsequent engine_fetch inside the ParserEngine,

    and have an inverted parser which doesn't need "engin",
    is pure Prolog code. An impurity can be the state changes,
    but you can delegate it to the DOM.

    But for streams you have always state changes, thats
    what streams do, they change the sink.

    Bye

    Mild Shock schrieb:
    Hi,

    Streamable DOM in the form of a "HTML writer",
    can be a real miracle. SWI, Ciao, etc.. none
    of the Prolog systems have a "HTML writer",

    it seems the prospect of a HTMLParser inside such
    "HTML writer", and that it is a state machine
    confuses the world view of many people. But

    the idea was already pursued by Tau Prolog.
    Just take an element:

    <div id="writeme"></div>

    And then literally you only have to open it:

    :- use_module(library(dom)).
    ;
    ;output :-
    ;    get_by_id(writeme, WriteMe),
    ;    open(WriteMe, write, Stream),
    ;    write(Stream, hello),
    ;    write(Stream, world).

    But it didn't have much adoption, rather cause more
    problems than solved any:

    How getting all the sandbox output into html?
    joseph-vidal-rosset opened on Aug 2, 2022
    https://github.com/tau-prolog/tau-prolog/issues/326

    I do not blame the Philosopher trying to be a
    Prolog programmer. It had not much utility since
    write/1 now accepted and inserted HTML.

    Bye

    Mild Shock schrieb:
    Hi,

    The development of Novacore takes interesting turns.
    Originally more accidentially, because I observed it
    can serve a few interesting use cases, like atomic

    logging with some unspoken or spoken gurantees,
    I introduced put_atom/[1,2] in Novacore streams:

    put_atom(S, A):
    The built-in succeeds. As a side effect, it adds
    the atom to the stream S.

    Now because I am revising my streamable DOMs, the
    "HTML writer" part, I even went so far as to
    bootstrap put_code/[1,2] from it:

    put_code(Stream, Code) :-
    ;    char_code(Atom, Code),
    ;    put_atom(Stream, Atom).

    One can eliminate each put_code/[1,2] call such
    as put_code(S, 0'\n) by a put_atom/[1,2] call
    such as put_atom(S, '\n'). The performance is the

    same, in my case can be slighly better since under
    the hood put_code and put_atom called the same
    stream meachnism.

    But the main reason I eliminate put_code was
    to have a single point. Because the Prolog
    write_term/1 is 100% written in Prolog, in the

    end it only only uses put_atom.

    Bye




    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mild Shock@21:1/5 to Mild Shock on Mon Apr 7 09:58:46 2025
    Hi,

    One of the dirty tricks, I use in the Dogelog Player
    backend for code generation. I do generate JavaScript,
    Python and Java code via write/[1,2].

    How does it work. Here an example: Wanna write a BigInt
    from JavaScript, like for example 123n. No problem put
    it into an atom and use unquoted write:

    /* JavaScript Generator */
    ?- write('123n').
    123n

    Now there are some nasty things. Like for example
    this test case. Very interesting behaviour:

    /* Dogelog Player 1.3.2 */
    ?- write(- '123n').
    - 123n

    /* SWI-Prolog 9.3.22 */
    ?- write(- '123n').
    - 123n

    On the other hand:

    /* Trealla Prolog 2.67.27 */
    ?- write(- '123n'), nl.
    -123n

    /* Scryer Prolog 0.9.4 */
    ?- write(- '123n'), nl.
    -123n

    See the difference? A space inserted or not. Its quite
    some twilight zone, the behaviour of unquoted atoms.

    Bye

    Mild Shock schrieb:
    Hi,

    The development of Novacore takes interesting turns.
    Originally more accidentially, because I observed it
    can serve a few interesting use cases, like atomic

    logging with some unspoken or spoken gurantees,
    I introduced put_atom/[1,2] in Novacore streams:

    put_atom(S, A):
    The built-in succeeds. As a side effect, it adds
    the atom to the stream S.

    Now because I am revising my streamable DOMs, the
    "HTML writer" part, I even went so far as to
    bootstrap put_code/[1,2] from it:

    put_code(Stream, Code) :-
        char_code(Atom, Code),
        put_atom(Stream, Atom).

    One can eliminate each put_code/[1,2] call such
    as put_code(S, 0'\n) by a put_atom/[1,2] call
    such as put_atom(S, '\n'). The performance is the

    same, in my case can be slighly better since under
    the hood put_code and put_atom called the same
    stream meachnism.

    But the main reason I eliminate put_code was
    to have a single point. Because the Prolog
    write_term/1 is 100% written in Prolog, in the

    end it only only uses put_atom.

    Bye

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mild Shock@21:1/5 to Mild Shock on Sun May 25 13:48:37 2025
    Hi,

    It is time for the 2025 Prolog Awards.
    Are you excited yet?

    https://9gag.com/gag/aPAXyEP

    Here is the list:

    1. Place: Scryer Prolog, it uses rustyline,
    very convenient:

    app<tab> gives append
    a<tab><tab> cycles through letter a predicates
    length(foo) shows the matching braket in blue
    Etc..

    -1. Place: SWI-Prolog, has no line edit at all

    Bye


    Mild Shock schrieb:
    Hi,

    During my quick brainstorming on SWI-Prolog
    discourse concerning my library(markup) I worte:

    Disclaimer: I didn’t look into Trealla, Scryer
    or Ciao, what they support in this respect.
    I only had a look at SWISH and their concept of
    answer substitutions filters. I find this too
    restrictive, already the library(turtle) cannot
    be done in this setting.

    So my subc-consciousness told me there is nothing
    useful to expect from Trealla, Scryer or Ciao.
    Since they are total web virgins, probably never

    seen a DOM API and/or never generated production
    webpages. For example this could be abused, not
    something that should be promoted:

    document.write(`<p>Sudoku solver returns:</p><pre>${result}</pre>`);

    https://github.com/mthom/scryer-prolog?tab=readme-ov-file#building-webassembly


    Not only is the document.write() method deprecated.
    The document.write() method directly injects HTML
    into the page. This leads to XSS vulnerability:

    During the second half of 2007, XSSed documented
    11,253 site-specific cross-site vulnerabilities,
    compared to 2,134 "traditional" vulnerabilities
    documented by Symantec. XSS effects vary in range from
    petty nuisance to significant security risk, depending
    on the sensitivity of the data handled by the vulnerable
    site and the nature of any security mitigation
    implemented by the site's owner network. https://en.wikipedia.org/wiki/Cross-site_scripting

    Bye

    Mild Shock schrieb:
    Hi,

    But a "HTML Writer" as a statemachine shouldn't be a problem
    in the Prolog world. If you have a concept of engine,
    you can write a the HTMLParser as an ordinary parser,

    which yields to get its input:

    The HTMLParser service:

    /* some ordinary code that reads a stream
    and writes a stream, only the stream is
    read via the engine interface */

    parser_get_code(X) :-
        engine_fetch(X).

    The HTMLParser client:

    /* Basically the HTMLParser is used inverted.
       Just like in ordinary document.write() from
       the JavaScript world, one uses the parser as sink (sic!) */

    parser_put_code(ParserEngine, X) :-
        engine_post(ParserEngine, X).

    But from the above once can also develop statemachine,
    and eliminate the "engine", by modelling what happens
    between subsequent engine_fetch inside the ParserEngine,

    and have an inverted parser which doesn't need "engin",
    is pure Prolog code. An impurity can be the state changes,
    but you can delegate it to the DOM.

    But for streams you have always state changes, thats
    what streams do, they change the sink.

    Bye

    Mild Shock schrieb:
    Hi,

    Streamable DOM in the form of a "HTML writer",
    can be a real miracle. SWI, Ciao, etc.. none
    of the Prolog systems have a "HTML writer",

    it seems the prospect of a HTMLParser inside such
    "HTML writer", and that it is a state machine
    confuses the world view of many people. But

    the idea was already pursued by Tau Prolog.
    Just take an element:

    <div id="writeme"></div>

    And then literally you only have to open it:

    :- use_module(library(dom)).
    ;
    ;output :-
    ;    get_by_id(writeme, WriteMe),
    ;    open(WriteMe, write, Stream),
    ;    write(Stream, hello),
    ;    write(Stream, world).

    But it didn't have much adoption, rather cause more
    problems than solved any:

    How getting all the sandbox output into html?
    joseph-vidal-rosset opened on Aug 2, 2022
    https://github.com/tau-prolog/tau-prolog/issues/326

    I do not blame the Philosopher trying to be a
    Prolog programmer. It had not much utility since
    write/1 now accepted and inserted HTML.

    Bye

    Mild Shock schrieb:
    Hi,

    The development of Novacore takes interesting turns.
    Originally more accidentially, because I observed it
    can serve a few interesting use cases, like atomic

    logging with some unspoken or spoken gurantees,
    I introduced put_atom/[1,2] in Novacore streams:

    put_atom(S, A):
    The built-in succeeds. As a side effect, it adds
    the atom to the stream S.

    Now because I am revising my streamable DOMs, the
    "HTML writer" part, I even went so far as to
    bootstrap put_code/[1,2] from it:

    put_code(Stream, Code) :-
    ;    char_code(Atom, Code),
    ;    put_atom(Stream, Atom).

    One can eliminate each put_code/[1,2] call such
    as put_code(S, 0'\n) by a put_atom/[1,2] call
    such as put_atom(S, '\n'). The performance is the

    same, in my case can be slighly better since under
    the hood put_code and put_atom called the same
    stream meachnism.

    But the main reason I eliminate put_code was
    to have a single point. Because the Prolog
    write_term/1 is 100% written in Prolog, in the

    end it only only uses put_atom.

    Bye




    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mild Shock@21:1/5 to Mild Shock on Mon May 26 12:22:13 2025
    Hi,

    Interestingly Scryer Prolog does many things right.
    I find the following test case:

    /* Scryer Prolog 0.9.4-403 */
    ?- length(L,2), f(L) = R, S = [_A].
    L = [_B, _C],
    R = f([_B, _C]),
    S = [_A].

    While SWI-Prolog still makes the following error. The
    newly generated _A and _B are not checked whether they
    already appear in the answer elsewhere, causing a name clash:

    /* SWI-Prolog 9.3.22 */
    ?- length(L,2), f(L) = R, S = [_A].
    = [_A, _B],
    R = f([_A, _B]),
    S = [_A].

    Other Prolog systems that avoid the clash as well are
    Trealla Prolog, and since today Dogelog Player.

    Bye

    Mild Shock schrieb:
    Hi,

    It is time for the 2025 Prolog Awards.
    Are you excited yet?

    https://9gag.com/gag/aPAXyEP

    Here is the list:

    1. Place: Scryer Prolog, it uses rustyline,
    very convenient:

    app<tab>     gives append
    a<tab><tab>  cycles through letter a predicates
    length(foo)  shows the matching braket in blue
    Etc..

    -1. Place: SWI-Prolog, has no line edit at all

    Bye

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mild Shock@21:1/5 to Mild Shock on Mon May 26 12:31:40 2025
    Hi,

    But doing the obvious right, is only solid engineering,
    it doesn't lead to this advertisement:

    testbed for bleeding edge research in logic and constraint programming https://github.com/mthom/scryer-prolog

    Also I doubt that this leads to anywhere, since we
    live in a new era of subsymbolic AI and generative AI,
    mostlikely pushing the boundaries of some symbolic pipe

    dreams which have been anyway invalidated by computational
    complexity research, without offering something really
    innovative, i.e. only copy pasting SWI-Prolog including

    nonsense like libray(sgml) mostlikely leads to nowhere.

    Bye

    Mild Shock schrieb:
    Hi,

    Interestingly Scryer Prolog does many things right.
    I find the following test case:

    /* Scryer Prolog 0.9.4-403 */
    ?- length(L,2), f(L) = R, S = [_A].
    L = [_B, _C],
    R = f([_B, _C]),
    S = [_A].

    While SWI-Prolog still makes the following error. The
    newly generated _A and _B are not checked whether they
    already appear in the answer elsewhere, causing a name clash:

    /* SWI-Prolog 9.3.22 */
    ?- length(L,2), f(L) = R, S = [_A].
     = [_A, _B],
    R = f([_A, _B]),
    S = [_A].

    Other Prolog systems that avoid the clash as well are
    Trealla Prolog, and since today Dogelog Player.

    Bye

    Mild Shock schrieb:
    Hi,

    It is time for the 2025 Prolog Awards.
    Are you excited yet?

    https://9gag.com/gag/aPAXyEP

    Here is the list:

    1. Place: Scryer Prolog, it uses rustyline,
    very convenient:

    app<tab>     gives append
    a<tab><tab>  cycles through letter a predicates
    length(foo)  shows the matching braket in blue
    Etc..

    -1. Place: SWI-Prolog, has no line edit at all

    Bye


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mild Shock@21:1/5 to Mild Shock on Wed May 28 12:09:28 2025
    I retract my claim that Scryer Prolog has dethroned
    anything. Its still in a quite bad state.

    It also shows that generating annonymous variables,
    has also some use cases, where its not only an arbitrary
    feature but rather a necessity.

    Take this real world example, from a file case.pl:

    :- dynamic(sys_get_code_list/6).
    sys_get_code_list(-1, _, _, _, [], _) :- !.
    sys_get_code_list(H, H, _, _, [H], _) :- !.
    sys_get_code_list(H, _, 1, _, [H], _) :- !.
    sys_get_code_list(H, D, 0, S, [H|L], F) :- !,
    sys_get_code(S, J, F),
    sys_get_code_list(J, D, 0, S, L, F).
    sys_get_code_list(H, D, M, S, [H|L], F) :-
    sys_get_code(S, J, F),
    N is M-1,
    sys_get_code_list(J, D, N, S, L, F).

    If I use Scyer Prolog listing/1 I get,
    I added the dynamic manually:

    :- dynamic(sys_get_code_list/6).
    sys_get_code_list(-1,A,B,C,[],D) :-
    !.
    sys_get_code_list(A,A,B,C,[A],D) :-
    !.
    sys_get_code_list(A,B,1,C,[A],D) :-
    !.
    sys_get_code_list(A,B,0,C,[A|D],E) :-
    !,
    sys_get_code(C,F,E),
    sys_get_code_list(F,B,0,C,D,E).
    sys_get_code_list(A,B,C,D,[A|E],F) :-
    sys_get_code(D,G,F),
    H is C-1,
    sys_get_code_list(G,B,H,D,E,F).

    If I put the generated code into a file case2.pl,
    I suddently get a lot of warnings:

    $ target/release/scryer-prolog
    ?- [case2].
    % Warning: singleton variables A, B, C, D at line 1 of case2.pl
    % Warning: singleton variables B, C, D at line 3 of case2.pl
    % Warning: singleton variables B, C, D at line 5 of case2.pl
    true.


    Mild Shock schrieb:
    Hi,

    Interestingly Scryer Prolog does many things right.
    I find the following test case:

    /* Scryer Prolog 0.9.4-403 */
    ?- length(L,2), f(L) = R, S = [_A].
    L = [_B, _C],
    R = f([_B, _C]),
    S = [_A].

    While SWI-Prolog still makes the following error. The
    newly generated _A and _B are not checked whether they
    already appear in the answer elsewhere, causing a name clash:

    /* SWI-Prolog 9.3.22 */
    ?- length(L,2), f(L) = R, S = [_A].
     = [_A, _B],
    R = f([_A, _B]),
    S = [_A].

    Other Prolog systems that avoid the clash as well are
    Trealla Prolog, and since today Dogelog Player.

    Bye

    Mild Shock schrieb:
    Hi,

    It is time for the 2025 Prolog Awards.
    Are you excited yet?

    https://9gag.com/gag/aPAXyEP

    Here is the list:

    1. Place: Scryer Prolog, it uses rustyline,
    very convenient:

    app<tab>     gives append
    a<tab><tab>  cycles through letter a predicates
    length(foo)  shows the matching braket in blue
    Etc..

    -1. Place: SWI-Prolog, has no line edit at all

    Bye


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mild Shock@21:1/5 to All on Thu Jun 5 09:54:43 2025
    Currently hardening my own 100% pure Prolog
    written colorizer. Try this nasty testcase:

    :- op(700, xfx, +\).

    f("ab\"c"+\"").

    The result in Tau Prolog is nonsense,
    an atom c appears in the colorize:

    <span class="cm-atom">f</span><span
    class="cm-paren">(</span><span
    class="cm-string">"ab\"</span><span
    class="cm-atom">c</span><span
    class="cm-string">"+\"").</span>

    The result in SWI-Tinker is ok,
    no atom c appears in the colorize:

    <span class="cm-functor">f</span>(<span
    class="cm-string">"ab\"c"</span><span
    class="cm-operator">+\</span><span
    class="cm-string">""</span>)<span
    class="cm-fullstop">.</span>

    For some screenshots see here:

    Backslash double quotes not correctly colorized https://github.com/tau-prolog/tau-prolog/issues/360

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)