HNHacker News
TopNewBestAskShowJobs

kwertzzz

153 karma · joined April 24, 2018

submissionscomments
kwertzzz··on Decompiled 2022 Beijing Olympics Apps
I stand corrected. Thanks!
kwertzzz··on Decompiled 2022 Beijing Olympics Apps
It also includes "Der Spiegel", a German newspaper (one of the most influential one in Germany).

https://github.com/jonathandata1/2022_beijing/blob/main/ille...

kwertzzz··on A trick to have arbitrary infix operators in Python
Here is an interesting discussion from the julia language where string concatenation is indeed the * operator:

https://github.com/JuliaLang/julia/issues/1771

In particular:

https://github.com/JuliaLang/julia/issues/1771#issuecomment-...

Undoubtedly, it is a big surprise for new users (without exposure to free monoids :-)), that * is string concatenation.

By the way, in python juxtaposition ("abc" "def") is also valid.

kwertzzz··on Things I learnt about Julia during Advent of Code
Nice article! One can you also use reduce(hcat,n) instead of hcat(n...). The function reduce(hcat,n) should be faster as there is optimized implementation of it:

https://github.com/JuliaLang/julia/blob/89a51fb98485219680c7...

This feature was discussed here: https://github.com/JuliaLang/julia/issues/21672

kwertzzz··on Type Stability in Julia: Avoiding Performance Pathologies in JIT Compilation
The code_warntype macro is helpful, but to prevent a future inadvertently introduced type stability, a failing test would be much better.

Test.@inferred is not quite what is needed:

    function foo(x)
      s = 0 
      # better use a zero of the same type than x
      # s = zero(x)
      for y in x
        s += y
      end
      return s
    end

    Test.@inferred Float64 foo(12.1) 
This test succeeds even if code is type-unstable
kwertzzz··on Germany wants smartphone makers to offer 7 years of software updates
One could check if the phone is vulnerable to any published issues in the CVE database. (I applaud this effort in reducing e-waste).
kwertzzz··on Pop_OS 21.04
Installing CUDA (with kernel driver, CuDNN, Tensorflow/PyTorch) has not been easy for me either. Usually you want to have the latest version of all of them. But sometimes the very latest version of these packages is not yet supported by the other. This is where it get difficult. Also the fact that the CUDA instruction from TensorFlow [1] still are at Ubuntu 18.04 does not help. In my experience installing PyTorch with CUDA is easier than TensorFlow (and much better documented). The best experience, in my opinion, is however with CUDA and Flux.jl or Knet.jl on Julia. All you need there is the kernel driver (and julia). CUDA and CuDNN will be installed per default if necessary. I am wondering why CUDA is not simply a pip-installable package (like it is in Julia or in Conda).

[1] https://www.tensorflow.org/install/gpu

kwertzzz··on Cuda.jl v3.3: union types, debug info, graph APIs
This is really the main problem. As far as I know, ROCm requires a quite expensive GPU for data centers (if you want to have a current GPU) which makes it quite difficult to build a community around ROCm.
kwertzzz··on Cuda.jl v3.3: union types, debug info, graph APIs
For Pytorch, I had no issues with conda. But with Tensorflow from conda, the training process just hangs (consuming 100% of CPU but no GPU resources, despite my GPUs are recognized). I got more luck with installing Tensorflow with pip. Given the fact that Tensorflow documentation does not mention conda, I wondering how well this is supported.
kwertzzz··on Cuda.jl v3.3: union types, debug info, graph APIs
Yes, you would still need to the NVIDIA kernel driver (preferably the most current one). Desktop users typically have it already installed. But the main difficulty in my opinion is to install CUDA (with CuDNN,...). Even the TensorFlow documentation [0] is outdated in this regards as it covers only Ubuntu 18.04. The installation process of CUDA.jl is really quite good and reliable. Per default it downloads it own version of CUDA and CuDNN, or you can use a system-wide CUDA installation by setting some environment variables [1].

[0] https://www.tensorflow.org/install/gpu [1] https://cuda.juliagpu.org/stable/installation/overview/

kwertzzz··on From Competitive Programming to APL
The compactness of APL is indeed quite intriguing. One could also write your example in Julia by:

sum(j -> j*2.0^(-j),1:n)

sum(function,array) applies function to all elements of array before the summation (without need to allocate an intermediate array).

kwertzzz··on From Competitive Programming to APL
I would be genuinely interested of the advantages of APL over languages like Julia or Python with numpy who have also quite flexible array types. For instance in Julia, I could write:

data = [1,2,3]

# . means element-wise operation

sum(exp.(filter(isodd,data)))

# or, where x |> f is f(x)

data |> x -> filter(isodd,x) .|> exp |> sum

Which looks quite clean to me. But Julia does not have partial function evaluation (just using filter(isodd) above would not work). Is this one of the main differences?

kwertzzz··on Cinder: Instagram's performance-oriented fork of CPython
I don't know why you got downvoted, but I agree that matrix manipulation in numpy look quite foreign to to somebody new to python/numpy. I had heard this "complain" from several colleagues (mostly former matlab-users). Several colleagues have migrated to Julia, which does a quite good job in producing easy readable numerical code. For instance, the dot-product can be written with the Unicode dot symbol (typed as \dot<tab>)
kwertzzz··on Wikipedia Is Finally Asking Big Tech to Pay Up
> "Russia's or China's state-sponsored propaganda"

I do not think that this is a crazy idea at all [1]

[1] https://en.wikipedia.org/wiki/Internet_Research_Agency

kwertzzz··on Enzyme – High-performance automatic differentiation of LLVM
The julia binding look really great. In zygote, arrays are immutable. Is enzyme able to handle such cases?
kwertzzz··on JuliaCall Update: Automated Julia Installation for R Packages
Indeed, the use of BinayBuilder was an important step forward. Before we had the problem that different package would require different versions of e.g. zlib (https://github.com/JuliaGraphics/Gtk.jl/pull/387). BinayBuilder made the package installation mush more robust.
kwertzzz··on Julia adoption keeps climbing
I tried also recently the beta version of Julia 1.6 and the speed improvement of installing/loading package are quite impressive. Essentially, packages get precompiled after installation using multiple threads.

Beside this, if you only infrequently install/update package, you can use PackageCompiler.jl. I use it for PyPlot.jl (based on matplotlib), DataFrames.jl, ... and plotting some data quasi instantaneous as it is in python (even the very first time in a session).

kwertzzz··on Groundhog: Addressing the Threat That R Poses to Reproducible Research
I full agree. With version number you can have a good sense whether a package update breaks your code or not (as long the package authors following semantic versioning).

I think in julia this problem is solved quite nicely with the Project.toml (list of package that you directly dependent) and Manifest.toml file (the version numbers of the complete dependency tree which is automatically generated).

It seems that in groundhog you declare only direct dependencies. Is there a way to store the full dependency tree in R ?

kwertzzz··on Coronavirus: Spain to keep registry of those who refuse Covid vaccine
In my country you need to show that your kid is vaccinated against e.g. Polio before you can let him/her go to daycare. To me, it makes perfect sense, that somebody who wants to go to e.g. a music festival in 2022 without a face mask, should be able to prove that he is vaccinated (assuming vaccinated people are not infectious, which still needs to be shown, but this is quite likely).

Keeping a record of those who refused vaccination might not be necessary for this. In fact, somebody who refused vaccination is as much as a health risk as somebody who has not (yet) the possibility to get vaccinated.

But vaccinated people should have the possibility to prove that they are vaccinated and current social distancing rules should no longer apply to these people.

kwertzzz··on A new release for GNU Octave
I have translated quite a bit of Matlab code to Julia. Just the simple fact that indices are handled the same way in Matlab and Julia makes this transition easier than going from Matlab to Python in my opinion. What I would suggest, is that you first write some test suite of your Matlab code (you might have it already), have a look to the Julia documentation and in particular to the performance tips (https://docs.julialang.org/en/v1/manual/performance-tips/) and for functions where performance is important check its type-stability. You might want to start first with a small project to familiarize yourself with the (quite rich) type system in julia.
kwertzzz··on The Rise and Fall of High Performance Fortran (2011)
Note that this article is about a Fortran dialect called "High Performance Fortran" (a competitor to OpenMP). It is not about Fortran for High-Performance Computing in general. I used Fortran quite a lot in my PhD and I actually did like it and it is very well suited for numerical calculations on multiple CPUs. Some criticism of Fortran is based on outdated Fortran version (like Fortran 77) and not applicable to current Fortran versions.

But the productivity boost of a REPL is undeniable and I use Julia mostly now. Interestingly, many skills to write high performant Fortran code (like the effective use of the processor cache), do actually translate to Julia.

kwertzzz··on Array Programming with NumPy
I also like that package environments are integrated in Julia and thus there is only one way handle environments.
kwertzzz··on Array Programming with NumPy
Yes, and the interface is pretty fast and without any noticeable overhead:

julia> data = rand(ComplexF64, 1024^2);

# python fft from julia:

julia> res = @btime np.fft.fft(data);

  78.613 ms (39 allocations: 16.00 MiB)
# python fft in ipython:

In [11]: %timeit res = np.fft.fft(data)

89.3 ms ± 1.65 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)

As expected, julia has its own fft package (based on FFTW):

julia> res = @btime fft(data);

  61.540 ms (33 allocations: 16.00 MiB)
kwertzzz··on Repl.it Database
I tried Julia as well to test the database feature. Unfortunately, when I `import HTTP`, I get "repl process died unexpectedly: signal killed". (julia 1.3.1 and HTTP v0.8.17)
kwertzzz··on Fast.ai and why Python is not the future of ML with Jeremy Howard
I would argue that Julia can be similarly flexible than Python, but you have to be more explicit that you need this flexibility.

For instance, in python you happily add a string to the list [1,2,3], but not in Julia because the list has been created as a vector of integers. However, if you create the list as Any[1,2,3], then you can append a variable of any type.

kwertzzz··on Show HN: Calculator of personal risk due to Covid-19
Why are you sending the data (including medical conditions) to Facebook?

https://www.facebook.com/v6.0/plugins/like.php?action=like&a...

kwertzzz··on Delphi's 25th Birthday
This is exactly what I like too about Delpi (and Pascal if I remember correctly) compared to C++ and Java. Julia, which I use now, has a similar feature but properties are less extensively used there (except for interoperability with Python). But it is a great feature to reduce the clutter in your code.
kwertzzz··on JuliaLang: The Ingredients for a Composable Programming Language
Did you know that Java for instance, was originally designed to run on interactive TVs? But then, Java run on many type of devices and in broad range of use-cases (maybe with the exception of TVs :-)).

The original niche for which a programming language is designed may or may not be indicative for what it is used in the end. Julia strikes a very good balance between performance, flexibility (macros) and ease-of-use (default type inference). I won't be surprised if there are other niches outside of scientific computing where these characteristics are desirable.

The biggest obstacle I see for the adoption of Julia outside of the scientific computing realm are the latencies due to compilation. There are already 3-party solutions for this (like PackageCompiler{X,}.jl) but imho they are not robust yet enough for widespread adoption, but this might be about to change when different effort join forces [1].

[1] https://github.com/JuliaLang/PackageCompiler.jl/pull/304

kwertzzz··on Copying data is wasteful, mutating data is dangerous
This is interesting to know, because Julia uses exactly the same approach[1] (now I know where it comes from). To me it seems to be the ideal solution: use the in-place normalize!(X) where performance is important, otherwise use the more convenient allocating variant normalize(X). The exclamation mark makes it clear that the array is modified.

[1] https://docs.julialang.org/en/v1/base/collections/#Base.sum!

kwertzzz··on Why I use R
I am not a R user (using primarily julia and python), but can you expand on the insecure aspect of CRAN. Do you refer to (potentially) missing package signing (similar to [1])? I am not aware that python or julia support this either. Or is the software download over ftp/http instead of https?

[1] https://wiki.debian.org/SecureApt

← PreviousPage 2 of 3Next →