Yggdrasil now type secure

15 views
Skip to first unread message

dr.mt...@gmail.com

unread,
Nov 29, 2025, 3:13:03 AM (yesterday) Nov 29
to Shen
A lot of my time over the past year has been spent on my autobiography;
detailing the journeys I made from America, to the plains of India and
the mountains of China and back to my foggy and rain swept England.
The route to publication will be next.

So after a rather bumpy year, in which I lost two people from my life
- one in April and one in October - I've returned to Yggdrasil and begun
the completion of this part of Shen.

Yggdrasil is the raison d'etre for all the many Shen ports and hopefully
will function with even the oldest.   I've revamped and simplified the code
and made the result type secure for the first time.    It totals 200 loc and 
checks in 14,271 inferences.  

I'm now going to test it on cases of ascending complexity.

Mark

dr.mt...@gmail.com

unread,
Nov 29, 2025, 4:35:52 AM (yesterday) Nov 29
to Shen
OK - Yggdrasil computes the transitive closure of the call relation
in the kernel in 25s in Shen/SBCL building an FDG (functional
dependency graph).   This is much better than older versions which took
> 10 minutes for the same job and is due to vector processing and Warshall's
algorithm.  

Once the FDG is computed stand-alone programs in CL are spat out 
quickly.  I'm starting with the N queens program which takes 0.04s for
the stand-alone CL program to appear.  

I'm simplifying Yggdrasil somewhat.  The program assumes that the
primitives will be loaded into the app and a boilerplate file containing
all the tweaks needed to run the system (in CL, setting the reader etc).

I'm now going to test the N queens under SBCL.

M.

dr.mt...@gmail.com

unread,
Nov 29, 2025, 5:07:33 AM (24 hours ago) Nov 29
to Shen

  * (MAPCAR 'LOAD '("C:/Users/drmta/OneDrive/Desktop/Shen/Yggdrasil/CL/boilerplate.lsp"
                "C:/Users/drmta/OneDrive/Desktop/Shen/Yggdrasil/CL/primitives.lsp"
                "C:/Users/drmta/OneDrive/Desktop/Shen/Yggdrasil/CL/kernel.lsp"
                "C:/Users/drmta/OneDrive/Desktop/Shen/Yggdrasil/CL/n queens.lsp"))
(T T T T)
* (n-queens 8)
((4 2 7 3 6 8 5 1) (5 2 4 7 3 8 6 1) (3 5 2 8 6 4 7 1) (3 6 4 2 8 5 7 1)
 (5 7 1 3 8 6 4 2) (4 6 8 3 1 7 5 2)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 2 5 1 6) (4 8 5 3 1 7 2 6) (3 5 8 4 1 7 2 6) (4 2 8 5 7 1 3 6)
 (5 7 2 4 8 1 3 6) (7 4 2 5 8 1 3 6) (8 2 4 1 7 5 3 6) (7 2 4 1 8 5 3 6)
 (5 1 8 4 2 7 3 6) (4 1 5 8 2 7 3 6) (5 2 8 1 4 7 3 6) (3 7 2 8 5 1 4 6)
 (3 1 7 5 8 2 4 6) (8 2 5 3 1 7 4 6) (3 5 2 8 1 7 4 6) (3 5 7 1 4 2 8 6)
 (5 2 4 6 8 3 1 7) (6 3 5 8 1 4 2 7) (5 8 4 1 3 6 2 7) (4 2 5 8 6 1 3 7)
 (4 6 1 5 2 8 3 7) (6 3 1 8 5 2 4 7) (5 3 1 6 8 2 4 7) (4 2 8 6 1 3 5 7)
 (6 3 5 7 1 4 2 8) (6 4 7 1 3 5 2 8) (4 7 5 2 6 1 3 8) (5 7 2 6 3 1 4 8))

A few notes.

1. Boilerplate contains the CL reader and compiler settings.
2.  Primitives contains the KL primitives of course, but also I had to add
     some CL not in the primitives but in the backend.  These functions
     are introduced to optimise the compilation of KL to CL.  So you won't
     find them in the user code at all.  
3.  The file kernel.lsp is generated by Yggdrasil from an analysis of the
      user app.  It contains that fraction of the kernel needed to run the app.
4.  The file n-queens.lsp is the Lisp object code from the N queens Shen program,
     again Yggdrasil gnerates this.  

So the first two files are invariant and the last two not.

M.
Reply all
Reply to author
Forward
0 new messages