[HN Gopher] Parametric Programming - an equational approach to O...
___________________________________________________________________
Parametric Programming - an equational approach to OO and beyond
Author : herodotus
Score : 46 points
Date : 2021-08-05 20:48 UTC (1 days ago)
(HTM) web link (billwadge.wordpress.com)
(TXT) w3m dump (billwadge.wordpress.com)
| wenc wrote:
| 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
| magicalhippo wrote:
| I'm being dense. Isn't this just anonymous functions with some
| syntax sugar? What am I missing?
| bade wrote:
| 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
| magicalhippo wrote:
| 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.
| coldtea wrote:
| 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...
| WkndTriathlete wrote:
| You're not missing anything. The author is rediscovering first-
| class functions, applicatives, functors, and monads the long
| way around.
| mjburgess wrote:
| 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...
| kmill wrote:
| 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.
___________________________________________________________________
(page generated 2021-08-06 23:01 UTC)