A Brief Introduction to Julia

Поділитися
Вставка
  • Опубліковано 24 січ 2025

КОМЕНТАРІ • 43

  • @ErikSchierboom
    @ErikSchierboom Рік тому +18

    One thing I forgot to show/stress is that functions also have a shorthand syntax, which is really nice: docs.julialang.org/en/v1/manual/functions/

  • @yaskygaming
    @yaskygaming Рік тому +59

    First thing I thought about Julia was "Oh this would be a breeze. It's yet another Python variant!" - boy was I wrong. Julia shifts my thinking from programming as an engineering activity to programming as a science.

    • @exercism_org
      @exercism_org  Рік тому +5

      Nice! That's a lovely way of describing it 💙

    • @ErikSchierboom
      @ErikSchierboom Рік тому +7

      It is a really cool and unique language.

    • @splat752
      @splat752 Місяць тому +1

      I think that's more of a personal choice. You can program badly in either language

  • @DeclanMBrennan
    @DeclanMBrennan 9 місяців тому +4

    Is *multiple dispatch* an alternative phrase for *function overloading* ?

    • @ErikSchierboom
      @ErikSchierboom 9 місяців тому +8

      They're very similar, but the key difference is that function overloading happens at compile time, whereas multiple dispatch happens at run time.

    • @DeclanMBrennan
      @DeclanMBrennan 9 місяців тому +2

      @@ErikSchierboom Thank you.

    • @grapy83
      @grapy83 2 місяці тому

      @@ErikSchierboom How can that happen at runtime, if we have already defined functions with diff input params

  • @dijikstra8
    @dijikstra8 2 місяці тому +3

    Very nice! It's like Matlab but actually good and performant :D I looked into this years ago when I was doing my PhD, but it was quite immature at the time.

  • @DaveParr
    @DaveParr Рік тому +7

    This is really neat. Great demo of function overloading ❤

    • @DaveParr
      @DaveParr Рік тому +2

      Just got to the bit about latex 😮 I 'knew' Julia had unicode support but I hadn't clicked that it had that kind of integer/float division behaviour

  • @mattpiz
    @mattpiz Рік тому +4

    Really nice introduction Erik!

  • @e101sg
    @e101sg 4 місяці тому +1

    Great and useful video, Thanks for the team ! Cheers! :)🙂

  • @halneufmille
    @halneufmille Рік тому +10

    Very nice, I know a bit of Julia, but didn't know about this sum trick x->x^2, 1:n or about this ÷ division. One thing that could have improved the code further is defining the functions by assignment:
    square_of_sum(n) = (n * (n + 1) ÷ 2)^2
    sum_of_squares(n) = (n * (n + 1) * (2n + 1)) ÷ 6

    • @ErikSchierboom
      @ErikSchierboom 9 місяців тому +1

      I totally should have done that, just forgot to do that!

    • @xazzzi
      @xazzzi 29 днів тому

      I thought he'd use generators, did not know about sum map fn either.
      sum(x^2 for x in 1:10)

  • @ItamarOliveira
    @ItamarOliveira Рік тому +2

    Excellent video!

  • @mailsiraj
    @mailsiraj Рік тому +5

    Thanks Erik for the wonderful intro. I am intrigued about multiple dispatch, but could NOT fully understand why it is such a killer feature in Julia - i would check out the video mentioned. It would be good to add links to the resources you described.
    Do we use Julia anywhere in Exercism - it would be good to get some real-life use cases of where these languages are used (from your own experience) - these might enrich these track introductions?

    • @ErikSchierboom
      @ErikSchierboom Рік тому +2

      Good shout about the links! I'll try add add those. For the moment, here is the link: ua-cam.com/users/livekc9HwsxE1OY?feature=share
      We use Julia in our cross-repo syncing code: github.com/exercism/org-wide-files/blob/main/scripts/apply-track-config.jl

    • @mailsiraj
      @mailsiraj Рік тому +4

      @@ErikSchierboom Thanks Erik. Nice to see how readable the Julia code is. I have now seen a video about multiple dispatches and how nice it is. I was very happy to learn that the indexing starts at 1 in Julia - you should mention it :)

  • @j.abrahamhernandez3629
    @j.abrahamhernandez3629 Рік тому +1

    i had the hope you would discuss multiple dispatch for user defined functions in the example since you (rightly so) hyped it as a core feature of the language
    dispatching of multiple types of the n input variable for example could be an idea

    • @ErikSchierboom
      @ErikSchierboom Рік тому +2

      It's always hard to try and balance the things one wants to show, versus the available time. Sorry

  • @nickboyadjian367
    @nickboyadjian367 Рік тому +3

    Great video!

  • @benitoe.4878
    @benitoe.4878 Рік тому +3

    About the functions looking like regular math. The (short) assignment form of functions makes for an even more mathy look, e.g.: sum_of_squares(n::Integer) = (n * (n + 1) * (2n + 1)) ÷ 6

  • @megakek4457
    @megakek4457 Рік тому +12

    Julia is great so far. With just this video, a bit of documentation and a background in Python I'm already solving Exercism challenges.
    And I just found out it even has a pipe operator (`|>`) like Haskell and Elixir. Amazing.
    (I'm still learning Haskell on the side since Functional February but what a difference that learning process is compared to Julia!)

  • @hewhointheearthlydomainsee1272

    I wish they would add the terseness/structure of F# and efficiency at low level programming of C next. I would like be able to write code that generates code. Supposedly there millions of lines of code in an operating system like Windows and Linux, and writing too much for one person, but if there were a language that generated code using expressions and descriptions, maybe.

  • @Mojo_DK
    @Mojo_DK Рік тому +1

    How does mojo compare to Julia.
    The developer of Mojo claims, that Mojo is more advanced because it is newer. Is that true?
    In what way is it better? Or is Julia still the faster language?

    • @blaisepascal3905
      @blaisepascal3905 9 місяців тому +4

      Hi,
      Beginner in Julia and Mojo (for about 5 and 3 months now). I can give you my beginner point of view.
      Both Julia and Mojo are fast. But if you are looking for pure speed, Mojo should be theoretically faster since it uses a "new technology" (MLIR) and is basically a static language. But Julia is really fast and it is easier/flexible to optimize your code and go even faster even though it is "optionally typed" and interactive. I would say it depends the use case. In my opinion, Julia is fast enough for most cases and can be improved using Julia code. While Mojo, was mostly designed to speed up Python code by replacing it with Mojo syntax.
      Keep in mind that the situation is not set in stone. Both Julia and specifically Mojo are young languages that are still growing. For instance, Julia is already more established than Mojo and has started projects to leverage MLIR (Brutus.jl or MLIR.jl). While Mojo has not reached a perfect compatibility with Python yet (coming soon), I believe many Python libraries should work.
      There is room for improvement in both Mojo (was open sourced recently) and Julia (ever growing and nice community).

  • @jeffreywhewhetu
    @jeffreywhewhetu Рік тому +6

    Julia it is, for Analytical April

  • @Jan_van_Waaij
    @Jan_van_Waaij Рік тому +2

    Leuke video!

  • @delightful-ish
    @delightful-ish 7 місяців тому

    Why does the philosophy of this language seem to be that everyone has 3 hours to wade through cruft to learn how to just get some code running?