Hey everyone, I was wondering if there is a name for the programming paradigm in Julia. Is there such a thing ?
Functional programming.
Oh, really? I thought Julia wasn't functional programming.
I guess I have to read a bit more in functional programming then.
I remember reading somewhere that Julia wasn't actual FP, but that incorporated some aspects of it.
FPMD :-)
Multiple Dispath programing?!
There's a difference between functional programming and "pure" functional programming, and while Julia definitely doesn't belong to the latter category it does belong to the former. As a point of comparison, Lisp is also often called a functional programming language. In the end, it's probably best to call Julia "multi-paradigm" which is the label often applied to languages like python.
I certainly wouldn't call julia a functional programming language. It doesn't really focus on a specific 'paradigm', at least not a paradigm that non-julia programmers would recognize
I see. I thought perhaps Julia was following some known paradigm. But, as pointed, it's own docs state that it's a multi-paradigm lang. Not problem, I was just wondering if a package I was working on could somehow be placed in a specific paradigm since I was using Julia.
Sure. You can write code in pretty much any paradigm you like in julia
More than anything else, single paradigm langauges are more about penalizing people from deviating from a specific paradigm.
I don't think julia is very functional currently, though I personally would like it to be more. And maybe it will be, e.g. https://github.com/JuliaLang/julia/pull/31630#issue-429910148
Julia has what one needs to write functional code. It doesn't always have what one needs to write performant functional code, but (hot take) neither does Haskell despite what they might tell you :stuck_out_tongue:
But yes, I certainly wouldn't advocate for writing functional style code in julia in many circumstances. Really depends. Julia is much more of a practical language than an ideological one.
Adam non-jedi Beckmeyer said:
There's a difference between functional programming and "pure" functional programming, and while Julia definitely doesn't belong to the latter category it does belong to the former. As a point of comparison, Lisp is also often called a functional programming language. In the end, it's probably best to call Julia "multi-paradigm" which is the label often applied to languages like python.
And given how little agreement there is about in- and out-group membership for each of these "paradigms", trying to assign a language into a neat set of categories is an inherently lossy exercise. "imperative" vs "declarative" is another tarpit.
To borrow a line from the OO-sphere, paradigms are "has-a" relationships rather than "is-a". Even then the threshold for having is not clear, hence the disagreement between pure FP and FP (and pure FP and purer FP, etc.)
I think even the line between has-a
vs is-a
gets blurred too. E.g. in many people's minds, functional programming is as much about disallowing things as it is about allowing features
This has-a
is a nice way to look at it.
My own hot take is that saying X language follows Y paradigm is primarily social signalling. It evokes a primarily emotional response and serves as a (usually poor) heuristic for those looking for a reason to jump on the bandwagon or avoid it like the plague.
For this reason, I'd argue it's a poor predictor of how well one's actual experience with the language will go. IMO there are many more quantitative and qualitative dimensions to assess a language by before having to resort to such vagaries.
Fredrik Ekre said:
Functional programming.
YES!!!
The marketing around these paradigms does confuse things. As we saw in the other OOP thread, programming languages all say they're "functional" these days, just like they all were "object-oriented" in 2000 and "structured" before that. Often such languages capture some of the ideas of $paradigm but miss others.
Personally, I call it "dispatch-oriented programming", because concepts like type-stability are really critical here, and don't really have an analogue in languages that aren't focused around multiple dispatch... but not sure how other folks feel about that term
The Wikipedia article on Julia says
Distinctive aspects of Julia's design include a type system with parametric polymorphism in a dynamic programming language; with multiple dispatch as its core programming paradigm.
when asked to select "white", "black", "hispanic", "asian", I just want to scream!
Last updated: Nov 22 2024 at 04:41 UTC