Yggdrasil Implementation + Update to ShenScript

213 views
Skip to first unread message

Reuben

unread,
Jun 12, 2026, 6:05:26 PMJun 12
to Shen
Based on Dr. Taver's description and code release of Yggdrasil, I put together an alternative implementation of the tree-shaking concept. See https://github.com/pyrex41/ratatoskr

This implementation targets shen-cl, shen-lua, shen-go, shen-rust, or ShenScript. I have also updated ShenScript to the latest 41.2 kernel, and added support for Deno+Bun: https://github.com/pyrex41/ShenScript. Happy to open PR against upstream but it has some significant changes to consider (issue here). The other ports have also been updated from 41.1 to 41.2.

Planning to shift gears and start building some things with Shen....


Juan Cadena

unread,
Jun 12, 2026, 7:57:27 PMJun 12
to qil...@googlegroups.com
Although I use ai extensively, I wouldn’t trust it for this work. 

Seems like interesting work though. 

--
You received this message because you are subscribed to the Google Groups "Shen" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qilang+un...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/qilang/8c957080-168f-4130-b304-be6ae18980ccn%40googlegroups.com.

Reuben

unread,
Jun 14, 2026, 4:00:09 PMJun 14
to Shen
To the extent my approach driving AI works, it's a testament to the clarity and quality of the underlying KLambda kernel, the standard test suite, and the strength of the existing ports that serve as useful context.

dr.mt...@gmail.com

unread,
Jun 16, 2026, 9:05:25 AMJun 16
to Shen
You've certainly put the effort into this.  I'll look at  Ratatoskr
more closely.  Perhaps you should be the keeper here and
a pointer on the Shen page to this implementation.

Mark

Reuben

unread,
Jun 19, 2026, 1:03:09 PMJun 19
to Shen
I'm happy to keep the Yggdrasil name -- "ratatoskr" was intended as an homage to directly connect the lineage. However, given the divergence in the design choices (notably, using a direct call graph instead of the Warshall closure), and that I made these choices unilaterally, it seemed appropriate to clearly differentiate from the original. There may be good reasons to prefer the Warshall closure that I have missed, and any such errors in judgement are mine alone.

dr.mt...@gmail.com

unread,
Jul 11, 2026, 1:07:39 AM (10 days ago) Jul 11
to Shen
On Friday, 19 June 2026 at 18:03:09 UTC+1 reub....@gmail.com wrote:
I'm happy to keep the Yggdrasil name -- "ratatoskr" was intended as an homage to directly connect the lineage. However, given the divergence in the design choices (notably, using a direct call graph instead of the Warshall closure), and that I made these choices unilaterally, it seemed appropriate to clearly differentiate from the original. There may be good reasons to prefer the Warshall closure that I have missed, and any such errors in judgement are mine alone.

I wouldn't worry too much about naming and if you want to take it over, its fine by me. 
With respect to Warshall, the algorithm is computationally expensive: computing the 
transitivity table for the Shen kernel takes about 26 seconds. However, once computed, 
the table can be reused for any number of different programs. Ratatoskr may therefore 
be faster for an individual program, but slower overall once the cost of constructing the 
reusable transitivity table has been amortised.  

FYI, here is the guts of it (64 loc) which works with the new stlib I just put up

(time (fdg ["KLambda\sequent.kl" "KLambda\sys.kl" "KLambda\toplevel.kl"
"KLambda\track.kl" "KLambda\t-star.kl" "KLambda\types.kl" "KLambda\writer.kl"
"KLambda\yacc.kl" "KLambda\backend.kl" "KLambda\core.kl" "KLambda\declarations.kl"
"KLambda\load.kl" "KLambda\macros.kl" "KLambda\prolog.kl" "KLambda\reader.kl"]))

run time: 26.375 secs
[[shen.<datatype-rules> shen.skip stoutput shen.a = if shen.app cn pr shen.loading? and let < cond shen.overapplication? defun shen.*loading?* value - cons ... etc]

fdg.shen

dr.mt...@gmail.com

unread,
Jul 13, 2026, 3:48:37 AM (8 days ago) Jul 13
to Shen
The attached was not type secure because read-file
returns a list of units where unit is an object of an
indeterminate type.  If we choose to define unit, it
can be type checked.

M.

fdg.shen
Reply all
Reply to author
Forward
0 new messages