top | item 33407830

Show HN: A small, weird and unpractical programming language

89 points| japiirainen | 3 years ago |github.com

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!

37 comments

order

sindoc|3 years ago

Nice 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.

chewxy|3 years ago

Nice. 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|3 years ago

Hi, 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!

still_grokking|3 years ago

Oh, another "FP". Nice one!

This time much less weird as the last one I've seen. :-)

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).

pasquinelli|3 years ago

i'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.

lloydatkinson|3 years ago

Well designing a language to use characters that aren't on the keyboard is certainly an example of an impractical language.

still_grokking|3 years ago

We should stop the ASCII madness at some point. The world speaks Unicode. Only programming languages are mostly stuck in the 7-bit era. That sucks.

People even use extra keyboards to input their emojis, but we "can't" input math or programming symbols? Really?

An "international" keyboard layout gives you already a shitload of "special" signs.

Using the compose key you can input even more.

When this isn't enough it's trivial to add something to ~/.XCompose

I'm not advocating to have a pure symbolic programming language. But things that are better expressed through symbols just should be.

It has reasons why you use symbols in math instead of writing everything out in some human language.

Programming is evidently symbolic, just like math: We know that as we let professionals read code while in a MRI scanner and we could look on their brain activity. The brain activity correlates with the one seen when reading (and understanding) math, not with the one seen while processing human language.

We should design programming languages accordingly!

mlajtos|3 years ago

Can programming be liberated from the keyboard-style input?

svnpenn|3 years ago

[deleted]

pvg|3 years ago

Title 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.

Retr0id|3 years ago

The name of the thing is "fp". What new information does that give you? What more information could you possibly jam into the post title?

ad404b8a372f2b9|3 years ago

Could 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.

lolinder|3 years ago

The lecture in question is not obscure, it's one of the most influential papers in Computer Science and is foundational to a lot of modern PL research. It's currently sitting at 4166 citations on Google Scholar--that's twice as many as Dijkstra's "goto considered harmful".

In general I'm all for including context, but in this case and for this audience (people on HN interested in useless programming languages) a reference to the paper is plenty.