Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Parametric Programming – an equational approach to OO and beyond (billwadge.wordpress.com)
57 points by herodotus on Aug 6, 2021 | hide | past | favorite | 8 comments


Just FYI, the term Parametric Programming [1] is also a longstanding term used to denote a type of mathematical optimization technique, first coined in 1952.

The technique converts an optimization solution into a function of its parameters, so instead of a (re-)solving an optimization problem each time the parameters change, one only needs to evaluate a function.

[1] https://en.wikipedia.org/wiki/Parametric_programming


I'm being dense. Isn't this just anonymous functions with some syntax sugar? What am I missing?


It seems to be node-based programming, done textually instead of graphically. In PureData (or Max/MSP) each node has some number of inputs and outputs, and you wire them up.

The semantics here are a bit different though. The idea is that a "scheme" has a way to be instantiated, and then when you use an output, it's as if the equations for that output are substituted in. PureData uses a message passing style instead.

There is some prior art -- take a look at the work by Alexey Radul and Gerald Sussman on propagator networks. They were also interested in partial information and networks that could have cycles, so they solve problems with how to update information in nodes.

Another similar thing is Verilog, where each module has inputs and outputs you connect together. (For handling cycles, you use a clock and registers.)

There's also OCaml "functors," which seem somewhat similar. Pay no attention to the name -- a "functor" is a module parameterized by another module. The "schemes" seem to be like a functor in that you can pass in specific definitions, and then the "outputs" are members of the resulting module.


You're not missing anything. The author is rediscovering first-class functions, applicatives, functors, and monads the long way around.


Too add,

His first example is an applicative: parallel lines of evaluation into a result.

His second example I believe is the Either monad, if he takes ';' to be a sequencing operation.

His quad example is a monad with a syntax for defining an instance.

And so on...


It's equivalent to very elaborate function calls with named and optional arguments and output parameters. The declaration s would be nightmarish Syntax is important


Yeah, the same way Dropbox is just a rediscovery of "an FTP account, mounted locally with curlftpfs, and then using SVN or CVS on the mounted filesystem", which obviously is also more flexible and fundamental than a single-purpose SaaS service...


Sure, I agree syntax is important. It was just the wording made it sound like it was more than a redressing, hence I felt I was missing something.

Interesting read regardless.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: