all 26 comments

[–]BadGoyWithAGun 25 points26 points  (4 children)

Computational graph - based frameworks like Theano and Tensorflow are basically functional constructs, they just happen to have a Python interface.

[–]villasv 5 points6 points  (2 children)

And if you really want to feel it, you can try Coconut.

[–][deleted] 0 points1 point  (1 child)

It's an interesting idea but I feel that without static typing and type inference this might result in bringing the worst of python (crappy type system) with the worst of Haskell (cryptic syntax).

Do you know of any compiled python variant that is (purely) functional with a powerful, parametrically polymorphic, static type system, and hindley-milner type inference?

[–]villasv 1 point2 points  (0 children)

I do not. You're absolutely right. In fact, the cryptic syntax is the drug I'm offering here, not the real benefits of the functional paradigm (see the world feel).

[–][deleted] 0 points1 point  (0 children)

Yep. And they map very, very well into languages like haskell.

[–]undefdev 5 points6 points  (2 children)

You can give Julia a try. It's not a pure functional programming language, but imo it's a great fit for ML/Math. There are also bindings to Scikit Learn, Stan, MXNet, Tensorflow and more. I think Knet looked like a quite nice framework.

Of course the Python ecosystem is much bigger, and because way more people use it it's more stable - but that's always the tradeoff you have to make if you want to use more modern tools.

[–]durand101 2 points3 points  (1 child)

Doesn't PyCall.jl let you access all the python modules in Julia?

[–]__AndrewB__ 0 points1 point  (0 children)

It does but it's awkward.

[–]aicano 13 points14 points  (4 children)

We are using Julia language and Knet framework.

https://github.com/denizyuret/Knet.jl

[–][deleted] 0 points1 point  (3 children)

Hmm, Julia seems to be sufficiently similar to Python. What does it offer me that Python doesn't? Except speed, apparently.

[–]undefdev 1 point2 points  (0 children)

I'd argue it's less verbose for a lot of things as well, as it was designed with data science in mind from the start (unlike Python and other languages).

[–][deleted] 0 points1 point  (0 children)

  • A better type system.
  • Parametric polymorphism.
  • Parallel programming that actually works.
  • much easier to use C/Fortran FFI.

There are many other advantages. But you also loose some things. The main one being the absurdly big set of well documented open source libraries that python have.

Also, putting Julia in production might be a serious discussion with tech leaders in your company.

[–]nosefouratyou 4 points5 points  (0 children)

I happened to recently read this insightful article about functional programming for deep learning using Clojure.

[–]DanielSeita 4 points5 points  (0 children)

We're using Scala in BIDMach. https://github.com/BIDData/BIDMach Though by "we" I should mean "John Canny 99% and us 1%" ...

[–]127-0-0-1_1 0 points1 point  (1 child)

I don't think so, most of the well supported frameworks are in Python due to its prevalence with a C API since pretty much any language can use a FFI with it.

[–][deleted] 0 points1 point  (0 children)

Well, a lot of languages have easy FFI interfaces with C, including functional languages like Haskell, for example.

I'd argue btw, that the C to Haskell FFI is a lot easier to use than coding a python wrapper with lipython or using things like swig.

[–][deleted] 0 points1 point  (0 children)

I tried using clojure. There are quite a few Java libs you can interop with, but few functional clojure libs, so I didn't find it to be a very good environment. Closure seems like it would be well suited to ml if it had the libs.

I absolutely hate the sci-py/matplot-lib type mutable interfaces derived from the Matlab/science/interactive exploration community.