8 ms·
Show HN: A small, weird and unpractical programming language
I've been spending some time coding fp. It is a programming language heavily inspired by the language John Backus described in his 1977 Turing Award lecture.
There's plenty of examples in the projects github repository for the interested!
- sindoc 4y agoNice and clean. Keep up the good work. One thing I understood in programming languages is their ability to integrate with the rest of the ecosystem. A couple of things I like about your approach is how you allow your users to get a repl without even them having to install any perm files on their machine. That’s brilliant.
- japiirainen 4y agoThanks for the nice comment!
- mlajtos 4y agoI see FP [0] (and FL [1,2]) as continuations of the original APL vision – an algebra for programs. It is really nice to see this implementation of FP and I hope it will spark interest in the community. :) [0]: https://dl.acm.org/doi/pdf/10.1145/359576.359579 https://dl.acm.org/doi/pdf/10.1145/359576.359579 [1]: https://theory.stanford.edu/~aiken/publications/trs/FLProject.pdf https://theory.stanford.edu/~aiken/publications/trs/FLProjec... [2]: https://www.youtube.com/watch?v=FxcT4vK01-w https://www.youtube.com/watch?v=FxcT4vK01-w
- svnpenn 4y ago
- Retr0id 4y agoThe name of the thing is "fp". What new information does that give you? What more information could you possibly jam into the post title?
- xigoi 4y agoKnowing whether you'd already seen the language, for one.
- pvg 4y agoTitle should contain the name of the thing. People presenting their own work get a lot of leeway and there's nothing in this that approaches clickbait. Having to click on a thing to learn more about what it is is not in itself clickbait.
- ad404b8a372f2b9 4y agoCould you describe/explain it? Referencing some obscure language from a lecture in 1977 means nothing to me. edited for everyone else's convenience, from wikipedia: FP (short for functional programming)[2] is a programming language created by John Backus to support the function-level programming[2] paradigm. It allows building programs from a set of generally useful primitives and avoiding named variables (a style also called tacit programming or "point free"). It was heavily influenced by APL which was developed by Kenneth E. Iverson in the early 1960s.[3] The FP language was introduced in Backus's 1977 Turing Award paper, "Can Programming Be Liberated from the von Neumann Style?", subtitled "a functional style and its algebra of programs." The paper sparked interest in functional programming research,[4] eventually leading to modern functional languages, which are largely founded on the lambda calculus paradigm, and not the function-level paradigm Backus had hoped. In his Turing award paper, Backus described how the FP style is different: An FP system is based on the use of a fixed set of combining forms called functional forms. These, plus simple definitions, are the only means of building new functions from existing ones; they use no variables or substitutions rules, and they become the operations of an associated algebra of programs. All the functions of an FP system are of one type: they map objects onto objects and always take a single argument.[2] FP itself never found much use outside of academia.[5] In the 1980s Backus created a successor language, FL, which was an internal project at IBM Research.
- Jtsummers 4y agoDid you click on the link to the github repo? https://github.com/japiirainen/fp https://github.com/japiirainen/fp
- ad404b8a372f2b9 4y agoYes the readme contains the exact same referential description as this post. I looked at the examples, I don't know the language and its purpose is not immediately obvious to me. If I missed some explanation in the repo, please enlighten me.
- Jtsummers 4y ago
- chewxy 4y agoNice. I can roughly understand it though I don't quite understand why inner product has a transpose in it (assuming you use are using the symbols per APL). Check my understanding: IP = distribute `+` across an application of `*` across all transposed elements. If your vectors/arrays are just arrays and column/row vectors are shape conventions then there is no need for transposition. Right? Unless you have some sort of checks for shapes
- japiirainen 4y agoHi, yeah you assumes right that the transpose symbol comes from APL! This language does not have ”implicit iteration” a la APL, thus * is just a binary operation you can apply like this *:<1,2> which will yield 3. This is why inner product needs to first transpose. TBH I don’t like this, I just wanted to follow the specification given in the paper as closely as possible. I might diverge from this and implement ”implicit iteration” in the future!
- chewxy 4y agoBackus' paper had a specification. TIL. Must be a weird award speech to give. Thanks for the explanation. It's now very clear
- Jtsummers 4y agoTuring Award lectures are not acceptance speeches in the normal sense. They've been technical lectures since the start related to the primary work/interest of the individual receiving the award. https://amturing.acm.org/alphabetical.cfm https://amturing.acm.org/alphabetical.cfm - You can find the lectures linked from the individual's name. The length varies significantly.
- lloydatkinson 4y agoWell designing a language to use characters that aren't on the keyboard is certainly an example of an impractical language.
- mlajtos 4y agoCan programming be liberated from the keyboard-style input?
- still_grokking 4y agoAnd what would be the alternative? A joystick maybe? (No, the joystick idea isn't serous of course). You can already program by drag & drop. Try Scratch. But this just does not scale… Before we give up keyboards and switch to brain interfaces, maybe we should first try to liberate programming form the monadic style, or something like that. ;-)
- mlajtos 4y agoI am exploring pencil input for coding: https://mlajtos.mu/posts/new-kind-of-paper https://mlajtos.mu/posts/new-kind-of-paper What do you mean by "monadic style"?
- still_grokking 4y agoI'm not sold on this pen & paper idea to be honest. It looks slow and cumbersome. It misses all the advantages of using a computer. How would for example code competition, context sensitive features, or refactoring work? How about editing features of a capable editor like this here: https://helix-editor.com/ https://helix-editor.com/ It would be very hard, if even possible, to replicate such user experience with "pen & paper" (even if "pen and paper" would be digital). I think programming could be improved. But not by going back in time. Instead the "text" (code) should become even more interactive. I really like the ideas of e.g. Bret Victor in this regard: http://worrydream.com/#!/LearnableProgramming http://worrydream.com/#!/LearnableProgramming https://youtube.com/watch?v=8pTEmbeENF4 https://youtube.com/watch?v=8pTEmbeENF4 Or the ideas behind something like Enso: https://enso.org/ https://enso.org/ Or "just" interactive notebooks… Computers are so much more than pen & paper! --- "Liberating programming form monadic style" was only a pun on the parent post. :-) If you do FP (functional programming) in an advanced typed language you will likely end up with code written in monadic style, meaning that you wrap all (effectful) computation in some monads. In my opinion that's in the end not really much better than the usual imperative style—and that closes the circle to the original citation: "Can programming be liberated from the von Neumann style?" (which was the title of a quite important paper).
- pasquinelli 4y agoi've always been curious about fp, but, to my knowlege there aren't any implementations of it or closely related successors to play with-- or i suppose now there's one.
- still_grokking 4y agoOh, another "FP". Nice one! This time much less weird as the last one I've seen. :-) http://www.fp-system.org/ http://www.fp-system.org/ Maybe the authors like to connect? As I'm here maybe someone can explain something I didn't found an answer until now: How does FP relate to data-flow languages? "Classical" data-flow languages are quite different on the surface but fundamentally their inner workings look like data-processing pipelines. FP expression also look like data-processing pipelines… How is this related? Also, if the fundamental paradigm would be data-flow, why nobody designed a (functional) HW description language around that? It would be a perfect match I guess because hardware is all about signals flowing though processing elements! (Something like Haskell's Clash is imho a worse fit as the fundamental semantic of Haskell isn't data-flow; using lazy lambda calculus to model HW doesn't look like a proper fit; there's a quite large "impedance mismatch" you need to bridge first).