Clojure in a nutshell by James Trunk

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ก.ย. 2024

ความคิดเห็น • 126

  • @mertnuhoglu
    @mertnuhoglu 3 ปีที่แล้ว +41

    This is really a great way of teaching design ideas. The presenter firstly mentions a design principle and then gives examples and reasons that supports the design principle.

  • @user-ey2ei4oz3m
    @user-ey2ei4oz3m 3 ปีที่แล้ว +21

    This was awesome. The thread operator really makes looking at FP code way more palatable for me.

  • @DjastinFaiht
    @DjastinFaiht 3 ปีที่แล้ว +18

    James you are a wonderful teacher! I still love coding in Clojure after you taught me half a decade ago. Your incredible teaching style with explaining the background and mechanics of the language rather than just how to work with it plus your gentle English charm (e.g. When you got a water refill) and how knowledgable you are makes you the perfect teacher for people who have a similar learning style as me.
    A big whoop whoop and thank you for your presentation!

    • @Misophistful
      @Misophistful 3 ปีที่แล้ว +4

      Thank you so much for your kind words! I have so many fond memories of our Clojure sessions, and to this day I’ve never seen someone pickup the concepts as quickly as you did. I’m so pleased to hear that you still use it!

  • @johnneiberger7311
    @johnneiberger7311 3 ปีที่แล้ว +15

    I tried learning clojure over a year ago and had a very hard time. It was my first attempt at a functional language. I gave up after a couple of weeks. Recently, I've been learning some Erlang and getting a better feel for functional thinking. I wish I had found a teacher who taught clojure this way back when I was trying to learn it. It would have made things so much easier for me. Great job!

  • @gagansrai8137
    @gagansrai8137 3 ปีที่แล้ว +122

    This has to be one of the best "sales pitches" for clojure. How can you watch this and go back to JS/Java/Scala/python etc? Amazing presentation skills as well

    • @RogueTravel
      @RogueTravel 3 ปีที่แล้ว +5

      I thought about that, then I realized that I don't need/want the jvm. Learning elixir and golang instead

    • @gagansrai8137
      @gagansrai8137 3 ปีที่แล้ว +2

      @@RogueTravel I tried go, it's easy, but probably the most boring language ever. Elixir is interesting, but I have no idea about the BEAM VM and OTP. Also writing end everywhere seems annoying 😂 which one is your favourite elixir or go?

    • @sfyire
      @sfyire 3 ปีที่แล้ว +9

      @@RogueTravel JVM is a world class VM but if you don't want it you can run V8 via ClojureScript or .NET via ClojureCLR or substrateVM via babashka or normal Clojure via graalvm (supports polyglot programming)
      There's also lots of unofficial variants for Erlang and others all variants would work the same for the examples in this video

    • @RogueTravel
      @RogueTravel 3 ปีที่แล้ว

      @@sfyire since this comment, I decided on Golang for my back end. The performance is great, pace of development is great. Language is a bit boring but I don't care, it has proven to be a good fit for what I need

    • @RogueTravel
      @RogueTravel 3 ปีที่แล้ว

      @@gagansrai8137 I like elixir better than go, but go fits my needs more

  • @mickeyeng
    @mickeyeng 3 ปีที่แล้ว +19

    Best introduction to Clojure I have seen. Would be great if @Misophistful could create an online course on the Clojure programming language. Brilliant presentation 👍

  • @simonkeng3908
    @simonkeng3908 3 ปีที่แล้ว +10

    This is an incredible introduction to the design of Clojure and a brilliant tutorial for someone learning Clojure

  • @johnneiberger7311
    @johnneiberger7311 2 ปีที่แล้ว +5

    I know I already commented seven months ago, but I'm watching this again and have to say it's easily the best introduction to clojure I've seen on TH-cam.

  • @Kah0ona
    @Kah0ona 3 ปีที่แล้ว +23

    Great presentation, thanks
    And, fantastic presentational skills! Clear and simple slides, very well articulated.

  • @a0um
    @a0um 2 ปีที่แล้ว +5

    3:12 That is *Programming Language * design, and I totally agree. For a statically typed language true to this principle I’ve started learning OCaml and I’m loving it.

  • @euankirkhope5390
    @euankirkhope5390 ปีที่แล้ว +3

    An absolutely amazing presentation. Congrats James, this has to be the clearest and most concise demonstration of any new language I have seen.

  • @Frodohack
    @Frodohack 3 ปีที่แล้ว +7

    Is really brilliant how this guy explains the concepts in his own words. Thanks!

  • @Desi-qw9fc
    @Desi-qw9fc ปีที่แล้ว +3

    Loving the ->> piping. That plus the list-like basic structure of Lisp makes for a very familiar language to a person like me who loves R.

  • @mohamedabdulaziz107
    @mohamedabdulaziz107 3 ปีที่แล้ว +41

    What an amazing intro to Clojure! You explained it so well that I was able to pause the video and implement the last thread-last macro example without any help. Really felt like I was playing with legos!
    Loved that you went from the language design principles and showed how it looks like in practice. It was also great seeing the REPL in action and I can definitely see how it could be great for experimenting due to the fast feedback loop.
    Thank you for the presentation James!

    • @Misophistful
      @Misophistful 3 ปีที่แล้ว +1

      Hi Mo, thank you for your kind words, and congratulations on taking your first steps towards Clojure mastery!

  • @esakkisundar
    @esakkisundar 3 ปีที่แล้ว +25

    Great tutorial. The only problem with Clojure is with people having experience with other programming language. There is a bit of unlearning that has to happen to get acquainted with the syntax of Clojure

    • @cswaroop2
      @cswaroop2 2 ปีที่แล้ว +2

      unlearning clojure also has to happen when you go back to non-clojure world like missing , (commas)

    • @caribe_imperial1945
      @caribe_imperial1945 2 ปีที่แล้ว +1

      @@cswaroop2 yeah you start to really get bothered by semicolons and commas and other silly things lol.

    • @Simon-xi8tb
      @Simon-xi8tb 2 ปีที่แล้ว

      @@cswaroop2 tell me about it. I am doing some golang now and I hate every second of it

    • @zed9zed
      @zed9zed 2 ปีที่แล้ว

      It's even worse going the other way. Knowing Clojure will make you absolutely hate some common languages.

    • @Simon-xi8tb
      @Simon-xi8tb 2 ปีที่แล้ว

      @@zed9zed can confirm. I absolutely hate Go. I curse at it daily. It's torture.

  • @JubayerKothaBole
    @JubayerKothaBole 10 หลายเดือนก่อน +3

    I never coded in clojure, nor ever tried it. But I was able to catch up the syntaxes immediately. Such a nice presentations.

  • @rauljosegarcia
    @rauljosegarcia ปีที่แล้ว +8

    This is so freaking cool. I've never been "impressed" by a programming language before. It looks fun.

  • @divakaratanjore1059
    @divakaratanjore1059 3 ปีที่แล้ว +3

    Very precise and deep introduction to Clojure. Thanks you.

  • @Newascap
    @Newascap 2 ปีที่แล้ว +2

    Thank you for this awesome presentation. Truly a hidden gem for the ones like me learning clojure from scratch.

    • @tunesoop7653
      @tunesoop7653 10 หลายเดือนก่อน

      Search on here for 'Misophistful' for more of his [kinda] hidden gems. Helped me a lot. Particularly the destructuring tutorial.

  • @karthikraghunathan4742
    @karthikraghunathan4742 3 ปีที่แล้ว +3

    great presentation . functional thinking with Clojure is a powerful drug !

  • @daviddelaney363
    @daviddelaney363 11 หลายเดือนก่อน +1

    Nice - I have recently last 2 years been learning Python. I see similarities. And lots of new ideas.

  • @diegonayalazo
    @diegonayalazo 2 ปีที่แล้ว +2

    Thanks for sharing

  • @alexk.6022
    @alexk.6022 ปีที่แล้ว +1

    Brilliant course. Thank you.

  • @niallduggan1858
    @niallduggan1858 2 ปีที่แล้ว +2

    Brilliant how after you declare how much you love quotes you tell one yourself on collections being immutable "That gives us a stable base to build upon not a shifting sand of immutability underneath everything we are building"

  • @a0um
    @a0um 2 ปีที่แล้ว +3

    4:26 he quotes: “when you combined two pieces of data you get data, when you combine two machines you get trouble“, well
    I’m slightly puzzled. What are the machines? Pure functions? Stateful functions? Objects? Pure modules? Do their interface agree? Static typing or dynamic typing?
    Regarding data: you may get data, consistent or inconsistent data. Maybe a compilation error if the data types don’t match up, maybe a runtime error downstream in case of semi-structured data …
    Definitely a stimulating observation, as it touches the essence of software engineering: designing data and functions and building systems by combining them.
    But you don’t always get trouble if you combine two machines, and merely combining data may just result in nonsense.

  • @ww123ification
    @ww123ification 5 หลายเดือนก่อน

    The Clojure syntax seems to be very interesting, I have not come across anything like that. The equivalent of the code shown at 15:42 in F# will be either [0..4] |> List.map (fun x -> x + 1) |> List.filter (fun x -> x % 2 0) or [0..4] |> List.map ((+) 1) |> List.filter (() 0 >> (%) 2) - both variants look "boringly conventional"😀.

  • @AsifMehedi
    @AsifMehedi 3 ปีที่แล้ว +1

    Brilliant presentation. Thank you.

  • @hypergraphic
    @hypergraphic 2 ปีที่แล้ว +2

    Coming from Typescript and Go I’m like “where are the type declarations?”. Its kinda cool what you can do without them though. Definitely going to give Clojure a try.

  • @wildan6335
    @wildan6335 2 ปีที่แล้ว +1

    thank you very much James Trunk!

  • @ath0006
    @ath0006 3 ปีที่แล้ว +3

    Great presentation! Very useful info.

  • @Oi-mj6dv
    @Oi-mj6dv 11 หลายเดือนก่อน +1

    After seeing a very large java production codebase whose stack traces looked worse than verdun after the first world war i can 100% feel what rich hickey wanted to avoid. Holy shit does OO under deliver. What a mess.
    PS: after having seen the video now: clojure seems like a thing of beauty. Cant wait to get hands on with it

  • @christopherbennett22
    @christopherbennett22 3 ปีที่แล้ว +4

    Brilliant format :)

  • @bufo333
    @bufo333 2 ปีที่แล้ว +4

    I would love to see his emacs config file. Loved his theme and they parenthesis module he was using.

    • @rauljosegarcia
      @rauljosegarcia ปีที่แล้ว

      Yes!

    • @ShahJr
      @ShahJr ปีที่แล้ว

      Please let us know if you figure it out. I especially liked the parenthesis plugin

    • @ShahJr
      @ShahJr ปีที่แล้ว

      Looks like it was atom with the theme that's linked in his TH-cam channel but I couldn't find how he did the ghost themed parenthesis matching anywhere

    • @daniellopezgarsco2215
      @daniellopezgarsco2215 ปีที่แล้ว +1

      ​@@ShahJrI believe it was the parinfer-rust plugin.

  • @rodelias9378
    @rodelias9378 2 ปีที่แล้ว +1

    Awesome presentation. Well done!! Thanks a lot!!

  • @santosharakere
    @santosharakere 2 ปีที่แล้ว +2

    Excellent, thanks.

  • @romanostash822
    @romanostash822 3 ปีที่แล้ว +25

    Thank you for an excellent presentation! May I ask what IDE the presenter was using?

    • @Misophistful
      @Misophistful 3 ปีที่แล้ว +20

      Hi Roman, you're welcome! I used Atom: atom.io with Proto REPL: atom.io/packages/proto-repl . Though I believe Chlorine: atom.io/packages/chlorine has become more popular with Atom-loving Clojure devs recently, as it's more actively maintained than Proto REPL.

    • @romanostash822
      @romanostash822 3 ปีที่แล้ว +5

      @@Misophistful Hi James! I’m using VSCode + Calva plug-in right now. Will definitely try your setup. Thank you!

    • @Misophistful
      @Misophistful 3 ปีที่แล้ว +6

      @Scott Hi Scott, I'm using the theme I designed, called Borealis: github.com/Misophistful/borealis-syntax

    • @Ed-lq9qq
      @Ed-lq9qq 3 ปีที่แล้ว +1

      Does anyone know the color theme he's using ?

    • @ShahJr
      @ShahJr 2 ปีที่แล้ว +2

      Could you tell me what the IDE was? The answer seems to be deleted unfortunately

  • @smokelordo
    @smokelordo 2 ปีที่แล้ว +1

    Beautifully explained.

  • @maxgiraldo
    @maxgiraldo 3 ปีที่แล้ว +3

    Great talk

  • @crccrc6
    @crccrc6 3 ปีที่แล้ว +2

    Fantastic presentation!

  • @avi3681
    @avi3681 2 ปีที่แล้ว +1

    Excellent live coding demo at the end. Makes me want to try Clojure sometime.

  • @DanielHorrisberger
    @DanielHorrisberger 2 ปีที่แล้ว +2

    Great Talk!

  • @patricsteiner8483
    @patricsteiner8483 3 ปีที่แล้ว +2

    what a sympathetic presenter. good talk :)

  • @stefansalapura6659
    @stefansalapura6659 2 ปีที่แล้ว +1

    Amazing video. Thank you guys!

  • @ivanvincent7534
    @ivanvincent7534 3 ปีที่แล้ว +2

    Really excellent presentation, any anxiety around live coding was well and truely unfounded. I am new to functional programming and find it hard to see the difference around data as a first class citizen compared to object oriented programming. The data appears to be loaded into memory and worked upon in much the same way as one would do with objects in OOP. Can’t see an obvious distinction.

    • @Misophistful
      @Misophistful 2 ปีที่แล้ว +4

      Hi Ivan, with "first class citizen" I primarily mean that data structures have literal representation in Clojure's syntax. In Clojure, you can construct and populate a vector with the code "[1 2 3]", rather than having to construct and then populate an object with something like "ArrayList values = new ArrayList(); values.add(1); values.add(2); values.add(3);"
      This syntax-level representation brings data structures directly into the language, and changes how you think and communicate about data.

  • @chakier
    @chakier 10 หลายเดือนก่อน +1

    What a nice IDE James uses. What's the name of this IDE? Sorry for nooby question.

  • @_modiX
    @_modiX 2 ปีที่แล้ว +1

    Great speaker!

  • @karthikeyanak9460
    @karthikeyanak9460 2 ปีที่แล้ว +1

    Excellent video!

  • @JoshReighley
    @JoshReighley 3 ปีที่แล้ว +2

    Very well done!

  • @xaapt
    @xaapt 3 ปีที่แล้ว +1

    really solid talk about clojure

  • @PatClanet
    @PatClanet 3 ปีที่แล้ว +2

    wow, this was a great talk

  • @EmoPorEmilio
    @EmoPorEmilio 11 หลายเดือนก่อน +1

    what IDE or environment is he using for the live coding?

  • @gongfei
    @gongfei 3 ปีที่แล้ว +1

    Thank you for the studio-quality audio and video.
    All over the web, there're too many bad sounded videos since 2020...

  • @kerron68
    @kerron68 ปีที่แล้ว

    That was superb!

  • @zed9zed
    @zed9zed 2 ปีที่แล้ว +3

    This was great. The live coding examples were accessible and practical. They certainly illustrate how to get useful things done quickly (and very cleanly). Was that VSCode (with Calva)? If so, I wish I could get mine setup that well.

    • @daveqr
      @daveqr ปีที่แล้ว

      Was wondering that myself. Actually came to the comments to see if anyone mentioned it.

  • @inanitas
    @inanitas 2 ปีที่แล้ว +1

    Can someone tell me which theme he is using? I want that 😁

  • @it_is_ni
    @it_is_ni 3 ปีที่แล้ว +2

    Thanks for the talk! I haven’t used Clojure myself but it looks logical and readable.
    What would you say are reasons not to choose Clojure?
    How would you rate its performance, dependency management story, large codebase refactoring (I see no types) and the deployment of Clojure apps?
    Thanks!

    • @thenashbridges
      @thenashbridges 3 ปีที่แล้ว +7

      Clojure is a hosted language, the answers below are for Clojure on JVM:
      - you get a very powerful VM for free. Persistent collections come at a performance cost, but (only if needed) there are many paths to improve the situation in hot loops,
      - you get all Java libs for free. Java interop has no performance penalty and is plain clear. You can also reuse pure Clojure libs which can be fetched as code (eg from github) or as a compiled jar from Maven/clojars. For dependency management there's a built-in tool where you define lib versions in an edn (think of json) file
      - to deploy you compile your project and assets in a uberjar, copy it to a production server and restart JVM
      - there's a limited support for refactoring in tools like cider, perhaps in some IDEs too (I use vim). Despite having no types, Clojure is a compiled language, so any typos/missing declarations are caught immediately, and for me this would be the main source of bugs.
      When not to choose Clojure:
      - when JVM is not acceptable (memory wise or GC wise)
      - when your domain does not have enough libs in Javaland
      Otherwise this is the best language for JVM, period.
      It is a perfect choice for web development.

  • @antoniosousa4178
    @antoniosousa4178 3 ปีที่แล้ว +2

    Very good!

  • @sspaeti
    @sspaeti 3 ปีที่แล้ว +1

    This insanely insightful, thank you!

  • @kahnfatman
    @kahnfatman ปีที่แล้ว +2

    It took 10 years for Java books to burn Object Encapsulation into my brain. 5 minutes to wash them all away :D

  • @oshinenajarian
    @oshinenajarian 2 ปีที่แล้ว +1

    This is dope!

  • @altoma3562
    @altoma3562 2 ปีที่แล้ว +1

    Does anyone know what IDE or programing program he is using? thanks! Amazing presentation too

    • @vitalipe
      @vitalipe 2 ปีที่แล้ว +3

      atom + proto-repl + parinfer

  • @lukevin1537
    @lukevin1537 2 ปีที่แล้ว +2

    What are the tools and IDEs used in this video?

    • @FuncProgSweden
      @FuncProgSweden  2 ปีที่แล้ว +4

      @Misophistful uses Atom: atom.io with Proto REPL: atom.io/packages/proto-repl . Though I believe Chlorine: atom.io/packages/chlorine has become more popular with Atom-loving Clojure devs recently, as it's more actively maintained than Proto REPL.

  • @michaelsingh1340
    @michaelsingh1340 11 หลายเดือนก่อน

    @Misophistful, can you describe your VS Code setup? I'd love to replicate it!

  • @AlBakerDev
    @AlBakerDev 2 ปีที่แล้ว +1

    What editor are you using ?

    • @FuncProgSweden
      @FuncProgSweden  2 ปีที่แล้ว +2

      @Misophistful used Atom: atom.io with Proto REPL: atom.io/packages/proto-repl . Though @Misophistful belives Chlorine: atom.io/packages/chlorine has become more popular with Atom-loving Clojure devs recently, as it's more actively maintained than Proto REPL.

  • @candrar2866
    @candrar2866 ปีที่แล้ว

    I just realized from the examples above
    Functional programming in clojure done right looks a lot like SQL

    • @candrar2866
      @candrar2866 ปีที่แล้ว

      One key difference may be SQL is usually composable using a join statement instead of a function
      while clojure is composable with function of functions.

  • @Chris-op7yt
    @Chris-op7yt ปีที่แล้ว

    looks cool. there are different options for setti ng up working clojure emvironments. i dont know which of the options to choose, and is not that simple to set up..for say Vim editor.

  • @xaapt
    @xaapt 3 ปีที่แล้ว +2

    which IDE does he use?

    • @FuncProgSweden
      @FuncProgSweden  3 ปีที่แล้ว +1

      @Misophistful, James, used Atom: atom.io with Proto REPL: atom.io/packages/proto-repl . Though I believe Chlorine: atom.io/packages/chlorine has become more popular with Atom-loving Clojure devs recently, as it's more actively maintained than Proto REPL.

    • @CalvaTV
      @CalvaTV 3 ปีที่แล้ว +2

      @@FuncProgSweden Han borde använda Calva, tycker jag. 😀 (Haha, j/k, I think it's super nice that people use what they are comfortable with using.)

  • @MECHANISMUS
    @MECHANISMUS 2 ปีที่แล้ว

    nice. what's that editor?

  • @michaelsingh1340
    @michaelsingh1340 11 หลายเดือนก่อน

    Is this Calva?

  • @thiagomiranda3
    @thiagomiranda3 3 ปีที่แล้ว +1

    What IDE are this guy using?

    • @FuncProgSweden
      @FuncProgSweden  3 ปีที่แล้ว +1

      James used Atom: atom.io with Proto REPL: atom.io/packages/proto-repl . Though James believe Chlorine: atom.io/packages/chlorine has become more popular with Atom-loving Clojure devs recently, as it's more actively maintained than Proto REPL.

  • @BenjaminWheeler0510
    @BenjaminWheeler0510 2 ปีที่แล้ว

    Liked for Mandolorian references

  • @treeislife
    @treeislife 2 ปีที่แล้ว +1

    "Code as Data" Shouldn't that credit go to John McCarthy?

  • @RawCoding
    @RawCoding ปีที่แล้ว

    30:17 nearly took me out

  • @bitti1975
    @bitti1975 ปีที่แล้ว

    I suspected it's Moby Dick from the load time alone before you revealed the word count. Now you're impressed? (Ok, the truth is, that it's a very common example...)

  • @_xeere
    @_xeere 2 ปีที่แล้ว +1

    “Systems are dynamic and data driven. It might be a nice idea to use a language that is also dynamic and data driven.”
    A brilliant summary of how you can pass utter rubbish for useful advice by making it vague enough and small enough.
    “Our world is filled with objects. It might be a nice idea to have a language that is also filled with objects.”
    Understand why it's wrong now?

    • @Misophistful
      @Misophistful 2 ปีที่แล้ว +2

      You might be being a little uncharitable to Rich Hickey's quote here.
      His quote uses the form "X has properties Y and Z, therefore if we want to build X we should probably use tools that help us with Y and Z." You could potentially refute this claim by arguing that X doesn't actually have the properties Y or Z, or that the suggested tool doesn't help you to achieve Y or Z.
      However, I don't think creating a new quote with the form of "Our world is filled with X, therefore our tool should be filled with X.", demonstrates anything about the accuracy of Rich's claim. Especially when this new form is so easily dismissed with a counter example: "Our world is filled with socks. It might be a nice idea to have a language that is also filled with socks."

    • @_xeere
      @_xeere 2 ปีที่แล้ว

      @@Misophistful I am making the point that the quote is completely meaningless and similar ones have been used in the past to sell things people don't like. He could be entirely correct but nothing in this quote or that video proved it.
      My refutation is that half the words in the sentence are meaningless and they come together in a blatant appeal to naturalism. "Systems" are just as related to programming as the world is.
      The biggest thing this ignores is abstraction. The whole point of programming is to remove most of the properties of the actual system because they are detrimental to understanding it. This is a failure for both the OO quote and the Rich one.
      You have to skirt around this by replacing "tools that are X" with the more reasonable "tools that help with X". Tools with the same properties as problems are really just problems themselves.

  • @musicalintuition
    @musicalintuition ปีที่แล้ว +3

    I'm starting a new job and I'm forced to learn Java. You've ruined it for me. :)

  • @EngineerNick
    @EngineerNick 3 ปีที่แล้ว +1

    The ->> operator is something I have never seen before nice way to remove nesting. Lisp is theoretically nice, until you try do anything useful; stupid overabundance of parentheses... I suppose the alternative for a language like this is Haskell where the syntax and order of operations is like dark magic... but why can't we invent a nice ballance? I want to put my + sign between the numbers at least. QWERTY keyboards are to blame i think.

    • @thenashbridges
      @thenashbridges 3 ปีที่แล้ว +5

      First of all, Clojure has a good balance of parens, curlies and brackets (compared to other lisps). As for editing, have a look at parinfer -- it infers syntax from indentation, after that coding in Clojure becomes a breeze.

  • @kamleshyadav-yk6hs
    @kamleshyadav-yk6hs ปีที่แล้ว

    00

  • @jmoz
    @jmoz 2 ปีที่แล้ว

    Too many brackets. If they use syntactic sugar already they could have dropped outer brackets and more. Constantly having to count brackets is annoying and unnecessary.

    • @GreyDeathVaccine
      @GreyDeathVaccine ปีที่แล้ว +2

      Do you know that IDE is a thing , right?

  • @eygs493
    @eygs493 ปีที่แล้ว +1

    impressive