I've been reading a bit about functional programming recently and am keen to get have a bit of a play. are there any decent scripting languages that support functional programming? I find that the bulk of my ad-hoc programming is done in Python, so I thought I might be able to do the same with a functional language. Any recommendations?
The short answer is yes, you can do functional programming in any language. Functional programming is a paradigm. It's all in your mind.
Is JavaScript a functional programming language or object-oriented? Thanks to new developments in ES6, we can say that JavaScript is both a functional as well as object-oriented programming language because of the various first-class features it provides.
JavaScript can function as both a procedural and an object oriented language. Objects are created programmatically in JavaScript, by attaching methods and properties to otherwise empty objects at run time, as opposed to the syntactic class definitions common in compiled languages like C++ and Java.
Python is not a strictly functional programming language. But it is trivial to write Python in a functional style. There are three basic functions on iterables that allow us to write a powerful program in a very trivial way: filter, map, and reduce.
Lua appears to fit your needs:
Lua (pronounced /ˈluː.ə/ LOO-uh) is a lightweight, reflective, imperative and functional programming language, designed as a scripting language with extensible semantics as a primary goal.
Scala can also be used as a scripting language. It runs on the JVM and supports both imperative OO and functional programming. Using this you can have access to the entire Java class library.
Python can be written in a functional style, as can JavaScript. If you mean something more purely functional, then you could try Haskell.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With