TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The unreasonable effectiveness of the Julia programming language

284 点作者 nikbackm超过 4 年前

19 条评论

Tarrosion超过 4 年前
I quite liked this article, but both the article and the comments here mostly skip over my absolute favorite Julia feature: because Julia is fast end-to-end, you can code in the style that naturally matches your use case and mental models without sacrificing performance. Functional patterns and imperative patterns, vector-based or element-by-element, your types or built-in: they all work well and run quickly!<p>I do most of my programming in Julia and Python. Python libraries like numpy and pandas are fast and efficient—if you&#x27;re staying &quot;within the lines&quot; of how the library is designed to work. And most of the time this is okay! But not irregularly I want to do array operations on arrays of user-defined types, or I want to walk through a dataframe row by row without paying a huge performance penalty, etc. And all the sudden the well-tuned Python ecosystem feels very restrictive.<p>In Julia, my workflow is roughly: 1) think about the problem. 2) Code an intuitive solution. 3) If necessary, tweak a little bit of code to improve performance by reducing allocations or type instability.<p>That&#x27;s a lot less mental work than my Python&#x2F;Matlab&#x2F;Java workflow of 1) think about the problem. 2) Think about how the solution can be expressed in the paradigm the language supports performance with. 3) Write a solution in this particular paradigm. 4) Tune for performance, which may be awkward if the initial solution was not intuitive.
评论 #24733770 未加载
评论 #24737029 未加载
tasubotadas超过 4 年前
Since everybody is so hyped about Julia, I took on learning it and using it in one of my pet projects. The use case seemed to be perfect for Julia: financial portfolio optimization.<p>But honestly, it is a royal pain in the ass to use. Mostly because tooling is so crappy (no decent IDE).<p>For example, I&#x27;ve made these notes on my journey with Julia:<p>- Juno and VSCode julia is a pain<p>- Debugging is pain - no watch expressions (but debug&gt; works)<p>- Works like with matlab (workspaces, designed for the single script use-cases)<p>- Long registry lookup times (2-5mins) when starting a new session<p>- No hints from IDE (Juno) on what methods are available for which types<p>- Ctrl-click navigation does not work to lookup definitations in libraries<p>- Debugger does not show the full list of elements - there are triple dots in the middle<p>- Filters and maps are not lazy<p>- Arrays start at one<p>- Precompilation times can take 1-2min<p>- Package management is done as a part of script execution<p>- Delay (0.5-1s) when processing commands (compilation?)<p>- Editors (Juno) do not check types at runtime when the information is readily available<p>- Include() includes (is this PHP all over again?) a file into the script!<p>- Reuses same REPL between different files<p>- DataFrames.jl: Transform does nonsense (use map instead)<p>- DataFrames.jl: No transpose<p>Obviously, there is a bunch of good things like freakin insane speed and vectorized method calls are awesome, but I struggle seeing myself becoming more producting than Python + Pandas.<p>It&#x27;s really a shame that language is strongly and semi-statically typed yet no tooling is making a use of that.
评论 #24732043 未加载
评论 #24733393 未加载
评论 #24732164 未加载
评论 #24734463 未加载
评论 #24733886 未加载
评论 #24732709 未加载
评论 #24736780 未加载
评论 #24734694 未加载
vsskanth超过 4 年前
I&#x27;m an engineer who writes the occasional matlab&#x2F;python code to automate tasks, process data and fit models. Numerical libraries are extremely important to me.<p>I recently started using Julia for simulating&#x2F;fitting some differential equations and am thoroughly impressed with the speed, syntax and library documentation. Startup speed was initially painful but I am used to it now since I only pay it once.<p>The IDE situation is not fully stable yet but Juno is very good. I wish they package a standalone Julia IDE (I am aware of the new VS Code plugin) based on either Atom or Code just to make it easier for those switching over from MATLAB and Python (Spyder) IDEs.<p>Don&#x27;t know how far they&#x27;ve progressed on static compilation yet, but if they get that even for a language subset it would truly be a game changer for general purpose programming.
评论 #24730242 未加载
评论 #24730300 未加载
leephillips超过 4 年前
I’d be particularly interested in opinions about whether my popularized attempt to explain the expression problem is effective, or just confusing.
评论 #24732275 未加载
评论 #24729318 未加载
评论 #24731987 未加载
评论 #24732716 未加载
评论 #24729674 未加载
评论 #24729424 未加载
评论 #24732412 未加载
评论 #24733485 未加载
评论 #24732182 未加载
zepearl超过 4 年前
Fyi, I liked this to get a quick and initial understanding of the language (I just read it): <a href="https:&#x2F;&#x2F;juliabyexample.helpmanual.io" rel="nofollow">https:&#x2F;&#x2F;juliabyexample.helpmanual.io</a><p>Question:<p>I see that on Gentoo Linux all versions of the language-compiler (pkg &quot;dev-lang&#x2F;julia&quot; versions 1.2, 1.3, 1.4, 1.5) are all marked as not yet being officially stable ( <a href="https:&#x2F;&#x2F;packages.gentoo.org&#x2F;packages&#x2F;dev-lang&#x2F;julia" rel="nofollow">https:&#x2F;&#x2F;packages.gentoo.org&#x2F;packages&#x2F;dev-lang&#x2F;julia</a> ) =&gt; any &quot;real&quot; reason for this? Are there any open&#x2F;important bugs or is it just because of e.g. a low usage of the language itself on the Gentoo distro, or maybe because the specs of the language are still changing, etc...?<p>I think that e.g. Rust more or less as old as Julia, but Rust on Gentoo is marked as being stable since a long time... .
评论 #24732952 未加载
reggieband超过 4 年前
Julia is one of those programming languages where I find it interesting but I cannot imagine a practical use case for myself. I even took the time to `brew install` it and was thinking about it again recently when I saw it update. The same is true with numpy or R - my work just doesn&#x27;t involve high performance numerical computing. And even if it did, it would always be secondary to some other purpose. Outside of a REPL, if I were to productionize some heavy computational work, even numerically based, I would probably still lean towards containerizing a C++ (or maybe Rust) binary.<p>It&#x27;s one of those &quot;right tool for the job&quot; type quandaries. For many popular languages (Javascript, Python, Go, C&#x2F;C++, Rust, Java, OCaml) I have an intuition on when I would reach for them based on my experience. With Julia - I am not sure the shape or character of the problem where I would reach for it.
评论 #24733532 未加载
tokai超过 4 年前
So how is julia nowadays? I stopped using and following it sometime ago as I found it as slow as python, or worse, for anything that wasn&#x27;t numerical computing.<p>Really wanted to love it.
评论 #24730089 未加载
评论 #24731759 未加载
评论 #24729439 未加载
评论 #24729342 未加载
评论 #24739112 未加载
评论 #24729310 未加载
fouric超过 4 年前
Common Lisp has had multiple dispatch for decades. Yet another Lisp feature &quot;taken&quot; by another language - why not just <i>start</i> with a Lisp and improve it (e.g. Typed Racket, for performance) rather then repeatedly creating new languages and just adding a tiny piece of Lisp to them each time?
评论 #24729628 未加载
评论 #24730158 未加载
评论 #24729801 未加载
评论 #24729605 未加载
评论 #24729903 未加载
评论 #24729611 未加载
评论 #24729874 未加载
pmoriarty超过 4 年前
I wish Julia was much more Lisp&#x2F;Scheme-like in terms of syntax. If they&#x27;d just focused on making a more performant, typed-Scheme (or improving one of the existing ones), that would be much more interesting for me.<p>I took a dip in to Julia recently, and found it to be a mishmash of Lisp, Haskell, Matlab and Fortran ideas, wrapped in Python-like syntax.<p>I guess that can be appealing for people coming from those worlds, and for those for whom speed trumps everything else.<p>For me the loss of a Lispy syntax and the price of working with a relatively immature language wasn&#x27;t worth it for me. I&#x27;d just rather use something with reasonable performance that&#x27;s more Lispy.
评论 #24730336 未加载
dalke超过 4 年前
At a conference presentation the other day a speaker made the claim that well-written Julia code was as fast as well-written C code while as expressive as Python, so it solved the two language problem.<p>My Python package uses a C extension for performance. That C extension uses AVX2 intrinsics. How well does Julia support intrinsics?<p>Even supporting something like __builtin_popcountll() would be nice, but <a href="http:&#x2F;&#x2F;rosettacode.org&#x2F;wiki&#x2F;Population_count#Julia" rel="nofollow">http:&#x2F;&#x2F;rosettacode.org&#x2F;wiki&#x2F;Population_count#Julia</a> suggests that it&#x27;s not supported in Julia.<p>I&#x27;ve no experience with Julia and my attempt at finding this out on my own failed - does anyone here know about Julia&#x27;s support for intrinsics?
评论 #24737451 未加载
评论 #24737327 未加载
评论 #24739138 未加载
langitbiru超过 4 年前
You know what? In the past, I was toying with the idea of building Julia IDE. In the end, I decided to build something else.<p>So the pain point is still there. Looking at this thread, it could be a good idea to build Julia IDE. Then you can apply for funding in the next YC batch. 6 months should be enough to build an MVP.<p>Bonus point if you could build Julia IDE with Rust. In Show HN, surely you would get a lot of karma points. But we need to be realistic. Rust does not have a solid GUI library. If I chose to build Julia IDE, I would use either C++ with Qt or C++ with wxWidgets.
评论 #24736024 未加载
DennisP超过 4 年前
I tried to get started with Julia a couple months ago, downloaded several libraries, and they wouldn&#x27;t compile due to missing dependencies. Is there a problem with the package manager?
评论 #24729709 未加载
评论 #24729841 未加载
评论 #24730007 未加载
评论 #24729731 未加载
bshanks超过 4 年前
<a href="https:&#x2F;&#x2F;dl.acm.org&#x2F;doi&#x2F;pdf&#x2F;10.1145&#x2F;327649" rel="nofollow">https:&#x2F;&#x2F;dl.acm.org&#x2F;doi&#x2F;pdf&#x2F;10.1145&#x2F;327649</a> (&quot;Julia: Dynamism and Performance Reconciled by Design&quot;) section 4.2.1 shows how multiple dispatch enables a library to compute the derivative of another program without modifying that other program to be aware of the derivative-computing library.
ralphc超过 4 年前
How easy would it be to use Julia on a problem that would take advantage of the 16 hyperthreaded cores on my computer? Does it use threads, async&#x2F;await mechanism, something else? Is it intuitive to use?
评论 #24736119 未加载
评论 #24736117 未加载
IshKebab超过 4 年前
I wanted to like Julia, but loading the graphing library takes longer than starting the entirety of MATLAB. Not a good design.
naveen99超过 4 年前
Why should I use julia over c++11 ?
scoot_718超过 4 年前
It&#x27;s another R, something that seems like progress, but will end up stopping further progress.
评论 #24733329 未加载
评论 #24729925 未加载
评论 #24729919 未加载
orbifold超过 4 年前
Here is my main gripe with Julia: They blatantly copy Matlab. The same is also true to a lesser degree of Python&#x27;s numpy and matplotlib, but Julia goes the whole nine yards, by basically replicating the syntax and copying most of the numerical APIs including the indexing convention. I understand why they do it and I get that Matlab is hugely popular, I just wish that there was more creative energy in the Open Source world and not just rehashing of 20-40 year old designs.
评论 #24735294 未加载
评论 #24734372 未加载
评论 #24735998 未加载
fizixer超过 4 年前
Wow, Julia is a &quot;baby language&quot; and there is not a single project where its dominating the usage landscape.<p>What&#x27;s next, the unreasonable effectiveness of an idea I just had last night?<p>Come back in 10 years.
评论 #24732666 未加载