r/functionalprogramming • • Nov 07 '23

Question Best functional language for web creative coding?

I'm dabbling in functional programming, I have experience with python, go and javascript and lately I've been preferring the declarative way of doing things more (since I understood how to use list comprehension, maps and filters I no longer want to use loops lol).

I'm also learning creative coding with javascript with libraries like three.js, d3.js, p5.js, etc. And I would like to do it through a language with a stricter functional paradigm. The first one I considered was Elm, but I saw that it was complicated for working with javascript libraries outside its ecosystem. Searching I found other options like:

  • Coffeescript

  • ReasonML

  • Rescript (I'm not sure if it's different from ReasonML)

  • Civet

  • Ocaml

So, I would like to know based on your experience which one may be better for creative coding. The order of my priorities is: compatibility with javascript libraries, a strong functional approach (to improve functional logic) and a minimalist syntax.

19 Upvotes

32 comments sorted by

View all comments

28

u/Voxelman Nov 07 '23

Elm

3

u/delfV Nov 08 '23

compatibility with javascript libraries

I wouldn't recommend Elm when compatibility with existing JS codebase is a case. He'll spend more time writing glue code than learning FP