> Pocketlang is a [...] functional language written in C. What features make this a functional language?
> func(x) return x*x end # Lambda/literal functions. [1]
[1] - https://thakeenathees.github.io/pocketlang/getting-started-l...
21–30 of 63 posts
> Pocketlang is a [...] functional language written in C. What features make this a functional language?
> func(x) return x*x end # Lambda/literal functions. [1]
[1] - https://thakeenathees.github.io/pocketlang/getting-started-l...
My suggestion to the author is to think more on the selling points of the lang. is it the intention of this language is remain small and fast, or is it just a temporary property of the language because it is so new? Most languages start out as fast as C on toy problems, and then slow down as programs become larger as the language becomes more capable. Often it’s the case then you implement the cool features you want your language to have, it’s several orders of magnitude slower than when you started. That’s why so much time is spent on compiler optimizations.
> Pocketlang is a [...] functional language written in C. What features make this a functional language?
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.
I love these little embedded languages, but I really want one that supports type annotations. I'm specifically want something that can generate large configuration structures (e.g., Kubernetes YAMLs, CloudFormation YAMLs, Terraform HCLs, etc) and I want some static typing because the iteration loops can be quite long (minutes) which is too long to test every branch and writing and maintaining unit tests to catch type…
I love these little embedded languages, but I really want one that supports type annotations. I'm specifically want something that can generate large configuration structures (e.g., Kubernetes YAMLs, CloudFormation YAMLs, Terraform HCLs, etc) and I want some static typing because the iteration loops can be quite long (minutes) which is too long to test every branch and writing and maintaining unit tests to catch type…
> Pocketlang is a [...] functional language written in C. What features make this a functional language?
I love these little embedded languages, but I really want one that supports type annotations. I'm specifically want something that can generate large configuration structures (e.g., Kubernetes YAMLs, CloudFormation YAMLs, Terraform HCLs, etc) and I want some static typing because the iteration loops can be quite long (minutes) which is too long to test every branch and writing and maintaining unit tests to catch type…
It sounds like CUE - https://cuelang.org/docs/about/ may be useful to you.
I love these little embedded languages, but I really want one that supports type annotations. I'm specifically want something that can generate large configuration structures (e.g., Kubernetes YAMLs, CloudFormation YAMLs, Terraform HCLs, etc) and I want some static typing because the iteration loops can be quite long (minutes) which is too long to test every branch and writing and maintaining unit tests to catch type…
Sounds like https://dhall-lang.org/