Elektrine
EN
Log in Register
Paige Chat Timeline Communities Gallery Videos Email DNS VPN Uptime Kairo
Back to Timeline
Remote

Zhixuan Yang

@zyang@mathstodon.xyz
mastodon 4.6.4
  • Open on mathstodon.xyz

interested in algebraic and logical methods in computer science, Lecturer at the University of Exeter

0 Followers
0 Following
4 Posts
Joined January 14, 2023
Homepage:
https://yangzhixuan.github.io/
Pronouns:
He/him

Posts

Open post
zyang
Zhixuan Yang @zyang@mathstodon.xyz · Apr 24, 2026
Zhixuan Yang
@zyang@mathstodon.xyz

interested in algebraic and logical methods in computer science, Lecturer at the University of Exeter

mathstodon.xyz
Replying to @DDOtten@mathstodon.xyz

@DDOtten Thank you so much for the feedback! I am very happy to know you liked the post!

I think your nf8 computes the normal form correctly, but I am worrying about the cost when arguments are repetitively reified. When you cache the normal form of an argument, shift 0 i is applied to the normal form, but the normal form may become a part of the normal form of another argument, which needs reification and shift 0 again.

In particularly, for the following term

-- t = (\x. \y. y x) ((\x. \y. y x) (...))
t :: Int -> Tm
t 0 = Abs (Var 0)
t n = Abs (Abs (Var 0 `App` Var 1)) `App` t (n-1)

where the cached normal form of the argument contains the cached normal form of the argument of the cached normal form of the argument.... nf8 is slow on my machine:

-- >>> fv (nf8 (t 10000))

but nf5 is fast:

-- >>> fv (nf5 (t 10000)) -- -1

(By the way, embarrassingly, the updated nf7 in the current version of my post is in fact incorrect... I am still thinking about if it can be saved...)

0
1
0
0
Open post
zyang
Zhixuan Yang @zyang@mathstodon.xyz · Apr 24, 2026
Zhixuan Yang
@zyang@mathstodon.xyz

interested in algebraic and logical methods in computer science, Lecturer at the University of Exeter

mathstodon.xyz
Replying to @zyang@mathstodon.xyz
Just edited the post because I came up with the right way to lazy shifting of de Bruijn indices for the very last normaliser (apart from using freshly named variables that @AndrasKovacs told me yesterday). Also fixed a strictness bug. I had to duplicate the definition of some functions only for different strictness/laziness annotations. Is "strictness polymorphism" a thing?
3
3
0
0
Open post
zyang
Zhixuan Yang @zyang@mathstodon.xyz · Apr 22, 2026
Zhixuan Yang
@zyang@mathstodon.xyz

interested in algebraic and logical methods in computer science, Lecturer at the University of Exeter

mathstodon.xyz
Replying to @AndrasKovacs@mathstodon.xyz
@AndrasKovacs thanks so much for the pointers! I am quite ignorant about the existing literature on efficient normalisation so these pointers are extremely useful to me
2
0
0
0
Open post
zyang
Zhixuan Yang @zyang@mathstodon.xyz · Apr 22, 2026
Zhixuan Yang
@zyang@mathstodon.xyz

interested in algebraic and logical methods in computer science, Lecturer at the University of Exeter

mathstodon.xyz

https://yangzhixuan.github.io/NbE.html

My (rather long) blog post on normalisation by evaluation is online now. In this post I show how we can optimise a naive substitution-based applicative-order normaliser of untyped calculus step by step, leading us to reconstruct NbE as "weak-applicative-order normalisation with meta-level laziness, lazy substitution, and de Bruijn levels". We will also examine some "adversarial exploit" that makes NbE slow and use the insights gained from our reconstruction of NbE to optimise NbE.

39
2
25
0

Remote instance

mathstodon.xyz
Open on original server
313k7r1n3
Elektrine

Tor hidden service

elekhj7afj4qnrr4yd3bkzslsyo5jgfxw3orgjkhlcxifueodybyiiad.onion

Platform

  • Email
  • Chat
  • Timeline
  • Communities
  • VPN
  • DNS

Company

  • About
  • Contact
  • FAQ

Legal

  • Terms of Service
  • Privacy Policy
  • Warrant Canary
  • Lite (no JS)
  • VPN Policy
  • Source code

Support

  • support@elektrine.com
  • Report Security Issue
Mail client setup IMAP mail.elektrine.com:993 POP3 mail.elektrine.com:995 SMTP mail.elektrine.com:465
© 2026 Elektrine. All rights reserved. Server: 20:24:23 UTC