News for hackers. Stuff that matters.
Re:Symbolic Programming with Clojure [pdf] by Conscat on Saturday February 25, 2023 @12:43PM (#34938580)
Problem: Given known variable values, find appropriate physics equations and solve them to find a desired variable value.

• Ordinary programming: 5 person-years by two PhD students; 25,000 lines of C++.

• Symbolic Programming: 200 lines, a few days.

Where do you even begin decompressing a claim like this?

Re:Symbolic Programming with Clojure [pdf] by jonahbenton on Saturday February 25, 2023 @01:15PM (#34938972)
Needs a timeframe and context. Back in the, say, 1990s or maybe even early 2000s, when the modern world was just forming and the only languages students would work in were C and C++, maybe with some Bash and Perl on the side, 25k lines is a reasonable estimate for a brand new symbolic engine- a thing that in imperative languages didn't exist- with some element of typical PhD edge case over-engineering.

25k lines in fact could be considered small for that sort of C++ engine.

But it would have been reasonable at the time to explore the type system around such a thing and produce a PhD (or a couple of PhDs) from it over a period of a few years.

Of course even at that time there was prior art in the Lisp world, but after the AI winter 1980s no students were going to work in Lisp. C++ was where the jobs were going to be.

Re:Symbolic Programming with Clojure [pdf] by uonpopular_th on Saturday February 25, 2023 @04:49PM (#34940813)
>Needs a timeframe and context. Back in the, say, 1990s or maybe even early 2000s, when the modern world was just forming and the only languages students would work in were C and C++, maybe with some Bash and Perl on the side, 25k lines is a reasonable estimate for a brand new symbolic engine- a thing that in imperative languages didn't exist- with some element of typical PhD edge case over-engineering.

The modern world was very much formed by the 90s. Mathematica, Axiom, Maple, etc were all mature software written a decade or more ago. What people were doing wasn't writing a CAS from scratch but writing one that could slot into whatever program they needed at the time, e.g. chaotic simulation of the solar system: https://en.wikipedia.org/wiki/Structure_and_Interpretation_o...

Re:Symbolic Programming with Clojure [pdf] by pjlegato on Saturday February 25, 2023 @10:05PM (#34942652)
Mathematica is a comprehensive symbolic manipulation engine and functional programming language written by a physicist starting in the late 70s. It has been used to solve various real world physics problems since the early 80s. It has been commercially available since 1988.

https://en.wikipedia.org/wiki/Stephen_Wolfram

Re:Symbolic Programming with Clojure [pdf] by eddsh1994 on Saturday February 25, 2023 @12:51PM (#34938679)
Their PhD was in crappy programming, I assume
Re:Symbolic Programming with Clojure [pdf] by uonpopular_th on Saturday February 25, 2023 @04:15PM (#34940565)
Yes, C++.
Re:Symbolic Programming with Clojure [pdf] by PaulHoule on Saturday February 25, 2023 @02:08PM (#34939461)
Norvig's Paradigms of Artificial Intelligence Programming has a nice little Common Lisp program that parses word problems and converts them to a system of equations which it proceeds to solve.

It's got numerous limitations but it is definitely a small program.

Re:Symbolic Programming with Clojure [pdf] by uonpopular_th on Saturday February 25, 2023 @04:46PM (#34940791)
>Where do you even begin decompressing a claim like this?

Start writing the code and see where it takes you. Having done that type of work in grad school I moved from C++ to Guile for exploratory work for that very reason.

I then rewrote the slow bits in C as custom functions much like how you would in Python.

Re:Symbolic Programming with Clojure [pdf] by iainctduncan on Sunday February 26, 2023 @11:15AM (#34946639)
This has been my experience with music programming as well, music (not audio - music) being a highly symbolic domain. The past-me that had not experienced first class symbolic programming support would not have believed how much easier it is in a symbolic language (in my case Scheme). The size of my music code in Scheme compared to C/C++ or Python is an order of magnitude smaller.
Re:Symbolic Programming with Clojure [pdf] by user3939382 on Saturday February 25, 2023 @09:33PM (#34942494)
Couldn’t you implement lisp in much less than 25k lines of C++ and then use that to copy the rest of the 200 line strategy?

That would make the cpp loc =200+lisp implementation loc