Why Julia?

Hi!
Im about to finish my undergraduate in AI. I basically learned Python there, except one subject that teached me Julia. After that i spent a lot of time with Julia, because it seemed just perfect: efficient and high level, big ecosistem and niche packages, very low level at some times and very mathematical at other times… I loved that. However, my relation with Julia was just pasive, I read some repos, watched some videos; the enthusiams grew inside me.
So I decided to code always that I could in Julia. And then I realiced that I had to learn to do the things I already knew in Python again, and also I realiced that I never worried too much about types… Everything became more difficult and most of the time the only docs are the source code.

My questions are: Is difficult to me because I never learned C? Is Julia also more difficult for you that Python? And in general, Why do you like/ use Julia? Why bother?

I like Julia because it’s community its so dedicated to do the right thing that lots of Julia snippets seem like poetry and because I feel that the end (coder) user is still very close to EVERYTHING, not like PyTorch.

Thanks for reading and appreciate any comments.
Have a nice day :slight_smile:

My old post is still valid:

For the problems I try to solve, mainly modeling using differential algebraic equations, Julia is far superior to Python. Much better tooling, better readability, 100 times faster…

But this is not true for every problem. Image recognition with AI tools might be easier in Python than in Julia due to better libraries and documentation.

So it depends…

Starting to solve simple problems in Julia is easy, but if the tasks become more complex, you also have to learn a lot (how to create a package, how to manage dependencies, how to make your code fast …)

Thanks for you answer!

If you want to read people’s experiences about adopting Julia, try this blog post:

I switched to Julia primarily for speed – we had a very heavily optimized numpy pipeline in Python, and the Julia version I wrote over a week while learning the language was 14x faster. The current, well-optimized version is over 100x faster.

Of course, you could try languages C++ or Go, or Python extensions like Numba, but in all those cases we found that it took much longer to rewrite the pipeline, with substantially worse results. Julia just has really good primitives for data and number crunching that are much harder to express in other languages.

Glad you liked Julia! Julia and Python doesn’t have to be mutually exclusive. I like to use Julia for all my personal smaller things that I used to do in JS/TS (the language itself is terrible compared to Julia, but initial prototyping is fast). I still use Python for things slightly more complicated like building an app, or using Numba for parallel computing. The ability to use Julia in Python and Python in Julia exists, so we could have the best of both worlds!

As a language, Julia is as different from C as Python is from C. All the similarities I’ve heard is performance comparisons, which doesn’t really matter in the moments you’re typing. I really don’t expect learning C to often be helpful in learning Julia or vice versa. Obviously that changes when you’re interfacing with C and managing pointers.

Sometimes, I can’t really make many broad statements except that I’m more likely to find an API or framework in Python because Julia usage is a rounding error by comparison. That can matter a lot for the quality of implementation and maintenance.

I’m not a software developer in a meaningful sense, more of an end-user, so my reasons are entirely about personal ease of use. For example, being able to wrap any function call in an asynchronous Task scheduled on multiple threads is just easier to me than Python’s def/async def split (which also shows up in APIs as split subclasses) and newer GIL/free-threaded builds split. Any asynchronous multithreaded program is doable in Python, but I haven’t bothered to really learn it because Julia is sufficient so far. The tasks are mostly HTTP requests and processing, every practical language does that.

function execute_outer(f::Any, a::Integer, b::Cfloat)::Cdouble
    a_c = Cint(a)
    if !isempty(LTO_IR)
                __cc_f = Base.cconvert(Ptr{Cvoid}, f)
                __ptr_f = Base.unsafe_convert(Ptr{Cvoid}, __cc_f)
        GC.@preserve __cc_f begin
            return Base.llvmcall((LTO_IR, "execute_outer"), Cdouble, Tuple{Ptr{Cvoid}, Cint, Cfloat}, __ptr_f, a_c, b)
        end
    else
        return ccall((:execute_outer, LIBRARY_PATH), Cdouble, (Ptr{Cvoid}, Cint, Cfloat,), f, a_c, b)
    end
end

With llvmcall, dispatch and ccall its not so much that julia is like c but that julia makes it very easy to use and even write c like code, this is what I like the most is how well julia can handle things all the way, you can hand the calls off or just start inlining things and it still works but even better because julia starts folding fp ops and optimizing the c code but the call never actually touches the .so which is really cool for a language to just do. Julia is so good at handling other languages that i think alot of people differ to interop use maybe and we see an enormous amount of julia using x language questions here…