Hacker News new | past | comments | ask | show | jobs | submit login

The title says "GPU vendor-agnostic". But in fact for AMD only professional (expensive) GPUs are supported (ROCm is officially unsupported on most consumer and integrated GPUs).

To be truly vendor-agnostic it needs to support OpenGL or Vulkan.

Also this is the first time I saw examples of Julia code and the syntax looks worse than C++.




You may be confusing front end APIs and the compiler backends.

Julia is flexible enough that you can essentially define domain specific languages within Julia for certain applications. In this case, we are using Julia as an abstract front end and then deferring the concrete interface to vendor specific GPU compilation drivers. Part of what permits this is that Julia is a LLVM front end and many of the vendor drivers include LLVM-based backends. With some transformation of the Julia abstract syntax tree and the LLVM IR we can connect the two.

That said we are mostly dependent on vendors providing the backend compiler technology. When they do, we can bridge Julia to use that interface. We can wrap Vulkan and technologies like oneAPI.

https://github.com/JuliaGPU/Vulkan.jl https://github.com/JuliaGPU/oneAPI.jl

As for syntax, Julia syntax scales from a scripting language to a fully typed language. You can write valid and performant code without specifying any types, but you can also specialize methods for specific types. The type notation uses `::`. The types also have parameters in the curly brackets. The other aspect that makes this specific example complicated is the use of Lisp-like macros which starts with `@`. These allow for code transformation as I described earlier. The last aspect is that the author is making extensive use of Unicode. This is purely optional as you can write Julia with just ASCII. Some authors like to use `ε` instead of `in`.


Regarding syntax, I think there are too many weird character combinations (:., ==:, etc) like these:

    ex.head == :. && return union!(sym,[ex])
    start = ex.head==:(call) ? 2 : 1
    
Also I don't like |> combination because it is hard to type. Why not use just single pipe character.


The colon is a bit overused (ranges, ternary, quoting), but this would be pretty clear with parentheses and spacing, i.e. ex.head == :(.) and ex.head == :(call). Now you can see it's a comparison against the symbols '.' and 'call'. Kind of like saying C has too many weird character combinations because there's a "--> operator".


Indeed there are no special operators, :. and ==: etc. They are just :, . and ==

And macro definition code looks quite different from 'regular' code since it works so much with expressions and symbols.


> Also this is the first time I saw examples of Julia code and the syntax looks worse than C++.

For someone who writes both Julia and C++, the above comment comes across as an obscene joke.

Possibly, you object to the programming style in that library, the choice of identifiers or whatever? But that has nothing to do with language syntax.



> Also this is the first time I saw examples of Julia code and the syntax looks worse than C++.

That's surely an exaggeration, but just for context, most Julia code isn't nearly this macro-heavy. The first half of the final code showcase is all macros and expression manipulation, and those always look a bit weird. Usually, those comprise less than 10% of your code though; and if you're a regular user and not a package author, probably much less than that.


I would guess the majority of users never write a single line of macro definitions or expression evaluation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: