Re:Concatenative Programming; the Free Monoid of Programming...
by Kednicma on Monday October 05, 2020 @01:09PM
(#24689669)
You're not wrong. Categories have an inherent monoid on their arrows which composes them, and so concatenative programming is extremely close to categorical programming.
The two main ingredients that are missing in the ecosystem are (1) a good intermediate compiler target, and (2) a way to write programs categorically so that we don't have to retype them in each different programming system's syntax.
Re:Concatenative Programming; the Free Monoid of Programming...
by carapace on Monday October 05, 2020 @01:37PM
(#24689971)
Cheers!
> concatenative programming is extremely close to categorical programming
How do they differ? (I'm a newbie at CT. Sorry if that's a dumb question.)
FWIW, I suspect that Joy is as good way as any to provide (2). You could implement a basis set of primitive functions and combinators in each different programming system.
As for (1) part of what got me into Prolog was the work done on compiling using it. I've actually come to believe that syntax is a macguffin, a kind of blind alley. I have no idea what to use though, C?, LLVM IR?, etc. I've been toying with Prof. Wirth's Oberon RISC CPU as a target.
I'd like to go the other way too: translate existing code into categorical forms. (Then do fun things like refactoring, etc...)
Edit: No, no it is not. (HN drops U+2588 '' for some reason.)
Edit: But U+25D9 '◙' works.
@mods: I assume no one has commit access to fix this bug, but on the off chance they do: bug report: HN deletes U+2588 character at some point in the path from submitting a comment to that comment being displayed; not sure exactly what part's going wrong there.
Re:Concatenative Programming; the Free Monoid of Programming...
by cultus on Monday October 05, 2020 @01:50PM
(#24690132)
I hope someday there will be a Compiling to Categories-esque language. When it comes down to it, the essence of all of this is just keeping a rigorous separation of implementation and interface. Just build a language with that in mind, and you can have purity and never have to know what a monad is.
Something about Conal Elliott's Compiling to Categories ( http://conal.net/papers/compiling-to-categories/ ) ...
New paradigm... hand wave...
The two main ingredients that are missing in the ecosystem are (1) a good intermediate compiler target, and (2) a way to write programs categorically so that we don't have to retype them in each different programming system's syntax.
> concatenative programming is extremely close to categorical programming
How do they differ? (I'm a newbie at CT. Sorry if that's a dumb question.)
FWIW, I suspect that Joy is as good way as any to provide (2). You could implement a basis set of primitive functions and combinators in each different programming system.
As for (1) part of what got me into Prolog was the work done on compiling using it. I've actually come to believe that syntax is a macguffin, a kind of blind alley. I have no idea what to use though, C?, LLVM IR?, etc. I've been toying with Prof. Wirth's Oberon RISC CPU as a target.
I'd like to go the other way too: translate existing code into categorical forms. (Then do fun things like refactoring, etc...)
(Edit: I tried copy-pasting an example here, but it didn't render. Example: https://git.sr.ht/~sforman/Thun/tree/master/source/thun.pl#L...)
https://en.wikipedia.org/wiki/FIGlet
In addition to a cool old school feel it helps me with navigation as the big headers are clearly visible in editor "minimaps".
Is this any better?:
Edit: No, no it is not. (HN drops U+2588 '' for some reason.)Edit: But U+25D9 '◙' works.
@mods: I assume no one has commit access to fix this bug, but on the off chance they do: bug report: HN deletes U+2588 character at some point in the path from submitting a comment to that comment being displayed; not sure exactly what part's going wrong there.