10 ms·
Agreed, that's my experience as well. Julia is amazing for scripts and smaller projects, but I wish there was something like Swift (which I'm increasingly convi
by RivieraKid 8y ago
Agreed, that's my experience as well. Julia is amazing for scripts and smaller projects, but I wish there was something like Swift (which I'm increasingly convinced is closest to the ultimate general-purpose language) with all the nice things that Julia has.
Specifically, these things make Julia less suitable for larger projects:
- Lack of support for OOP. And no, purely functional programming is not the best way to code all projects.
- Dynamic typing.
- Doesn't compile to native code (there are ways to do it, but too complicated and there are caveats).
- Module system doesn't seem to be design well.
- You can't use a function before it's defined.
- CyberDildonics 8y ago> - Lack of support for OOP. And no, purely functional programming is not the best way to code all projects. Julia doesn't rely on functional programming and there are also structs and operator overloading. What feature do you think is missing specifically? > Dynamic typing. Julia is not dynamically typed, though if you write a type unstable function, you will get back an Any type. - Module system doesn't seem to be design well. What specifically is problematic?
- StefanKarpinski 8y agoJulia is dynamically typed: https://stackoverflow.com/a/28096079 https://stackoverflow.com/a/28096079.
- RivieraKid 8y ago> Julia doesn't rely on functional programming and there are also structs and operator overloading. What feature do you think is missing specifically? Interfaces, access modifiers, calling methods via object.method() instead of method(object), you can't define methods inside classes (structs) with an implicit "this" parameter. > Module system doesn't seem to be design well. Working with a multiple file project feels weird... I have to first "include()" the source code and then use "import" or "using". The module system in Java, Javascript or Swift seem to be more straightforward and sensible.
- FridgeSeal 8y ago> - Lack of support for OOP. And no, purely functional programming is not the best way to code all projects. ...and neither is OOP? For doing data things I greatly prefer functional programming for ease of understanding how the data flows and gets changed. > - Doesn't compile to native code (there are ways to do it, but too complicated and there are caveats). Neither does Python, neither does R. AOT compilation is being worked on, I expect it to get pretty great. C and FORTRAN do, sure, but most people are not writing C and FORTRAN in production. > - Module system doesn't seem to be design well. It’s maybe not perfect, but it’s honestly miles better than Python. > - You can't use a function before it's defined. This feels like an incredibly unfair and unreasonable complaint given not many languages that aren’t AOT compiled actually support this and Python and R certainly do not.
- nicoburns 8y ago> ...and neither is OOP? For doing data things I greatly prefer functional programming for ease of understanding how the data flows and gets changed. OOP support doesn't imply not having support for functional programming. Swift, Scala, and Rust are good examples of languages thst support both. The parent seems to like julia, but laments that it is missing several features which they have come to appreciate and depend on from Swift. Your response points out that Python and R don't have those features either, which is true, but sometmwhat besides the point of the parent comment.
- Sukera 8y ago- Doesn't compile to native code (there are ways to do it, but too complicated and there are caveats). What do you mean by that? It absolutely is compiled to e.g. x86_64 instructions by default, going through LLVM. Do you mean no standalone binaries? If so, that's actively being worked on by e.g. PackageCompiler. https://github.com/JuliaLang/PackageCompiler.jl https://github.com/JuliaLang/PackageCompiler.jl
- simonbyrne 8y ago> - You can't use a function before it's defined. I'm not sure what you mean by this. You obviously can't call a function before it is defined, but you can use a function in another function without any problems: julia> foo(x) = bar(x) foo (generic function with 1 method) julia> bar(x) = x+2 bar (generic function with 1 method) julia> foo(3) 5
- dnautics 8y agoSorry, why do you need OOP? I haven't coded OO in about 10 years now. (Mostly Julia, elixir, and functional JavaScript). It's great. Would never go back.
- walshemj 8y agoI would be more interested in why needing dynamic typing is such a deal breaker
- dnautics 8y agoI even had to write python once, so I built a class where none of the functions were passed self (so it was basically a functional module)
- aidos 8y agoIn python you’d normally just use module level functions for that. Using a class without having instances and all static functions doesn’t really buy you anything.
- dnautics 8y agoIirc, modules have a dependency on bareword paths that can get awkward. I'm not a professional python programmer, so the fastest way for me to deliver something that I could be 100% guaranteed to work was that way. Maybe I'm wrong, but that was my logic.
- playing_colours 8y agoThe only problem I found with this approach is to manage state and dependencies: say, if the functions need to work with database, it is not convinient to send it as a parameter. A class instance initialised with a database looks more feasible in my opinion.
- dfee 8y agoYour alternative is dependency injection. What you seem to be describing is class factories (I.e. the use of meta classes) which /is/ OOP. That said, I think OOP is fine. And so is FP. They’re just tools, and I would prefer to model nouns in the former, and model verbs with the latter.
- banku_brougham 8y agohonest question, not a serious SDE here. In what ways is julia not supportive of OOP?
- RivieraKid 8y agoIt doesn't have interfaces for example. It doesn't have access modifiers. Also, not sure if this belongs to OOP but working with optionals is cumbersome.
- StefanKarpinski 8y agoPython also doesn’t have interfaces or access modifiers. Would you consider Python to have bad support for OOP by those criteria?
- spaced-out 8y agoYes, Python definitely has bad support for OOP.
- kbp 8y agoSmalltalk doesn't have them, either.
- StefanKarpinski 8y agoIndeed. Alan Kay might take some issue with this notion of OOP.
- h8hawk 8y agoOnly if define OOP as what java does.
- ken 8y agoSmalltalk might be a better example.
- 8y ago
- AllegedAlec 8y ago> Lack of support for OOP. Please. No. Languages that try to do everything are crap. If you want to do something OOP, why don't you grab a language built for it?
- RivieraKid 8y agoI do. Many languages have excellent support for both OOP and FP. I think Swift is currently the best-designed general-purpose language and wish that it would improve in areas where Julia is better, e.g. standard library and available packages or REPL.
- AllegedAlec 8y agoI'd much rather whave a couple of language that specialize in their own paradigm rather than a single one which tries to do everything, to be honest.
- skohan 8y agoWhat's convenient about Swift as a language which "tries to do everything" is that you can mix and match. Sometimes it's convenient to use different programming paradigms for different components.
- AllegedAlec 8y agoIt also makes the code a pain to read and maintain.
- skohan 8y agoDifference of opinion. Swift is the most self-documenting language I have worked with between the named function parameters and the power of the type system.
- skohan 8y agoSwift does have a REPL.