The simplicity and readability is truly unmatched. I can't imagine Rust, Haskell or C++ being taught in only 7 minutes
@IsaacHarrisHolt6 күн бұрын
True! I like simple languages
@AlesNajmann7 күн бұрын
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.
@IsaacHarrisHolt6 күн бұрын
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
@0x5D8 күн бұрын
5:07 this is wrong, you can use function anywhere a statement or expression is allowed, not only at top level
@IsaacHarrisHolt6 күн бұрын
You're right, thank you!
@mr.johnson89748 күн бұрын
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.
@IsaacHarrisHolt8 күн бұрын
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!
@TeamDman9 күн бұрын
great vid! your github link in the description is broken
@pelegbaram72469 күн бұрын
Might be a weird question, but what font are you using?
@IsaacHarrisHolt9 күн бұрын
JetBrains Mono
@ケブ12 күн бұрын
Assembly all the way 🎉
@IsaacHarrisHolt12 күн бұрын
Uhhhhh good luck good luck
@m4saurabh12 күн бұрын
great work, i wonder what you think about if else
@IsaacHarrisHolt12 күн бұрын
I have no strong opinions really. It's useful in some cases, but in others it's unnecessary indentation
@AGeekTragedy12 күн бұрын
"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
@IsaacHarrisHolt12 күн бұрын
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.
@YuraSuper204812 күн бұрын
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
@IsaacHarrisHolt12 күн бұрын
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.
@PiyushChauhan201112 күн бұрын
Thank you, Awesome video!
@IsaacHarrisHolt12 күн бұрын
Glad you found it useful!
@worldpeace182212 күн бұрын
I’m still trying to understand why such functional language is something needed ? To me it seem a bit complicated
@IsaacHarrisHolt12 күн бұрын
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
@minandychoi859713 күн бұрын
when an app opens in light mode
@IsaacHarrisHolt12 күн бұрын
😂
@emmanuelgenga742113 күн бұрын
Awesome video, I'd like to request a video on decoding nested json in gleam using the zero api
@IsaacHarrisHolt13 күн бұрын
Definitely got a JSON video planned!
@gro96713 күн бұрын
Goodbye for loop hello out of memory xD
@IsaacHarrisHolt13 күн бұрын
Someone didn't watch all the way to the end before commenting 👀
@gro96711 күн бұрын
@@IsaacHarrisHolt I actually did, this was more of a shared experience ;) I actually liked the video a lot, keep more of these coming!
@fedpo602213 күн бұрын
Delete emacs
@IsaacHarrisHolt13 күн бұрын
Yes
@kodosunofficial_513 күн бұрын
next: higher order function, currying, folding, and partial application
@IsaacHarrisHolt13 күн бұрын
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_913 күн бұрын
@@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
@jamesarthurkimbell13 күн бұрын
@@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
@seannewell39713 күн бұрын
Just on my phone (pixel 6a) but the white balance seems quite white imo at 0:29
@IsaacHarrisHolt13 күн бұрын
It 100% is way too exposed 😅
@undergradplayers305714 күн бұрын
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??
@IsaacHarrisHolt14 күн бұрын
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_514 күн бұрын
Gleam is not Rust Elixir is not Ruby
@IsaacHarrisHolt14 күн бұрын
Someone gets it
@IsaacHarrisHolt15 күн бұрын
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!
@slpwrm13 күн бұрын
Angelic
@davidmurphy56315 күн бұрын
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.
@IsaacHarrisHolt14 күн бұрын
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 KZbin 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??
@davidmurphy56314 күн бұрын
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.
@IsaacHarrisHolt14 күн бұрын
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.
@davidmurphy56314 күн бұрын
@@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. :)
@IsaacHarrisHolt14 күн бұрын
@@davidmurphy563 you're very difficult to have a constructive conversation with, by god.
@livinlicious16 күн бұрын
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.
@IsaacHarrisHolt16 күн бұрын
Gleam isn't a new concurrency system, it builds on Erlang!
@sir_christmas_leopold_duckson16 күн бұрын
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.
@IsaacHarrisHolt16 күн бұрын
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
@reireireireireireireireirei17 күн бұрын
Before this vid I thought my analogies were inane, but you sir take the cake with ease.
@IsaacHarrisHolt17 күн бұрын
How kind, thank you :)
@Exilum18 күн бұрын
Wait a minute, what kind of nighttime activities do you have where you use a hammer and a corkscrew at the same time?
@IsaacHarrisHolt17 күн бұрын
Uhhh... drunken woodworking?
@Exilum17 күн бұрын
@IsaacHarrisHolt that is an activity xD
@fcolecumberri19 күн бұрын
I have used Laravel's ORM and QuerryBuilder (PHP), both are very intuitive.
@SpektralJo23 күн бұрын
I really dont like the idea of writing html using function composition
@IsaacHarrisHolt23 күн бұрын
How come?
@SpektralJo23 күн бұрын
@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.
@IsaacHarrisHolt23 күн бұрын
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
@SpektralJo22 күн бұрын
@@IsaacHarrisHolt can you use lustre just on the Server. Because I want to try out htmx for the frontend
@IsaacHarrisHolt22 күн бұрын
Absolutely!
@stevetaxpro402224 күн бұрын
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
@IsaacHarrisHolt24 күн бұрын
I've slowed down a lot in newer videos :)
@Llenne25 күн бұрын
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.
@IsaacHarrisHolt25 күн бұрын
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...
@AlNewkirk25 күн бұрын
Errors were always values. Variables hold values, so everytime you catch a thrown exception it ends up in a variable that... holds a value. 🤯
@IsaacHarrisHolt25 күн бұрын
Ah, pedantry. We are alike, you and I 😅
@CalebCleavinger25 күн бұрын
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...
@IsaacHarrisHolt25 күн бұрын
Thanks! Let me know how you get on
@NuncNuncNuncNunc26 күн бұрын
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?
@IsaacHarrisHolt26 күн бұрын
You could possibly use it in a similar way, but `use` is a lot more general than that
@ivanjermakov26 күн бұрын
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).
@IsaacHarrisHolt26 күн бұрын
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
@ivanjermakov26 күн бұрын
@@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.
@IsaacHarrisHolt26 күн бұрын
Thank you :)
@SuperQuwertz26 күн бұрын
Nice
@IsaacHarrisHolt26 күн бұрын
Thanks!
@blacklistnr126 күн бұрын
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.
@IsaacHarrisHolt26 күн бұрын
If you use tail call recursion, and your language supports it, your stack size won't increase.
@tiggax200026 күн бұрын
Isnt there one too many parentheses after the "zorua" at 1:43 ?
@IsaacHarrisHolt26 күн бұрын
You're right!
@consciouscode815026 күн бұрын
Reminds me of continuations, monads, and coroutines but in a pretty nice abstraction
@IsaacHarrisHolt26 күн бұрын
Yep, it can help with a lot of styles of programming you'll see elsewhere, for sure. `use` with `result.try` gives you that nice railway programming experience
@zill_laiss26 күн бұрын
so it's just a syntactic sugar which allow to move a function, that is a parameter to a function, below it instead? it makes sense I guess. and honestly, as someone coming from Go, I don't really like it :(
@IsaacHarrisHolt26 күн бұрын
You'll start to love it as you write more Gleam. It's so great
@nel_tu_26 күн бұрын
I've never met c# evangelist lol why the hate
@IsaacHarrisHolt26 күн бұрын
It's just a joke dw :)
@nel_tu_24 күн бұрын
@IsaacHarrisHolt ah i see, you trying to bait engagement >:|
@IsaacHarrisHolt24 күн бұрын
Not necessarily? I'm just a functional programmer making a joke about OOP langs :)
@RuySenpai26 күн бұрын
Minior gleam
@IsaacHarrisHolt26 күн бұрын
Except Lucy is always pink!
@funkdefied126 күн бұрын
Using gleam for advent of code this year. Thanks, Isaac!
@IsaacHarrisHolt26 күн бұрын
Check out the gladvent package!
@khai96x26 күн бұрын
That's a great innovation! I wonder if more languages should adopt this pattern.
@IsaacHarrisHolt26 күн бұрын
It's absolutely fantastic, but I don't know if it'd work in every language. I'd be curious to see what it's like to use in JS, though
@khai96x26 күн бұрын
@@IsaacHarrisHolt One thing I noticed is that the type of `return` must necessary change from the return type of the outer function to that of the callback function. Also, early return for the outer function is no longer possible. Is that correct?
@IsaacHarrisHolt26 күн бұрын
It doesn't necessarily have to change. It'll depend on what function you're using with `use`. You'll get the return type of that function, not the callback. Of course, that function MAY return the same type as the callback (e.g. result.try, the defer example) but it doesn't have to (e.g. with list.map)
@jazzkid_26 күн бұрын
This is a great video for simple cases, but I disagree that use is always as simple as is shown here. Everything under 'use' that isn't held as a single expression (in curly braces or in a function) is being passed up and called back to the 'use' line in ways that are very hard to conceptualise. fn foo(mylist: List(Int)) { list.fold(mylist, 0, fn(x, y) { x + y }) |> int.to_string } == fn bar(mylist: List(Int)) { { use x, y <- list.fold(mylist, 1) x + y } |> int.to_string } != fn bad(mylist: List(Int)) { use x, y <- list.fold(mylist, 1) x + y |> int.to_string // Error: Type mismatch. Expected type: Int, Found type: String }
@IsaacHarrisHolt26 күн бұрын
I think this is something you get used to. Everything under `use` in the same scope becomes your callback. You're right though - this is one of the ways `use` can be misunderstood.
@dupdrop27 күн бұрын
Looks a lot like Haskell's do-notation
@nathansnail26 күн бұрын
Seems very similar, lets you write a heavily nested lambda in a procedural way. Other than not using monads it seems almost identical.
@IsaacHarrisHolt26 күн бұрын
It was probably somewhat inspired by that for sure
@vytah25 күн бұрын
@@nathansnailit uses monads though
@nathansnail25 күн бұрын
@@vytah how so? it doesn't seem to add any additional monadic structure from what the video shows.