4 ms·
Concatenative Programming; the Free Monoid of Programming Languages (2019)
- carapace 6y agoI was playing with Joy ( http://joypy.osdn.io/ http://joypy.osdn.io/ ) and got nerd-sniped by Prolog and wound up messing around with Joy-in-Prolog ( https://git.sr.ht/~sforman/Thun/tree/master/source/thun.pl https://git.sr.ht/~sforman/Thun/tree/master/source/thun.pl ) and, uh, it's really neat. Something about Conal Elliott's Compiling to Categories ( http://conal.net/papers/compiling-to-categories/ http://conal.net/papers/compiling-to-categories/ ) ... New paradigm... hand wave...
- Kednicma 6y agoYou'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.
- carapace 6y agoCheers! > 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...)
- cultus 6y agoI 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.
- agambrahma 6y agoThis is going to sound silly, but I _love_ the comment blocks in the code for Thun, how did you make them? (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#L186-191 https://git.sr.ht/~sforman/Thun/tree/master/source/thun.pl#L...)
- mcaruso 6y agoThe ASCII art text? There's a link in the top comment there: http://www.patorjk.com/software/taag/#p=display&f=ANSI%20Shadow&t=formatter http://www.patorjk.com/software/taag/#p=display&f=ANSI%20Sha...
- carapace 6y agoYah, that. It's a SaaS Figlet service. https://en.wikipedia.org/wiki/FIGlet 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".
- a1369209993 6y ago> I tried copy-pasting an example here, but it didn't render. 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.
- deleted 6y ago[deleted]