News for hackers. Stuff that matters.
Re:Lisp as the Maxwell’s Equations of Software by tromp on Wednesday November 09, 2022 @10:43AM (#33533198)
I agree that Maxwell’s Equations of Software should be based on lambda calculus, the binary version of which [1] admits a much more concise 29 byte self-interpreter

        (λ11)(λλλ1(λλλλ3(λ5(3(λ2(3(λλ3(λ1 2 3)))(4(λ4(λ3 1(2 1))))))(1(2(λ1 2))(λ4(λ4(λ2(1 4)))5))))(3 3)2)(λ1((λ1 1)(λ1 1)))
[1] https://tromp.github.io/cl/Binary_lambda_calculus.html
Re:Lisp as the Maxwell’s Equations of Software by martyalain on Wednesday November 09, 2022 @10:45AM (#33533241)
I agree with you, but so far I have never been able to get into the logic of de Bruijn's clues. As for example John Tromp knows how to do. (https://tromp.github.io/) But I don't despair of getting there one day...
Re:Lisp as the Maxwell’s Equations of Software by qsort on Wednesday November 09, 2022 @11:39AM (#33534097)
A picture is worth a thousand words: https://en.wikipedia.org/wiki/De_Bruijn_index#/media/File:De...

It's literally just notation:

- It doesn't matter how you name variables. (if you want to sound cool: "lambda terms are invariant under alpha-conversion")

- Each new variable introduces a scope.

- Therefore, how scopes are nested defines the entire expression.

- Instead of the usual way, we represent scopes with numbers, with the index representing "how nested the scope is". Imagine it's python, and you're pressing tab that many times.

Re:Lisp as the Maxwell’s Equations of Software by pierrebai on Wednesday November 09, 2022 @01:46PM (#33536098)
Syntax and layout ware worth yet a few more orders of magnitude of words. But that argument has slipped past LISPers forever. I'll just let them keep scratching their heads why Python got so popular when LISP was around for so long and is /clearly/ superior.
Re:Lisp as the Maxwell’s Equations of Software by thrown_22 on Wednesday November 09, 2022 @03:41PM (#33537526)
Python is popular because the majority of programs are extremely simple.

Look at how ugly decorators are in python when in lisp you get them for free and they don't even need a name.

Re:Lisp as the Maxwell’s Equations of Software by lispm on Wednesday November 09, 2022 @05:11PM (#33538709)
I don't think LISPers are scratching their head about this. Lisp syntax is optimized towards meta-programming. Generating and processing code is built-in and supported with central mechanisms: READ, EVAL, PRINT, s-expressions, macros, ...

Python is optimized towards simple pseudo-code like imperative OOP. That's easier for most programmers.

Re:Lisp as the Maxwell’s Equations of Software by voldacar on Wednesday November 09, 2022 @06:02PM (#33539423)
What world are you living in where popularity is somehow a way of judging quality? The masses love marvel movies and fast food
Re:Lisp as the Maxwell’s Equations of Software by lisper on Wednesday November 09, 2022 @12:01PM (#33534466)
Note that the person you were responding to is John Tromp. :-)
Re:Lisp as the Maxwell’s Equations of Software by SkyMarshal on Wednesday November 09, 2022 @12:02PM (#33534495)
> As for example John Tromp knows how to do.

You might not have noticed the userid of the person you're replying to ;)

Re:Lisp as the Maxwell’s Equations of Software by martyalain on Wednesday November 09, 2022 @12:08PM (#33534586)
yes, I hadn't noticed that. I wish I could understand it better.
Re:Lisp as the Maxwell’s Equations of Software by deltasevennine on Wednesday November 09, 2022 @10:54AM (#33533377)
lambda calculus is turing complete. But so are turing machines. So why not have turing machines be the Maxwells equations of software.

Maybe there's an infinite amount of mathematical theories that are turing complete. Why is lambda calculus chosen as the foundational one?

I would argue, the Maxwells equation of software should be MORE foundational. Not some arbitrarily specific turing complete language.

This is what I think it should be (link is a comment in the same thread): https://news.ycombinator.com/item?id=33533321

Re:Lisp as the Maxwell’s Equations of Software by mejutoco on Wednesday November 09, 2022 @11:40AM (#33534128)
I find Lambda calculus and term rewriting much more elegant and easy to understand. I don't think there is a simpler Turing-complete language (maybe Game of Life?).

For Turing machines I recommend the book "The annotated Turing".

Re:Lisp as the Maxwell’s Equations of Software by deltasevennine on Wednesday November 09, 2022 @12:20PM (#33534775)
Well if game of life is simpler, why not game of life?

What does it mean to be Maxwells Equations? Does it mean absolutely most fundamental? Most practical? What?

Maybe there's something more fundamental then turing. Thanks for the book recommendation

Re:Lisp as the Maxwell’s Equations of Software by d0mine on Wednesday November 09, 2022 @02:39PM (#33536786)
> What does it mean to be Maxwells Equations?

In a word: elegant.

Re:Lisp as the Maxwell’s Equations of Software by sfpotter on Wednesday November 09, 2022 @03:23PM (#33537317)
It means much more than just being elegant!

Maxwell’s equations are arguably the most successful existing physical theory. They are incredibly accurate over a huge range of scales. They are used in essentially unaltered form all over modern day engineering and have astonishing predictive power.

On top of this, they are a useful tool without modification! They are the working tool for all electrical engineers. They’re not some lower-level substrate that exists in the background. They are used directly to model and generate other, simpler approximate theories (such as geometric and physical optics) which are powerful and elegant in their own right.

I don’t think Lisp, lambda calculus, Turing machines, or similar can make this kind of claim.

Re:Lisp as the Maxwell’s Equations of Software by kragen on Wednesday November 09, 2022 @05:59PM (#33539379)
what it means to say maxwell's equations have 'predictive power' is that we can

1. take a situation observed or designed in the contingent universe,

2. translate it into the abstract entities maxwell's equations talk about,

3. deduce consequences in the world of abstract entities,

4. translate those consequences back into the contingent universe, and then

5. find that the consequences in the contingent universe are within narrow uncertainty bounds we translated from the abstract world of ideas

the meaning of turing universality is precisely that any turing-complete programmable system can be used to model any other logical or mathematical system, including other turing-complete systems, in exactly the same way that maxwell's equations model electromagnetism

for example, you can model risc-v execution in lisp and predict what a risc-v processor will do, you can model lisp execution in the λ-calculus and predict what a lisp interpreter will do, you can model the λ-calculus in a turing machine and predict what λ-reduction will do, and you can model a turing machine in a risc-v processor and predict what the turing machine will do

there is a significant sense in which this sort of modeling is much more perfect than the kind done with maxwell's equations

when we apply maxwell's equations, we are subject to measurement error in steps 1 and 5; our measurements are never complete and correct, and heisenberg's uncertainty principle strongly suggests that they never can be. and in step 3, because maxwell's equations are continuous-time continuous-space differential equations, we often also introduce numerical error in our calculations as well, because we usually have to integrate them numerically rather than algebraically

on the other hand, in the case of computational universality all the entities being discussed are discrete, algebraic, mathematically abstract entities, so our simulations are absolutely perfect unless we run out of memory or suffer a rare hardware error

obviously these universal machines are not limited to modeling other universal machines; we can also use lisp or turing machines or risc-v processors to model things like gravitation, taxation, or maxwell's equations. and they are obviously also the main working tool for all electrical engineers today, having displaced slide rules and load lines generations ago

ultimately, though, we are also using maxwell's equations (and other equations describing electromagnetism, like the ebers-moll transistor model) to design our electronic computers which we use to simulate lisp

Re:Lisp as the Maxwell’s Equations of Software by sfpotter on Wednesday November 09, 2022 @07:42PM (#33540544)
I think you're confused about the premise of this discussion. The comparison is not between Maxwell's equations and lambda calculus, it's between lambda calculus and other theoretical constructs in CS.

Maxwell's equations are "the Maxwell's equations" of physics because they are "the most successful" physical theory: i.e., incredible accuracy, wide applicability, and concision. This is relative to other physical theories. (I guess you could debate whether this is actually the case---obviously this is all subjective, and not everyone agrees. Maybe someone thinks Einstein's field equations should really be "the Maxwell's equations" of physics.)

To say that the lambda calculus or anything else are "the Maxwell's equations" of computer science is to say that they have the same set of properties relative to other let's theoretical constructs in computer science. But is this actually the case? It seems like Turing machines, lambda calculus, etc. are all similar in terms of relative modeling utility and concision. I disagree that they are widely applicable---in practice, just about any commonly used programming language is far more widely applicable than anything of these. And as you pointed out, by Turing universality, they're all logically equivalent---so the question of difference in modeling "power" is not relevant here.

I guess I just don't think it makes much sense to talk about anything in CS being "the Maxwell's equations" of CS. In physics, a wide variety of disparate physical phenomena are being modeled, with individual models having a quite varied range of power and applicability. In CS, things are much different.

Incidentally, even if you simulate Maxwell's equations on a computer using Lisp, a Turing machine, or whatever else, you will not go far if you insist on algebraically exact computations. :-) As you say yourself, you must integrate them numerically, which means numerical error introduced through your discretization. But I honestly can't say I understand your point including this information above.

Re:Lisp as the Maxwell’s Equations of Software by kragen on Wednesday November 09, 2022 @07:54PM (#33540658)
there are lots of equivalent formulations of maxwell's equations (cf. https://en.wikipedia.org/wiki/Mathematical_descriptions_of_t... for a few); the ∇× ∇· one we most commonly use is quite a bit more compact and usable than maxwell's own formulation because vector calculus was, to a significant degree, invented to systematize maxwell's equations. there's apparently an even more compact form of them in terms of clifford algebras that i don't understand yet, \left(\frac{1}{c} \dfrac{\partial}{\partial t} + \boldsymbol\nabla \right) \mathbf F = \mu_0 c (c \rho - \mathbf J).

similarly there are lots of equivalent formulations of universal computation. lisp and the λ-calculus are analogous to the geometric-algebra formulation above and the more commonly used form in terms of vector field derivatives: they look very different, and they make different problems easy, but ultimately they all model the same thing, just like the various formulations of maxwell's equations

maxwell's equations are the maxwell's equations of classical electrodynamics, not of physics. without a lot of extra assumptions they won't get you very far in understanding why solid things are solid (which depends on the pauli exclusion principle) or why some nuclei break down or how transistors work or how stars can burn or why mercury's orbit precesses or why hot things go from red to orange to yellow when you heat them further

my point about modeling maxwell's equations in lisp (etc.) is that lisp (etc.) can model maxwell's equations (at least, as well as anything else we know of can model them), so if we're looking for incredible accuracy, wide applicability, and concision, lisp (etc.) would seem to trump maxwell's equations — but good luck trying to build a computer without electromagnetism, maybe you can in some sense do it on a neutron star but not with atoms

Re:Lisp as the Maxwell’s Equations of Software by earleybird on Wednesday November 09, 2022 @06:02PM (#33539427)
The lambda calculus is useful without modification. It can also be used to model other simpler languages or logics which are power and elegant in their own right.

So, yes, since I've used the lc in these ways I believe the same claim can be made regarding the lambda calculus.

Re:Lisp as the Maxwell’s Equations of Software by deltasevennine on Wednesday November 09, 2022 @04:02PM (#33537781)
elegance is a human attribute. Opinionated and open to interpretation. So Maxwells equations are an opinionated choice? I don't think so.
Re:Lisp as the Maxwell’s Equations of Software by tromp on Wednesday November 09, 2022 @11:16AM (#33533735)
Because Turing machines are so cumbersome compared to lambda calculus that a universal Turing machine takes thousands of bits [1].

[1] http://www.verostko.com/tur-doc.html#B0,%20Universal%20Turin...