Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

A man is not complete until he is married -- then he is finished.


devel / comp.lang.prolog / Re: Prolog is a language from the 70's and Prologers still use 70's approaches

SubjectAuthor
* Prolog is a language from the 70's and Prologers still use 70's approachesMostowski Collapse
`* Re: Prolog is a language from the 70's and Prologers still use 70's approachesMostowski Collapse
 `- Re: Prolog is a language from the 70's and Prologers still use 70's approachesMostowski Collapse

1
Prolog is a language from the 70's and Prologers still use 70's approaches

<a96fab59-0f6d-41d6-8332-4d492c6938can@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=619&group=comp.lang.prolog#619

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ae9:f40d:: with SMTP id y13mr8307526qkl.100.1625385546514;
Sun, 04 Jul 2021 00:59:06 -0700 (PDT)
X-Received: by 2002:a25:afcd:: with SMTP id d13mr9853747ybj.504.1625385546373;
Sun, 04 Jul 2021 00:59:06 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!2.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Sun, 4 Jul 2021 00:59:06 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a96fab59-0f6d-41d6-8332-4d492c6938can@googlegroups.com>
Subject: Prolog is a language from the 70's and Prologers still use 70's approaches
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sun, 04 Jul 2021 07:59:06 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Mostowski Collapse - Sun, 4 Jul 2021 07:59 UTC

I just wonder how somebody could post such a response:

There isn't in the standard any assertz/1 directive, only
an assertz/1 built-in predicate. A standard compliant version
of that code is:

:- initialization((
assertz(foo(bar)),
assertz(foo(baz))
)).

https://github.com/tau-prolog/tau-prolog/issues/252#issuecomment-860217540

So where does intialization/1 come from? Well its some 70's
nonsense, when compilers were multipass.

Re: Prolog is a language from the 70's and Prologers still use 70's approaches

<2c237d53-334e-4e5b-9cba-6a5a07865416n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=620&group=comp.lang.prolog#620

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a37:71c1:: with SMTP id m184mr8387877qkc.367.1625385684252;
Sun, 04 Jul 2021 01:01:24 -0700 (PDT)
X-Received: by 2002:a25:af09:: with SMTP id a9mr10145363ybh.38.1625385683998;
Sun, 04 Jul 2021 01:01:23 -0700 (PDT)
Path: i2pn2.org!rocksolid2!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Sun, 4 Jul 2021 01:01:23 -0700 (PDT)
In-Reply-To: <a96fab59-0f6d-41d6-8332-4d492c6938can@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <a96fab59-0f6d-41d6-8332-4d492c6938can@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2c237d53-334e-4e5b-9cba-6a5a07865416n@googlegroups.com>
Subject: Re: Prolog is a language from the 70's and Prologers still use 70's approaches
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sun, 04 Jul 2021 08:01:24 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Mostowski Collapse - Sun, 4 Jul 2021 08:01 UTC

The traditional first two passes were scanner and parser.
Sometimes even done by using files. That these two passes
could correspond to two DCGs is a useful insight.

But then, Jan W. C parser collects a list of tokens first:

c99_tokens(List) -->
c99_token(H), !, /* calls token */
( {skip_token(H)}
-> c99_tokens(List)
; {List = [H|T]},
c99_tokens(T)
).

token(T) --> keyword(T), \+ identifier_cont_char(_).
token(T) --> identifier(T).
token(T) --> constant(T).
Etc..

In a “monadic” parser you dont have these two passes, but
nevertheless two DCGs. The passes are interwoven and no
token list is materialized. One can imagine the DCGs have a

‘C’/3 implementation, which call get_code/2 in the case of the
tokenizer and get_token/2 in the case of the parser. The result is
that you can process huge files with little or no memory.

Mostowski Collapse schrieb am Sonntag, 4. Juli 2021 um 09:59:07 UTC+2:
> I just wonder how somebody could post such a response:
>
> There isn't in the standard any assertz/1 directive, only
> an assertz/1 built-in predicate. A standard compliant version
> of that code is:
>
> :- initialization((
> assertz(foo(bar)),
> assertz(foo(baz))
> )).
>
> https://github.com/tau-prolog/tau-prolog/issues/252#issuecomment-860217540
>
> So where does intialization/1 come from? Well its some 70's
> nonsense, when compilers were multipass.

Re: Prolog is a language from the 70's and Prologers still use 70's approaches

<35f4f202-28c3-44a8-940a-a254599d54ccn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=621&group=comp.lang.prolog#621

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:1116:: with SMTP id o22mr8147994qkk.299.1625386050521;
Sun, 04 Jul 2021 01:07:30 -0700 (PDT)
X-Received: by 2002:a25:41c7:: with SMTP id o190mr9791450yba.256.1625386050244;
Sun, 04 Jul 2021 01:07:30 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Sun, 4 Jul 2021 01:07:30 -0700 (PDT)
In-Reply-To: <2c237d53-334e-4e5b-9cba-6a5a07865416n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <a96fab59-0f6d-41d6-8332-4d492c6938can@googlegroups.com> <2c237d53-334e-4e5b-9cba-6a5a07865416n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <35f4f202-28c3-44a8-940a-a254599d54ccn@googlegroups.com>
Subject: Re: Prolog is a language from the 70's and Prologers still use 70's approaches
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sun, 04 Jul 2021 08:07:30 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Mostowski Collapse - Sun, 4 Jul 2021 08:07 UTC

About “Write two DCGs”, the original Modula compiler was
multi pass. There was a scanner which wrote a file with tokens.
Then there was a parser which took this tokens and the next

pass started. Until over christmas Wirth and Gutknecht(*)
wrote a totally new Modula compiler that did everything together.
Or as they describe it:

" During 1984, the author designed a new compiler for Modula-2.
[...] Indeed, compilation time of the compiler itself was reduced
from some 4 minutes to a scant 45 seconds.

[...] Instead of each task constituting a pass - [...] - it constituted a
module with a mostly procedural interface. These modules represented
a scanner, a parser, a code generator, and a handler of symbol files."
http://www.modulaware.com/mdlt52.htm

How do this procedural interface in Prolog? Here is an example:

Monadic Parser in Prolog (Example DIMACS files)
https://stackoverflow.com/a/66800186/502187

Inspired by:

Happy - 2.5. Monadic Parsers
https://www.haskell.org/happy/doc/html/sec-monads.html

Mostowski Collapse schrieb am Sonntag, 4. Juli 2021 um 10:01:24 UTC+2:
> The traditional first two passes were scanner and parser.
> Sometimes even done by using files. That these two passes
> could correspond to two DCGs is a useful insight.
>
> But then, Jan W. C parser collects a list of tokens first:
>
> c99_tokens(List) -->
> c99_token(H), !, /* calls token */
> ( {skip_token(H)}
> -> c99_tokens(List)
> ; {List = [H|T]},
> c99_tokens(T)
> ).
>
> token(T) --> keyword(T), \+ identifier_cont_char(_).
> token(T) --> identifier(T).
> token(T) --> constant(T).
> Etc..
>
> In a “monadic” parser you dont have these two passes, but
> nevertheless two DCGs. The passes are interwoven and no
> token list is materialized. One can imagine the DCGs have a
>
> ‘C’/3 implementation, which call get_code/2 in the case of the
> tokenizer and get_token/2 in the case of the parser. The result is
> that you can process huge files with little or no memory.
> Mostowski Collapse schrieb am Sonntag, 4. Juli 2021 um 09:59:07 UTC+2:
> > I just wonder how somebody could post such a response:
> >
> > There isn't in the standard any assertz/1 directive, only
> > an assertz/1 built-in predicate. A standard compliant version
> > of that code is:
> >
> > :- initialization((
> > assertz(foo(bar)),
> > assertz(foo(baz))
> > )).
> >
> > https://github.com/tau-prolog/tau-prolog/issues/252#issuecomment-860217540
> >
> > So where does intialization/1 come from? Well its some 70's
> > nonsense, when compilers were multipass.


devel / comp.lang.prolog / Re: Prolog is a language from the 70's and Prologers still use 70's approaches

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor