HNHacker News
TopNewBestAskShowJobs

mgkuhn

44 karma · joined December 6, 2022

submissionscomments
mgkuhn··on Making Julia as Fast as C++ (2019)
Note that this article is about Julia 1.0.3, whereas today you should consider as obsolete any experience reports involving Julia versions prior to Julia 1.10 (the current LTS version), the most significant milestone in the maturity and usability of the language.
mgkuhn··on Making Julia as Fast as C++ (2019)
I'm always surprised when people describe Julia syntax as "Pythonic": Julia's syntax was clearly inspired by MATLAB rather than Python.

And that's a good thing, because Python+NumPy syntax is far more cumbersome than either Julia or MATLAB's.

You can see this at a glance from this nice trilingual cheat sheet:

https://cheatsheets.quantecon.org/

mgkuhn··on False claims in a widely-cited paper
I thought the proper way to correct questionable results is to conduct and publish a follow-up study that independently looks at the same question with better data and better methodology. And wait until multiple independent teams have done the same. And then write a meta-analysis on the emerging pool of independent papers.

That's how scientific consent is normally formed, at least in rigorous disciplines like experimental physics or medicine. A single paper in the end is going to be just a single data point in any such meta-analysis study.

mgkuhn··on In Defense of Matlab Code
In Julia:

  X = [1 2 3]
  Y = [1 2 3;
       4 5 6;
       7 8 9]

  Z = Y * X'
  W = hcat(Z, Z)
mgkuhn··on In Defense of Matlab Code
The problem with MATLAB is that idiomatic MATLAB style (every operation returns a fresh matrix) can easily become very inefficient: it leads to countless heap memory allocations of new matrices, resulting in low data-access locality, i.e. your data is needlessly copied around in slow DRAM all the time, rather than being kept in the fastest CPU cache.

Julia's MATLAB-inspired syntax is at least as nice, but the language was from the ground up designed to enable you writing high-performance code. I have seen numerous cases where code ported from MATLAB or NumPy to Julia performed well over an order of magnitude faster, while often also becoming more readable at the same time. Julia's array-broadcast facilities, unparalleled in MATLAB, are just reason for that. The ubiquitous availability of in-place update versions of standard library methods (recognizable by an ! sign) is another one.

In our group, nobody has been using MATLAB for nearly a decade, and NumPy is well on its way out, too. Julia simply has become so much more productive and pleasant to work with.

https://julialang.org/

https://docs.julialang.org/en/v1/manual/noteworthy-differenc...

mgkuhn··on How often does Python allocate?
There are reasons why the same program in Julia can be 60x faster than in Python, see e.g. slide 5 in https://www.cl.cam.ac.uk/teaching/2526/TeX+Julia/julia-slide... for an example.
mgkuhn··on Correctness and composability bugs in the Julia ecosystem (2022)
The pre-compilation speed/caching performance ("time to first plot") has practically been solved since 2024, when Julia 1.10 became the current LTS version. The current focus is on improving the generation of reasonably-sized stand-alone binaries.
mgkuhn··on Correctness and composability bugs in the Julia ecosystem (2022)
Julia is a very powerful and flexible language. With very powerful tools you can get a lot done quickly, including shooting yourself into the foot. Julia's type-system allows you to easily compose different elements of Julia's vast package ecosystem in ways that possibly were never tested or even intended or foreseen by the authors of these packages to be used that way. If you don't do that, you may have a much better experience than the author. My own Julia code generally does not feed the custom type of one package into the algorithms of another package.
mgkuhn··on Clashes between web and X11 colors in the CSS color scheme
The wonders of standards-committee bike shedding?
mgkuhn··on The end of AM radio in your car?
What exactly does he technically want to preserve? Does he really care about amplitude modulation? Or does he care about the frequency band (medium wave, HF) and its propagation properties? Or does he care bout the geographic reach of these stations?

Amplitude modulation is a historically important technology, because it was technically very simple to receive in the early history of radio, and because it was more bandwidth-efficient than FM. But it remains utterly badly suited for mobile reception, because it is highly sensitive for multi-path interference (unlike FM).

We have now far better modern, digital modulation schemes, including DAB and DVB-T2 for VHF and DRM for long, medium, and short-wave transmission. They provide (thanks to OFDM) much better audio quality and interference resistance than the old analogue modulation schemes, and they are also far more power efficient, which substantially reduces the enormous electricity bills of the transmitter stations. They also are very bandwidth efficient, and can be used in single-frequency networks.