Dominik Picheta: An intro to Nim for the uninitiated (NimConf 2020)

Поделиться
HTML-код
  • Опубликовано: 14 янв 2025

Комментарии • 66

  • @Neoclassicalmaese
    @Neoclassicalmaese 3 года назад +24

    I am smiling and being such a fangirl about this. Dominik, your book "Nim in Action" is by far and large one of the absolute best books ever written about a programming language. I found is absolutely easy and interesting to expand on the examples provided for this amazing programming language. By far my favorite programming book ever, and I say this as someone that has read some of the most famous texts in the field. Thank you for your contributions to the Nim ecosystem and community. I hope to reach the level necessary to become a contributor one of these days. I am currently learning more about compiler and interpreter design, and although I am learning about it through Go, I aim to port what I find to Nim eventually and see if I can jump in an be of some help to the Nim language designers.
    This language truly is the future of programming, and a joy to use.

  • @driziiD
    @driziiD 4 года назад +15

    didn't know Nim had an Option type (a la Functional Programming) very sweet

  • @pengain4
    @pengain4 Год назад +2

    This feels almost like a meditation ❤

  • @pnaranja
    @pnaranja 4 года назад +14

    I'm surprised he didn't mention a comparison to Rust

    • @peterpandaluki6663
      @peterpandaluki6663 3 года назад +2

      Or Julia?

    • @reisaki18
      @reisaki18 Год назад

      because he's comparing nim to the other languages which has similarities to it. Rust is so much different to nim.

  • @GaryChike
    @GaryChike 2 года назад +5

    Nim is a perfect blend of Python, C and the Pascal-Family of languages(Modula, Oberon, Ada) 🤓

  • @sken1301
    @sken1301 3 года назад +4

    I am a Java/Kotlin developer, not experienced in C++ or Rust. I would like to ask some questions:
    1. Is Nim with ORC GC memory safe while having an almost deterministic memory deallocation?
    2. As of 2021, can Nim interface with C++ much better than in Rust?
    3. Can we add something to detect and block cyclic references so that we can use ARC without the fear of memory leak?
    If the answer is yes for 1+2, then Nim is the best of both worlds: not so complicated, memory safe, almost deterministic memory management.
    If 3 could be done in the future too, then Nim is perfect.

    • @andreasrumpf9012
      @andreasrumpf9012 3 года назад +4

      1. Correct.
      2. I think so yes, but the interop can always be better still. We're getting there though.
      3. There is a heuristic for this already yes, but it's usually wiser to annotate your types with .acyclic (which keeps the memory safety) and let the cycle collector enabled. It's really good in the upcoming 1.6 release, nothing to worry about.

  • @jaffreyjoy
    @jaffreyjoy 4 года назад +6

    9:14 Contributing to a language at 14 😌

  • @syzygy8060
    @syzygy8060 4 года назад +2

    I'm very excited about Nim.

  • @mariomatos8800
    @mariomatos8800 4 года назад +4

    BRACE! This is the future!

  • @uncannydeduction
    @uncannydeduction 4 года назад +3

    20:00 Is the compile time calculation only for "const" types?

  • @nifaresg
    @nifaresg 2 года назад

    26:43 Is there any sort of typeclass that tie together types that have a functionality for + operator?

  • @slackeare
    @slackeare 4 года назад +15

    I made my internal log processing tool using nim because I had a choice and I was amazed that my code did wonders on Linux, windows and Mac same time
    Cool language.
    Great presentation Dominic

  • @FPChris
    @FPChris 2 года назад

    C has a logical syntax.

  • @lardosian
    @lardosian 4 года назад +2

    As a fairly new fullstack webdev who is using mostly js and some python, would nim be something that could be of use to me, it has caught my interest for some reason, thank you.

    • @d0m96
      @d0m96 4 года назад +3

      Sure it would. I have used it personally for a lot of web dev, both for server-side (with Jester) and client-side (with Karax). A great example of this is forum.nim-lang.org (written 100% in Nim).

    • @lardosian
      @lardosian 4 года назад +1

      @@d0m96 Cheers dude.

  • @pedroluzio
    @pedroluzio Год назад

    when you run echo $some(42) you get some(42) not Some(42)

  • @dranon0o
    @dranon0o 4 года назад +5

    ASMR Nim intro
    Loved it!

  • @uncannydeduction
    @uncannydeduction 4 года назад

    I may be inexperienced, but it would be sweet with a FOR-loop that is automatically threaded (and waits until every thread is finished). C++ std containers are somewhat thread safe as I understand... Maybe in some way this can be analyzed by compiler with some more compile time which is fine to me.

    • @uncannydeduction
      @uncannydeduction 4 года назад

      Also FOR-loop threaded on graphical card using compute shader... Please...

    • @xnoreq
      @xnoreq 4 года назад +1

      @@uncannydeduction C++ std containers are not thread safe. "Somewhat thread safe" is not a thing. Since there's no synchronization, parallel mutation will lead to data races.
      Most programming languages offer parallel for-loop functionality in their libraries. With Nim I think you can use OpenMP for that.

    • @uncannydeduction
      @uncannydeduction 4 года назад

      @@xnoreqCan't it be automatically handled with appropriate mutices? It would just be a cool feature.

    • @uncannydeduction
      @uncannydeduction 4 года назад

      @@xnoreq writing in different indices is thread safe as long as it's not reading the same indices at the same time. Most design patterns doesn't read in the same time (same scope). So there should be able to analyze the scope and whats happening and if reading is being done then add automatic mutices surrounding those parts, otherwise no mutice is needed at all.

    • @xnoreq
      @xnoreq 4 года назад

      ​@@uncannydeduction Do you mean mutexes?
      A common use case is to have a writer that adds to a collection and multiple readers that consume the items. Since STL is not thread safe, you need to use some locking mechanism. (Usually you need to lock more than just access to the collection so that's the way to go.)
      If you just read or can ensure that multiple writers access dedicated indices then you could as well just use an array.
      This still doesn't make any of this thread-safe. The whole point of thread-safety is to ensure that operations are serialized/atomic or appear as such to other threads.
      If you want guarantees about data-race freedom ("fearless concurrency") then you should use Rust.
      All the other programming languages (C, C++, Java, C#, Nim, Zig, even Go ...) all put this burden on the programmer.

  • @jrhugs
    @jrhugs Год назад

    Great video! What did you use to create the sound visualization in your slides? (Side-note: Thanks for everything you've done with Nim!)

  • @guilherme5094
    @guilherme5094 Год назад

    👍Thanks!!

  • @पापानटोले
    @पापानटोले 4 года назад +5

    Interesting talk but why not use just C++ or Go? Are there any distinct advantages of Nim over C++/Go ?
    Can we make Desktop UI in Nim ? If Nim has to frequently depends on C/C++ then it may not be the best thing as programmers need to know both Nim and C/C++ ?

    • @superagucova
      @superagucova 4 года назад +8

      Regarding Desktop UIs, there are several projects working on that, see WebGUI, Fidget, NimX, and Nim's own "ui" library. (Among others).
      As for the last part, Nim depends on C/C++ because it compiles to C/C++ (as well as JS). You don't need any C/C++ knowledge to write Nim, but you do have the freedom to easily import C libraries if you want (like Python).

    • @पापानटोले
      @पापानटोले 4 года назад +2

      @@superagucova
      Thanks for the explanation. My point is Is there is any advantage of porting c/c++ applications to Nim? i doubt as Nim transpiles to c/c++. So it will be difficult to convince people using c/c++ in large scale project to move to Nim.
      May be Python projects facing performance problems could be right candidates..

    • @kobi2187
      @kobi2187 4 года назад +2

      @@पापानटोले yes, but you can write library code in Nim, and have the main function on the c++ side, using that. I haven't programmed in c/c++ and don't know about its tools, but I think there are benefits to writing in Nim due to all the static checking by the compiler, i.e: for safety reasons.

    • @vcool
      @vcool 4 года назад

      Doesn't Go have a lot of error checking crud? Nim has exceptions that'll just propagate like they do in Python. C++ needs ten more years to become clean enough for general use.

    • @davidste60
      @davidste60 4 года назад +12

      @@पापानटोले C transpiles to machine code, so I doubt there are any advantages to using C over just using machine code.

  • @eomenia
    @eomenia 3 года назад

    Thanks for this! I'm growing more and more interested in giving Nim a go.

  • @akurnya
    @akurnya 24 дня назад

    this is like pythonic Go albeit more expressive with template/macro, meta and type defs are like F#. gives it ability to define enterprise application type systems, value objects and entities. I see use case of modern language semantics in GUI applications design with enterprise-grade type systems, hopefully mobile too someday as against leaky, inefficient energy sucking apps being created these days. I do recall VHDL (Ada inspired) syntax with hard typing. That was clean and so is this.

  • @mehdiyahiacherif2326
    @mehdiyahiacherif2326 3 года назад +1

    Hello , i want to start contributing into Nim , i think it can be the next mainstream lang but the problem is it is not maintained or pushed by a big company , i can influence peaople starting it and i can start dev some libraries ,

  • @itellyouforfree7238
    @itellyouforfree7238 Год назад +1

    This is by far the SLOWEST talk I've ever heard. Even playing it at 2x wasn't enough

  • @filgo
    @filgo 4 года назад +3

    Thanks for the great intro to NIM! In my opinion, It would be better to keep dark mode also for code examples like in your video from BelFOSS 2018 : ruclips.net/video/hzxr9_ZK9uY/видео.html

  • @pushqrdx
    @pushqrdx 2 года назад

    CSM Reference

  • @sevenhong5809
    @sevenhong5809 4 года назад +17

    Too much pause

    • @d0m96
      @d0m96 3 года назад +6

      I optimised for clarity with the assumption that talks can always be watched at 2x speed, so feel free to watch it this way :)

    • @earlhawkmusic
      @earlhawkmusic 3 года назад +2

      I really liked the pause. Gave me time to take everything in

    • @SianaGearz
      @SianaGearz 3 года назад

      @@d0m96 Well pause button in player is a thing too. I too feel pauses are too long and being so long, no longer help pace the talk.

  • @SianaGearz
    @SianaGearz 3 года назад +1

    Well this was unfortunately a waste of time to me personally, because the contents of this talk was basically equivalent to example program i saw on the website already. I find basic constructs to be among the least interesting traits of any language, alongside the syntax, as they are essentially arbitrary. What i want to know first thing about the language, or any tool: how does it help me solve common, complex engineering problems? First thing, before the syntax is even mentioned. If i am to spend hundreds of hours learning the language, which necessarily will include a lot of intricacies, i need a WHY, not a HOW.

  • @carriagereturned3974
    @carriagereturned3974 Год назад

    you have to be completely sick/perverted to love python. It is a slowpoke, complete break, devs don't really know how to really do DEV - they were completely unable to transition to version 3 - language split in 2, and therefore i read that it is unlikely we will ever going to witness version 4, EVER.

  • @BryanChance
    @BryanChance 2 года назад

    I couldn't (don't want to??) deal with Python's white-space significance.

    • @nandoflorestan
      @nandoflorestan 2 года назад +2

      Without opening this discussion yet again, let me just state that your opinion is nonsense.

    • @vncstudio
      @vncstudio 2 года назад

      Some like curly braces, some like whitespace, and some don't mind either.

  • @_slier
    @_slier 4 года назад

    If only nim is not sensitive ( white space ) like my ex girlfriend, im more than happy to use it..arghh..hate all python/ruby crap..i cant stand the syntax of function

    • @shalokshalom
      @shalokshalom 4 года назад +9

      When you could be a little sensitive (white space and girlfriend) could it be possible, that your girlfriend and Nim become accessible to you (again)

    • @heroe1486
      @heroe1486 3 года назад +1

      How is it even a problem with modern text editors and IDEs ? And you should most likely have a consistent formatting even for languages that don't push it tho

    • @_slier
      @_slier 3 года назад +1

      @@shalokshalom no thx.. why should i be sensitive to an attention seeker gf? i stick with zig ( better girlfriend )

    • @_slier
      @_slier 3 года назад

      @@heroe1486 relying to ide solely, implying a bad design of the language.. plus what happen when u are on terminal ( vim ) ? relying solely on ide is dumb

    • @heroe1486
      @heroe1486 3 года назад +2

      @@_slier dude My Neovim config with coc.nvim is more powerful than Vscode, that's not even an excuse, I just need to copy paste it if I'm on a remote server.
      And btw you don't even need a full fleged config, I'm sure vim handles indentation almost out of the box