Both C# and C++ support Lamda expressions. Would this qualify as supporting first class functions?
Ahh yes. I've never really used C# nor many new features in C++, so take this with a grain of salt, but yes, lambda expressions are very much about having first order functions. The question I'm unclear about, is if they capture the variables in their surrounding scope to form closures. I've heard mention of "delegates" in these languages, which do seem to form closures. I've also seen implementations in other languages which don't capture variables in the surrounding scope to form closures.
Just came across this article which states that C# lambdas do capture variables from the surrounding scope. Near the end of the article is a section titled "Variable Scope in Lambda Expressions":
Lambda ExpressionsI just checked out the Wikipedia article on
First-class functions. Indeed, they had three main sections in their table of support. They had first-order functions, nested functions, and then closures. They're explicitly discussing the capture of variables from the surrounding environment (the closures), separately from the other two supporting features. That's something I kind of ignored in my first post. I like how they presented that.
Sadly the Wikipedia article on first class functions listed JavaScript as a scripting language and not a higher level programming language, which is just not true despite the language's poor choice on names.
Sounds like you view scripting languages as somehow inferior. Though oddly, it seems to go the other way. The only low level languages I can think of, such as assembler, are definitely not scripting languages. Even languages like C/C++ are sometimes viewed as medium-level languages, due to all the extra concerns they burden the programmer with, such as memory management. Actually, from the Wikipedia article on
Scripting Languages:
Scripting languages are also sometimes referred to as very high-level programming languages, as they operate at a high level of abstraction, or as control languages, particularly for job control languages on mainframes.
I suppose you mean they have a reputation of being used for short small programs, particularly of the nature of batch files/shell scripts. In which case, JavaScript did sort of fit that bill for browser scripting in the early days. Though you're right, now it's definitely a full on language, with support from standalone JavaScript engines, such as
NodeJS.