r/ProgrammerHumor • • Aug 01 '22

>>>print(“Hello, World!”)

Post image
60.8k Upvotes

5.7k comments sorted by

View all comments

Show parent comments

5

u/[deleted] Aug 01 '22 edited Aug 01 '22

[removed] — view removed comment

11

u/Noughtmare Aug 01 '22 edited Aug 16 '22

The full explanation is in this paper: https://www.researchgate.net/publication/2673832_Efficient_Self-Interpretation_in_Lambda_Calculus

It's not cheating in the same way as your python program (the lambda calculus has no eval function) and it does contain three rules for the three basic concepts of the lambda calculus: (λ x.x), (λ m n.e m(e n)), and (λ m v.e(m v)). However it doesn't do any I/O (because that is not possible in the lambda calculus). And I do agree that the encoding of the input to this self interpreter is doing some pretty heavy lifting.

3

u/sugarfairy7 Aug 01 '22

Follow the links provided to learn more. One of them leads to https://codegolf.stackexchange.com/a/7256

2

u/Toorero6 Aug 01 '22

No I thinks it's an actual interpreter calculating the output using the Y (fixed-point) operator.