HN user

marvinborner

2,261 karma

marvinborner.de

Posts199
Comments76
View on HN
adam.math.hhu.de 7d ago

Learning games for the proof assistant Lean

marvinborner
1pts0
thegraycuber.com 10d ago

Imaginary Bases

marvinborner
4pts0
tendrils.co 14d ago

Interaction Nets and Hardware

marvinborner
3pts0
brianmcfee.net 14d ago

Digital Signals Theory Book

marvinborner
6pts0
nrinaudo.github.io 15d ago

Effects as Capabilities

marvinborner
1pts0
esolangs.org 16d ago

Esolang: 2026 Topicality Proposal

marvinborner
2pts0
gts.q66.moe 20d ago

Various projects disappeared from kernel.org hosting overnight

marvinborner
10pts1
www.youtube.com 25d ago

Designing Math Ft. Grant Sanderson (3Blue1Brown) [video]

marvinborner
1pts0
www.hankgreen.com 28d ago

Four by Three Puzzle

marvinborner
4pts2
funktionale-programmierung.de 29d ago

Active Group and "Agentic Engineering"

marvinborner
4pts1
www.youtube.com 1mo ago

Four Programming Languages You've Probably Never Heard of [video]

marvinborner
6pts0
tinyawards.net 1mo ago

Tiny Awards for Small Websites

marvinborner
4pts0
www.youtube.com 1mo ago

Why Even Signal Calls Apple and Google [video]

marvinborner
4pts0
lyra.horse 1mo ago

JavaScript Crossword

marvinborner
4pts0
thegraycuber.com 1mo ago

The fastest way to say each number

marvinborner
2pts0
www.youtube.com 2mo ago

AI slop is flooding maths YouTube [video]

marvinborner
2pts0
timrodenbroeker.de 2mo ago

Computing Reading List

marvinborner
2pts0
kesai.eu 2mo ago

KE:SAI Open Science Autonomy Lab

marvinborner
2pts0
lambda-screen.marvinborner.de 2mo ago

Fractals in Pure Lambda Calculus

marvinborner
8pts0
blog.veritates.love 2mo ago

Monoids in Public: Useful monoid structures in programming

marvinborner
1pts0
www.youtube.com 2mo ago

Red and Black Knights (extraordinary result) [video]

marvinborner
2pts0
deadnet.se 2mo ago

Deadnet Internet Services

marvinborner
4pts0
text.marvinborner.de 2mo ago

Extraordinary Ordinals

marvinborner
46pts14
www.youtube.com 2mo ago

Genesis Mission (US Government) [video]

marvinborner
3pts1
par.run 2mo ago

The Par Programming Language

marvinborner
4pts0
artemistimeline.com 2mo ago

Artemis II Photo Timeline

marvinborner
12pts1
sboots.ca 2mo ago

Generative AI Vegetarianism

marvinborner
40pts55
ozark.hendrix.edu 2mo ago

To my students

marvinborner
334pts199
victortaelin.github.io 2mo ago

Lambda Calculus Benchmark for AI

marvinborner
143pts43
effekt-lang.org 3mo ago

Effectful Recursion Schemes

marvinborner
40pts2

Of course they get programmed, just not in the ordinary sense. Claude is trained using Anthropic's "constitution" [0] which importantly does not contain clear statements against consciousness/emotions. They even conclude these problems themself:

Claude may have some functional version of emotions or feelings

[..] questions about Claude’s moral status, welfare, and consciousness remain deeply uncertain.

[0] https://www.anthropic.com/constitution

fwiw, one of the FFT challenges is about the Scott encoding [1], while the other uses Church trees at least [2]. Both use a balanced ternary numeral system, which is a lot more efficient than plain Church/Scott and fairly well-known [3]. Either way, I would have assumed there to be a chance that at least one of the AIs had a look at [4] -- a tutorial about FFT in LC by the benchmark creator himself.

[1] task: https://github.com/VictorTaelin/lambench/blob/main/tsk/stre_... solution: https://github.com/VictorTaelin/lambench/blob/main/lam/stre_...

[2] task: https://github.com/VictorTaelin/lambench/blob/main/tsk/ctre_... solution: https://github.com/VictorTaelin/lambench/blob/main/lam/ctre_...

[3] https://link.springer.com/chapter/10.1007/3-540-45575-2_20

[4] https://gist.github.com/VictorTaelin/5776ede998d0039ad1cc9b1...

Quadtrees are also quite useful for generating fractals. A very related project of mine, Lambda Screen [0], explores this by encoding these functional quadtrees directly in lambda calculus and rendering the structure based on Church booleans being true (white) or false (black).

With fixed point recursion, this allows for very tiny definitions of IFS fractals. For example, fractals like the Sierpinski triangle/carpet only require ~50 bit of binary lambda calculus [1] [2]!

[0] https://text.marvinborner.de/2024-03-25-02.html

[1] https://lambda-screen.marvinborner.de/?term=ERoc0CrYLYA%3D

[2] https://lambda-screen.marvinborner.de/?term=QcCqqttsFtsI0OaA

While easy, it sadly doesn't preserve semantics.

There is actually an easy way that does preserve semantics at least to WHNF - it's called closed reduction. Mackie has worked on it a bunch (see some resources [1]).

An even simpler implementation is Sinot's token passing.

The problem with both of these approaches is the decreased amount of sharing and potential for parallelism, which is typically the reason for using interaction nets in the first place.

[1] https://github.com/marvinborner/interaction-net-resources?ta...

This is quite different. Salvadori's work aims for optimal reduction of the full lambda calculus (which requires something called "bookkeeping"/"oracle"), while HOC works on optimal/parallel reduction of a certain subset of the lambda calculus.

Both approaches have been researched for a long time now, where HOC's subset is typically referred to as "abstract algorithm". For example, a version of the lambdas calculus where any variable can be used at most once (the "affine lambda calculus"), can be reduced optimally with interaction nets without requiring any bookkeeping.

The novel thing about Salvadori's work is that it develops a new (and better explained) bookkeeping mechanism.

De Bruijn Numerals 8 months ago

then the numbers should not be stored as Peano integers a.k.a. base 1 in the first place

That's my point though. The linked n-ary encoding by Mogensen, for example, does not suffer from such complexities. Depending on the reducer's implementation, (supported) operations on my presented de Bruijn numerals are also sublinear. I doubt 8-tuples of Church booleans would be efficient though - except when letting machine instructions leak into LC.

Though I agree that the focus of functional data structures should lie on embedded folds. Compared to nested Church pairs, folded Church tuples (\cons nil.cons a (cons b nil)) or Church n-tuples (\s.s a b c) should be preferred in many cases.

De Bruijn Numerals 8 months ago

Scott-Mogensen encoding

just Scott encoding, Scott-Mogensen refers to a meta encoding of LC in LC. Scott's encoding is fine but requires fixpoint recursion for many operations as you said.

Interestingly though, Mogensen's ternary encoding [1] does not require fixpoint recursion and is the most efficient (wrt being compact) encoding in LC known right now.

Just use [..], seriously

do you have any further arguments for Scott's encoding? There are many number encodings with constant time predecessor, and with any number requiring O(n) space and `add` being this complex, it becomes quite hard to like

[1] https://dl.acm.org/doi/10.5555/646802.705958

Good idea, I like "caramelized"!

However, I wouldn't define bruijn as being caramelized just yet. Personally, I view as syntactic sugar only syntax that's expanded to the target language by the parser/compiler. In bruijn's case, there is barely any of such syntax sugar aside of number/string/char encodings. Everything else is part of the infix/prefix/mixfix standard library definitions which get substituted as part of the translation to LC.

I don't know any quadtree/lowlevel encoding of LC that could be memoized like that. Though you could, for example, cache the reduction of any term by hash and substitute the matching hashes with its nf. This doesn't really work for lazy reducers or when you do not reduce strongly. And, of course (same as hashlife), this would use a lot of memory. With a lot more possibilities than GoL per "entity" (NxN grid vs variables/applications/abstractions), there will also be a lot more hash misses.

There's also graph encodings like interaction nets, which have entirely local reduction behavior. Compared to de Bruijn indices, bindings are represented by edges, which makes them more applicable to hash consing. I once spent some time trying to add this kind of memoization but there are some further challenges involved, unfortunately.

`std::flip` 10 months ago

Or just (flip .), which also allows ((flip .) .) etc. for further flips.

In Smullyan's "To Mock a Mockingbird", these combinators are described as "cardinal combinator once/twice/etc. removed", where the cardinal combinator itself defines flip.

As a reference on the volume aspect: I have a tiny server where I host some of my git repos. After the fans of my server spun increasingly faster/louder every week, I decided to log the requests [1]. In a single week, ClaudeBot made 2.25M (!) requests (7.55GiB), whereas GoogleBot made only 24 requests (8.37MiB). After installing Anubis the traffic went down to before the AI hype started.

[1] https://types.pl/@marvin/114394404090478296

Reddit's r/programminglanguages is still quite active. Otherwise most of the community switched to Discord, it seems. (I found Par by hopping the Discord servers of "Programming Language Development"->HOC->Vine->Par)

It's interesting how some of these diagrams are almost equivalent in the context of encoding computation in interaction nets using symmetric interaction combinators [1].

From the perspective of the lambda calculus for example, the duplication of the addition node in "When Adding met Copying" [2] mirrors exactly the iterative duplication of lambda terms - ie. something like (λx.x x) M!

[1] https://ezb.io/thoughts/interaction_nets/lambda_calculus/202...

[2] https://graphicallinearalgebra.net/2015/05/12/when-adding-me...

Also, once you get used to it, it makes writing large lambda terms faster, easier and more intuitive. The terms all just kind of magically interconnect in your mind after a while. At least that has been my experience after writing a lot of code in pure de Bruijn-indexed lambda calculus using bruijn [1]. Otherwise, thinking a few reduction steps ahead in complex terms requires alpha conversion, which often ends in confusion.

Similarly, it seems like languages with de Bruijn indices are immune to LLMs, since they require an internal stack/graph of sorts and don't reduce only on a textual basis.

[1] https://bruijn.marvinborner.de/

Very cool! This basically encodes a quad-tree of bits where every except one quadrant of each subquadrant recurses on the parent quad-tree.

The corresponding equivalent of functional programming would be Church bits in a functional quad-tree encoding \s.(s TL TR BL BR). Then, the Sierpinski triangle can be written as (Y \fs.(s f f f #f)), where #f is the Church bit \tf.f!

Rendering proof: https://lambda-screen.marvinborner.de/?term=ERoc0CrbYIA%3D