Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any decent scripting languages that use functional programming?

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?

like image 776
Dawsy Avatar asked Apr 09 '09 07:04

Dawsy


People also ask

Can you do functional programming in any language?

The short answer is yes, you can do functional programming in any language. Functional programming is a paradigm. It's all in your mind.

Does JavaScript use functional programming?

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.

Is JavaScript OOP or functional?

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.

Is Python good for functional programming?

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.


3 Answers

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.

like image 127
Alnitak Avatar answered Mar 28 '23 15:03

Alnitak


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.

like image 29
Jason Miesionczek Avatar answered Mar 28 '23 16:03

Jason Miesionczek


Python can be written in a functional style, as can JavaScript. If you mean something more purely functional, then you could try Haskell.

like image 27
mishac Avatar answered Mar 28 '23 15:03

mishac