5

dev && !rant

I am thinking about picking up a functional language. Currently I use Kotlin (and I fucking love that language) but I have to admit that it's support for functional programming is limited.

But I think their lies a certain beauty in fp and I want to do some project with it.

The 2 main problems are:
1. I have no experience in functional programming. I have no clue how to structure my program (potantialy without oop) and write clean testable code.
2. I don't know what language to use. Scala seems great since it has good IDE support and I like the Java ecosystem and Haskell seems to have more beauty but is missing that IDE support and it is very unfamilar for me.

So what do you guys think I should pick up? And how do I learn to write good software with it?

Comments
  • 1
    How about c? It wasn't designed for fp but come on it's c, you can make it do whatever you want as long as you can handle the power
  • 1
    @dontPanic I don't like C (C++ is ok for me) and think it is kinda ugly. While it has a fuckton of power, I never enjoyed using it.
  • 0
    @danielspaniol it's not pretty. It's badass!
    Pic related
  • 0
    @danielspaniol Clojure is quite nice, as far as I know it's the most stable lisp, and more pro functional that most of them.

    Also super controversial but JavaScript can do functional pretty well. Highland and lodash/fp will get you on your way nicely.
  • 0
    My suggestions are kind of muddy functional languages. Things like Elm, Haskell (and Elixir by the looks of it) are more pure functional languages, if you want that.
  • 1
    @dontPanic I actually quite liked my C assignment back in uni, once I got into it. Though not sure on its capabilities as a practical functional language. Are functions first class?
  • 2
    @AlexDeLarge right, did a quick search, looks neat.

    Haskell guys are quite... evangelical about language purity. It's nice in principle, but I don't know if it just becomes masochistic after a while. I would like to learn it some day.

    So many languages I want to learn. No time....
  • 0
    Python/numpy is pretty functional
  • 0
    @AlexDeLarge i second the elixir, very solid choice
  • 0
    @alwaysmpe python is not functional, but it offers some tools from the functional world.

    I learned fp with Racket - but I always liked the look of Haskell code... Got to study that language at some point.

    Functional programming has a certain elegance to it and I recommend it to any developer.

    Even if it isn't your main way of programming, knowing fp will give you more approaches to solve many problems and broaden your understanding of coding.
  • 0
    @theCalcaholic technically Racket isn't functional either though. Many languages aren't strictly functional, but can be coded functionally. First class functions are a major feature for that to be possible
  • 0
    @Hedgepig What? It definitely is. It's a Lisp/Scheme dialect after all...

    I'm intrigued to hear how you meant that. :)
  • 0
    @theCalcaholic honestly it isn't. It has mutations and classes.

    Lisp != Functional
  • 0
    @Hedgepig classes in Racket are rather an extension than part of the core language.

    IMHO, Racket is functional in the same sense as Java is imperative/OO - the fact that it has higher order funtions doesn't make Java a functional language.
  • 0
    https://docs.racket-lang.org/refere...

    Its in the base package.

    Racket is definitely a multi-paradigm language.

    Haskell and Elm on the other hand are functional languages.

    The definitions are academic, many multi-paradigm languages can be used to code functionally
  • 0
    @Hedgepig I know that it is in the base package. However nearly all of tge usage examples are purely functional without OOP - and even the class system is kind functional. :D

    But to be honest I didn't pay too much attention during the last two weeks of the semester, when we learned about the class system of Racket. So I might just be lacking knowledge in that regard.
  • 0
    @theCalcaholic like I say, I am coming at it from an academic sense. Practically it is arguably more functional than python.
Add Comment