Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Premature optimization is the root of all evil. -- D. E. Knuth


devel / comp.lang.python / Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

SubjectAuthor
* ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
+* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
|`- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
+* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Julio Di Egidio
|`* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
| `- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Julio Di Egidio
+* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
|`* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
| `- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
`* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
 `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Terry Reedy
  `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   +* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   |`* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   | +- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   | +* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Julio Di Egidio
   | |`* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   | | +* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Chris Angelico
   | | |+* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   | | ||+- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Chris Angelico
   | | ||`- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Greg Ewing
   | | |`* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)alister
   | | | `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   | | |  `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Julio Di Egidio
   | | |   `- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Julio Di Egidio
   | | +* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)alister
   | | |`* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   | | | `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   | | |  `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)alister
   | | |   +- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)alister
   | | |   `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   | | |    +- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   | | |    +* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   | | |    |+* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)alister
   | | |    ||`* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   | | |    || +* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   | | |    || |`- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   | | |    || `- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)DFS
   | | |    |`- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Greg Ewing
   | | |    `- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)alister
   | | +* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)DFS
   | | |`* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   | | | `- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   | | `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Greg Ewing
   | |  `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   | |   `- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Greg Ewing
   | `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   |  +- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   |  `* RE: ANN: Dogelog Runtime, Prolog to the Moon (2021)Avi Gross
   |   `- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
   `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Chris Angelico
    `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     +* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Chris Angelico
     |`* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | +* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Chris Angelico
     | |`* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | | `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |  `- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | +* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Greg Ewing
     | |`* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Chris Angelico
     | | `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |  +- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |  +* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Chris Angelico
     | |  |+* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |  ||+- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |  ||+- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |  ||`- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Chris Angelico
     | |  |+* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Greg Ewing
     | |  ||`* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |  || `- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |  |+- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |  |`- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |  +* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Peter J. Holzer
     | |  |`* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |  | +* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |  | |+- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |  | |`* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Greg Ewing
     | |  | | `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |  | |  `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |  | |   `- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |  | +* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Michael F. Stemper
     | |  | |`- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |  | `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Peter J. Holzer
     | |  |  `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |  |   `- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |  `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Chris Angelico
     | |   `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |    `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |     `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | |      `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mark Lawrence
     | |       `- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     | `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     |  `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Chris Angelico
     |   `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     |    `* Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     |     `- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Mostowski Collapse
     `- Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)Greg Ewing

Pages:1234
Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<mailman.754.1632140693.4164.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15246&group=comp.lang.python#15246

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ros...@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
Date: Mon, 20 Sep 2021 22:24:40 +1000
Lines: 20
Message-ID: <mailman.754.1632140693.4164.python-list@python.org>
References: <6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com>
<CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net>
<fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org>
<CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<YUh1S59dbFZ3d3IM@hjp.at>
<CAPTjJmrjn5Cr9Jky6uajHCHnJNgRA1zs1X5JNztFaSe4fhmwLA@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de ySqNSfYbfsVFCvPqZwaI9A0NEyj0FEqTuU11Cxy+HmAw==
Return-Path: <rosuav@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=kyajJr/u;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.074
X-Spam-Evidence: '*H*': 0.85; '*S*': 0.00; 'underlying': 0.07;
'received:209.85.166.180': 0.09; '"don\'t': 0.16; 'chrisa': 0.16;
'collection.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris
angelico': 0.16; 'holzer': 0.16; 'interpreter': 0.16;
'subject:ANN': 0.16; 'wrote:': 0.16; 'python': 0.16; "can't":
0.17; 'to:addr:python-list': 0.20; 'language': 0.21; 'languages':
0.22; 'python,': 0.25; 'think': 0.32; 'sep': 0.32;
'to:name:python': 0.32; 'message-id:@mail.gmail.com': 0.32; 'but':
0.32; 'header:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'received:209.85.166': 0.35; 'from:addr:gmail.com': 0.35; 'mon,':
0.36; 'received:209.85': 0.37; 'way': 0.38; 'could': 0.38; 'put':
0.38; 'received:209': 0.39; 'use': 0.39; 'advantage': 0.40; 'try':
0.40; 'point.': 0.62; 'your': 0.64; 'his': 0.65; 'top': 0.65;
'let': 0.66; '20,': 0.67; '2021': 0.71; 'features.': 0.76;
'languages,': 0.76; 'subject:2021': 0.76; 'garbage': 0.84;
'think,': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
bh=7Otfr3sd3pdMptJDxalik40j2BRNRf+MBJ8F8HGNqfI=;
b=kyajJr/upd1auJZZpZL1JKCcijPnm4lKSCHRU6XoOxECstPmrY4akY2aAZPKlmE+VJ
ykK7YJV4znlS8JimDfIFrjP/Em8C67UBe8ua62RzGQmeYKKYmC0nORGGw9OKRWqbUQs6
3iES5voDB8nT5Y+Mow51VUxIu3VVpu7WzEQhqxwlJj/yGyv2sSJ3HW3aDX8ux0hd9iun
CXtQJA0I0eqXnM0JSucEj9P8SBcOwfUYHWRqYOfd/+xXxw6lYK/qDrKTPcIxZp8ZdTSs
HgZlV55Lj/L8+MLO9aFCWe8JHWgvxd79rlaxHSwcIqn/DWwle6G+dTsm+rUg5zKpC2BS
2Vww==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to;
bh=7Otfr3sd3pdMptJDxalik40j2BRNRf+MBJ8F8HGNqfI=;
b=6toBXQ/+1CfHrHWIAeRksHF4cdGUEKmXNsZSig2/X2N0fGaBR4qMC/SfOsNnVsLTV3
FjWjrwknHofkFFiyNkCYXtekV3bzzc30lGt61SO5/hqJ7vad4358Y59hBWIt1BUWedoc
j3yUdEHp+BhLOA7MKJz05rsvmDgzDgZ6q0KeWFTKi2/htBdJ8TaMYxzxJ8YFd7LE8Okm
rjjeGrFD0Rp5OTpgWA69lz/BH8LDhwOViqvviCQiBhHJ1wK6W/Of/QCFMygg4Ggl29Dd
vAT7UeutrvKuWZteef7FsgkA3J26Zp8nzCdD/h11T1kHw0ETN5Qr1xta2cGUi1kzwf8N
Wplw==
X-Gm-Message-State: AOAM532R13So41bIVCQ0OllsnX4xtLP8f7AHZYDiKW0UHuOVgoF5NZk6
vn+Q15Qg/bBCbbe2gMDgBf2RkMRtimRA/BPk2hUVhHryMok=
X-Google-Smtp-Source: ABdhPJwk0USfxyogTTlyYmlbo/q8jfQrrVuegPa4kls4IZQFTGOGyIRFrlR/8JGViHRhV65zPJe+Mf3xiZFaqk233rQ=
X-Received: by 2002:a92:c744:: with SMTP id y4mr16405775ilp.288.1632140691513;
Mon, 20 Sep 2021 05:24:51 -0700 (PDT)
In-Reply-To: <YUh1S59dbFZ3d3IM@hjp.at>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAPTjJmrjn5Cr9Jky6uajHCHnJNgRA1zs1X5JNztFaSe4fhmwLA@mail.gmail.com>
X-Mailman-Original-References: <6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com>
<CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net>
<fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org>
<CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<YUh1S59dbFZ3d3IM@hjp.at>
 by: Chris Angelico - Mon, 20 Sep 2021 12:24 UTC

On Mon, Sep 20, 2021 at 9:50 PM Peter J. Holzer <hjp-python@hjp.at> wrote:
> > Let Python be Python, don't try to build your own language on top of
> > it.
>
> Well, he's writing a Prolog interpreter, so building his own language on
> top of Python is sort of the point. I think a better way to put it is
> "Don't try to write Python as if it was C".

Fair point. Or combining them both: Writing a language interpreter in
Python as if you were writing it in C, and then complaining that it is
slow, is only going to elicit "well uhh yes?" responses.

Languages like NetRexx (and, I think, Jython, although I can't find
any definitive and current answers) are slightly different from their
"parent" languages, because they make good use of their implementation
languages' features. This Prolog interpreter might not even need to be
different in functionality, but its implementation would be different,
and it could take advantage of the underlying garbage collection.

ChrisA

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<ed2ef4e8-63df-439d-8f53-07dcad35d5e2n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15247&group=comp.lang.python#15247

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a0c:e103:: with SMTP id w3mr24593394qvk.24.1632141350089;
Mon, 20 Sep 2021 05:35:50 -0700 (PDT)
X-Received: by 2002:a05:620a:2988:: with SMTP id r8mr23421149qkp.445.1632141349922;
Mon, 20 Sep 2021 05:35:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Mon, 20 Sep 2021 05:35:49 -0700 (PDT)
In-Reply-To: <mailman.754.1632140693.4164.python-list@python.org>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com>
<CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net> <fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org>
<CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<CAPTjJmrjn5Cr9Jky6uajHCHnJNgRA1zs1X5JNztFaSe4fhmwLA@mail.gmail.com>
<YUh1S59dbFZ3d3IM@hjp.at> <mailman.754.1632140693.4164.python-list@python.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ed2ef4e8-63df-439d-8f53-07dcad35d5e2n@googlegroups.com>
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 20 Sep 2021 12:35:50 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 56
 by: Mostowski Collapse - Mon, 20 Sep 2021 12:35 UTC

The sweep_trail() is not an issue. There must be a bottleneck
somewhere else in Python. The sweep_trail() respectively the
paremt call gc() only takes a very small fraction of the runtime:

Check the "gc" timing, the bottleneck is somewhere else?

Mostowski Collapse schrieb am Freitag, 17. September 2021 um 10:58:57 UTC+2:
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> % Standard Python Version, Warm Run
> % ?- time(fibo(23,X)).
> % % Wall 3865 ms, gc 94 ms, 71991 lips
> % X = 46368.
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> % GraalVM Python Version, Warm Warm Run
> % ?- time(fibo(23,X)).
> % % Wall 695 ms, gc 14 ms, 400356 lips
> % X = 46368.

Also my code is not C-style. If I would use C-style code, I would
use address calculations and the adress operator &. But you
don't find and according C-style in the Python or JavaScript code.

Also there is no substitute for such coding style in the for
of value holders or some such. Its all plain Python respectively
JavaScript not at all inspired by the C programming language.

The single linked list is not some indicative of C programming
language style. With C programming language sytle one would
do other tricks, you cannot read off from my Python or JavaScript

code, since I cannot apply them to Python or JavaScript. Among
the other C programming language tricks not available in Python
or JavaScript would for example be inlining the args in Compound

and so on. But I am not sure whether this is the bottleneck.

Chris Angelico schrieb am Montag, 20. September 2021 um 14:25:12 UTC+2:
> On Mon, Sep 20, 2021 at 9:50 PM Peter J. Holzer <hjp-p...@hjp.at> wrote:
> > > Let Python be Python, don't try to build your own language on top of
> > > it.
> >
> > Well, he's writing a Prolog interpreter, so building his own language on
> > top of Python is sort of the point. I think a better way to put it is
> > "Don't try to write Python as if it was C".
> Fair point. Or combining them both: Writing a language interpreter in
> Python as if you were writing it in C, and then complaining that it is
> slow, is only going to elicit "well uhh yes?" responses.
>
> Languages like NetRexx (and, I think, Jython, although I can't find
> any definitive and current answers) are slightly different from their
> "parent" languages, because they make good use of their implementation
> languages' features. This Prolog interpreter might not even need to be
> different in functionality, but its implementation would be different,
> and it could take advantage of the underlying garbage collection.
>
> ChrisA

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<f93ee73d-5856-4938-a965-c628a0335851n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15248&group=comp.lang.python#15248

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a37:bdc4:: with SMTP id n187mr1425484qkf.271.1632141770204;
Mon, 20 Sep 2021 05:42:50 -0700 (PDT)
X-Received: by 2002:ae9:de06:: with SMTP id s6mr24115085qkf.489.1632141770057;
Mon, 20 Sep 2021 05:42:50 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Mon, 20 Sep 2021 05:42:49 -0700 (PDT)
In-Reply-To: <ed2ef4e8-63df-439d-8f53-07dcad35d5e2n@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: <6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com>
<CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net> <fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org>
<CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<CAPTjJmrjn5Cr9Jky6uajHCHnJNgRA1zs1X5JNztFaSe4fhmwLA@mail.gmail.com>
<YUh1S59dbFZ3d3IM@hjp.at> <mailman.754.1632140693.4164.python-list@python.org>
<ed2ef4e8-63df-439d-8f53-07dcad35d5e2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f93ee73d-5856-4938-a965-c628a0335851n@googlegroups.com>
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 20 Sep 2021 12:42:50 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 76
 by: Mostowski Collapse - Mon, 20 Sep 2021 12:42 UTC

Also I am not a C programmer. The last time I was programming C
was 30 years ago. I am mostly a Java programmer the recent years.
Dogelog Runtime adopts a lot of implementation details from

Jekejeke Prolog which is a Prolog written in Java. The difference
betweeen the two is that Jekejeke Prolog has another Prolog term
model where Prolog terms are passed around as molecs, which

are pairs of skeleton and display. On the other in Dogelog Runtime
uses a simpler representation, Prolog terms are passed around
as only one object. Programming language wise the difference

between using Java and JavaScript or Python, is that Java has
types. So variables need a type declaration. Otherwise Java is
very similar to JavaScript or Python, it also provides a runtime with

a garbage collection. The idea I would use C-style is a little absurd. It
would also require that a free() objects manually. But sweep_trail() has
nothing to do with freeing objects manually, its the anti-thesis to

freeing objects manually, its a Prolog garbage collector after all!

Mostowski Collapse schrieb am Montag, 20. September 2021 um 14:36:01 UTC+2:
> The sweep_trail() is not an issue. There must be a bottleneck
> somewhere else in Python. The sweep_trail() respectively the
> paremt call gc() only takes a very small fraction of the runtime:
>
> Check the "gc" timing, the bottleneck is somewhere else?
> Mostowski Collapse schrieb am Freitag, 17. September 2021 um 10:58:57 UTC+2:
> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> > % Standard Python Version, Warm Run
> > % ?- time(fibo(23,X)).
> > % % Wall 3865 ms, gc 94 ms, 71991 lips
> > % X = 46368.
> >
> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> > % GraalVM Python Version, Warm Warm Run
> > % ?- time(fibo(23,X)).
> > % % Wall 695 ms, gc 14 ms, 400356 lips
> > % X = 46368.
> Also my code is not C-style. If I would use C-style code, I would
> use address calculations and the adress operator &. But you
> don't find and according C-style in the Python or JavaScript code.
>
> Also there is no substitute for such coding style in the for
> of value holders or some such. Its all plain Python respectively
> JavaScript not at all inspired by the C programming language.
>
> The single linked list is not some indicative of C programming
> language style. With C programming language sytle one would
> do other tricks, you cannot read off from my Python or JavaScript
>
> code, since I cannot apply them to Python or JavaScript. Among
> the other C programming language tricks not available in Python
> or JavaScript would for example be inlining the args in Compound
>
> and so on. But I am not sure whether this is the bottleneck.
> Chris Angelico schrieb am Montag, 20. September 2021 um 14:25:12 UTC+2:
> > On Mon, Sep 20, 2021 at 9:50 PM Peter J. Holzer <hjp-p...@hjp.at> wrote:
> > > > Let Python be Python, don't try to build your own language on top of
> > > > it.
> > >
> > > Well, he's writing a Prolog interpreter, so building his own language on
> > > top of Python is sort of the point. I think a better way to put it is
> > > "Don't try to write Python as if it was C".
> > Fair point. Or combining them both: Writing a language interpreter in
> > Python as if you were writing it in C, and then complaining that it is
> > slow, is only going to elicit "well uhh yes?" responses.
> >
> > Languages like NetRexx (and, I think, Jython, although I can't find
> > any definitive and current answers) are slightly different from their
> > "parent" languages, because they make good use of their implementation
> > languages' features. This Prolog interpreter might not even need to be
> > different in functionality, but its implementation would be different,
> > and it could take advantage of the underlying garbage collection.
> >
> > ChrisA

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<a9ca6a2d-b4f2-4869-b51c-2cd886825663n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15249&group=comp.lang.python#15249

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a05:620a:559:: with SMTP id o25mr2841462qko.200.1632142328646; Mon, 20 Sep 2021 05:52:08 -0700 (PDT)
X-Received: by 2002:a05:622a:5d4:: with SMTP id d20mr22112548qtb.376.1632142328404; Mon, 20 Sep 2021 05:52:08 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Mon, 20 Sep 2021 05:52:08 -0700 (PDT)
In-Reply-To: <f93ee73d-5856-4938-a965-c628a0335851n@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: <6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com> <CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com> <mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org> <iql5tuFjaqU1@mid.individual.net> <fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com> <CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com> <mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org> <CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com> <CAPTjJmrjn5Cr9Jky6uajHCHnJNgRA1zs1X5JNztFaSe4fhmwLA@mail.gmail.com> <YUh1S59dbFZ3d3IM@hjp.at> <mailman.754.1632140693.4164.python-list@python.org> <ed2ef4e8-63df-439d-8f53-07dcad35d5e2n@googlegroups.com> <f93ee73d-5856-4938-a965-c628a0335851n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a9ca6a2d-b4f2-4869-b51c-2cd886825663n@googlegroups.com>
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 20 Sep 2021 12:52:08 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 101
 by: Mostowski Collapse - Mon, 20 Sep 2021 12:52 UTC

Now I am expecting somebody telling me I should not
program Java style in Python. So I wonder what would have
happened if I would tell you I am FORTRAN programmer.

Then somebody would tell me I should not program
FORTRAN style in Python. Hopefully this makes it evident
that this argumentation is moot.

Better would be more facts on the table based on
the existing code of Dogelog runtime. The future Dogelog
runtime code will possibly use ast.parse() and compile().

Thats why I am conducting this experiment which has only
been half way completed. The experiment is conducted
because Python belongs to the champ of dynamic languages:

Dynamic programming language
https://en.wikipedia.org/wiki/Dynamic_programming_language

The experiment will be completed when the ast.parse()
and compile() thingy was explored as well. As it happens I
am conducting the experiment in parallel for JavaScript and

Python, both being dynamic programming languages.

Mostowski Collapse schrieb am Montag, 20. September 2021 um 14:43:01 UTC+2:
> Also I am not a C programmer. The last time I was programming C
> was 30 years ago. I am mostly a Java programmer the recent years.
> Dogelog Runtime adopts a lot of implementation details from
>
> Jekejeke Prolog which is a Prolog written in Java. The difference
> betweeen the two is that Jekejeke Prolog has another Prolog term
> model where Prolog terms are passed around as molecs, which
>
> are pairs of skeleton and display. On the other in Dogelog Runtime
> uses a simpler representation, Prolog terms are passed around
> as only one object. Programming language wise the difference
>
> between using Java and JavaScript or Python, is that Java has
> types. So variables need a type declaration. Otherwise Java is
> very similar to JavaScript or Python, it also provides a runtime with
>
> a garbage collection. The idea I would use C-style is a little absurd. It
> would also require that a free() objects manually. But sweep_trail() has
> nothing to do with freeing objects manually, its the anti-thesis to
>
> freeing objects manually, its a Prolog garbage collector after all!
> Mostowski Collapse schrieb am Montag, 20. September 2021 um 14:36:01 UTC+2:
> > The sweep_trail() is not an issue. There must be a bottleneck
> > somewhere else in Python. The sweep_trail() respectively the
> > paremt call gc() only takes a very small fraction of the runtime:
> >
> > Check the "gc" timing, the bottleneck is somewhere else?
> > Mostowski Collapse schrieb am Freitag, 17. September 2021 um 10:58:57 UTC+2:
> > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> > > % Standard Python Version, Warm Run
> > > % ?- time(fibo(23,X)).
> > > % % Wall 3865 ms, gc 94 ms, 71991 lips
> > > % X = 46368.
> > >
> > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> > > % GraalVM Python Version, Warm Warm Run
> > > % ?- time(fibo(23,X)).
> > > % % Wall 695 ms, gc 14 ms, 400356 lips
> > > % X = 46368.
> > Also my code is not C-style. If I would use C-style code, I would
> > use address calculations and the adress operator &. But you
> > don't find and according C-style in the Python or JavaScript code.
> >
> > Also there is no substitute for such coding style in the for
> > of value holders or some such. Its all plain Python respectively
> > JavaScript not at all inspired by the C programming language.
> >
> > The single linked list is not some indicative of C programming
> > language style. With C programming language sytle one would
> > do other tricks, you cannot read off from my Python or JavaScript
> >
> > code, since I cannot apply them to Python or JavaScript. Among
> > the other C programming language tricks not available in Python
> > or JavaScript would for example be inlining the args in Compound
> >
> > and so on. But I am not sure whether this is the bottleneck.
> > Chris Angelico schrieb am Montag, 20. September 2021 um 14:25:12 UTC+2:
> > > On Mon, Sep 20, 2021 at 9:50 PM Peter J. Holzer <hjp-p...@hjp.at> wrote:
> > > > > Let Python be Python, don't try to build your own language on top of
> > > > > it.
> > > >
> > > > Well, he's writing a Prolog interpreter, so building his own language on
> > > > top of Python is sort of the point. I think a better way to put it is
> > > > "Don't try to write Python as if it was C".
> > > Fair point. Or combining them both: Writing a language interpreter in
> > > Python as if you were writing it in C, and then complaining that it is
> > > slow, is only going to elicit "well uhh yes?" responses.
> > >
> > > Languages like NetRexx (and, I think, Jython, although I can't find
> > > any definitive and current answers) are slightly different from their
> > > "parent" languages, because they make good use of their implementation
> > > languages' features. This Prolog interpreter might not even need to be
> > > different in functionality, but its implementation would be different,
> > > and it could take advantage of the underlying garbage collection.
> > >
> > > ChrisA

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<mailman.756.1632160405.4164.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15254&group=comp.lang.python#15254

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ros...@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
Date: Tue, 21 Sep 2021 03:53:10 +1000
Lines: 15
Message-ID: <mailman.756.1632160405.4164.python-list@python.org>
References: <sfb25a$3a5$1@solani.org>
<90e326fc-dc3d-43ff-a8ea-630f4740c8e2n@googlegroups.com>
<shtjcb$v8r$6@gioia.aioe.org>
<7232cc7f-52d3-4af8-99c2-d952752cdf09n@googlegroups.com>
<58398d5e-6b73-4a50-b52b-0e943bc543f4n@googlegroups.com>
<CAPTjJmoc6qw3kh4U8x9=_x8mEjDvPbLHs5UxL06qU__AsL26mw@mail.gmail.com>
<924df9eb-fb4f-4773-b81c-23e7209368ean@googlegroups.com>
<mailman.729.1631743354.4164.python-list@python.org>
<6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com>
<CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net>
<fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org>
<CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<mailman.752.1632076433.4164.python-list@python.org> <si841q$dbg$1@solani.org>
<CAPTjJmq-ymF8SVgGYCDVtYqe4DsiEUaCbEHbSE3hJ7h5QkgvCQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de 12Yrf7TyWMtnd2TxbJ+BawyQCTVf+PSXytremx2+LgvA==
Return-Path: <rosuav@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=dhlxirm1;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.089
X-Spam-Evidence: '*H*': 0.83; '*S*': 0.00; 'python.': 0.08; 'pandas':
0.09; 'chrisa': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris
angelico': 0.16; 'low-level': 0.16; 'subject:ANN': 0.16; 'wrote:':
0.16; 'says': 0.17; 'tue,': 0.19; 'to:addr:python-list': 0.20;
'language': 0.21; 'think': 0.32; 'language.': 0.32; 'sep': 0.32;
'to:name:python': 0.32; "wouldn't": 0.32; 'message-
id:@mail.gmail.com': 0.32; 'there': 0.33; 'same': 0.34; 'header
:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'received:209.85.166': 0.35; 'from:addr:gmail.com': 0.35;
'received:209.85': 0.37; 'received:209': 0.39; 'otherwise': 0.39;
'dont': 0.64; 'your': 0.64; 'top': 0.65; '2021': 0.71; 'features':
0.75; 'subject:2021': 0.76; 'allowed,': 0.84; 'etc..': 0.84;
'collapse': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
bh=H9utXmNuGnMMr89giHAegaI8S//6FmhbBz7lcXi17r4=;
b=dhlxirm1fijvmcU9vuA1oKJ0l1uR6RBPsS3DkLVs0+mvcHeNIkYAlTwTgNltC22G/y
WxDrKkRB958NpCoBwnjVi2eI+6UMKGd1xe3By9bZLTcOq899F3lSoTXB6p1vVaFIkGY6
kchXJ0KfgJJGkrQbss8MRGswNsCkBNGe32+8Bw9h6FybzwpKhFtmoRH4un9HSBOm+sju
BV21pdts3Ihyu7ysBvrCm9P3OIzQrv+8AhjKcxkQSZlvRlXqy/MBA3eVj/MRQweezc9B
z9w6X7FY90E8tiPRBl/iUUKpkN/jght5pWk1f1WU8M/KSYpvuTs70Hys335G7qzQNtO1
YUlA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to;
bh=H9utXmNuGnMMr89giHAegaI8S//6FmhbBz7lcXi17r4=;
b=UQnQEOgvCMZf2IcPTvmMUZo4VaMaI3efkv8rb/yXCP2oHw3I5ztDlzeuf1Pg8ERiZH
D9JTOQmfKf1Ii78CrHMsfpftZkxITAatEAOBUxPkkav3kZDkh6ie594ukQoxxxLzR3FX
PHMM7Pyuah9BoRINnrbKAQ5fI5KEdWna+CTouojtm1fAatwAJ9tNH8yHaNKiiKd3hXhE
thZjPa6UodTnzfQ9wrhWb8r0v6p8xDDBUpW6cay0Cd+yp/mgYIBDp/txPZKc2wgOESKj
88nFNotswJxa+DrL6uF2MPL0FePD9jh9IFXZNXwGCvfL0AkQzq4LUMOl+5I3kE3L7EGC
tEaQ==
X-Gm-Message-State: AOAM530VwaLgZWDH8lIhtLuT5eeN+UxEMD4iDvzzNQF/mSMsUS+AJkVS
9fB5pSq/EYjr9U0a0jLljrn+gjm1JX48R5LjEEtiNLKWg+g=
X-Google-Smtp-Source: ABdhPJxWZHjbzgGdkYrk8GJ4X9VlGqI+t1XYm+KCzTTk6gRzQMCUlVvccJH8ob1JsYvf4xgyUd4pQrWFzdBo/gWIn2s=
X-Received: by 2002:a05:6638:14b:: with SMTP id
y11mr14047733jao.34.1632160401741;
Mon, 20 Sep 2021 10:53:21 -0700 (PDT)
In-Reply-To: <si841q$dbg$1@solani.org>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAPTjJmq-ymF8SVgGYCDVtYqe4DsiEUaCbEHbSE3hJ7h5QkgvCQ@mail.gmail.com>
X-Mailman-Original-References: <sfb25a$3a5$1@solani.org>
<90e326fc-dc3d-43ff-a8ea-630f4740c8e2n@googlegroups.com>
<shtjcb$v8r$6@gioia.aioe.org>
<7232cc7f-52d3-4af8-99c2-d952752cdf09n@googlegroups.com>
<58398d5e-6b73-4a50-b52b-0e943bc543f4n@googlegroups.com>
<CAPTjJmoc6qw3kh4U8x9=_x8mEjDvPbLHs5UxL06qU__AsL26mw@mail.gmail.com>
<924df9eb-fb4f-4773-b81c-23e7209368ean@googlegroups.com>
<mailman.729.1631743354.4164.python-list@python.org>
<6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com>
<CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net>
<fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org>
<CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<mailman.752.1632076433.4164.python-list@python.org> <si841q$dbg$1@solani.org>
 by: Chris Angelico - Mon, 20 Sep 2021 17:53 UTC

On Tue, Sep 21, 2021 at 3:51 AM Mostowski Collapse <janburse@fastmail.fm> wrote:
>
> sympy also builds a language on top of Python.
> pandas also builds a language on top of Python.
>
> Is there some pope that says this wouldn't be
> allowed, I dont think so, otherwise sympy, pandas, etc..
>
> wouldn't exist. I dont understand your argument.
>

That's not the same thing as reimplementing your own low-level
features on top of a high level language.

ChrisA

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<siai11$uto$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15255&group=comp.lang.python#15255

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: michael....@gmail.com (Michael F. Stemper)
Newsgroups: comp.lang.python
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
Date: Mon, 20 Sep 2021 12:56:48 -0500
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <siai11$uto$1@dont-email.me>
References: <6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com>
<CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net>
<fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org>
<si6tl1$csn$1@solani.org> <YUh1S59dbFZ3d3IM@hjp.at>
<CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<mailman.753.1632138579.4164.python-list@python.org>
<ccdfa071-fbdf-4720-87fb-d0665b59d1c4n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 20 Sep 2021 17:56:49 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="39b4509305243d63a08124fa4eb664d9";
logging-data="31672"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19y9DwTSzTrHCwTcb9jxDPUQBYwSk+HsCU="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.10.0
Cancel-Lock: sha1:8/6/JwJRlZHbiy4CPUKTBb8FJ7g=
In-Reply-To: <ccdfa071-fbdf-4720-87fb-d0665b59d1c4n@googlegroups.com>
Content-Language: en-US
 by: Michael F. Stemper - Mon, 20 Sep 2021 17:56 UTC

On 20/09/2021 07.08, Mostowski Collapse wrote:
> I read the following, and you should also know:
>
>> Python's [] is implemented as an array, not a linked list.
>> Although resizing is O(n), appending to it is amortized O(1),
>> because resizes happen very rarely.
> https://stackoverflow.com/a/5932364/502187
>
> The list type doesn't have an O(1) operation to remove
> an element during sweep. The list type, not like its name
> would suggest, in Python is an array.
>
> These arrays are not so expensive when you append()
> an element. Because they are allocated with some excess
> capacity. And they grow exponentially.
>
> So amortisized you can append() a lot of elements to
> a Python list, which is an array. But you cannot poke so
> cheaply holes into it. So if you have this scenario:
>
> Before:
> - [ A1, .., An , B, C1, .., Cm ]
>
> After:
> - [ A1, .., An , C1, .., Cm ]
Do you happen to know what the asymptotic complexity of the
remove operation is?

>>> l = ["A1","A2","An","B","C1","C2","Cm"]
>>> l.remove("B")
>>> l
['A1', 'A2', 'An', 'C1', 'C2', 'Cm']
>>>

I can't figure out any way to benchmark it that doesn't involve
creation of ever-longer lists, which would probably mask its effects.

--
Michael F. Stemper
Deuteronomy 24:17

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<2dcd0197-e271-476e-a12b-c28539e1d65fn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15256&group=comp.lang.python#15256

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:ac8:1190:: with SMTP id d16mr24110932qtj.391.1632160706927;
Mon, 20 Sep 2021 10:58:26 -0700 (PDT)
X-Received: by 2002:a37:ad0:: with SMTP id 199mr21949391qkk.261.1632160706731;
Mon, 20 Sep 2021 10:58:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Mon, 20 Sep 2021 10:58:26 -0700 (PDT)
In-Reply-To: <mailman.756.1632160405.4164.python-list@python.org>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <sfb25a$3a5$1@solani.org> <90e326fc-dc3d-43ff-a8ea-630f4740c8e2n@googlegroups.com>
<shtjcb$v8r$6@gioia.aioe.org> <7232cc7f-52d3-4af8-99c2-d952752cdf09n@googlegroups.com>
<58398d5e-6b73-4a50-b52b-0e943bc543f4n@googlegroups.com> <CAPTjJmoc6qw3kh4U8x9=_x8mEjDvPbLHs5UxL06qU__AsL26mw@mail.gmail.com>
<924df9eb-fb4f-4773-b81c-23e7209368ean@googlegroups.com> <mailman.729.1631743354.4164.python-list@python.org>
<6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com> <CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net> <fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org>
<CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<mailman.752.1632076433.4164.python-list@python.org> <CAPTjJmq-ymF8SVgGYCDVtYqe4DsiEUaCbEHbSE3hJ7h5QkgvCQ@mail.gmail.com>
<si841q$dbg$1@solani.org> <mailman.756.1632160405.4164.python-list@python.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2dcd0197-e271-476e-a12b-c28539e1d65fn@googlegroups.com>
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 20 Sep 2021 17:58:26 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 20
 by: Mostowski Collapse - Mon, 20 Sep 2021 17:58 UTC

Again, I don't implement any low level features,
that would explain any bottleneck in the performance
of Python. gc() is only a very small percentage.

You are halucinating.

Chris Angelico schrieb am Montag, 20. September 2021 um 19:53:36 UTC+2:
> On Tue, Sep 21, 2021 at 3:51 AM Mostowski Collapse <janb...@fastmail.fm> wrote:
> >
> > sympy also builds a language on top of Python.
> > pandas also builds a language on top of Python.
> >
> > Is there some pope that says this wouldn't be
> > allowed, I dont think so, otherwise sympy, pandas, etc..
> >
> > wouldn't exist. I dont understand your argument.
> >
> That's not the same thing as reimplementing your own low-level
> features on top of a high level language.
>
> ChrisA

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<23afc497-b905-460d-bc36-7a19b50b1b6fn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15257&group=comp.lang.python#15257

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a05:622a:610:: with SMTP id z16mr15133302qta.101.1632160804285;
Mon, 20 Sep 2021 11:00:04 -0700 (PDT)
X-Received: by 2002:a37:66c7:: with SMTP id a190mr17620254qkc.427.1632160804137;
Mon, 20 Sep 2021 11:00:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Mon, 20 Sep 2021 11:00:03 -0700 (PDT)
In-Reply-To: <2dcd0197-e271-476e-a12b-c28539e1d65fn@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: <sfb25a$3a5$1@solani.org> <90e326fc-dc3d-43ff-a8ea-630f4740c8e2n@googlegroups.com>
<shtjcb$v8r$6@gioia.aioe.org> <7232cc7f-52d3-4af8-99c2-d952752cdf09n@googlegroups.com>
<58398d5e-6b73-4a50-b52b-0e943bc543f4n@googlegroups.com> <CAPTjJmoc6qw3kh4U8x9=_x8mEjDvPbLHs5UxL06qU__AsL26mw@mail.gmail.com>
<924df9eb-fb4f-4773-b81c-23e7209368ean@googlegroups.com> <mailman.729.1631743354.4164.python-list@python.org>
<6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com> <CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net> <fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org>
<CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<mailman.752.1632076433.4164.python-list@python.org> <CAPTjJmq-ymF8SVgGYCDVtYqe4DsiEUaCbEHbSE3hJ7h5QkgvCQ@mail.gmail.com>
<si841q$dbg$1@solani.org> <mailman.756.1632160405.4164.python-list@python.org>
<2dcd0197-e271-476e-a12b-c28539e1d65fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <23afc497-b905-460d-bc36-7a19b50b1b6fn@googlegroups.com>
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 20 Sep 2021 18:00:04 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 28
 by: Mostowski Collapse - Mon, 20 Sep 2021 18:00 UTC

Maybe you could stop spamming my thread with
your idee fix, about something low level. Thats
just absurd. The language itself, Prolog, is extremly

highlevel, and I am using Python in a very highlevel
fashion. There is nothing C-ish in my code. You
are just spamming the ever same nonsense.

Mostowski Collapse schrieb am Montag, 20. September 2021 um 19:58:36 UTC+2:
> Again, I don't implement any low level features,
> that would explain any bottleneck in the performance
> of Python. gc() is only a very small percentage.
>
> You are halucinating.
> Chris Angelico schrieb am Montag, 20. September 2021 um 19:53:36 UTC+2:
> > On Tue, Sep 21, 2021 at 3:51 AM Mostowski Collapse <janb...@fastmail.fm> wrote:
> > >
> > > sympy also builds a language on top of Python.
> > > pandas also builds a language on top of Python.
> > >
> > > Is there some pope that says this wouldn't be
> > > allowed, I dont think so, otherwise sympy, pandas, etc..
> > >
> > > wouldn't exist. I dont understand your argument.
> > >
> > That's not the same thing as reimplementing your own low-level
> > features on top of a high level language.
> >
> > ChrisA

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<f1f57947-a276-4a40-993c-8bd8551a0bdbn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15258&group=comp.lang.python#15258

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:ac8:7d46:: with SMTP id h6mr5057376qtb.162.1632160928038;
Mon, 20 Sep 2021 11:02:08 -0700 (PDT)
X-Received: by 2002:a37:9606:: with SMTP id y6mr24997328qkd.13.1632160927854;
Mon, 20 Sep 2021 11:02:07 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Mon, 20 Sep 2021 11:02:07 -0700 (PDT)
In-Reply-To: <siai11$uto$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com>
<CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net> <fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org>
<YUh1S59dbFZ3d3IM@hjp.at> <CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<mailman.753.1632138579.4164.python-list@python.org> <ccdfa071-fbdf-4720-87fb-d0665b59d1c4n@googlegroups.com>
<siai11$uto$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f1f57947-a276-4a40-993c-8bd8551a0bdbn@googlegroups.com>
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 20 Sep 2021 18:02:08 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 13
 by: Mostowski Collapse - Mon, 20 Sep 2021 18:02 UTC

If you don't know the index of the element, you
need first to find the element which is O(n).
And then removing it is O(n) again.

See also here:

> Python's [] is implemented as an array, not a linked list.
> Although resizing is O(n), appending to it is amortized O(1),
> because resizes happen very rarely.
https://stackoverflow.com/a/5932364/502187

Michael F. Stemper schrieb am Montag, 20. September 2021 um 19:56:59 UTC+2:
> Do you happen to know what the asymptotic complexity of the
> remove operation is?

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<mailman.757.1632161376.4164.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15259&group=comp.lang.python#15259

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ros...@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
Date: Tue, 21 Sep 2021 04:09:22 +1000
Lines: 79
Message-ID: <mailman.757.1632161376.4164.python-list@python.org>
References: <6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com>
<CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net>
<fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org>
<YUh1S59dbFZ3d3IM@hjp.at>
<CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<mailman.753.1632138579.4164.python-list@python.org>
<ccdfa071-fbdf-4720-87fb-d0665b59d1c4n@googlegroups.com>
<CAPTjJmozo+xk=oam+gev4g4tOaA1Ez2nzpHz+r1OgHM4HO_J7w@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de tjjViCq/Oj7Nr0RoNLxejgw8RP848CAROMf/2i+1GszQ==
Return-Path: <rosuav@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=GPSFW3j8;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.009
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'url-ip:140.82/16': 0.03;
'frequent': 0.05; "python's": 0.05; 'arrays': 0.07; 'filter':
0.07; 'python.': 0.08; 'anymore.': 0.09; 'else:': 0.09;
'resizing': 0.09; 'url:github': 0.14; 'url-ip:140/8': 0.15;
'append()': 0.16; 'assuming': 0.16; 'capacity.': 0.16; 'chrisa':
0.16; 'collection,': 0.16; 'drops': 0.16; 'from:addr:rosuav':
0.16; 'from:name:chris angelico': 0.16; 'hand,': 0.16; 'indeed':
0.16; 'none:': 0.16; 'rarely.': 0.16; 'scanning': 0.16; 'seen.':
0.16; 'subject:ANN': 0.16; 'thats': 0.16; 'want,': 0.16; 'wrote:':
0.16; 'python': 0.16; 'instead': 0.17; 'uses': 0.19; 'tue,': 0.19;
'to:addr:python-list': 0.20; 'maybe': 0.22; 'version': 0.23;
'code': 0.23; 'list,': 0.24; 'cannot': 0.25; 'tried': 0.26;
'wrong': 0.28; "doesn't": 0.32; 'elements': 0.32; 'here,': 0.32;
'lists,': 0.32; 'negative': 0.32; 'sep': 0.32; 'to:name:python':
0.32; "wouldn't": 0.32; 'message-id:@mail.gmail.com': 0.32; 'but':
0.32; 'there': 0.33; 'header:In-Reply-To:1': 0.34;
'received:google.com': 0.34; 'received:209.85.166': 0.35;
'from:addr:gmail.com': 0.35; 'also,': 0.36; 'count': 0.36;
'lists': 0.37; 'currently': 0.37; 'using': 0.37;
'received:209.85': 0.37; 'read': 0.38; 'received:209': 0.39;
'quite': 0.39; 'single': 0.39; 'branch': 0.39; 'list': 0.39;
'use': 0.39; 'seeing': 0.39; 'happen': 0.40; 'try': 0.40;
'should': 0.40; 'simply': 0.63; 'copy': 0.63; 'becomes': 0.64;
'url:a': 0.64; 'your': 0.64; 'saw': 0.65; 'now,': 0.67; 'back':
0.67; 'items': 0.68; 'during': 0.69; 'stands': 0.69; '2021': 0.71;
'implemented': 0.76; 'subject:2021': 0.76; 'position': 0.81;
'happens': 0.84; 'about,': 0.84; 'allocated': 0.84; 'excess':
0.84; 'garbage': 0.84; 'pointer': 0.84; 'type,': 0.84; 'positive':
0.86; 'cheap': 0.91; 'collapse': 0.91; 'expensive': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
bh=N/ZVs1uCnZECoCVTLzVbAbqWqR+c8Nudm/oiK/4kRtE=;
b=GPSFW3j85IDHgE9c+vnbuj4xJ0O5vH7flFiu4UjDpoAgYiwvf3q027Zqo8LQageOMu
vXV27FA7qj8X+ZAqHN+zBzgyOE8D92O6Po81FrnHMO/SD23uT19JPar4vUPH7OFXnu0c
RfMFOBUpgAV+8qq2/wPulm7RCuvk6g4E7lefFr/U0tNOeQJIUoQN6JnmPlXQUbzy2ph5
b1CT9ZlBY9wmb6uf0//cwd3kxHXqA7FWm/SNz4Z+8c2NkgAIhFu+NaWn4TFVZ1eXQDJ7
pTHNhsFPX5AlrmTtEVIYxS1+TfULqUOtsNXifUdLKBa8qIXVPqrXc4Wbn5bEovVRz9hx
vnPw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to;
bh=N/ZVs1uCnZECoCVTLzVbAbqWqR+c8Nudm/oiK/4kRtE=;
b=EErCW/k85NAwMSTrPSLogSckqZDkE0kkoCLsWaCSpJ6P/S7K3FW2j8gffncQAcxwof
xuobT+z7Bn9nPJP6A11tFd7qD6FzctB5YpZeF3cWW+MM3KndmFJ4FzRsB6FTgsuVrf4F
W0X7Rh5kQHzKBP6kLMq6ExRtGMdLZ1UZFJnVDaajDrvLYyhfEIN4/ILp6s9Cs+nadK8I
bXVlzPijl28sC3lpqohH3f48QuwukYVmVEeLlKy24t9U5sEnr8vnNI139Ca9T76L1emK
/Duo/0iml/IN+ho7Mu93hJJVSIUDa1b6cm3AQvbIN1aupY+WTw9SWlF1tvAwlP9ZFnSh
lkxQ==
X-Gm-Message-State: AOAM533KWm7eZ6ur2N0MtgwEYWxs5wZteO3vbLZJDxT1r26cZW3wGv87
CyHQNBUVgvmJ2zJbG/9AwTNACBVmiPZvrQdq8NInNtTriV0=
X-Google-Smtp-Source: ABdhPJy5MAZIegzv3e2zub8YtLA71GShFiQZNVSVFNcE0PZx9aPxbmj55Z9ap98WS94mKeLnpqyvUuacRN+yPO8JGBs=
X-Received: by 2002:a05:6638:14b:: with SMTP id
y11mr14107967jao.34.1632161373944;
Mon, 20 Sep 2021 11:09:33 -0700 (PDT)
In-Reply-To: <ccdfa071-fbdf-4720-87fb-d0665b59d1c4n@googlegroups.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAPTjJmozo+xk=oam+gev4g4tOaA1Ez2nzpHz+r1OgHM4HO_J7w@mail.gmail.com>
X-Mailman-Original-References: <6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com>
<CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net>
<fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org>
<YUh1S59dbFZ3d3IM@hjp.at>
<CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<mailman.753.1632138579.4164.python-list@python.org>
<ccdfa071-fbdf-4720-87fb-d0665b59d1c4n@googlegroups.com>
 by: Chris Angelico - Mon, 20 Sep 2021 18:09 UTC

On Tue, Sep 21, 2021 at 3:58 AM Mostowski Collapse <bursejan@gmail.com> wrote:
>
> I read the following, and you should also know:
>
> > Python's [] is implemented as an array, not a linked list.
> > Although resizing is O(n), appending to it is amortized O(1),
> > because resizes happen very rarely.
> https://stackoverflow.com/a/5932364/502187
>
> The list type doesn't have an O(1) operation to remove
> an element during sweep. The list type, not like its name
> would suggest, in Python is an array.
>
> These arrays are not so expensive when you append()
> an element. Because they are allocated with some excess
> capacity. And they grow exponentially.
>
> So amortisized you can append() a lot of elements to
> a Python list, which is an array. But you cannot poke so
> cheaply holes into it. So if you have this scenario:
>
> Before:
> - [ A1, .., An , B, C1, .., Cm ]
>
> After:
> - [ A1, .., An , C1, .., Cm ]
>
> You have to copy C1,..,Cm one position down. On the other
> hand, when scanning the single list, removing the
> element is just pointer swizzling.
>
> The code is here, the positive if-then-else branch keeps
> the element, the negative if-then-else branch drops the
> element. Thats quite standard algorithm for linked lists:
>
> /* pointer swizzling */
> while temp is not None:
> term = temp
> temp = term.tail
> if (term.flags & MASK_VAR_MARK) != 0:
> term.flags &= ~MASK_VAR_MARK
> if back is not None:
> back.tail = term
> else:
> trail = term
> back = term
> else:
> term.instantiated = NotImplemented
> term.tail = None
> count -= 1
>
> https://github.com/jburse/dogelog-moon/blob/main/devel/runtimepy/drawer/machine.py#L163
>
> There is nothing wrong with implementing a single list
> in Python. Only you never saw that one maybe. If you would
> indeed use Python lists which are arrays, you would
> maybe get a much slower sweep_trail() and this would
> be seen. But currently its not seen. It happens that 1000000
> of elements are sweeped, if you would do this with copy
> inside a Python list which are arrays, it would get much
> more expensive, and the extremly cheap Prolog garbage
> collection, as it stands now, wouldn't be that cheap anymore.
>
> You can try yourself. My sweep_trail() needs frequent resize,
> which would be O(n) each, so that sweep_trail becomes O(n^2).
> Which the current implementation its only O(n).
>

How about, instead: Use a Python list, and instead of removing
individual items one by one, filter out the ones you don't want, using
a list comprehension? That would be O(n) to completely remove all the
ones you don't want, instead of O(n) for each individual removal.

Also, have you actually benchmarked a version that uses Python's
lists, or are you simply assuming that the removals will be slow?
Implementing your own singly-linked list was clearly suboptimal, but
have you tried writing simpler code and seeing if it is also faster?

ChrisA

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<370d72a5-efb8-4b4a-9e70-91d68cdb392cn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15260&group=comp.lang.python#15260

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a37:a886:: with SMTP id r128mr12247833qke.453.1632162478823;
Mon, 20 Sep 2021 11:27:58 -0700 (PDT)
X-Received: by 2002:a37:a155:: with SMTP id k82mr11646348qke.349.1632162478643;
Mon, 20 Sep 2021 11:27:58 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Mon, 20 Sep 2021 11:27:58 -0700 (PDT)
In-Reply-To: <mailman.757.1632161376.4164.python-list@python.org>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com>
<CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net> <fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org>
<YUh1S59dbFZ3d3IM@hjp.at> <CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<mailman.753.1632138579.4164.python-list@python.org> <CAPTjJmozo+xk=oam+gev4g4tOaA1Ez2nzpHz+r1OgHM4HO_J7w@mail.gmail.com>
<ccdfa071-fbdf-4720-87fb-d0665b59d1c4n@googlegroups.com> <mailman.757.1632161376.4164.python-list@python.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <370d72a5-efb8-4b4a-9e70-91d68cdb392cn@googlegroups.com>
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 20 Sep 2021 18:27:58 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 127
 by: Mostowski Collapse - Mon, 20 Sep 2021 18:27 UTC

Its a good idea to use list comprehension. But its
an incomplete solution.

I don't think the single list is suboptimal, it has complexity
O(n). How would you solve the adjust_mark() problem with
list comprehension?

Also I am not using anything low-level. I don't use a
module unsafe or some such. I even don't know whether
Python has a module unsafe, but other high level

languages do it by a module unsafe. There are now
3 claims by Chris Angelico that are completely baseless
and just polute this thread:

- Baseless Claim 1: Need to optimize gc(), but
it takes only 2-3% of runtime. Why would I optimize gc().

- Baseless Claim 2: My single list is subobtimal,
but it is O(n), the same complexity as list comprehension,
but there is no list comprehension solution around
that also solves the adjust_mark() issue.

- Baseless Claim 3: My code is low level. But nothing
in the code is low level, its all programmed in proper
Python high level. List comprehension, that doesn't
solve the problem is not more high level than single
linked lists. Its just a failed attempt at a solution.

The adjust_mark() is also explained here. See section
"Sweeping the Stack" (Page 22). The paper does it slightly
different than Dogelog Runtime. Dogelog Runtime does it:

/* Dogelog Runtime */
adjust_mark() /* which is the SICStus sweep_stack() */
sweep_stack() /* which includes the SICStus compact_heap(), so to speak */

SICStus has sweep_stack() without compact_heap() first.
The paper shows C-code. But this doesn't imply that
I want C-code. I am only using it as an algorithmic

template, not as a verbatim code template.

Mostowski Collapse schrieb am Montag, 20. September 2021 um 14:22:05 UTC+2:
> Garbage Collection for Prolog Based on WAM
> January 1986
> Karen Appleby, Mats Carlsson, Seif Haridi, Dan Sahlin
> https://www.researchgate.net/publication/279463524

Chris Angelico schrieb am Montag, 20. September 2021 um 20:09:52 UTC+2:
> On Tue, Sep 21, 2021 at 3:58 AM Mostowski Collapse <burs...@gmail.com> wrote:
> >
> > I read the following, and you should also know:
> >
> > > Python's [] is implemented as an array, not a linked list.
> > > Although resizing is O(n), appending to it is amortized O(1),
> > > because resizes happen very rarely.
> > https://stackoverflow.com/a/5932364/502187
> >
> > The list type doesn't have an O(1) operation to remove
> > an element during sweep. The list type, not like its name
> > would suggest, in Python is an array.
> >
> > These arrays are not so expensive when you append()
> > an element. Because they are allocated with some excess
> > capacity. And they grow exponentially.
> >
> > So amortisized you can append() a lot of elements to
> > a Python list, which is an array. But you cannot poke so
> > cheaply holes into it. So if you have this scenario:
> >
> > Before:
> > - [ A1, .., An , B, C1, .., Cm ]
> >
> > After:
> > - [ A1, .., An , C1, .., Cm ]
> >
> > You have to copy C1,..,Cm one position down. On the other
> > hand, when scanning the single list, removing the
> > element is just pointer swizzling.
> >
> > The code is here, the positive if-then-else branch keeps
> > the element, the negative if-then-else branch drops the
> > element. Thats quite standard algorithm for linked lists:
> >
> > /* pointer swizzling */
> > while temp is not None:
> > term = temp
> > temp = term.tail
> > if (term.flags & MASK_VAR_MARK) != 0:
> > term.flags &= ~MASK_VAR_MARK
> > if back is not None:
> > back.tail = term
> > else:
> > trail = term
> > back = term
> > else:
> > term.instantiated = NotImplemented
> > term.tail = None
> > count -= 1
> >
> > https://github.com/jburse/dogelog-moon/blob/main/devel/runtimepy/drawer/machine.py#L163
> >
> > There is nothing wrong with implementing a single list
> > in Python. Only you never saw that one maybe. If you would
> > indeed use Python lists which are arrays, you would
> > maybe get a much slower sweep_trail() and this would
> > be seen. But currently its not seen. It happens that 1000000
> > of elements are sweeped, if you would do this with copy
> > inside a Python list which are arrays, it would get much
> > more expensive, and the extremly cheap Prolog garbage
> > collection, as it stands now, wouldn't be that cheap anymore.
> >
> > You can try yourself. My sweep_trail() needs frequent resize,
> > which would be O(n) each, so that sweep_trail becomes O(n^2).
> > Which the current implementation its only O(n).
> >
> How about, instead: Use a Python list, and instead of removing
> individual items one by one, filter out the ones you don't want, using
> a list comprehension? That would be O(n) to completely remove all the
> ones you don't want, instead of O(n) for each individual removal.
>
> Also, have you actually benchmarked a version that uses Python's
> lists, or are you simply assuming that the removals will be slow?
> Implementing your own singly-linked list was clearly suboptimal, but
> have you tried writing simpler code and seeing if it is also faster?
>
> ChrisA

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<2429f44c-a824-4a08-97b4-94b2b82a4378n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15261&group=comp.lang.python#15261

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a37:618c:: with SMTP id v134mr11222183qkb.231.1632163003156;
Mon, 20 Sep 2021 11:36:43 -0700 (PDT)
X-Received: by 2002:a0c:aa4f:: with SMTP id e15mr16793174qvb.43.1632163002961;
Mon, 20 Sep 2021 11:36:42 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Mon, 20 Sep 2021 11:36:42 -0700 (PDT)
In-Reply-To: <a9ca6a2d-b4f2-4869-b51c-2cd886825663n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=146.200.61.243; posting-account=aKzvzQoAAAAnYB7N4xfKf_Ihdfau7aG5
NNTP-Posting-Host: 146.200.61.243
References: <6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com>
<CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net> <fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org>
<CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<CAPTjJmrjn5Cr9Jky6uajHCHnJNgRA1zs1X5JNztFaSe4fhmwLA@mail.gmail.com>
<YUh1S59dbFZ3d3IM@hjp.at> <mailman.754.1632140693.4164.python-list@python.org>
<ed2ef4e8-63df-439d-8f53-07dcad35d5e2n@googlegroups.com> <f93ee73d-5856-4938-a965-c628a0335851n@googlegroups.com>
<a9ca6a2d-b4f2-4869-b51c-2cd886825663n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2429f44c-a824-4a08-97b4-94b2b82a4378n@googlegroups.com>
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
From: breamore...@gmail.com (Mark Lawrence)
Injection-Date: Mon, 20 Sep 2021 18:36:43 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 7
 by: Mark Lawrence - Mon, 20 Sep 2021 18:36 UTC

On Monday, September 20, 2021 at 1:52:18 PM UTC+1, Mostowski Collapse wrote:
> Now I am expecting somebody telling me I should not
> program Java style in Python. So I wonder what would have
> happened if I would tell you I am FORTRAN programmer.
>

http://dirtsimple.org/2004/12/python-is-not-java.html
http://dirtsimple.org/2004/12/java-is-not-python-either.html

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<edf6aac4-af99-4755-bf06-fdef6c9517e4n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15262&group=comp.lang.python#15262

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:ad4:4ab1:: with SMTP id i17mr26246140qvx.11.1632163173252;
Mon, 20 Sep 2021 11:39:33 -0700 (PDT)
X-Received: by 2002:a05:620a:632:: with SMTP id 18mr3726595qkv.457.1632163173073;
Mon, 20 Sep 2021 11:39:33 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Mon, 20 Sep 2021 11:39:32 -0700 (PDT)
In-Reply-To: <370d72a5-efb8-4b4a-9e70-91d68cdb392cn@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: <6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com>
<CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net> <fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org>
<YUh1S59dbFZ3d3IM@hjp.at> <CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<mailman.753.1632138579.4164.python-list@python.org> <CAPTjJmozo+xk=oam+gev4g4tOaA1Ez2nzpHz+r1OgHM4HO_J7w@mail.gmail.com>
<ccdfa071-fbdf-4720-87fb-d0665b59d1c4n@googlegroups.com> <mailman.757.1632161376.4164.python-list@python.org>
<370d72a5-efb8-4b4a-9e70-91d68cdb392cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <edf6aac4-af99-4755-bf06-fdef6c9517e4n@googlegroups.com>
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 20 Sep 2021 18:39:33 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 160
 by: Mostowski Collapse - Mon, 20 Sep 2021 18:39 UTC

A good picture in the paper is on Page 25. The picture
as 3 diagrams. The following diagrams correspond
to Dogelog runtime code:

2. Diagram: Updating the Choice Points, this my adjust_mark()
3. Diagram: Sliding the Trail, this is my sweep_trail()

The above solution is linked list based. If you can
provide an array based solution, using list comprehension,
why not? But is it possible? And how?

I am refering to this paper:

Mostowski Collapse schrieb am Montag, 20. September 2021 um 14:22:05 UTC+2:
> Garbage Collection for Prolog Based on WAM
> January 1986
> Karen Appleby, Mats Carlsson, Seif Haridi, Dan Sahlin
> https://www.researchgate.net/publication/279463524

P.S.: I know how it could be done with list comprehension,
in that you do a kind of double comprehension, or two separate
comprehensions with some variable remembering the last

non-marked trail. This would require to traverse the choice
points from the bottom, in parallel to the trail. But it would
require to replace the choice points by another datastructure,

because the choice points also point only from top to bottom,
and there is no order from bottom to top. But even if you
manage to implement this circus act, it still begs the

question what you gain? Since garbage collection only
takes 2-3% of execution time?

Mostowski Collapse schrieb am Montag, 20. September 2021 um 20:28:12 UTC+2:
> Its a good idea to use list comprehension. But its
> an incomplete solution.
>
> I don't think the single list is suboptimal, it has complexity
> O(n). How would you solve the adjust_mark() problem with
> list comprehension?
>
> Also I am not using anything low-level. I don't use a
> module unsafe or some such. I even don't know whether
> Python has a module unsafe, but other high level
>
> languages do it by a module unsafe. There are now
> 3 claims by Chris Angelico that are completely baseless
> and just polute this thread:
>
> - Baseless Claim 1: Need to optimize gc(), but
> it takes only 2-3% of runtime. Why would I optimize gc().
>
> - Baseless Claim 2: My single list is subobtimal,
> but it is O(n), the same complexity as list comprehension,
> but there is no list comprehension solution around
> that also solves the adjust_mark() issue.
>
> - Baseless Claim 3: My code is low level. But nothing
> in the code is low level, its all programmed in proper
> Python high level. List comprehension, that doesn't
> solve the problem is not more high level than single
> linked lists. Its just a failed attempt at a solution.
>
> The adjust_mark() is also explained here. See section
> "Sweeping the Stack" (Page 22). The paper does it slightly
> different than Dogelog Runtime. Dogelog Runtime does it:
>
> /* Dogelog Runtime */
> adjust_mark() /* which is the SICStus sweep_stack() */
> sweep_stack() /* which includes the SICStus compact_heap(), so to speak */
>
> SICStus has sweep_stack() without compact_heap() first.
> The paper shows C-code. But this doesn't imply that
> I want C-code. I am only using it as an algorithmic
>
> template, not as a verbatim code template.
> Mostowski Collapse schrieb am Montag, 20. September 2021 um 14:22:05 UTC+2:
> > Garbage Collection for Prolog Based on WAM
> > January 1986
> > Karen Appleby, Mats Carlsson, Seif Haridi, Dan Sahlin
> > https://www.researchgate.net/publication/279463524
> Chris Angelico schrieb am Montag, 20. September 2021 um 20:09:52 UTC+2:
> > On Tue, Sep 21, 2021 at 3:58 AM Mostowski Collapse <burs...@gmail.com> wrote:
> > >
> > > I read the following, and you should also know:
> > >
> > > > Python's [] is implemented as an array, not a linked list.
> > > > Although resizing is O(n), appending to it is amortized O(1),
> > > > because resizes happen very rarely.
> > > https://stackoverflow.com/a/5932364/502187
> > >
> > > The list type doesn't have an O(1) operation to remove
> > > an element during sweep. The list type, not like its name
> > > would suggest, in Python is an array.
> > >
> > > These arrays are not so expensive when you append()
> > > an element. Because they are allocated with some excess
> > > capacity. And they grow exponentially.
> > >
> > > So amortisized you can append() a lot of elements to
> > > a Python list, which is an array. But you cannot poke so
> > > cheaply holes into it. So if you have this scenario:
> > >
> > > Before:
> > > - [ A1, .., An , B, C1, .., Cm ]
> > >
> > > After:
> > > - [ A1, .., An , C1, .., Cm ]
> > >
> > > You have to copy C1,..,Cm one position down. On the other
> > > hand, when scanning the single list, removing the
> > > element is just pointer swizzling.
> > >
> > > The code is here, the positive if-then-else branch keeps
> > > the element, the negative if-then-else branch drops the
> > > element. Thats quite standard algorithm for linked lists:
> > >
> > > /* pointer swizzling */
> > > while temp is not None:
> > > term = temp
> > > temp = term.tail
> > > if (term.flags & MASK_VAR_MARK) != 0:
> > > term.flags &= ~MASK_VAR_MARK
> > > if back is not None:
> > > back.tail = term
> > > else:
> > > trail = term
> > > back = term
> > > else:
> > > term.instantiated = NotImplemented
> > > term.tail = None
> > > count -= 1
> > >
> > > https://github.com/jburse/dogelog-moon/blob/main/devel/runtimepy/drawer/machine.py#L163
> > >
> > > There is nothing wrong with implementing a single list
> > > in Python. Only you never saw that one maybe. If you would
> > > indeed use Python lists which are arrays, you would
> > > maybe get a much slower sweep_trail() and this would
> > > be seen. But currently its not seen. It happens that 1000000
> > > of elements are sweeped, if you would do this with copy
> > > inside a Python list which are arrays, it would get much
> > > more expensive, and the extremly cheap Prolog garbage
> > > collection, as it stands now, wouldn't be that cheap anymore.
> > >
> > > You can try yourself. My sweep_trail() needs frequent resize,
> > > which would be O(n) each, so that sweep_trail becomes O(n^2).
> > > Which the current implementation its only O(n).
> > >
> > How about, instead: Use a Python list, and instead of removing
> > individual items one by one, filter out the ones you don't want, using
> > a list comprehension? That would be O(n) to completely remove all the
> > ones you don't want, instead of O(n) for each individual removal.
> >
> > Also, have you actually benchmarked a version that uses Python's
> > lists, or are you simply assuming that the removals will be slow?
> > Implementing your own singly-linked list was clearly suboptimal, but
> > have you tried writing simpler code and seeing if it is also faster?
> >
> > ChrisA

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<6c69d64c-d010-4e35-8c5d-5e07b106c311n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15263&group=comp.lang.python#15263

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a37:e301:: with SMTP id y1mr24690073qki.475.1632163722949;
Mon, 20 Sep 2021 11:48:42 -0700 (PDT)
X-Received: by 2002:ac8:4583:: with SMTP id l3mr9052628qtn.188.1632163722786;
Mon, 20 Sep 2021 11:48:42 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Mon, 20 Sep 2021 11:48:42 -0700 (PDT)
In-Reply-To: <edf6aac4-af99-4755-bf06-fdef6c9517e4n@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: <6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com>
<CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net> <fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org>
<YUh1S59dbFZ3d3IM@hjp.at> <CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<mailman.753.1632138579.4164.python-list@python.org> <CAPTjJmozo+xk=oam+gev4g4tOaA1Ez2nzpHz+r1OgHM4HO_J7w@mail.gmail.com>
<ccdfa071-fbdf-4720-87fb-d0665b59d1c4n@googlegroups.com> <mailman.757.1632161376.4164.python-list@python.org>
<370d72a5-efb8-4b4a-9e70-91d68cdb392cn@googlegroups.com> <edf6aac4-af99-4755-bf06-fdef6c9517e4n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6c69d64c-d010-4e35-8c5d-5e07b106c311n@googlegroups.com>
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 20 Sep 2021 18:48:42 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 173
 by: Mostowski Collapse - Mon, 20 Sep 2021 18:48 UTC

The double comprehension, might even spare some double
work. It can happen that two different adjust_mark() calls
for two different choice points, run over the same

unmarked trail segment. I did not yet measure how often
this happened. Initially, the early Dogelog Runtime versions,
every clause had at least one variable for the continuation,

and therefore this double work didn't happen. But release 0.9.6
eliminated this variable. This makes the trail also smaller.
But now it becomes possible that adjust_mark() slides

along longer unmarked trail segments, and different adjust_mark()
might even have such segments in common now.

Mostowski Collapse schrieb am Montag, 20. September 2021 um 20:39:43 UTC+2:
> A good picture in the paper is on Page 25. The picture
> as 3 diagrams. The following diagrams correspond
> to Dogelog runtime code:
>
> 2. Diagram: Updating the Choice Points, this my adjust_mark()
> 3. Diagram: Sliding the Trail, this is my sweep_trail()
>
> The above solution is linked list based. If you can
> provide an array based solution, using list comprehension,
> why not? But is it possible? And how?
>
> I am refering to this paper:
> Mostowski Collapse schrieb am Montag, 20. September 2021 um 14:22:05 UTC+2:
> > Garbage Collection for Prolog Based on WAM
> > January 1986
> > Karen Appleby, Mats Carlsson, Seif Haridi, Dan Sahlin
> > https://www.researchgate.net/publication/279463524
> P.S.: I know how it could be done with list comprehension,
> in that you do a kind of double comprehension, or two separate
> comprehensions with some variable remembering the last
>
> non-marked trail. This would require to traverse the choice
> points from the bottom, in parallel to the trail. But it would
> require to replace the choice points by another datastructure,
>
> because the choice points also point only from top to bottom,
> and there is no order from bottom to top. But even if you
> manage to implement this circus act, it still begs the
>
> question what you gain? Since garbage collection only
> takes 2-3% of execution time?
> Mostowski Collapse schrieb am Montag, 20. September 2021 um 20:28:12 UTC+2:
> > Its a good idea to use list comprehension. But its
> > an incomplete solution.
> >
> > I don't think the single list is suboptimal, it has complexity
> > O(n). How would you solve the adjust_mark() problem with
> > list comprehension?
> >
> > Also I am not using anything low-level. I don't use a
> > module unsafe or some such. I even don't know whether
> > Python has a module unsafe, but other high level
> >
> > languages do it by a module unsafe. There are now
> > 3 claims by Chris Angelico that are completely baseless
> > and just polute this thread:
> >
> > - Baseless Claim 1: Need to optimize gc(), but
> > it takes only 2-3% of runtime. Why would I optimize gc().
> >
> > - Baseless Claim 2: My single list is subobtimal,
> > but it is O(n), the same complexity as list comprehension,
> > but there is no list comprehension solution around
> > that also solves the adjust_mark() issue.
> >
> > - Baseless Claim 3: My code is low level. But nothing
> > in the code is low level, its all programmed in proper
> > Python high level. List comprehension, that doesn't
> > solve the problem is not more high level than single
> > linked lists. Its just a failed attempt at a solution.
> >
> > The adjust_mark() is also explained here. See section
> > "Sweeping the Stack" (Page 22). The paper does it slightly
> > different than Dogelog Runtime. Dogelog Runtime does it:
> >
> > /* Dogelog Runtime */
> > adjust_mark() /* which is the SICStus sweep_stack() */
> > sweep_stack() /* which includes the SICStus compact_heap(), so to speak */
> >
> > SICStus has sweep_stack() without compact_heap() first.
> > The paper shows C-code. But this doesn't imply that
> > I want C-code. I am only using it as an algorithmic
> >
> > template, not as a verbatim code template.
> > Mostowski Collapse schrieb am Montag, 20. September 2021 um 14:22:05 UTC+2:
> > > Garbage Collection for Prolog Based on WAM
> > > January 1986
> > > Karen Appleby, Mats Carlsson, Seif Haridi, Dan Sahlin
> > > https://www.researchgate.net/publication/279463524
> > Chris Angelico schrieb am Montag, 20. September 2021 um 20:09:52 UTC+2:
> > > On Tue, Sep 21, 2021 at 3:58 AM Mostowski Collapse <burs...@gmail.com> wrote:
> > > >
> > > > I read the following, and you should also know:
> > > >
> > > > > Python's [] is implemented as an array, not a linked list.
> > > > > Although resizing is O(n), appending to it is amortized O(1),
> > > > > because resizes happen very rarely.
> > > > https://stackoverflow.com/a/5932364/502187
> > > >
> > > > The list type doesn't have an O(1) operation to remove
> > > > an element during sweep. The list type, not like its name
> > > > would suggest, in Python is an array.
> > > >
> > > > These arrays are not so expensive when you append()
> > > > an element. Because they are allocated with some excess
> > > > capacity. And they grow exponentially.
> > > >
> > > > So amortisized you can append() a lot of elements to
> > > > a Python list, which is an array. But you cannot poke so
> > > > cheaply holes into it. So if you have this scenario:
> > > >
> > > > Before:
> > > > - [ A1, .., An , B, C1, .., Cm ]
> > > >
> > > > After:
> > > > - [ A1, .., An , C1, .., Cm ]
> > > >
> > > > You have to copy C1,..,Cm one position down. On the other
> > > > hand, when scanning the single list, removing the
> > > > element is just pointer swizzling.
> > > >
> > > > The code is here, the positive if-then-else branch keeps
> > > > the element, the negative if-then-else branch drops the
> > > > element. Thats quite standard algorithm for linked lists:
> > > >
> > > > /* pointer swizzling */
> > > > while temp is not None:
> > > > term = temp
> > > > temp = term.tail
> > > > if (term.flags & MASK_VAR_MARK) != 0:
> > > > term.flags &= ~MASK_VAR_MARK
> > > > if back is not None:
> > > > back.tail = term
> > > > else:
> > > > trail = term
> > > > back = term
> > > > else:
> > > > term.instantiated = NotImplemented
> > > > term.tail = None
> > > > count -= 1
> > > >
> > > > https://github.com/jburse/dogelog-moon/blob/main/devel/runtimepy/drawer/machine.py#L163
> > > >
> > > > There is nothing wrong with implementing a single list
> > > > in Python. Only you never saw that one maybe. If you would
> > > > indeed use Python lists which are arrays, you would
> > > > maybe get a much slower sweep_trail() and this would
> > > > be seen. But currently its not seen. It happens that 1000000
> > > > of elements are sweeped, if you would do this with copy
> > > > inside a Python list which are arrays, it would get much
> > > > more expensive, and the extremly cheap Prolog garbage
> > > > collection, as it stands now, wouldn't be that cheap anymore.
> > > >
> > > > You can try yourself. My sweep_trail() needs frequent resize,
> > > > which would be O(n) each, so that sweep_trail becomes O(n^2).
> > > > Which the current implementation its only O(n).
> > > >
> > > How about, instead: Use a Python list, and instead of removing
> > > individual items one by one, filter out the ones you don't want, using
> > > a list comprehension? That would be O(n) to completely remove all the
> > > ones you don't want, instead of O(n) for each individual removal.
> > >
> > > Also, have you actually benchmarked a version that uses Python's
> > > lists, or are you simply assuming that the removals will be slow?
> > > Implementing your own singly-linked list was clearly suboptimal, but
> > > have you tried writing simpler code and seeing if it is also faster?
> > >
> > > ChrisA


Click here to read the complete article
Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<mailman.758.1632167507.4164.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15264&group=comp.lang.python#15264

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: hjp-pyt...@hjp.at (Peter J. Holzer)
Newsgroups: comp.lang.python
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
Date: Mon, 20 Sep 2021 21:51:44 +0200
Lines: 123
Message-ID: <mailman.758.1632167507.4164.python-list@python.org>
References: <si07i1$ds$1@solani.org> <iql5tuFjaqU1@mid.individual.net>
<fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org>
<si6tl1$csn$1@solani.org> <YUh1S59dbFZ3d3IM@hjp.at>
<CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<mailman.753.1632138579.4164.python-list@python.org>
<ccdfa071-fbdf-4720-87fb-d0665b59d1c4n@googlegroups.com>
<YUjmUFZMg9kJCK9q@hjp.at>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
protocol="application/pgp-signature"; boundary="lzeezILEmj4qqaZg"
X-Trace: news.uni-berlin.de PvijIO3OREuGbTk9MDCAgwofgVsu+S2vhxDjDffhwNoQ==
Return-Path: <hjp-python@hjp.at>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.001
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '(which': 0.04; 'def':
0.04; 'yet.': 0.04; 'content-type:multipart/signed': 0.05;
'random': 0.05; '-0700,': 0.09; 'compiler': 0.09; 'content-
type:application/pgp-signature': 0.09; 'filename:fname piece:asc':
0.09; 'filename:fname piece:signature': 0.09;
'filename:fname:signature.asc': 0.09; 'it)': 0.09; 'lookup': 0.09;
'objects,': 0.09; 'unlike': 0.09; 'import': 0.15; 'memory': 0.15;
'problem.': 0.15; '"creative': 0.16; '(even': 0.16; '3.8,': 0.16;
'__/': 0.16; 'builtin': 0.16; 'challenge!"': 0.16; 'compiled':
0.16; 'cpython': 0.16; 'dict': 0.16; 'from:addr:hjp-python': 0.16;
'from:addr:hjp.at': 0.16; 'from:name:peter j. holzer': 0.16;
'hand,': 0.16; 'happening.': 0.16; 'hjp@hjp.at': 0.16; 'holzer':
0.16; 'jit': 0.16; 'n-1': 0.16; 'objects.': 0.16; 'pointers':
0.16; 'reality.': 0.16; 'scanning': 0.16; 'shorter': 0.16;
'stross,': 0.16; 'subject:ANN': 0.16; 'url-ip:212.17.106.137/32':
0.16; 'url-ip:212.17.106/24': 0.16; 'url-ip:212.17/16': 0.16;
'url:hjp': 0.16; '|_|_)': 0.16; 'wrote:': 0.16; 'python': 0.16;
'code.': 0.17; 'probably': 0.17; 'uses': 0.19; 'to:addr:python-
list': 0.20; 'machine': 0.22; 'languages': 0.22; 'laptop': 0.23;
'list,': 0.24; 'depends': 0.25; 'seems': 0.26; 'normally': 0.26;
'object': 0.26; 'bit': 0.27; 'expect': 0.28; 'sense': 0.28;
'think': 0.32; 'elements': 0.32; 'guess': 0.32; 'nature': 0.32;
'but': 0.32; 'there': 0.33; '100': 0.33; 'able': 0.34; 'header:In-
Reply-To:1': 0.34; 'lists': 0.37; 'special': 0.37; "it's": 0.37;
'quite': 0.39; 'single': 0.39; 'list': 0.39; 'methods': 0.39;
'both': 0.40; 'something': 0.40; 'best': 0.61; 'received:212':
0.62; 'here': 0.62; 'copy': 0.63; 'skip:b 20': 0.63; 'between':
0.63; 'skip:b 10': 0.63; 'company': 0.64; 'produce': 0.65;
'similar': 0.65; 'less': 0.65; 'received:userid': 0.66;
'operations': 0.68; 'skip:# 10': 0.68; 'par': 0.69; 'repeatedly':
0.69; 'url-ip:212/8': 0.69; '1000': 0.70; 'performance': 0.71;
'longer': 0.71; 'head': 0.73; 'plus': 0.73; 'charset:iso-8859-1':
0.73; 'hundreds': 0.75; 'implemented': 0.76; 'subject:2021': 0.76;
'spent': 0.81; 'position': 0.81; 'elements,': 0.84; 'optimizing':
0.84; 'pointer': 0.84; 'received:at': 0.84; 'dollars': 0.86;
'cheap': 0.91; 'collapse': 0.91; 'pop': 0.91; 'clock': 0.93;
'seemingly': 0.93
Content-Disposition: inline
In-Reply-To: <ccdfa071-fbdf-4720-87fb-d0665b59d1c4n@googlegroups.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <YUjmUFZMg9kJCK9q@hjp.at>
X-Mailman-Original-References: <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net>
<fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org>
<si6tl1$csn$1@solani.org>
<YUh1S59dbFZ3d3IM@hjp.at>
<CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<mailman.753.1632138579.4164.python-list@python.org>
<ccdfa071-fbdf-4720-87fb-d0665b59d1c4n@googlegroups.com>
 by: Peter J. Holzer - Mon, 20 Sep 2021 19:51 UTC
Attachments: signature.asc (application/pgp-signature)

On 2021-09-20 05:08:55 -0700, Mostowski Collapse wrote:
> You have to copy C1,..,Cm one position down. On the other
> hand, when scanning the single list, removing the
> element is just pointer swizzling.

That's the problem. You think that pointer swizzling is fast because you
are used to languages where this is compiled into a few machine
instructions. (Even there it depends a lot on locality: A random memory
access can take hundreds of clock cycles.)

In Python something like «a.next = b.next» normally does a dict lookup
on both objects, plus it also has to check for the existence of special
methods on both objects. You can probably copy quite a few contiguous
bytes while this is happening.

Here is a simple demo:

------------------------------------------------------------------------
#!/usr/bin/python3

import time

n = 10000

def build_linked_list(n):
head = [None, None]
tail = head
for i in range(n):
tail[1] = [i, None]
tail = tail[1]
return head

def empty_list(ls):
while ls[1]:
ls[1] = ls[1][1]

t0 = time.monotonic()
ll = build_linked_list(n)
t1 = time.monotonic()
empty_list(ll)
t2 = time.monotonic()
print(n, t1 - t0, t2 - t1)
------------------------------------------------------------------------
#!/usr/bin/python3

import time

n = 10000

def build_list(n):
return list(range(n))

def empty_list(ls):
while ls:
ls.pop(0)

t0 = time.monotonic()
ll = build_list(n)
t1 = time.monotonic()
empty_list(ll)
t2 = time.monotonic()
print(n, t1 - t0, t2 - t1)
------------------------------------------------------------------------

Both scripts create a list of n integers, then repeatedly pop off the
first element until the list is empty. The first uses a linked list
(where each element is a Python list - I guess this is faster than an
object although I haven't timed it) the second a python list. Popping
off the first element is the worst case for a python list since it is
implemented as an array of pointers and n-1 pointers have to be copied
for each operation and the best case for a linked list.

Still, on my laptop with CPython 3.8, the builtin list is faster for
lists of less than 100 elements, they are about on par between 100 and
1000 elements and only for longer lists does the linked list become
faster.

With Pypy 6.0 (yes, I know it's old), the linked list seems to be always
a bit faster although the difference is very small for lists shorter
than 100 elements - GraalVM is probably closer to PyPy than to CPython
in its performance characteristics, but the point is that the dynamic
nature of Python makes some seemingly cheap operations much more costly
than one would expect - a good optimizing compiler may be able to detect
that all that is not needed in a specific case and produce
straightforward code. But unlike for JavaScript (which has a very
similar problem) no company has spent millions of dollars on an
optimizing JIT compiler for Python yet.

hp

--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp@hjp.at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"

Attachments: signature.asc (application/pgp-signature)
Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<5a58cf4d-6b36-4536-b487-9f1ee4f447ebn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15267&group=comp.lang.python#15267

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a0c:8c81:: with SMTP id p1mr27814959qvb.7.1632174803041;
Mon, 20 Sep 2021 14:53:23 -0700 (PDT)
X-Received: by 2002:a37:48f:: with SMTP id 137mr9345002qke.105.1632174802740;
Mon, 20 Sep 2021 14:53:22 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Mon, 20 Sep 2021 14:53:22 -0700 (PDT)
In-Reply-To: <mailman.758.1632167507.4164.python-list@python.org>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <si07i1$ds$1@solani.org> <iql5tuFjaqU1@mid.individual.net>
<fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com> <CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org>
<YUh1S59dbFZ3d3IM@hjp.at> <CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<mailman.753.1632138579.4164.python-list@python.org> <YUjmUFZMg9kJCK9q@hjp.at>
<ccdfa071-fbdf-4720-87fb-d0665b59d1c4n@googlegroups.com> <mailman.758.1632167507.4164.python-list@python.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5a58cf4d-6b36-4536-b487-9f1ee4f447ebn@googlegroups.com>
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 20 Sep 2021 21:53:23 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 122
 by: Mostowski Collapse - Mon, 20 Sep 2021 21:53 UTC

ls.pop() is probably also, not only attribute access. Just check
out the figures here, its not pop() but append():

>>> %%timeit
out = []
for x in range(10**6):
out.append(x**2)
....
1 loops, best of 3: 510 ms per loop

>>> %%timeit
out = [];append=out.append
for x in range(10**6):
append(x**2)
....
1 loops, best of 3: 467 ms per loop

https://stackoverflow.com/a/30097520/502187

Peter J. Holzer schrieb am Montag, 20. September 2021 um 21:51:59 UTC+2:
> On 2021-09-20 05:08:55 -0700, Mostowski Collapse wrote:
> > You have to copy C1,..,Cm one position down. On the other
> > hand, when scanning the single list, removing the
> > element is just pointer swizzling.
> That's the problem. You think that pointer swizzling is fast because you
> are used to languages where this is compiled into a few machine
> instructions. (Even there it depends a lot on locality: A random memory
> access can take hundreds of clock cycles.)
>
> In Python something like «a.next = b.next» normally does a dict lookup
> on both objects, plus it also has to check for the existence of special
> methods on both objects. You can probably copy quite a few contiguous
> bytes while this is happening.
>
> Here is a simple demo:
>
> ------------------------------------------------------------------------
> #!/usr/bin/python3
>
> import time
>
> n = 10000
>
> def build_linked_list(n):
> head = [None, None]
> tail = head
> for i in range(n):
> tail[1] = [i, None]
> tail = tail[1]
> return head
>
> def empty_list(ls):
> while ls[1]:
> ls[1] = ls[1][1]
>
> t0 = time.monotonic()
> ll = build_linked_list(n)
> t1 = time.monotonic()
> empty_list(ll)
> t2 = time.monotonic()
> print(n, t1 - t0, t2 - t1)
> ------------------------------------------------------------------------
> #!/usr/bin/python3
>
> import time
>
> n = 10000
>
> def build_list(n):
> return list(range(n))
>
> def empty_list(ls):
> while ls:
> ls.pop(0)
>
> t0 = time.monotonic()
> ll = build_list(n)
> t1 = time.monotonic()
> empty_list(ll)
> t2 = time.monotonic()
> print(n, t1 - t0, t2 - t1)
> ------------------------------------------------------------------------
>
> Both scripts create a list of n integers, then repeatedly pop off the
> first element until the list is empty. The first uses a linked list
> (where each element is a Python list - I guess this is faster than an
> object although I haven't timed it) the second a python list. Popping
> off the first element is the worst case for a python list since it is
> implemented as an array of pointers and n-1 pointers have to be copied
> for each operation and the best case for a linked list.
>
> Still, on my laptop with CPython 3.8, the builtin list is faster for
> lists of less than 100 elements, they are about on par between 100 and
> 1000 elements and only for longer lists does the linked list become
> faster.
>
> With Pypy 6.0 (yes, I know it's old), the linked list seems to be always
> a bit faster although the difference is very small for lists shorter
> than 100 elements - GraalVM is probably closer to PyPy than to CPython
> in its performance characteristics, but the point is that the dynamic
> nature of Python makes some seemingly cheap operations much more costly
> than one would expect - a good optimizing compiler may be able to detect
> that all that is not needed in a specific case and produce
> straightforward code. But unlike for JavaScript (which has a very
> similar problem) no company has spent millions of dollars on an
> optimizing JIT compiler for Python yet.
> hp
>
> --
> _ | Peter J. Holzer | Story must make more sense than reality.
> |_|_) | |
> | | | h...@hjp.at | -- Charles Stross, "Creative writing
> __/ | http://www.hjp.at/ | challenge!"

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<c13257d9-3d0a-4c37-a35b-1ed5cd94f9e3n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15268&group=comp.lang.python#15268

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a37:ab15:: with SMTP id u21mr22993759qke.394.1632175911326;
Mon, 20 Sep 2021 15:11:51 -0700 (PDT)
X-Received: by 2002:a37:66c7:: with SMTP id a190mr18747697qkc.427.1632175911103;
Mon, 20 Sep 2021 15:11:51 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Mon, 20 Sep 2021 15:11:50 -0700 (PDT)
In-Reply-To: <5a58cf4d-6b36-4536-b487-9f1ee4f447ebn@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: <si07i1$ds$1@solani.org> <iql5tuFjaqU1@mid.individual.net>
<fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com> <CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org>
<YUh1S59dbFZ3d3IM@hjp.at> <CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<mailman.753.1632138579.4164.python-list@python.org> <YUjmUFZMg9kJCK9q@hjp.at>
<ccdfa071-fbdf-4720-87fb-d0665b59d1c4n@googlegroups.com> <mailman.758.1632167507.4164.python-list@python.org>
<5a58cf4d-6b36-4536-b487-9f1ee4f447ebn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c13257d9-3d0a-4c37-a35b-1ed5cd94f9e3n@googlegroups.com>
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 20 Sep 2021 22:11:51 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 161
 by: Mostowski Collapse - Mon, 20 Sep 2021 22:11 UTC

Woa! PyPy is faster! Faster than GraalVM. Now I get
for my usual benchmark, figures in milliseconds:

Standard GraalVM PyPy
170'996 28'523 9'755

Not bad. Only like 2x times slower than node.exe.
Now imaging I can realize the ast.parse() and

compile() idea as well! (Made an experiment
today, testing some corner with evaluation)

BTW: Here the full results. Was using:
pypy3.7-v7.3.5-win64\pypy3.exe

Test Standard GraalVM PyPy
nrev 20'389 3'611 1'254
crypt 17'103 3'248 960
deriv 20'808 3'111 1'250
poly 17'518 3'045 1'149
qsort 20'191 3'243 1'127
tictac 13'761 2'469 783
queens 17'691 3'242 1'024
query 6'161 1'155 313
mtak 17'209 2'300 907
perfect 20'165 3'099 988
calc N/A N/A N/A
Total 170'996 28'523 9'755

Mostowski Collapse schrieb am Montag, 20. September 2021 um 23:53:32 UTC+2:
> ls.pop() is probably also, not only attribute access. Just check
> out the figures here, its not pop() but append():
>
> >>> %%timeit
> out = []
> for x in range(10**6):
> out.append(x**2)
> ...
> 1 loops, best of 3: 510 ms per loop
>
> >>> %%timeit
> out = [];append=out.append
> for x in range(10**6):
> append(x**2)
> ...
> 1 loops, best of 3: 467 ms per loop
>
> https://stackoverflow.com/a/30097520/502187
> Peter J. Holzer schrieb am Montag, 20. September 2021 um 21:51:59 UTC+2:
> > On 2021-09-20 05:08:55 -0700, Mostowski Collapse wrote:
> > > You have to copy C1,..,Cm one position down. On the other
> > > hand, when scanning the single list, removing the
> > > element is just pointer swizzling.
> > That's the problem. You think that pointer swizzling is fast because you
> > are used to languages where this is compiled into a few machine
> > instructions. (Even there it depends a lot on locality: A random memory
> > access can take hundreds of clock cycles.)
> >
> > In Python something like «a.next = b.next» normally does a dict lookup
> > on both objects, plus it also has to check for the existence of special
> > methods on both objects. You can probably copy quite a few contiguous
> > bytes while this is happening.
> >
> > Here is a simple demo:
> >
> > ------------------------------------------------------------------------
> > #!/usr/bin/python3
> >
> > import time
> >
> > n = 10000
> >
> > def build_linked_list(n):
> > head = [None, None]
> > tail = head
> > for i in range(n):
> > tail[1] = [i, None]
> > tail = tail[1]
> > return head
> >
> > def empty_list(ls):
> > while ls[1]:
> > ls[1] = ls[1][1]
> >
> > t0 = time.monotonic()
> > ll = build_linked_list(n)
> > t1 = time.monotonic()
> > empty_list(ll)
> > t2 = time.monotonic()
> > print(n, t1 - t0, t2 - t1)
> > ------------------------------------------------------------------------
> > #!/usr/bin/python3
> >
> > import time
> >
> > n = 10000
> >
> > def build_list(n):
> > return list(range(n))
> >
> > def empty_list(ls):
> > while ls:
> > ls.pop(0)
> >
> > t0 = time.monotonic()
> > ll = build_list(n)
> > t1 = time.monotonic()
> > empty_list(ll)
> > t2 = time.monotonic()
> > print(n, t1 - t0, t2 - t1)
> > ------------------------------------------------------------------------
> >
> > Both scripts create a list of n integers, then repeatedly pop off the
> > first element until the list is empty. The first uses a linked list
> > (where each element is a Python list - I guess this is faster than an
> > object although I haven't timed it) the second a python list. Popping
> > off the first element is the worst case for a python list since it is
> > implemented as an array of pointers and n-1 pointers have to be copied
> > for each operation and the best case for a linked list.
> >
> > Still, on my laptop with CPython 3.8, the builtin list is faster for
> > lists of less than 100 elements, they are about on par between 100 and
> > 1000 elements and only for longer lists does the linked list become
> > faster.
> >
> > With Pypy 6.0 (yes, I know it's old), the linked list seems to be always
> > a bit faster although the difference is very small for lists shorter
> > than 100 elements - GraalVM is probably closer to PyPy than to CPython
> > in its performance characteristics, but the point is that the dynamic
> > nature of Python makes some seemingly cheap operations much more costly
> > than one would expect - a good optimizing compiler may be able to detect
> > that all that is not needed in a specific case and produce
> > straightforward code. But unlike for JavaScript (which has a very
> > similar problem) no company has spent millions of dollars on an
> > optimizing JIT compiler for Python yet.
> > hp
> >
> > --
> > _ | Peter J. Holzer | Story must make more sense than reality.
> > |_|_) | |
> > | | | h...@hjp.at | -- Charles Stross, "Creative writing
> > __/ | http://www.hjp.at/ | challenge!"

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<sib44d$kc0$1@solani.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15269&group=comp.lang.python#15269

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janbu...@fastmail.fm (Mostowski Collapse)
Newsgroups: comp.lang.python
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
Date: Tue, 21 Sep 2021 01:05:49 +0200
Message-ID: <sib44d$kc0$1@solani.org>
References: <6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com>
<CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net>
<fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org>
<si6tl1$csn$1@solani.org>
<CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<CAPTjJmrjn5Cr9Jky6uajHCHnJNgRA1zs1X5JNztFaSe4fhmwLA@mail.gmail.com>
<YUh1S59dbFZ3d3IM@hjp.at>
<mailman.754.1632140693.4164.python-list@python.org>
<ed2ef4e8-63df-439d-8f53-07dcad35d5e2n@googlegroups.com>
<f93ee73d-5856-4938-a965-c628a0335851n@googlegroups.com>
<a9ca6a2d-b4f2-4869-b51c-2cd886825663n@googlegroups.com>
<2429f44c-a824-4a08-97b4-94b2b82a4378n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 20 Sep 2021 23:05:49 -0000 (UTC)
Injection-Info: solani.org;
logging-data="20864"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101
Firefox/60.0 SeaMonkey/2.53.9
X-User-ID: eJwFwYEBwCAIA7CXOqAFzxGV/09YQtenkyEqOJwlkOhHMxXnNowlnJjtppuOF1PZlbvWwURuUPZ0wy+sfy0rFKQ=
Cancel-Lock: sha1:UK/YhaN5I07WxdOfT9r21hb0iLA=
In-Reply-To: <2429f44c-a824-4a08-97b4-94b2b82a4378n@googlegroups.com>
 by: Mostowski Collapse - Mon, 20 Sep 2021 23:05 UTC

The Java vs Python articles are utterly outdated.
For example they think a difference between Java
and Python is that Java is interface centric.

The articles are from 2004. But the ABC PEP is from 2007:

https://www.python.org/dev/peps/pep-3119/

https://www.python.org/dev/peps/pep-3141/

You find also write-ups like:

https://realpython.com/python-interface/

Hope this helps!

Mark Lawrence wrote:
> On Monday, September 20, 2021 at 1:52:18 PM UTC+1, Mostowski Collapse wrote:
>> Now I am expecting somebody telling me I should not
>> program Java style in Python. So I wonder what would have
>> happened if I would tell you I am FORTRAN programmer.
>>
>
> http://dirtsimple.org/2004/12/python-is-not-java.html
> http://dirtsimple.org/2004/12/java-is-not-python-either.html
>

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<iqsk43FdpjhU1@mid.individual.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15270&group=comp.lang.python#15270

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: greg.ew...@canterbury.ac.nz (Greg Ewing)
Newsgroups: comp.lang.python
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
Date: Tue, 21 Sep 2021 11:34:27 +1200
Lines: 14
Message-ID: <iqsk43FdpjhU1@mid.individual.net>
References: <6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com>
<CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net>
<fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org>
<si6tl1$csn$1@solani.org> <YUh1S59dbFZ3d3IM@hjp.at>
<CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<mailman.753.1632138579.4164.python-list@python.org>
<ccdfa071-fbdf-4720-87fb-d0665b59d1c4n@googlegroups.com>
<si9u35$v9u$1@solani.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net N5OYblmxtnoyQBQXvkkN6w6ln1PUtFkw/97muIhy4p5gmALEJB
Cancel-Lock: sha1:B7G/52pP0T/uCj8ln0QOPtC6Vkg=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:78.0)
Gecko/20100101 Thunderbird/78.4.0
In-Reply-To: <si9u35$v9u$1@solani.org>
Content-Language: en-US
 by: Greg Ewing - Mon, 20 Sep 2021 23:34 UTC

On 21/09/21 12:16 am, Mostowski Collapse wrote:
> This is needed to adjust the choice points.
> If you have an array instead of a linked
> listed as I have now, you would need
> to adjust array indexes instead pointers
> into linked list elements.

All right, so you don't just have a list, you have a more complicated
data structure. The way you're doing it is probably reasonable, and
good enough given it's not a significant part of the running time.

--
Greg

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<f801f040-c5fe-4398-8c38-01ae6b8f4942n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15317&group=comp.lang.python#15317

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:ad4:4a01:: with SMTP id m1mr5294860qvz.29.1632413897863;
Thu, 23 Sep 2021 09:18:17 -0700 (PDT)
X-Received: by 2002:a37:a54c:: with SMTP id o73mr5751312qke.334.1632413897654;
Thu, 23 Sep 2021 09:18:17 -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.python
Date: Thu, 23 Sep 2021 09:18:17 -0700 (PDT)
In-Reply-To: <iqsk43FdpjhU1@mid.individual.net>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com>
<CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net> <fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org>
<YUh1S59dbFZ3d3IM@hjp.at> <CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<mailman.753.1632138579.4164.python-list@python.org> <ccdfa071-fbdf-4720-87fb-d0665b59d1c4n@googlegroups.com>
<si9u35$v9u$1@solani.org> <iqsk43FdpjhU1@mid.individual.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f801f040-c5fe-4398-8c38-01ae6b8f4942n@googlegroups.com>
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 23 Sep 2021 16:18:17 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Mostowski Collapse - Thu, 23 Sep 2021 16:18 UTC

A nice project could now be to redo this one,
see how the prover would perform:

FLiP, a Logical Framework in Python
http://staff.washington.edu/jon/flip/www/index.html

The prover is listed here:

Proof checkers - Joseph Vidal-Rosset
https://www.vidal-rosset.net/proof_checkers.html

Ha Ha, the prover was just right in front of my nose
all the time. But before venturing into such a quest,
need to add occurs check to the Dogelog runtime.

I had some very good dynamic optimization for
occurs check in Jekejeke Prolog, but for Dogelog
runtime everything is new, need to figure out what

optimizations could be applied there. There is a ticket
for occurs check already on GitHub:

Bring occurs check to Dogelog runtime #143
https://github.com/jburse/dogelog-moon/issues/143

Greg Ewing schrieb am Dienstag, 21. September 2021 um 01:34:38 UTC+2:
> On 21/09/21 12:16 am, Mostowski Collapse wrote:
> > This is needed to adjust the choice points.
> > If you have an array instead of a linked
> > listed as I have now, you would need
> > to adjust array indexes instead pointers
> > into linked list elements.
> All right, so you don't just have a list, you have a more complicated
> data structure. The way you're doing it is probably reasonable, and
> good enough given it's not a significant part of the running time.
>
> --
> Greg

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<7a87e42f-a658-41ae-812e-cc393b849fb3n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15318&group=comp.lang.python#15318

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a05:622a:1111:: with SMTP id e17mr5560032qty.185.1632414963536;
Thu, 23 Sep 2021 09:36:03 -0700 (PDT)
X-Received: by 2002:a37:48f:: with SMTP id 137mr5706788qke.105.1632414963362;
Thu, 23 Sep 2021 09:36:03 -0700 (PDT)
Path: i2pn2.org!rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Thu, 23 Sep 2021 09:36:03 -0700 (PDT)
In-Reply-To: <f801f040-c5fe-4398-8c38-01ae6b8f4942n@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: <6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com>
<CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net> <fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org>
<YUh1S59dbFZ3d3IM@hjp.at> <CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<mailman.753.1632138579.4164.python-list@python.org> <ccdfa071-fbdf-4720-87fb-d0665b59d1c4n@googlegroups.com>
<si9u35$v9u$1@solani.org> <iqsk43FdpjhU1@mid.individual.net> <f801f040-c5fe-4398-8c38-01ae6b8f4942n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7a87e42f-a658-41ae-812e-cc393b849fb3n@googlegroups.com>
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 23 Sep 2021 16:36:03 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 73
 by: Mostowski Collapse - Thu, 23 Sep 2021 16:36 UTC

That I get censored on Python pipermail, is possibly an
out burst of taking Python too literal, like here:

Monty Python - She's a witch!
https://www.youtube.com/watch?v=zrzMhU_4m-g

But we can turn this into a FLiP, a Logical Framework in Python exercise:

"There are ways of telling whether she's a witch."
"What do you do with witches?" "Burn them!"
Ax.(Witch(x) -> Burn(x)) (1) Given
"Why do witches burn?" "'Cause they're made of wood!"
Ax.(Wood(x) -> Witch(x)) (2) Given
"How do we tell if she's made of wood?" "Does wood sink in water?" "It floats!"
Ax.(Floats(x) -> Wood(x)) (3) Given
"What also floats in water?" "A duck!"
Floats(duck) (4) Given
"Exactly! So, logically ..."
"If she weights the same as a duck, she's made of wood!"
Ax.Ay.((Floats(x) & (weight(x) = weight(y))) -> Floats(y)) (5) Given
"We shall use my largest scales. ... Remove the supports!"
weight(duck) = weight(girl) (6) Given
Ay.((Floats(duck) & (weight(duck) = weight(y))) -> Floats(y)) (7) A-Elimination (5)
(Floats(duck) & (weight(duck) = weight(girl))) -> Floats(girl) (8) A-Elimination (7)
Floats(duck) & (weight(duck) = weight(girl)) (9) And-Introduction (4) (6)
Floats(girl) (10) Implication-Elimination (Modus Ponens) (8) (9)
Floats(girl) -> Wood(girl) (11) A-Elimination (3)
Wood(girl) (12) Implication-Elimination (Modus Ponens) (11) (10)
"A witch! A witch!"
Wood(girl) -> Witch(girl) (13) A-Elimination (2)
Witch(girl) (14) Implication-Elimination (Modus Ponens) (13) (12)
"Burn her! Burn!"
Witch(girl) -> Burn(girl) (15) A-Elimination (1)
Burn(girl) (16) Implication-Elimination (Modus Ponens) (15) (14)
http://staff.washington.edu/jon/flip/www/witch.html

Mostowski Collapse schrieb am Donnerstag, 23. September 2021 um 18:18:30 UTC+2:
> A nice project could now be to redo this one,
> see how the prover would perform:
>
> FLiP, a Logical Framework in Python
> http://staff.washington.edu/jon/flip/www/index.html
>
> The prover is listed here:
>
> Proof checkers - Joseph Vidal-Rosset
> https://www.vidal-rosset.net/proof_checkers.html
>
> Ha Ha, the prover was just right in front of my nose
> all the time. But before venturing into such a quest,
> need to add occurs check to the Dogelog runtime.
>
> I had some very good dynamic optimization for
> occurs check in Jekejeke Prolog, but for Dogelog
> runtime everything is new, need to figure out what
>
> optimizations could be applied there. There is a ticket
> for occurs check already on GitHub:
>
> Bring occurs check to Dogelog runtime #143
> https://github.com/jburse/dogelog-moon/issues/143
> Greg Ewing schrieb am Dienstag, 21. September 2021 um 01:34:38 UTC+2:
> > On 21/09/21 12:16 am, Mostowski Collapse wrote:
> > > This is needed to adjust the choice points.
> > > If you have an array instead of a linked
> > > listed as I have now, you would need
> > > to adjust array indexes instead pointers
> > > into linked list elements.
> > All right, so you don't just have a list, you have a more complicated
> > data structure. The way you're doing it is probably reasonable, and
> > good enough given it's not a significant part of the running time.
> >
> > --
> > Greg

Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)

<32e02a2f-d361-4a36-b2d7-18c7fbf402c8n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15928&group=comp.lang.python#15928

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a05:622a:56:: with SMTP id y22mr61653618qtw.364.1636331132165;
Sun, 07 Nov 2021 16:25:32 -0800 (PST)
X-Received: by 2002:ad4:4451:: with SMTP id l17mr65227358qvt.33.1636331132043;
Sun, 07 Nov 2021 16:25:32 -0800 (PST)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!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.python
Date: Sun, 7 Nov 2021 16:25:31 -0800 (PST)
In-Reply-To: <7a87e42f-a658-41ae-812e-cc393b849fb3n@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: <6a2ecba4-0558-4784-a9ae-edefca830351n@googlegroups.com>
<CAPTjJmrmdK48mhFTOkKKOh9Y=5oRJErE1L4SqfRmQkXJ91Z1cg@mail.gmail.com>
<mailman.731.1631813366.4164.python-list@python.org> <si07i1$ds$1@solani.org>
<iql5tuFjaqU1@mid.individual.net> <fc2ede48-9232-4720-97c2-cdd67d310734n@googlegroups.com>
<CAPTjJmrt=CPA3eGzgq=ez7Z_5rab2z8-J907WXQZHJAp+Zcbvg@mail.gmail.com>
<mailman.743.1632016663.4164.python-list@python.org> <si6tl1$csn$1@solani.org>
<YUh1S59dbFZ3d3IM@hjp.at> <CAPTjJmrG1XcrvU+HhfwS0sCNnvLXq4oQFY29acw6vKir8UnSOQ@mail.gmail.com>
<mailman.753.1632138579.4164.python-list@python.org> <ccdfa071-fbdf-4720-87fb-d0665b59d1c4n@googlegroups.com>
<si9u35$v9u$1@solani.org> <iqsk43FdpjhU1@mid.individual.net>
<f801f040-c5fe-4398-8c38-01ae6b8f4942n@googlegroups.com> <7a87e42f-a658-41ae-812e-cc393b849fb3n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <32e02a2f-d361-4a36-b2d7-18c7fbf402c8n@googlegroups.com>
Subject: Re: ANN: Dogelog Runtime, Prolog to the Moon (2021)
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 08 Nov 2021 00:25:32 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Mostowski Collapse - Mon, 8 Nov 2021 00:25 UTC

Dogelogs new signature sound:

Led Zeppelin Immigrant song (Racing Beat remix)
https://www.youtube.com/watch?v=oryBBkmIVCc

LoL

Pages:1234
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor