Hacker News new | ask | show | jobs
by tejtm 2851 days ago
User defined types are __no__ different than "native" types.

You are talking to the llvm compiler, sure you are talking in Julia most of the time, but if you happen to want to talk in C or FORTRAN or ASM in the middle of your high level script, just do. No marshalling of I/O or data structure impedance it all compiles the same.

2 comments

Exactly. Typing choices are a key part of what makes Julia interesting. And user types are first-class.
So can I define custom operations in llvm ir?
You can write custom code in llvm IR.[0] I must leave it to you to tell me if you can use it as an operator. My guess is yes, but I will not be getting to play any time soon.

[0]https://docs.julialang.org/en/stable/base/c/#Core.Intrinsics...