Isaac Harris-Holt
Isaac Harris-Holt
  • 102
  • 879 369
Learn recursion with Gleam
The first 500 people to use my link skl.sh/isaacharrisholt12241 will get a 1 month free trial of Skillshare!
Recursion is a difficult topic for people new to it, but it doesn't have to be! Let's take a tour of recursion... using Gleam! Stay tuned for a great recursion tutorial recursion tutorial recursion tutorial!
Resources:
Gleam playground: playground.gleam.run
gleam/list: hexdocs.pm/gleam_stdlib/gleam/list.html
This video is sponsored by Skillshare.
__________________________________________
Check out my other socials!
🎮 Discord ▶ discordapp.com/invite/bWrctJ7
🐦 Twitter ▶ IsaacHarrisHolt
🖥️ Portfolio ▶ ihh.dev
📝 Blog ▶ isaacharrisholt.com
__________________________________________
Timestamps:
00:00 - Introduction
00:53 - What is recursion?
01:52 - Replacing loops
03:01 - Returning from recursive functions
05:40 - Data structure functions
08:35 - Tail call optimisation
13:32 - Why you don't need recursion
#gleam #softwareengineer
Переглядів: 3 862

Відео

My favourite Gleam feature confuses people...
Переглядів 8 тис.Місяць тому
My favourite Gleam feature - use - is often misunderstood, and many people find it confusing. Let's take a look at how it works, how to use it, and when not to. Resources: Using use in Gleam: erikarow.land/notes/using-use-gleam Check out my other socials! 🎮 Discord ▶ discordapp.com/invite/bWrctJ7 🐦 Twitter ▶ IsaacHarrisHolt 🖥️ Portfolio ▶ ihh.dev 📝 Blog ▶ isaacharrisholt.com Timesta...
You don't need loops
Переглядів 14 тис.2 місяці тому
The first 500 people to use my link (skl.sh/isaacharrisholt11241) will get a 1 month free trial of Skillshare premium! Looping is a very common, and very useful, practice in software development. But do you need it, or are there other alternatives? Perhaps, better alternatives? Resources: Gleam's list module: hexdocs.pm/gleam_stdlib/gleam/list.html Errors as values are the future: ua-cam.com/vi...
Go Realtime in Gleam with Lustre Server Components
Переглядів 10 тис.2 місяці тому
Server components are a really cool way to create realtime experiences in Gleam. This video will walk you through how to use them to create them using Lustre. Thanks to CodeCrafters for sponsoring! Check them out: ihh.dev/codecrafters Check out the code: github.com/isaacharrisholt/youtube/tree/main/code/048-lustre-server-components See the deployed app: mon.ihh.dev Resources: Lustre: lustre.bui...
Polar for Impatient Devs
Переглядів 6 тис.4 місяці тому
Polar is an open source monetisation platform created specifically for developers, and they've just hit v1! Upvote Polar on Product Hunt: dub.sh/polarhunt Massive thank you to Polar for sponsoring this video! Resources: Polar: polar.sh Polar Docs: docs.polar.sh Polar GitHub: github.com/polarsource/polar Astro integration: github.com/polarsource/polar/tree/main/clients/packages/astro My Portfoli...
Gleam is not Rust
Переглядів 28 тис.4 місяці тому
Gleam is not Rust, and I'm sick of people comparing them. Here's why they're different. Join the Discord! discordapp.com/invite/bWrctJ7 Follow my ranting! IsaacHarrisHolt Resources: Gleam: gleam.run Rust: rust-lang.org All you need is data and functions: mckayla.blog/posts/all-you-need-is-data-and-functions.html Check out my other socials! 🎮 Discord ▶ discordapp.com/invite/bWrctJ7 🐦...
How to Deploy Gleam Apps Anywhere
Переглядів 7 тис.4 місяці тому
Deploying Gleam is fairly simple, but it's not obvious how to do it at first glance. This video will cover how to deploy your apps locally, regionally and globally! Get yourself a ZimaBoard: ihh.dev/zima International links: ZimaBoard Official Shop: bit.ly/4cfqN3A ZimaBoard Media Server: bit.ly/3YwVwpr ZimaBoard on Amazon: amzn.to/3YCBzOh Check out the code: github.com/isaacharrisholt/youtube/t...
Slash Lustre Load Times with Server Side Rendering
Переглядів 7 тис.5 місяців тому
Want to use server-side rendering (SSR) to speed up your Lustre apps? Here's how! Previous video: ua-cam.com/video/3kr4Ydx6GGU/v-deo.html Client-side rendering can be great, but it has some downsides when it comes to load times and SEO. This video will show you how to use SSR and hydration in Lustre while keeping your code clean. Check out the code: github.com/isaacharrisholt/youtube/tree/main/...
Errors as Values are the Future
Переглядів 43 тис.5 місяців тому
We've all been in situations where our code errors when we least expect it, blowing up our program and taking down production. It's natural, and totally normal! But it's also preventable. Here's how Gleam does errors better. Writer: Ben Peinhardt Check out my other socials! 🎮 Discord ▶ discordapp.com/invite/bWrctJ7 🐦 Twitter ▶ IsaacHarrisHolt 🖥️ Portfolio ▶ ihh.dev 📝 Blog ▶ isaachar...
Everything you need to know about FFI in Gleam
Переглядів 8 тис.6 місяців тому
Gleam is a great language, but sometimes you just need to access the underlying platform, be it JavaScript, Erlang or Elixir. This video will teach you just how to do that using the power of foreign function interfaces, or FFIs! Resources: Externals in Gleam: tour.gleam.run/externals gleam_javascript: hexdocs.pm/gleam_javascript/ gleam_erlang: hexdocs.pm/gleam_erlang/ Check out my other socials...
Create Robust Web Apps with Gleam and Lustre
Переглядів 41 тис.6 місяців тому
Software is becoming more type-safe, but web technologies are falling behind. TypeScript alleviates some of the JavaScript woes, but it's still not enough. So what do we do? In this video, I'll show you how to build a completely type-safe web app in Gleam using the Lustre framework. Thanks to CodeCrafters for sponsoring this video! Level up your coding skills: ihh.dev/codecrafters Check out the...
The Ultimate Guide to Gleam Concurrency
Переглядів 24 тис.7 місяців тому
Thanks to the Erlang BEAM VM, Gleam is a fantastic language for writing highly concurrent software. But how do you deal with concurrency in Gleam? This video will teach you everything you need to know! New to Gleam? Check out this video first: ua-cam.com/video/NyKIvWvr9kw/v-deo.html Resources: Gleam Erlang: hexdocs.pm/gleam_erlang Gleam OTP: hexdocs.pm/gleam_otp Gleam: gleam.run Learn OTP w/ Gl...
Your backend is too complicated
Переглядів 95 тис.7 місяців тому
Your backend is too complicated
Astro for Impatient Devs
Переглядів 20 тис.8 місяців тому
Astro for Impatient Devs
You might never need Pandas again...
Переглядів 7 тис.8 місяців тому
You might never need Pandas again...
Using Rust to write scalable Python APIs
Переглядів 15 тис.9 місяців тому
Using Rust to write scalable Python APIs
Gleam for Impatient Devs
Переглядів 72 тис.9 місяців тому
Gleam for Impatient Devs
TypeScript for Impatient JavaScript Devs
Переглядів 1,5 тис.10 місяців тому
TypeScript for Impatient JavaScript Devs
The 5 Languages Making Python Code Faster
Переглядів 1,5 тис.10 місяців тому
The 5 Languages Making Python Code Faster
The Solution to Python Package Management is... Rust??
Переглядів 3,9 тис.11 місяців тому
The Solution to Python Package Management is... Rust??
JavaScript for Impatient Devs
Переглядів 5 тис.11 місяців тому
JavaScript for Impatient Devs
How to Create Mobile Apps with Python: BeeWare Tutorial
Переглядів 22 тис.11 місяців тому
How to Create Mobile Apps with Python: BeeWare Tutorial
Zig for Impatient Devs
Переглядів 112 тис.Рік тому
Zig for Impatient Devs
Use THIS Language to Speed Up Your Python Code
Переглядів 7 тис.Рік тому
Use THIS Language to Speed Up Your Python Code
HTMX for Impatient Devs
Переглядів 64 тис.Рік тому
HTMX for Impatient Devs
Supabase E2E testing just got so much easier...
Переглядів 1,7 тис.Рік тому
Supabase E2E testing just got so much easier...
Go for Impatient Devs
Переглядів 25 тис.Рік тому
Go for Impatient Devs
SIMPLIFY Your Python Code With The Facade Pattern
Переглядів 1,9 тис.Рік тому
SIMPLIFY Your Python Code With The Facade Pattern
I Created A Free AI App To Teach You A Language
Переглядів 634Рік тому
I Created A Free AI App To Teach You A Language
Dataclasses From Scratch in Python - Class Decorators
Переглядів 744Рік тому
Dataclasses From Scratch in Python - Class Decorators

КОМЕНТАРІ

  • @diggus88
    @diggus88 17 годин тому

    6:29 I think that should be "if (!HUNGRY)", not "if (HUNGRY)".

  • @Giona_2
    @Giona_2 3 дні тому

    As a Rust user, I have to agree the "rewrite it in Rust" movement was definitely a mistake. I think what a lot of people don't understand is that coding languages are entirely situational by definition, as a coding language is just a specific interpretation of abstraction of machine code. Sure, a language like C is technically "general purpose," but how many people are making LLM's in C? How many do you think are writing embedded firmware (not counting the RPi Pico) or system drivers in Python? You know? Rust is great for a lot of reasons, but it's not an end-all-be-all. Nothing really is.

    • @IsaacHarrisHolt
      @IsaacHarrisHolt 3 дні тому

      This is a great take. These days we're also seeing more and more specialist programming languages and fewer "general purpose" ones, and I think that's fine! Alternatively, we see languages like Gleam which can compile to different backends depending on the use case you're targeting.

  • @AshesWake-sf7uw
    @AshesWake-sf7uw 4 дні тому

    How does gleam, make you not use a cache store nd a message queue 😅 Huh

    • @IsaacHarrisHolt
      @IsaacHarrisHolt 4 дні тому

      I demonstrated the cache in the video, and as for the message queue, concurrency in Gleam is often handled using actors, which have a mailbox that acts as a queue, processing a single message at a time! It's quite easy to build systems on top of that to replicate fanout queues and so on too. In fact, RabbitMQ, one of the most popular messages brokers, is built on the same virtual machine Gleam uses!

  • @zankfrappa93
    @zankfrappa93 6 днів тому

    sorrybut7minutesistoolongtolistentosomeonetalkingwithnobreakssinbetweensentencesyouwouldnttalklikethisinpersonsowhydoithere

  • @jacet8080
    @jacet8080 6 днів тому

    How do you get the assets?

  • @talideon
    @talideon 6 днів тому

    4:13 - while it's not necessarily going to have a huge impact on the image size, it's good hygiene to use a disposable builder image, do any kind of prep work you need there, and then use COPY to copy anything you need to your final image. It means you don't end up with useless layers and the possibility of leaking credentials (if you need to hit some artifact repository that expects credentials, for instance) is greatly reduced.

  • @peanutbutter8885
    @peanutbutter8885 6 днів тому

    take a shot every time he says type.

  • @matthewb192
    @matthewb192 6 днів тому

    Good. I'm sick of numpties over complicating the simplest tasks. The ecosystem is such a mess nowadays.

    • @IsaacHarrisHolt
      @IsaacHarrisHolt 6 днів тому

      There's certainly a lot going on! It seems that a lot of the major frameworks are converging on the same ideas though, which is nice

  • @JMCV2
    @JMCV2 8 днів тому

    No mention of Elixir ?

  • @pr0master
    @pr0master 10 днів тому

    Another new language...

  • @JasonCunliffe
    @JasonCunliffe 14 днів тому

    very elpful

  • @seasong7655
    @seasong7655 15 днів тому

    The simplicity and readability is truly unmatched. I can't imagine Rust, Haskell or C++ being taught in only 7 minutes

  • @ales-rocks
    @ales-rocks 16 днів тому

    Clojure has wonderful loop/recur construct, which is really beautiful in my opinion because it looks like a loop but behaves functionally without need of tail call elimination.

    • @IsaacHarrisHolt
      @IsaacHarrisHolt 15 днів тому

      What do you mean it doesn't need tail call elimination? I've not used Clojure at all, so I'm curious what this would look like

  • @0x5D
    @0x5D 16 днів тому

    5:07 this is wrong, you can use function anywhere a statement or expression is allowed, not only at top level

  • @mr.johnson8974
    @mr.johnson8974 16 днів тому

    Nothing is better than Go for backend. 1. Everything you need is in the std library 2. Syntax is dead simple. 3. Concurrency is dead simple. 4. I’ve never written cache handler longer than 50 lines of code in Go. Having the cache as a separate process (ie redis) provides a fault tolerant system.

    • @IsaacHarrisHolt
      @IsaacHarrisHolt 16 днів тому

      Go is great! I agree with your first three points for sure. On the last one, with the BEAM, your cache can be a separate process, or even on a separate node, but still be in your program, and still be perfectly fault tolerant!

  • @TeamDman
    @TeamDman 17 днів тому

    great vid! your github link in the description is broken

  • @pelegbaram7246
    @pelegbaram7246 17 днів тому

    Might be a weird question, but what font are you using?

  • @ケブ
    @ケブ 20 днів тому

    Assembly all the way 🎉

  • @m4saurabh
    @m4saurabh 21 день тому

    great work, i wonder what you think about if else

    • @IsaacHarrisHolt
      @IsaacHarrisHolt 21 день тому

      I have no strong opinions really. It's useful in some cases, but in others it's unnecessary indentation

  • @AGeekTragedy
    @AGeekTragedy 21 день тому

    "Write a recursive function without having to think too hard about stack overflow" seems to be something where Haskell has a big advantage over Gleam. The naive list-doubling function works just fine with lazy evaluation

    • @IsaacHarrisHolt
      @IsaacHarrisHolt 20 днів тому

      Yeah, that'd be nice. Unfortunately it's difficult in Gleam as it doesn't have its own runtime, and instead relies on the runtimes it compiles to for most optimisations, especially runtime ones.

  • @YuraSuper2048
    @YuraSuper2048 21 день тому

    is that what people feel when i tell them that lifetimes in rust are good actually ._. i don't really get why would you sacrifice both performance and understandability and simplicity (except when you are walking through a branching structure) for purity

    • @IsaacHarrisHolt
      @IsaacHarrisHolt 21 день тому

      You're not sacrificing performance though. As I said, tail call optimised recursive functions get compiled down to tight loops, so they perform exactly the same.

  • @PiyushChauhan2011
    @PiyushChauhan2011 21 день тому

    Thank you, Awesome video!

  • @worldpeace1822
    @worldpeace1822 21 день тому

    I’m still trying to understand why such functional language is something needed ? To me it seem a bit complicated

    • @IsaacHarrisHolt
      @IsaacHarrisHolt 21 день тому

      Gleam is actually a lot simpler than an object oriented language! There's a lot less to learn and a lot less going on. It's merely a matter of what you're used to

  • @minandychoi8597
    @minandychoi8597 21 день тому

    when an app opens in light mode

  • @emmanuelgenga7421
    @emmanuelgenga7421 21 день тому

    Awesome video, I'd like to request a video on decoding nested json in gleam using the zero api

  • @gro967
    @gro967 21 день тому

    Goodbye for loop hello out of memory xD

    • @IsaacHarrisHolt
      @IsaacHarrisHolt 21 день тому

      Someone didn't watch all the way to the end before commenting 👀

    • @gro967
      @gro967 20 днів тому

      @@IsaacHarrisHolt I actually did, this was more of a shared experience ;) I actually liked the video a lot, keep more of these coming!

  • @fedpo6022
    @fedpo6022 21 день тому

    Delete emacs

  • @kodosunofficial_5
    @kodosunofficial_5 22 дні тому

    next: higher order function, currying, folding, and partial application

    • @IsaacHarrisHolt
      @IsaacHarrisHolt 21 день тому

      Gleam doesn't support currying or partial application (at least, not in a generalised way). Higher order functions are a big part of any functional language, but I'm not sure how much of a video I could do on them 😅

    • @loo_9
      @loo_9 21 день тому

      @@IsaacHarrisHoltI would find it super valuable if you did a video reviewing gleam code and showing how it could be simplified using the standard library. plenty of higher order functions there

    • @jamesarthurkimbell
      @jamesarthurkimbell 21 день тому

      @@IsaacHarrisHolt Whatever you call it, the quick "let add_one = add(1, _)" type of function is a lovely way of doing what I think of when I think of partials

  • @seannewell397
    @seannewell397 22 дні тому

    Just on my phone (pixel 6a) but the white balance seems quite white imo at 0:29

  • @undergradplayers3057
    @undergradplayers3057 22 дні тому

    That's such a great tutorial! A quick question, umm instead of toga thing can we use simple html,css,js for frontend and flask for backend and wrap the entire thing with briefcase??

    • @IsaacHarrisHolt
      @IsaacHarrisHolt 22 дні тому

      Unlikely - html and CSS don't really translate well to mobile unless you're making a progressive web app. You could use Flask for an API backend though

  • @kodosunofficial_5
    @kodosunofficial_5 23 дні тому

    Gleam is not Rust Elixir is not Ruby

  • @IsaacHarrisHolt
    @IsaacHarrisHolt 23 дні тому

    The first 500 people to use my link skl.sh/isaacharrisholt12241 will get a 1 month free trial of Skillshare! Yes, I know I'm overexposed. New camera, working on it!

    • @slpwrm
      @slpwrm 21 день тому

      Angelic

  • @davidmurphy563
    @davidmurphy563 24 дні тому

    The type safety myth... I'd love to know who these people are who need to stop themselves assigning a string to the variable `number`. Do you know what happens to python programmers who don't use type hinting? Nothing. Because mixing up types is either a sign of gross incompetence or, far more likely, the monster lurking in the child's cupboard. You know, there one that isn't there. If you're doing it for performance - that's perfectly valid, all power to you. If you're doing it as a crutch because you think you need your hand held - you almost certainly don't. Take those stabilisers off and just ride your bike like an adult.

    • @IsaacHarrisHolt
      @IsaacHarrisHolt 23 дні тому

      This is definitely one of the comments of all time. You come across as though you've never worked on a large project with many developers. When writing software in teams, the best thing you can do is get the computer to do as much of the work for you as possible (auto formatting, lint checks, automated testing, etc.). Type checking is part of that - it reduces the mental load on each engineer, increasing the development velocity of the team as a whole. If you're relying on variable names to tell you their types, e.g. "number", you're basically introducing your own weak, inconsistent version of static typing anyway and creating more work for the people writing code and the people reviewing code. There are cases where dynamic typing is helpful, for sure, but for the work that 90% of people are doing, having static types is going to be a boon purely for the time it saves debugging issues. As much as anything else, static typing is a form of documentation. When you're onboarding new engineers onto a project, having types for them to read makes parsing the codebase infinitely easier - they don't have to keep all the context of all the types of every possible permutation of variables in their head to understand the flow of what's going on. And if you try to make the argument for documenting types in docstrings etc., again, you're using a poor-man's static typing. On the Python point, as someone who has written a fair bit of Python professionally, and used to make Python videos on this very UA-cam channel, a lot of the industry is moving towards using type hints as much as possible. The same trend can be seen in other popular dynamically typed languages - Elixir is getting a type checker built into the compiler, and Ruby's Sorbet is growing in adoption. Basically, all this to say... what??

    • @davidmurphy563
      @davidmurphy563 23 дні тому

      I see. You're a proponent of the bloat approach. You're in a team so pile on the boilerplate and layer on the comments. "We can't take the stabilisers off the bike dad, it'll fall over." Let's agree to differ on that front.

    • @IsaacHarrisHolt
      @IsaacHarrisHolt 23 дні тому

      Type annotations aren't bloat. Having to do more typing to make your life and your colleagues' loves easier is always worth it. Typing isn't your main job as a software engineer anyway.

    • @davidmurphy563
      @davidmurphy563 23 дні тому

      @@IsaacHarrisHolt They literally are boilerplate. Listen, we clearly have very different ideas of what constitutes good code. You're the the verbose / explicit camp, I'm in the minimalist. Some experienced coders would agree with you and competent coders would agree with me. :)

    • @IsaacHarrisHolt
      @IsaacHarrisHolt 22 дні тому

      @@davidmurphy563 you're very difficult to have a constructive conversation with, by god.

  • @livinlicious
    @livinlicious 24 дні тому

    We have 20 concurrent languages. This is stupid. We should create one that fixes all these issues as a one stop solution. Now we have 21 concurrent languages. This is this video.

    • @IsaacHarrisHolt
      @IsaacHarrisHolt 24 дні тому

      Gleam isn't a new concurrency system, it builds on Erlang!

  • @sir_christmas_leopold_duckson
    @sir_christmas_leopold_duckson 25 днів тому

    I had the original Dark Core RGB and it was honestly the worst mouse I've ever owned. First and only Corsair product I've ever been disappointed in. My biggest complaint was battery life. It would go dead just sitting with the power switched turned off and I never got more than a half hour or so of gameplay out of it or the replacement. I also regularly got oddball multi-clicks or clicks not registering at all.

    • @IsaacHarrisHolt
      @IsaacHarrisHolt 25 днів тому

      Interesting! I still have (and use!) the exact same mouse I showed in the video, and I've never had that issue. Perhaps you had a faulty unit? It does happen, sadly

  • @reireireireireireireireirei
    @reireireireireireireireirei 25 днів тому

    Before this vid I thought my analogies were inane, but you sir take the cake with ease.

  • @Exilum
    @Exilum 26 днів тому

    Wait a minute, what kind of nighttime activities do you have where you use a hammer and a corkscrew at the same time?

    • @IsaacHarrisHolt
      @IsaacHarrisHolt 26 днів тому

      Uhhh... drunken woodworking?

    • @Exilum
      @Exilum 26 днів тому

      @IsaacHarrisHolt that is an activity xD

  • @fcolecumberri
    @fcolecumberri 28 днів тому

    I have used Laravel's ORM and QuerryBuilder (PHP), both are very intuitive.

  • @SpektralJo
    @SpektralJo Місяць тому

    I really dont like the idea of writing html using function composition

    • @IsaacHarrisHolt
      @IsaacHarrisHolt Місяць тому

      How come?

    • @SpektralJo
      @SpektralJo Місяць тому

      @IsaacHarrisHolt I think it just looks off and includes a lot of visual noise like a lot of brackets (often semantically useles ones like [], if an element has no atributes) the html. prefix (or you have to import the functions you use) etc. I really just like looking at actual HTML way more.

    • @IsaacHarrisHolt
      @IsaacHarrisHolt Місяць тому

      That's fair, but I don't think it's enough of a reason not to try Lustre. It's pretty great, and you get used to the syntax very quickly

    • @SpektralJo
      @SpektralJo Місяць тому

      @@IsaacHarrisHolt can you use lustre just on the Server. Because I want to try out htmx for the frontend

    • @IsaacHarrisHolt
      @IsaacHarrisHolt Місяць тому

      Absolutely!

  • @stevetaxpro4022
    @stevetaxpro4022 Місяць тому

    I am sure what you are teaching is great, but CAN YOU SPEAK a little slower .... OK, I mean, can you speak A LOT SLOWER. For someone new like me, you talk waaaayyyy too fast

    • @IsaacHarrisHolt
      @IsaacHarrisHolt Місяць тому

      I've slowed down a lot in newer videos :)

  • @Llenne
    @Llenne Місяць тому

    Useless video, defer in go doesn't exist for code alignments sake and language features in general do not exist for code alignments sake. 2000 callbacks isn't better just because it isn't nested either.

    • @IsaacHarrisHolt
      @IsaacHarrisHolt Місяць тому

      I don't think I ever said defer existed for that reason, and like I showed, you can implement it perfectly fine without `use` in a functional language. `use` just makes things a lot nicer. And I dunno, being nested 2000 levels deep would be pretty gnarly. Even the tabs v spaces folks would gang up against you there! And lastly, this video is definitely not `use`less. Seems to me that there's quite a lot of `use`ful stuff happening here...

  • @AlNewkirk
    @AlNewkirk Місяць тому

    Errors were always values. Variables hold values, so everytime you catch a thrown exception it ends up in a variable that... holds a value. 🤯

    • @IsaacHarrisHolt
      @IsaacHarrisHolt Місяць тому

      Ah, pedantry. We are alike, you and I 😅

  • @CalebCleavinger
    @CalebCleavinger Місяць тому

    As much as I love Kotlin and the functional-ish approach of jetpack compose for UI the sheer amount of nested lambdas is a pain. Also love your videos on Gleam! Might give it a try for my next backend...

  • @NuncNuncNuncNunc
    @NuncNuncNuncNunc Місяць тому

    All this and not a single mention of the M-word. Video went a little fast for this Gleam sub-novice, but the use of use seems to resemble Scala's for comprehension construct. Is this an accurate comparison or is this something totally different?

    • @IsaacHarrisHolt
      @IsaacHarrisHolt Місяць тому

      You could possibly use it in a similar way, but `use` is a lot more general than that

  • @ivanjermakov
    @ivanjermakov Місяць тому

    It's great in a couple of cases, but I expected some disadvantages to be mentioned. This messes up semantics that care about what function scope they are in (meaning of return, break, etc. changes). Also because the rest of the function body gets swallowed, it does not look this elegant when you need some expressions beyond callback scope (have to surround use expr in another block).

    • @IsaacHarrisHolt
      @IsaacHarrisHolt Місяць тому

      Well it's a good job Gleam doesn't have returns or loops to break out of then! And if you need things behind the function scope, you'd either a) not use `use` or b) pull your `use` usage out into a function. While you can use a block to change the scope, you're right in that it's pretty pointless

    • @ivanjermakov
      @ivanjermakov Місяць тому

      @@IsaacHarrisHolt I admit it is a great sugar for languages that rely heavily on callbacks. Use is great because it does not propagate to the function's caller (like with async/await syntax). Great video, as usual.

    • @IsaacHarrisHolt
      @IsaacHarrisHolt Місяць тому

      Thank you :)

  • @SuperQuwertz
    @SuperQuwertz Місяць тому

    Nice

  • @blacklistnr1
    @blacklistnr1 Місяць тому

    I will complain that recursion leads to unknown max stack size. If you do something like a depth-first search iteratively you have more control both over the max depth and handling the case when it is reached.

    • @IsaacHarrisHolt
      @IsaacHarrisHolt Місяць тому

      If you use tail call recursion, and your language supports it, your stack size won't increase.

  • @tiggax2000
    @tiggax2000 Місяць тому

    Isnt there one too many parentheses after the "zorua" at 1:43 ?