3 ms·
> Pocketlang is a [...] functional language written in C. What features make this a functional language?
by pansa2 5y ago
> Pocketlang is a [...] functional language written in C.
What features make this a functional language?
- ibraheemdev 5y agoProbably just referring to the fact that it is not object oriented. Not "functional" in the sense of pure functional programming.
- rottc0dd 5y agoI think it is not a purely functional language, but supports functions as first class citizens. > func(x) return x*x end # Lambda/literal functions. [1] [1] - https://thakeenathees.github.io/pocketlang/getting-started-learn-in-15-minutes.html https://thakeenathees.github.io/pocketlang/getting-started-l...
- mumblemumble 5y agoThat's always a fun subject for a late night argument at the pub. When I was in school (1990s), simply having first-class procedures was good enough for most people to consider a language functional. I'd assume that's roughly the definition being used here. But you go back to 20 years before that, and it wasn't totally unheard of to see higher-order functions in procedural languages (such as Algol 68) and object-oriented languages (such as Smalltalk). And you fast forward 20 years, and about the only language without some form of first-class procedures that's still allowed to exist seems to be C. And in the middle there's always been Python. You could go all purist and say that, since John Backus coined the term, we should stick with his definition. In that case lisps are definitely out (he explicitly said so in his paper), and it's possible that the only genuine examples are Miranda, Haskell and friends, because even allowing mutation or an imperative style will disqualify you. But I'm not sure everyone really wants to snub Robin Milner like that. It's almost like it's an ill-defined term with fuzzy boundaries that means whatever the person currently using it wants to tell you they meant by it, and trying to be pedantic about it is mostly just a good way to have a frustrating conversation. Kind of like just about every adjective that can be used to describe programming languages.
- nvarsj 5y agoI thought Miranda/Haskell were much more in the vein of Lisp/Lambda Calculus than Backus's ideas, which were more radical and not widely adopted to this day [1]. I always thought of Haskell as simply what Lisp would be if it had implemented a typed lambda calculus rather than an untyped one. 1: https://en.wikipedia.org/wiki/Function-level_programming https://en.wikipedia.org/wiki/Function-level_programming
- thayne 5y agoPerhaps they mean functional in the sense that it works? ;)
- zoom6628 5y agoThat's my take too.