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

Mostowski Collapse bursejan at gmail.com
Wed Sep 15 22:56:39 EDT 2021


Compound is not used for boxing. Integers and floats
are represented directly. Also integers are not mapped to
floats. But maybe compound could be a little flattened,

like using directly an array. But then you cannot assure
anymore "clean, simple, readable code". For example now
I have clean, simple and readable code, since I can

access the functor of a compound via:

     obj.functor

but when I flatten Compound into arrays, it would become:

     obj[0]

Should I declare a constant FUNCTOR = 0? Some of your 
requirements have a trade-off, not all of them can be
sustained simultaneously so easy.

I am rather expecting languages like Python and JavaScript
to offer the same comfort as C or Java, except that
I don't need to write types for all the varianbles and fields

all the time. But this requires smart language compiler
and language runtime. V8 Chrome has interesting articles
how they optimize access like .functor.

Chris Angelico schrieb am Donnerstag, 16. September 2021 um 00:02:54 UTC+2:
> On Thu, Sep 16, 2021 at 7:59 AM Mostowski Collapse <burs... at gmail.com> wrote: 
> > 
> > BTW: I could already make it faster, by not repeatedly 
> > accessing .arg anymore. It went down from ca.: 
> > 
> > 171'000 ms 
> > 
> > To this here: 
> > 
> > 140'000 ms 
> > 
> > But only in the cold run. In the warm run it went back 
> > to 171'000 ms. Possibly when my code is faster, 
> > it will create objects more faster, and kill the Python GC. 
> > 
> > Or it was because my Laptop went into screen black? 
> > And throttled the CPU. Not sure. 
> >
> Instead of worrying about all these details, start by simplifying your 
> code. Focus on clean, simple, readable code, and don't microoptimize. 
> Specifically, focus on the core arithmetic that you're trying to do, 
> and get rid of all the bookkeeping overhead; most of that is a waste 
> of time. I mentioned earlier the repeated boxing and unboxing in 
> "Compound" objects - have you changed anything with those? 
> 
> ChrisA


More information about the Python-list mailing list