24 ms·
Why I am betting on Julia (2014)
- ones_and_zeros 11y agoAny thoughts on how it compares and will overcome the dominant enviromnent for technical programming, matlab?
- 2miles4chicken 11y agoIt's certainly faster: http://julialang.org/benchmarks/ http://julialang.org/benchmarks/. It is free/open source. And, it benefits from being a younger language and therefore has the hindsight of the quirks in Matlab's design. Coming from Python, the 1-indexed arrays are annoying but it's great for math.
- sghodas 11y agoThe 1-indexed arrays can sometimes be nice, but I've run into bugs so many times when translating the code into a language with 0-indexed arrays.
- tptacek 11y agoThat's interesting, because the 1-indexed arrays are primary the primary reason I don't ever seriously consider using Julia (or Lua); I can only shudder and imagine the obnoxious number of off-by-one mistakes I'd make.
- jernfrost 11y agoI think this is a mental block people have. I grew up on zero based arrays in C, but I can't say this has caused me any issues thus far using Julia. I don't know how it is for others but for me I just into this mode where I think about Julia as doing math and I know in math you start at 1 for vectors and matrices. Besides the way functions and APIs work, you seldom have to write code that really depends on the start index.
- CyberDildonics 11y agoWhat you are saying is conjecture if you haven't tried Julia or Lua. The reality is that 1 based indexing is trivial compared to the difficulties of a complex program.
- ced 11y agoOut of curiosity, assuming that Julia magically had 0-indexed arrays, what would you use it for?
- deleted 11y ago[deleted]
- matt4077 11y agoYeah, it just feels wrong. Of course that's just habit and in fact starting counts at 1 is actually the more user-centric way of doing it. I wish I could get used to Julia but for some reason I just think the source looks..ugly. Maybe it's my dark past with php that makes me shudder at the sight of avg(x) (instead of x.avg). I know that's stupid (and the syntax is actually required for multiple dispatch). Maybe Julia and I should try couples' therapy.
- Avshalom 11y agoOn the other hand having cut my teeth programming in MATLAB and lua 1-based indexing is on of the things that endears Julia to me.
- simonster 11y agoIf I can switch between programming languages that use 0-based and 1-based indexing without getting confused, surely you could too. If you don't think that learning to use 1-based indexing is worth it, that's fair enough, but it's pretty low on my list of things that give me trouble when I translate code between languages.
- jhbadger 11y agoBasically every mathematical/data science language uses 1-based arrays -- R, MATLAB, and Mathematica in addition to Julia. Probably because traditionally (and to a degree even now) the standard numerical language was FORTRAN.
- ninjin 11y agoWhat Julia really lacks at this moment is something along the lines of the Matlab IDE. The community is aware of this though and there is something in the works that even I, someone that lives happily with a ssh/tmux/vim set-up, would deem as interesting. Since we are on Hacker News, maybe I should also spread a rumour. MathWorks, allegedly, in a recent settled lawsuit added a condition stating that the other company was not to create any Julia bindings for its product. If this is true, which I have many reasons to believe, it is a major recognition of how at least MathWorks sees Julia as a real threat to the Matlab market share.
- bsilvereagle 11y ago> MathWorks sees Julia as a real threat to the Matlab market share I think Mathworks is feeling a lot of pressure from both Python & Julia. In the r2016a release of MATLAB, Mathworks essentially released a Jupyter (one of the first environments for Julia, and formerly iPython Notebooks) competitor with the 'Live Notebook'. Mathematica has had notebooks for quite a while, and the best Mathworks had was their MuPad suite. I think the prevalence of Jupyter definitely led to this development. http://www.mathworks.com/products/matlab/live-editor/ http://www.mathworks.com/products/matlab/live-editor/
- jjoonathan 11y agoOn the other side of things, are you aware of any efforts in the open source community to close the gap between jupyter and Mathematica notebooks (i.e. editing of pretty-printed math expressions)? I would really like to not give Stephen Wolfram money every year, but evidently not quite as much as I really like to be free of paragraph-form monospace code blobs from hell. I was hoping that MathJax meant I could wait a few years and have my cake and eat it too, but so far I haven't seen anything that looks serious :(
- amk_ 11y agoLyX and TeXMacs can do that kind of thing through Maxima plugins. The Maxima frontend itself has some prettifying capabilities. Of course, if you aren't doing symbolic math that is going to be less useful to you. - http://www.texmacs.org/ http://www.texmacs.org/ - http://www.lyx.org/ http://www.lyx.org/ - http://maxima.sourceforge.net/ http://maxima.sourceforge.net/
- deleted 11y ago[deleted]
- phantom_oracle 11y agoWhen I read this, all I can think about is the enormous amount of man-hours people have put in to make Python the go-to for Julias target market. As the author says, the biggest drawback is libraries, and that is (1 of) the big attraction(s) towards languages. Nobody wants to have to switch between C, Python, Assembly, etc. to make their code faster, but even fewer people want to write bindings to underlying C code. This also goes exactly against what the author doesn't want to do, which is to yak-shave around the language to get things working.
- sdenton4 11y agoIt's extremely common to prototype in a language like python or R to be able to bang out a draft idea before diving into making it fast. If I'm not sure how awesome something is going to be, there's no sense in wasting weeks getting a C implementation working. And prototyping in a higher level language often reveals a lot of the architectural complexity you'l have to deal with in a lower level implementation. So I think this guy's use-case is more common than you think. Python addresses a good deal of the problem with Cython, which lets you declare variables and compile to get ~90% of the speed gain you would get from a pure C implementation. And then you can just link to a C implementation if you still find you need to build one...
- rm999 11y ago>It's extremely common to prototype in a language like python or R to be able to bang out a draft idea before diving into making it fast. I think what's far more common is prototyping something in Python or R, and then realizing that 99% of its CPU time is already spent in wrapped C code. And then you call it a day and move on to other things :) This is why Julia hasn't taken off nearly as quickly as I initially expected - Python/R/etc are highly optimized for their common use-cases.
- ihnorton 11y ago> I think what's far more common is prototyping something in Python or R, and then realizing that 99% of its CPU time is already spent in wrapped C code. And then you call it a day and move on to other things. Someone has to write those libraries. > This is why Julia hasn't taken off nearly as quickly as I initially expected Not sure what you were expecting, but consider: - the most conservative userbase estimate I would believe is 20k users (based on mailing list subscriptions, website stats, and download numbers). - sustained package ecosystem growth: http://pkg.julialang.org/pulse.html http://pkg.julialang.org/pulse.html
- idobai 11y ago> my two concerns are 1) making it work and 2) making it fast. If you want to make it work it will help to use a tool with features(safety, type systems...) aimed at your goal. And no, julia won't guarantee high performance for you by default. If we're talking about performance we can choose from 2 camps: AbsolutelyUseless and PossiblyBeUseful.
- riscy 11y ago> Julia breaks down the second wall — the wall between your high-level code and native assembly [...] you can take a peek behind the curtain of any function into its LLVM Intermediate Representation as well as its generated assembly code — all within the REPL While I agree with the author in "betting on Julia", I do not think inspecting LLVM IR or assembly of individual functions in the REPL is as useful as a feature as the author thinks, because it gives an inaccurate picture of what the actual output will be. Peeking at the code at the level of functions means a non-inlined version of the function must be produced at the REPL, and anywhere else this function is used in your actual code, it will probably be inlined (the author's example certainly will) so it can be further optimized/eliminated by later passes. Furthermore, for a non-trivial function's dump, fundamental optimizations that increase code size (inlining, unrolling loops etc) would make the output confusing to compare with the Julia equivalents. Thus, I imagine a lower optimization level is used to produce readable REPL dumps. For a performance minded person (the only type of person who would care about ASM/LLVM dumps at a REPL) even this is not helpful.
- 3JPLW 11y agoYes, when a function is inlined, the caller's context can dramatically affect optimizations. And inspecting varargs functions can be tricky. But beyond that, it generally displays exactly what gets executed. You can verify this yourself by looking at functions with different `-O` or `--inline=no` flags. And if you're interested how a function optimizes with inlining under typical conditions, you can just inspect the outer function.
- mynegation 11y agoIt needs (2014) in the title if for nothing else than for the fact that a lot could have changed since then, as Julia is pretty fast developing
- dang 11y agoAdded.
- ProAm 11y ago> For me, code is like a car. It's a means to an end. The "expressiveness" of a piece of code is about as important to me as the "expressiveness" of a catalytic converter. Im a sculptor, but all I make is coffee cups and ashtrays so I dont need to worry about the minor details of things..... This is what abstraction gets us.
- tanlermin 11y agoI think it will all come down to web assembly. Why? Python has blaze, numba, dynd and dask going for it. These all ameliorate (and exceed Julia in some respects) many of the disadvantages of python (including fast user defined types). Then there are the libraries that while some can be used in Julia, you will never get full reliability, ease of use and compatibility. On the other hand, Julia has amazing metaprogramming and much cleaner scientific syntax. I think it will come down to whether Python can compile to fast LLVM regular standard lib programs. Once (if?) Julia can be run in the browser with web assembly (using ahead of time compilation to produce small binaries), python has no chance if it doesn't follow suit. Python has no advantage that can permanently match Julia's potential ability to run on mobile, front end web, back end etc all from one beautiful codebase. What does HN think?
- riscy 11y ago> Once Julia can be run in the browser with web assembly [...] That will never happen for Julia, because the language is designed to be fast for scientific computing... targeting web assembly is a pointless additional layer of abstraction that only negatively impacts performance.
- tanlermin 11y agoYea... I don't think so: https://github.com/JuliaLang/julia/issues/9430 https://github.com/JuliaLang/julia/issues/9430 http://juliacomputing.com/blog/2016/02/09/static-julia.html http://juliacomputing.com/blog/2016/02/09/static-julia.html
- riscy 11y agoA "compiled binary emitted by a hypothetical slimmed down non-numerical Julia" seems to be the going theory about WebAssembly support in that issue thread, as the numerical C/Fortran libraries needed by Julia have inline assembly too. Doesn't sound like there is a direct way forward. I see value in Julia web notebooks, where the lifting is done by a server (or localhost), but what are the motivations for running Julia in a browser?
- rdtsc 11y ago2014. Wonder if anything changed since then. How did author find using and developing in Julia since then. Has their opinion changed?
- mhd 11y agohttp://wizardmac.tumblr.com/post/104019606584/whats-wrong-with-statistics-in-julia-a-reply http://wizardmac.tumblr.com/post/104019606584/whats-wrong-wi... The author writes that Julia still isn't ready to replace his current development setup.
- mahmud 11y agoCL-USER> (defun f (x) (* x x)) F CL-USER> (f 2.0) 4.0 CL-USER> (disassemble 'f) ; disassembly for F ; Size: 37 bytes. Origin: #x1002B10BDC ; BDC: 498B4C2460 MOV RCX, [R12+96] ; thread.binding-stack-pointer ; no-arg-parsing entry point ; BE1: 48894DF8 MOV [RBP-8], RCX ; BE5: 488BD3 MOV RDX, RBX ; BE8: 488BFB MOV RDI, RBX ; BEB: 41BBB0020020 MOV R11D, 536871600 ; GENERIC-* ; BF1: 41FFD3 CALL R11 ; BF4: 488B5DF0 MOV RBX, [RBP-16] ; BF8: 488BE5 MOV RSP, RBP ; BFB: F8 CLC ; BFC: 5D POP RBP ; BFD: C3 RET ; BFE: 0F0B10 BREAK 16 ; Invalid argument count trap NIL *
- username223 11y agoThat "GENERIC-*" points to just one of the problems.
- mahmud 11y ago[Edit: Julia prides itself in being a fully generic language. From its paper: "Generic functions have appeared in several object systems in the past, notably CLOS [15] and Dylan [28]. Julia is distinguished from these in that it uses generic functions as its primary abstraction mechanism, putting it in the company of research languages like Diesel [10] and Cecil [9]." :-) ] Behold! CL-USER> (defun f (x) (declare (single-float x)) (* x x)) F CL-USER> (compile 'f) F NIL NIL CL-USER> (disassemble 'f) ; disassembly for F ; Size: 37 bytes. Origin: #x10048EACEC ; CEC: 498B4C2460 MOV RCX, [R12+96] ; thread.binding-stack-pointer ; no-arg-parsing entry point ; CF1: 48894DF8 MOV [RBP-8], RCX ; CF5: 0F28D1 MOVAPS XMM2, XMM1 ; CF8: F30F59D1 MULSS XMM2, XMM1 ; CFC: 660F7ED2 MOVD EDX, XMM2 ; D00: 48C1E220 SHL RDX, 32 ; D04: 4883CA19 OR RDX, 25 ; D08: 488BE5 MOV RSP, RBP ; D0B: F8 CLC ; D0C: 5D POP RBP ; D0D: C3 RET ; D0E: 0F0B10 BREAK 16 ; Invalid argument count trap NIL
- tombert 11y agoAll of Evan Miller's programming reviews are good. I'm pretty sure it's been posted on HN before, but I quite liked his take on Rust as well.
- muktabh 11y agoThis was in 2014. Here is a more recent perspective (from a different blogger who used Julia in production) https://blog.staffjoy.com/retro-on-the-julia-programming-language-7655121ea341 https://blog.staffjoy.com/retro-on-the-julia-programming-lan...
- philip1209 11y agoI wrote that article. I still bet on Julia. We just used pre-production software in a production environment and the tooling wasn't ready. I still love the language and believe in its future, and I can see us building future services in the language.
- sklogic 11y agoThey tried to use Julia for things like networking instead of confining it within purely numeric parts. No idea why would anyone use a DSL for doing some "general purpose" stuff.
- IshKebab 11y agoI've used Matlab quite a lot for "general purpose" stuff. Ok not networking, but you'd be surprised how good it can be at non-numeric things. Most of that was probably due to the slick GUI which nothing else comes close to (I've tried them all; trust me), but that is a legitimate factor.
- sklogic 11y agoOf course it can be used for a general purpose stuff, but it should not, because there are always much better tools that a specialised for those domains. It's never a good idea to use a language for something it was not designed for.
- elcritch 11y agoTechnically Julia is designed for general purpose computing. It just happens to be really good at numerical applications. The main thing holding it back is lack of tooling, debugging, and somewhat largish changes in syntax still. Having said that writing typed, expressive, and _performant_ DSL's in Julia is easy if not even kinda fun.
- max_ 11y agoThe founders of julia are geniuses. The only problem the language is facing is, marketing. Juila is one of those great things that everyone should use, but are simply bot promoted enough.
- dmpk2k 11y agoJulia is getting plenty of attention. It's pretty obvious at this point that Julia is destined to eventually be a major player in some fields. The main problem facing the language is maturity. That will come with time. Until it has fully stabilised, has a mature runtime, has a mature library ecosystem, and has strong debug and post-mortem tooling, it is not something everyone should use.
- eggy 11y agoThey're smart alright, but I think Julia has gotten a lot of play on other channels besides the Matlab/tech world. The stopper is for me is use cases. I play with ideas in Mathematica (notebook IDE for decades) because it has everything at my fingertips, keep J programming language opened on my desktop for quick prototypes (not just as a desk calculator), and if I need technical libraries and speed, I just use C with the relative libraries (even though I should learn Fortran :) ) I like Julia's syntax, and I think it will be more general purpose as it matures, but it is already the wild mistress of the Matlab playboy.
- tanlermin 11y agoWhat other channels?
- eggy 11y agoI meant that as a PL being pitched as a Matlab replacement, and for math and science communities, it has had some highly visible, hyperbolic articles in Wired ("Man Creates One Programming Language to Rule Them All"), Venture Beat, Fast Company and other more broad startup and popular tech magazines. I like the programming language J, and I think I can truly say it doesn't get a lot of exposure outside of its niche along these lines, so I wouldn't say Julia doesn't have good marketing; J has yet to be featured in Wired ;)
- lmm 11y agoLanguage design is vital for a language that can evolve. If you build a language for "cowboys" with the immediately-useful functionality that you can see, but without the "language geeks" insisting on the underlying principles, you end up with a language like perl - one that can dominate a particular use case for a while, but will be virtually impossible to evolve, and ultimately fall out of favour as it's overtaken by languages with firmer foundations. That's why I'm betting on the strongly-typed functional tradition - OCaml/Haskell/etc. These language already have the killer feature from this article: they can be (almost) as expressive as Python and (almost) as performant as (naive) C++. But they also have really solid design with a lot of thought put into it that will let them evolve to meet the needs of the future.
- junke 11y agoJulia stands definitely on firm foundations, has a solid design and is strongly-typed too.
- 9981721212 11y agoStrongly typed and dynamically typed, which means that you can get runtime errors. Also, the "type system" with "dependent types" is really just equivalent to an ML datatype that's dynamically type checked. I'm a bit mystified with respect to what passes as research in the field of type systems for dynamic languages.
- lmm 11y agoThen why's it positioned as a numerical/datascience language rather than a general-purpose language?
- vfclists 11y agoSpoiler alert. Use Nim.
- bleair 10y agoThis review was really helpful to me when I was looking for more insight into Julia. http://danluu.com/julialang/ http://danluu.com/julialang/