I Learned Haskell In 15 Years

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024
  • Recorded live on twitch, GET IN
    Article
    duckrabbit.tec...
    By: Evan Silberman
    My Stream
    / theprimeagen
    Best Way To Support Me
    Become a backend engineer. Its my favorite site
    boot.dev/?prom...
    This is also the best way to support me is to support yourself becoming a better backend engineer.
    MY MAIN YT CHANNEL: Has well edited engineering videos
    / theprimeagen
    Discord
    / discord
    Have something for me to read or react to?: / theprimeagenreact
    Kinesis Advantage 360: bit.ly/Prime-K...
    Get production ready SQLite with Turso: turso.tech/dee...

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

  • @mattymattffs
    @mattymattffs 2 месяца назад +276

    We use Haskell at work for specific planning functionality. Called from CPP. This is because we can prove they're correct. It's also faster than the cpp code we produced. Eventually maybe the cpp would end up faster, but the Haskell was so effortless

    • @filip0x0a98
      @filip0x0a98 2 месяца назад +17

      Would you mind elaborating on that? I am considering taking an extra course in haskell but would like to know how it is used in industry.

    • @MorningNapalm
      @MorningNapalm 2 месяца назад +39

      I never thought I would see Haskell and effortless in one sentence, with no negation or sarcasm.

    • @andrearaimondi882
      @andrearaimondi882 2 месяца назад +66

      @@MorningNapalmthat’s because they can prove they are correct. This means they likely have someone on staff who has a Maths degree.

    • @knowledgedrinker7002
      @knowledgedrinker7002 2 месяца назад +19

      I can recommend Haskell from First Principles, which is a good way to understand the language and the FP mindset with a lot of exercises and deep simple explanations. It's not as difficult as people think.

    • @svenkuffer4512
      @svenkuffer4512 2 месяца назад +8

      @@andrearaimondi882 *CS degree, you learn that in Software Engineering and it involves mathematical logic. In this case formal methods (SAT), there are logic languages for that, like B-method. This makes it very easy to go from specification to implementation.

  • @dforj9212
    @dforj9212 2 месяца назад +66

    Prime making fun of Haskell because he knows he could fall in the FP rabbit hole

    • @GerinoMorn
      @GerinoMorn 5 дней назад

      Or worse, even fail in the FP hole!

  • @Frostbytedigital
    @Frostbytedigital 2 месяца назад +90

    The netbook fiasco had me emotionally on edge for a whole paragraph till he glanced at chat.

    • @MorningNapalm
      @MorningNapalm 2 месяца назад

      LOL, jerk. Me too.

    • @lamspam
      @lamspam 2 месяца назад +5

      haha it's funny because the "netbook" was almost a marketing term for a specific kind of notebook, or a slightly smaller notebook, so I can understand him reading it wrong the first time lol. I also think it was only a thing for a few years while the term "notebook" kept going

    • @PromptStreamer
      @PromptStreamer 2 месяца назад

      It’s interesting if you’ve always been a very keen person of letters who notices spelling very acutely, when someone is borderline dyslexic and pronounces Anarchaia as “anar-chaya”, suddenly even a very brilliant person looks unintelligent for a moment

    • @Frostbytedigital
      @Frostbytedigital 2 месяца назад +1

      @@PromptStreamer I find that, to me it just exposes more about how that person's brain works rather than making me feel like they're unintelligent. I KNOW that to be false so seeing that for what it is, becomes easier I guess. But I do understand where you're coming from. It's jarring regardless

  • @throwaway3227
    @throwaway3227 2 месяца назад +25

    So Haskell is actually pretty easy to use, and it mostly doesn't even get that hard when introducing Monads (unless you go into the MonadTrans[former] stuff with multiple Monads at the same time). What makes Monads hard is when you implement your own Monads. The worst thing in Haskell for a newbie is probably trying to figure out memory leaks in lazy types. There is also some operators which are confusing in the beginning, such as (.) and (#), but hoogle is great for this.
    That said, I mostly program in Rust now, but there are often problems where I think that "this will turn into a complexity explosion (if it's even doable in Rust's type system), but it would be pretty much a one liner in Haskell".

    • @AlexRodriguez-gb9ez
      @AlexRodriguez-gb9ez 2 месяца назад +1

      One difficulty of Haskell is when you figure out that your function shouldn't have been a -> b but f a -> f b, or a -> f b, or f a -> b, or whatever...

    • @eetswalads5528
      @eetswalads5528 2 месяца назад +1

      I learnt about the State Monad yesterday and it fucking blew my mind

    • @vatne4eg
      @vatne4eg Месяц назад

      @@eetswalads5528 the next step is to dig into IO data type :)

  • @newsofthenerd
    @newsofthenerd 2 месяца назад +32

    Yeah Xmonad mentioned. I love me some haskell tiling.

    • @remrevo3944
      @remrevo3944 2 месяца назад

      Was my first tiling window manager. And caused my taste for windowed fullscreen.

    • @newsofthenerd
      @newsofthenerd 2 месяца назад

      @remrevo3944 yeah I only use fullscreen

  • @mattymattffs
    @mattymattffs 2 месяца назад +118

    State management is the only programming paradigm that actually exists

    • @remrevo3944
      @remrevo3944 2 месяца назад +16

      State? What is state?
      I only know some registers and memory. (Some of which isn't even memory, but actually memory-mapped-io.)

    • @gwentarinokripperinolkjdsf683
      @gwentarinokripperinolkjdsf683 2 месяца назад

      @@remrevo3944that is your state (except the memory mapped-io, but the memory mapped io can effect state

    • @kebien6020
      @kebien6020 2 месяца назад +19

      State? We have a monad for that, it combines the capabilities of the Reader monad and the Writer monad.

    • @biggerdoofus
      @biggerdoofus 2 месяца назад

      @@remrevo3944 I think state is the parts of those you actually use in the code you're currently writing, but I'm not sure. I keep hearing about state somehow being "global" and that being bad somehow. Maybe it's a cache difference. Also not sure if the read-only parts count.

    • @ktxed
      @ktxed 2 месяца назад

      that's programming rite dere

  • @Axu227
    @Axu227 2 месяца назад +13

    Haskell probably is more difficult to learn than Go, sure. But as was the case with the author of the article, it'll teach you lessons that are valuable in whichever other language you'll write.

    • @yayinternets
      @yayinternets 2 месяца назад +3

      Years ago I did Scala full-time for a couple of years and the lessons from it have still stuck with me. Immutable data is the best.

    • @colemanroberts1102
      @colemanroberts1102 2 месяца назад +3

      Haskell, lisp, prolog, apl, forth, smalltalk. Basically, any language that is radically different from the ones you know. C has the same effect for some coming from the declarative side.

    • @AlexRodriguez-gb9ez
      @AlexRodriguez-gb9ez 2 месяца назад

      @@colemanroberts1102 How did Forth and Prolog change the way you write code?

    • @colemanroberts1102
      @colemanroberts1102 2 месяца назад +2

      @@AlexRodriguez-gb9ez forth makes you realize how much you can get with exceedingly little, and how hard a radically simple design is to get right.
      Prolog's unification and backtracking change the way you see control flow, and, in turn, what kinds of problems can be solved concisely and flexibly.

  • @redcollard3586
    @redcollard3586 2 месяца назад +8

    Thank you, Prime. The burrito metaphor has finally made everything clear to me. You got however many layers of logic all wrapped up in an i/o layer that makes it portable. Holy guacamole.

    • @lamspam
      @lamspam 2 месяца назад +3

      yeah, I kinda wish he expanded on the burrito metaphor in the video 😂

    • @TankorSmash
      @TankorSmash 2 месяца назад

      Sorta! It's more like any monad, lists, promises, optionals and yeah IO, are able to have internal state with a preset API

    • @Schindlabua
      @Schindlabua 2 месяца назад +2

      @@lamspam It's an ancient Haskell meme that there are as many monad tutorials as there are haskell programmers and then theres that ancient webcomic about how moands are just burritos. Truth is that monads aren't that complicated (you just need two functions, one that puts stuff in a burrito and another that tells you how burritos can be rewrapped into new burritos) but to actually grok it you need to learn a few fancy words and concepts.
      (And as a haskell enjoyer I'd be happy to talk about it)

    • @LorenzoGiovenali
      @LorenzoGiovenali 2 месяца назад

      @@Schindlabua Please tell us about them. I didn't understand sh1t from the burrito inside your parenthesis..

    • @Schindlabua
      @Schindlabua 2 месяца назад

      @@LorenzoGiovenali Functions take a value of some type and produce another. For a function f we can state the fact as `f :: A -> B`. Functions are cool and we all love them. Here's one that takes numbers and returns strings.
      const stringify = (x: number) => {/* magic */}
      We can then put in some number value and get a string back.
      stringify(4) === "4";
      Love me a good function. *Audience laughs and claps*
      By the way don't get me started about generics. Have you ever wondered about generics? Like, `LinkedList` is a type, and `LinkedList` is a type and `LinkedList`. But *what* is `LinkedList`? *Audience laughs, then goes silent*
      Like it's not a type is it.
      It only becomes a type if we give it another type.
      So uhm we pass in something and get back some other thing? Like a function? *Audience gasps*
      idk I'm tired of this bit but yeah generics are functions on types. If we give `LinkedList` the type `Int` as an argument you get back a `LinkedList` and turning stuff into other stuff is what functions do. And that's an interesting mindset shift for programmers because for us a function is just a bunch of code that computes a value and how would you write down the `LinkedList` function as code (you can't) and when you turn `Int` into `LinkedList` you're not really computing anything either, but in fact we can do all the mathsy functiony stuff with `LinkedList` like look at it's domain (all types) and it's codomain (all types of lists) etc.
      As you know a favourite pastime of mathematicians is categorizing things into categories, like we can look at multiplication of real numbers and people will say hey multiplication is associative and commutative and invertible and therefor the real numbers together with multiplication form we shall call a "group". Or mayhaps we could even say that (ℝ, *) is part of the category of groups. `(ℝ, *) ∈ Obj(Grp)` I guess idk.
      And yeah when we look at generics like LinkedList or HashSet or Promise, we also often observe common traits so we like categorizing those too. Like, often we have a canonical way of turning a T into a Generic which is kinda interesting.
      Take List: `const makeList = (x: T) => [x];`
      Or Promise: `const makePromise = (x: T) => Promise.resolve(x);`
      or for c-heads, we can turn any T into a Pointer, like so: `&x`.
      Or something slightly more complicated:
      type WithEnvironment = { value: T, environment: { USE_DATABASE: string; TIMEOUT: string; } };
      const makeWithEnvironment (x: T) => { value: x, environment: process.env };
      Turns out many generic types can be "mapped over". That is we can for example take any regular ass function and canonically make it so it suddenly works on lists. That is, we take `fn :: a -> b` and mold it into `fn :: List -> List` using a `mapList` function.
      List: const mapList = fn => list => list.map(fn); // types omitted for brevity
      Promise: const mapPromise = fn => promise => promise.then(fn);
      Pointer: err... `pointer_t *map_pointer(fn, pointer) { return &func(*pointer); }` (lets not think about it too hard)
      WithEnvironment: mapWithEnvironment = fn => ({ value, environment }) => ({ value: fn(value), environment });
      Okay and so whenever you see any generic type that has a map function like that, we call it an "Endofunctor". `(List, mapList) ∈ Obj(End)` as it were... an object in the category of endofunctors.
      Which is not quite monads but close. This is some preliminary things and me rambling to get you googling :) Monads are Endofunctors with some added stuff. (like our make* functions.) They're important because they're about sequencing things and doing stuff in sequence is pretty common in programming.

  • @mattymattffs
    @mattymattffs 2 месяца назад +36

    Rebase is great. That's what we do in our branches, but the code is merged into master/dev. Because you don't touch them directly, ever. Master exists to track releases. Dev exists for QA. It works well for us.

    • @sonicfind
      @sonicfind 2 месяца назад +2

      Rebase ftw

    • @georgehelyar
      @georgehelyar 2 месяца назад +3

      Rebase is great for branches that a single developer is working on before being merged, but just use a single long lived branch and use git tags to track releases.

    • @mattymattffs
      @mattymattffs 2 месяца назад +1

      @@georgehelyar we use tags on master and dev. But having devs work against either of these just leads to conflicts.

    • @lamspam
      @lamspam 2 месяца назад +4

      yeah, I think Prime kinda showed his colors about rebase vs merge, because it really does matter for your particular project, team, pipeline, branch, etc.

    • @thekwoka4707
      @thekwoka4707 2 месяца назад +1

      No, rebase your PRs before merging them. And squash merge PRs into main.

  • @MikkoRantalainen
    @MikkoRantalainen 2 месяца назад +11

    15:55 The idea that DOM is so slow that you can run *javascript* to emulate the tasks that DOM is supposed to do in C++ code is a long term plan sounds a bit weird idea to me. Unsurprisingly the browser native implementation of DOM has gotten much better during years.

    • @HyuLilium
      @HyuLilium 2 месяца назад

      Virtualization for huge lists is still useful unfortunately. It should be built into the browser for sure

  • @njabulothwala2198
    @njabulothwala2198 2 месяца назад +33

    The C++ stuff hit home coz I just started learning this

    • @ethgraham
      @ethgraham 2 месяца назад +24

      Bjarne Stroustrup rates himself a 7/10 in terms of C++ knowledge 👍 not very promising for the rest of us

    • @luizgfranca
      @luizgfranca 2 месяца назад

      So true. I'm learning C++ for over a year now and i still don't think I really know the language

    • @antonpieper
      @antonpieper 2 месяца назад

      C++ 23 deducing this mentioned?

    • @MorningNapalm
      @MorningNapalm 2 месяца назад +1

      My condolences.

    • @kippers12isOG
      @kippers12isOG 2 месяца назад

      If you know Richard smith, it's really hard to be remotely close to a 10

  • @coderz4life
    @coderz4life 2 месяца назад +7

    6:15 I think pandoc is probably the most prominent piece of software written in Haskell that I used frequently. Looking at the source code is quite an adventure, too.

  • @GerinoMorn
    @GerinoMorn 5 дней назад

    A pattern that kinda works is generating openapi spec from your backend via some introspection of endpoints and data types etc., and then generation of matching TS types (there is >1 package on npm to do that). It gives you models both of responses and of what is expected from you to post.
    I see it more as a temporary bridge than "the solution", but you can include it all nicely in your CICD and if there's an unmatched change in either BE or FE it will be caught automatically.

  • @thedarkknight-3894
    @thedarkknight-3894 2 месяца назад +75

    Hold my functor!

    • @GeorgijTovarsen
      @GeorgijTovarsen 2 месяца назад +4

      for about 15 years

    • @ZombieJig
      @ZombieJig 2 месяца назад +7

      Functor? Damn near killed her.

  • @foggyspinks
    @foggyspinks 2 месяца назад +3

    We all along knew 'The Notebook' was your favourite movie and Im glad you have finally pubically admitted it.. no judgement here dude, Im glad you are are at a point in life to make that confession, peace out my dude

    • @lamspam
      @lamspam 2 месяца назад +1

      He might've been joking, but don't y'all dare hate on that movie. I just re-watched it the other day, and while it may not have the same power as it did 20 years ago, I'd still say it's worth watching if anyone hasn't seen it yet

    • @foggyspinks
      @foggyspinks 2 месяца назад +1

      @@lamspam I am fairly sure Prime was joking and I was 100% joking because I have never even seen a part of that film once so I have no clue what I'm talking about but based on the pure conviction in your reply, it sounds like I should give it a watch, take care, peace.

  • @mtxn
    @mtxn 2 месяца назад +5

    the best form of learning (in my case) is starting a new project with minimal planing and 0 language knowledge, making a "TODO" section in the README file and treat the rest like the quest in a sandbox game like factorio or satisfactory.

    • @gristlelollygag
      @gristlelollygag 2 месяца назад

      how do you determine what kind of project with that new language?

    • @mtxn
      @mtxn 2 месяца назад +1

      I just make what I think is useful. mostly cli-utils. learning a language without purpose in mind is pointless

    • @gristlelollygag
      @gristlelollygag 2 месяца назад

      @@mtxn so usually you decide to make a specific new project, and then realize "oh this new language could do this well"?
      i mean i don't have a problem with learning a new language just to see "what the fuss is about" if it is being increasingly mentioned

    • @mtxn
      @mtxn 2 месяца назад +1

      essentially, yes. I recently started to learning java and kotlin this way. just to make android app. I do not saying that trying a new language is a bad idea however if you do not plan to use it, take that to consideration if it's really worth your time

  • @isodoubIet
    @isodoubIet 2 месяца назад +5

    Rebase when pulling from upstream, merge --no-ff when including downstream changes

    • @lamspam
      @lamspam 2 месяца назад +1

      there are so many other scenarios that it really depends on whether to use rebase or merge. I'm not exactly sure what Prime was talking about because there are common reasons why merge is better than rebase, especially when working on a large team, or an org of teams contributing to the same repo/project, etc.

    • @isodoubIet
      @isodoubIet 2 месяца назад

      @@lamspam Like with everything you may need to break the rules on occasion, but you need some rules in place if you want any hope of understanding what's going on in a repo's history.

  • @einargs
    @einargs 2 месяца назад +1

    I found learning Haskell very natural. The key to understanding monads (and monad transformers) is to use them and write your own version of them. Soon they become second nature, and then you become able to puzzle out the really weird ones like the coroutine monad or CPS (which I fortunately/unfortunately haven't yet had cause to use). I also recommend doing a parser in haskell; Haskell has the best parsing libraries in the world. What I Wish I Knew About Haskell, although not currently being updated, is still an invaluable overview of many different topics and a great jumping off point.

    • @alastairleith8612
      @alastairleith8612 Месяц назад +1

      the Data61Functional Programming course is in Haskell and has lots of parser exercises. I did a three day condensed version of this semester long course and it fried my brain but was amazing watching the parse library put to use by a fluent Haskell coder (Tony Morris) in action. You'll find it around online and other people teaching the course who didn't write it.

    • @alastairleith8612
      @alastairleith8612 Месяц назад

      @@samuraijosh1595 the syntactic elegance of Haskell seems to be unmatched, but I'm no professional coder!

  • @someguyO2W
    @someguyO2W 2 месяца назад +2

    The Elm Architecture, or Flux architecture is an architecture that pushes a unidirectional flow of data.
    If you used redux, that's an example.

  • @kuhluhOG
    @kuhluhOG 2 месяца назад +5

    7:35 Rebase is great until you need to bisect to find out what could have gone wrong (because the code itself doesn't really tell) and all the commits which were rebased besides the top one don't even compile anymore thanks to rebase.

    • @radfordmcawesome7947
      @radfordmcawesome7947 2 месяца назад +2

      i'm team rebase, but this is a good point. there is no one-size-fits-all strat, and there is no substitution for really understanding your commit graph

    • @isodoubIet
      @isodoubIet 2 месяца назад +2

      I'm also on team rebase but I've found I spend a lot of time planning how to do rebases "correctly" while keeping intermediate commits working, and it is an investment for sure.

  • @krtirtho
    @krtirtho 2 месяца назад +2

    Your POV: It took him 15 years to learn Haskell?!
    My POV: He finished learning Haskell?!

  • @tubeincompetence
    @tubeincompetence 2 месяца назад +17

    Why did I first read the title as "I learned haskell in 15 minutes".. oh well :P

    • @IgorGuerrero
      @IgorGuerrero 2 месяца назад +1

      Lol, did you believe it?

    • @tubeincompetence
      @tubeincompetence 2 месяца назад +2

      @@IgorGuerrero I felt "that's impossible!". Then i got disappointed when I figured out it really is impossible 😁

    • @thingsiplay
      @thingsiplay 2 месяца назад

      @@tubeincompetence Not impossible if you are already well versed in functional programming through other languages.

    • @Daniel_WR_Hart
      @Daniel_WR_Hart 2 месяца назад +1

      @@thingsiplay But how many decades does it take to master Clojure or OCaml?

    • @stevenhe3462
      @stevenhe3462 2 месяца назад +1

      I read "learn haskell in y" in 15 minutes and everything made sense to me. And then, I never used it. Lol.

  • @MikkoRantalainen
    @MikkoRantalainen 2 месяца назад +3

    33:33 One programming language worth learning enough to fully grasp its design-by-contract feature is Eiffel. I think that language has even less real world use than Haskell but the design-by-contract feature is obviously useful in any language, even though Eiffel is the only language with full native support for it. Other languages use assert()s to emulate the missing feature.

    • @MikkoRantalainen
      @MikkoRantalainen 2 месяца назад

      @@TapetBart Interesting... I tried to look for some examples but ATS code seems practically unreadable for me so I didn't understand how the design-by-contract feature would work if that's indeed supported.

    • @jimiscott
      @jimiscott 2 месяца назад

      We did Eiffel at Uni - great language.

    • @davidjohnston4240
      @davidjohnston4240 2 месяца назад

      @@jimiscott As did I. Machester Uni, 1989-91. Prolog, ML, Eifell, Modula. Lots of interesting languages.

  • @vatne4eg
    @vatne4eg Месяц назад +1

    last time when I decided to "not to propose to use haskell and just use typescript as it would be better for team and project" led to rewriting backend on haskell because TS "senior software engineers" was too busy to fix slow load times and implement features, lol

    • @vatne4eg
      @vatne4eg Месяц назад +1

      and by the way, I used haskell here and there for 14 years already and still don't think that I dig deep enough. I am not participating in the `*morphism`- talks, haven't used lenses or do not know how to write template haskell. Persistent-postgres, Servant and co, Aeson, mtl, transformers, containers, stm-chans are most of my tools, aside of expressive type system to model domain specific stuff to provide constraints and limitations to reduce a risk to screw things up, hehe.
      And the worst thing that it looks like the best tool/language that I know now, which is scare given how "many" jobs in haskell are there)

  • @pesterenan
    @pesterenan 2 месяца назад +1

    The kid that came with a black jacket showing you his notebook: 5:04
    *cool* - you say, nervously...

  • @TheRealBigYang
    @TheRealBigYang Месяц назад

    For the Git rant: it can be very confusing, if you use it for shit you don't need. Branch, switch, add, push and pull is all you need. Any PR can be done on the remote, or through actions/jenkins/whatever ass piping you use(if it's been automated already). Whatever you need outside of these is a yahoo search away, with explanations spanning from 45min tutorials to "git [command] [flag] [argument]"

  • @kahnfatman
    @kahnfatman 2 месяца назад +19

    Yup. Elm taught me Haskell. I started to learn Haskell in 2015. i really started to understand the language in 2021.
    m word because there is a class of functions that can be applied on the applicative functors/monoids, like mconcat, mfilter… To learn Haskell means to change your worldview.

    • @lamspam
      @lamspam 2 месяца назад

      did you ever take a class in college that required you to learn Haskell, like a functional programming course?

    • @TankorSmash
      @TankorSmash 2 месяца назад

      Yeah Haskell was way easier to learn after learning Elm. I'm glad to hear ThePrimeagen respects both languages so much!
      I'd be interested to see how close you can make a TUI in Haskell that would do the tower defense stuff.

    • @kahnfatman
      @kahnfatman 2 месяца назад +3

      @@lamspam I did only OOP during formal higher education. Some kids whispered the term “Haskell” during a class in 2009. When React was touted as “functional” and “declarative” around 2015, I started the functional journal head-on.

    • @Qrzychu92
      @Qrzychu92 2 месяца назад +2

      @@lamspam I took "scala programming" in university, but I learned that Scala is supposed to be functional just couple years ago :D that course sucked balls

    • @AlexRodriguez-gb9ez
      @AlexRodriguez-gb9ez 2 месяца назад +1

      Use Clojure/Racket/OCAML its an easier Haskell then learning Haskell makes more sense.

  • @BeOnlyChaos
    @BeOnlyChaos 2 месяца назад +2

    One day we'll get Prime to write some Haskell. He's already preparing his body and soul.

  • @albertoarmando6711
    @albertoarmando6711 2 месяца назад +3

    "why the lucky stiff" mentioned. Nostalgia

  • @ProjectVastness
    @ProjectVastness 2 месяца назад +17

    Never used Haskell, but since I do a lot of stuff in F# , maybe I'll give a try to haskell someday

    • @wotwithbert7591
      @wotwithbert7591 2 месяца назад +8

      That "someday" is crucial since the first actual step to learning Haskell is forgetting you have been wanting to learn it, ultimately resulting in forgetting you have had a thought about wanting to learn Haskell, until that thought reappears some day in a year or so

    • @evergreen-
      @evergreen- 2 месяца назад +1

      Never start learning Haskell today. Start learning it tomorrow!

    • @Ellefsen97
      @Ellefsen97 2 месяца назад

      What’s the benefit of writing things in F# instead of writing in C#? I’m fairly proficient in C#, but I am curious about F#

    • @DryBones111
      @DryBones111 2 месяца назад +1

      @@Ellefsen97 Discriminated unions, function composition syntax, and option types to name only 3 benefits.

    • @z0nx
      @z0nx 2 месяца назад

      @@Ellefsen97 I would absolutely recommend fsharp, just try not to write csharp in fsharp. Which means, writing mostly simple immutable functions and making use of discriminated unions.
      Haskell certainly has more potential theoretical learning value since it forces you to write pure functions, similar to how async/await is forced all the way up the call stack.

  • @thunder____
    @thunder____ 2 месяца назад +10

    “This is how I plan my shorts”
    But I thought you simplified your wardrobe so you didn't have to plan your clothes at all. Prime plot hole!

    • @no.no.4680
      @no.no.4680 2 месяца назад +1

      Plot hole so big you could stick your leg through it!

    • @lamspam
      @lamspam 2 месяца назад

      @@no.no.4680 this could've been a kid that posted the original comment. what are you doing? at least 2 legs fit in shorts

  • @sorek__
    @sorek__ Месяц назад

    The part of learning C++ is first to learn C, then read about all C++ quirks and features and still write C code but sometimes just use those lovely 0 cost abstractions and QOL stuff.

  • @tehpsalmist
    @tehpsalmist 2 месяца назад

    One thing I really appreciate about Prime's content is that he is continually pointing me to blogs that I would have otherwise never found on my own. I like getting good content outside of social media. Feels like that was the original purpose of the internet.

  • @some1and297
    @some1and297 2 месяца назад

    Hey, it's so cool hearing people describe the process I'm currently using to write a git files parser specifically for making invoices. Honestly rusts type system helps so much in modeling how the files are layout out on disk and doing this makes the actual application side dead simple and fantastic to work with.

  • @P-39_Airacobra
    @P-39_Airacobra 2 месяца назад +1

    Optimizations are good depending on how you define optimization. If it's just a trade-off, go for the most maintainable choice. If it's a simplification, ALWAYS go for it.

  • @TheCheD3
    @TheCheD3 День назад

    You sounded so hurt that chat didnt care about your notebook and just wanted to dunk on you for misreading it. Dont worry prime, I'm interested in your cool planning netbook 4:53

  • @IgnacioTaranto
    @IgnacioTaranto 2 месяца назад +2

    Shellcheck: "Am I a joke to you?"

  • @Bolpat
    @Bolpat 2 месяца назад +1

    1:00 It’s always fascinating how many “educated” Americans utterly lack foreign language skills. In Germany, a high-school degree requires you lean 2 foreign languages, usually one is English and the other is among French, Spanish, and Latin. I learned English, Latin, Spanish, and Italian, and apart from English, my skills in them aren’t that good, but good enough to skim a random Wikipedia article and tell you what it is about and to judge if a translation you present me is probably genuine or nonsense.

  • @TJ-hs1qm
    @TJ-hs1qm 2 месяца назад +2

    I Learned Haskell In 15 Years was headlining Hackr news last week :D

  • @MikkoRantalainen
    @MikkoRantalainen 2 месяца назад +3

    7:27 "I am always a rebase guy because I properly know how to use use git."
    Amen, brother!

  • @ymi_yugy3133
    @ymi_yugy3133 Месяц назад

    The DOM can still be slow. It's not unusual to have thousands of elements in the DOM. Now go use a slow budget phone from 5 years ago, you know the kind they sold your grandpa at the carrier store and enable some accessibility features. Then try to have a slider input and rerender the entire page while dragging the slider. That's the reason most frameworks are moving to signals, even the component based rerender of react isn't fine grained enough.

  • @NickCombs
    @NickCombs 2 месяца назад +1

    That's a beautiful notebook sweetie

  • @jayjeckel
    @jayjeckel 2 месяца назад

    C# with readonly structs and iterators. It doesn't matter the language, immutability reduces the number of moving parts and simplifies so much. As with anything, there are limits, like gui widgets, that map better to mutablity, but more often than not, immutable is just plain better.

  • @Bolpat
    @Bolpat 2 месяца назад

    4:00 Prime showing us his notebook and starts making jokes about those, when there’s “netbook” (NET-book) written in the article.

  • @thekwoka4707
    @thekwoka4707 2 месяца назад

    Prime: Can learn git in 13 seconds
    Also Prime: nobody knows how to use git

  • @Gunzy83
    @Gunzy83 2 месяца назад

    When I was an arch user btw, I used a niche unified package manager (could do repos and aur all in one) written in Haskell. It was really good but I tried to even read the code and failed. I think this is the only Haskell program I've ever used successfully.
    Also, having taught other engineers at work got internals, I'm with prime on rebase. Rebase is only hated if you don't understand git and know what you are doing.

  • @WayOfTheCode
    @WayOfTheCode 2 месяца назад +1

    India has a worker coop ride hailing app written in haskell backend and purescript frontend.

    • @knowledgedrinker7002
      @knowledgedrinker7002 2 месяца назад +1

      Juspay is in Haskell btw, Hasura too

    • @WayOfTheCode
      @WayOfTheCode 2 месяца назад

      @@samuraijosh1595 india has few multi million user real time applications in Haskell. Search for NammaYatri (ride hailing app launched to protect against Uber Lyft Ola like capitalists). NammaYatri works on ONDC framework of GovOfIndia. There is a globally known GQL toolkit-> Hasura also written in Haskell. There are many smaller (early in utilisation not small in code base) libraries that are part of the tech ecosystem here for some reason especially in web3.

    • @WayOfTheCode
      @WayOfTheCode 2 месяца назад

      @@knowledgedrinker7002 I knew of Hasura but not Juspay but make sense since JusPay is what Monetises NammaYatri.

  • @minecraftermad
    @minecraftermad 2 месяца назад

    32:05 i always think of a monad being a monoid in the family of endofunctors.

  • @bhavyakukkar
    @bhavyakukkar 2 месяца назад

    1:02 small world, today Leah is a Void Linux developer

  • @catcatcatcatcatcatcatcatcatca
    @catcatcatcatcatcatcatcatcatca 2 месяца назад

    This feels very much like my experience with lisp, specifically emacs-lisp. I still haven’t written a useful program or even a package. But I can recount years of progress and shifting understanding of the language, and I have little doubt this would change.
    I actually have spend a good amount of time on configuring how logging tasks is handled. Maybe it is my destiny as well to write a fully fledged worktime logging system that can generate reports for invoices.
    This basic capability of course is already included in org-mode and all emacs releases. But it doesn’t use sqlite, instead it relies on plaintext files like all of org-mode.

  • @mskiptr
    @mskiptr 2 месяца назад

    Prime, you should totally do an Elm stream once. You'll absolutely love it!
    (it's simple, it's elegant and it's kinda dead but not really)

  • @lalakingo7
    @lalakingo7 2 месяца назад

    23:42 Where Prime advises another language to improve the current one. I do alot of small automation tasks for our company which leads to python being the easiest and fastest tool for the job, however this leads to not great programming practices. I then had to do some work in golang for the ease of compiling and when I switched back to python the way I anticipated and handled errors was much more comprehensive.

  • @samgould8567
    @samgould8567 2 месяца назад

    “dictly-typed” is my new metric for programming language selection

  • @Zweimt
    @Zweimt 2 месяца назад

    If you have backward compatible migrations, all you need is copies of the previous code, with merging vs rebase. If you have docker containers of previous builds, it is not necessary to revert the main repository, imo I think commit history > less commit history

  • @petrus4
    @petrus4 2 месяца назад

    I don't claim to know Haskell, but from the source code examples of it that I've seen, I think my proposed mascot for it would be Freddy Kreuger with a lab coat and glasses. "Lovably terrifying" is the phrase that comes to mind. I've watched a few videos from Haskell advocates on RUclips. They seem like genuinely kind and benevolent people, and they always sound bewildered about why everyone else is so afraid of their language.

    • @NiDeCo
      @NiDeCo 2 месяца назад +1

      Yes... yes we are.
      It's like a self-perpetuating joke non-Haskellers tell other non-Haskellers to keep them from ever trying it.
      The biggest issue I've seen that cause people to abort when they DO attempt to learn it, is that they think it's "just another programming language", when you _should_ be expecting to learn programming from scratch.
      I've personally used Haskell in production for over 8 years... and the amount of bugs and frustration I've encountered is less than the 1 year (total) of JS and Python I've had to do on the side. I don't understand how anyone would (for a significant project or product) choose "this is so easy to write (and HORRRRRIBLE to debug and refactor)" over "this takes some effort to write (but it's mostly bugless and refactoring is a breeze)"

  • @litlclutch
    @litlclutch 2 месяца назад

    I'm pretty sure that notebook of his, which looks like a rather nice notebook, has more functionality then a netbook...

  • @jagagemo8141
    @jagagemo8141 2 месяца назад

    We are literally the first team using git at my site. Other teams are doing to now (and better than us, honestly) but most of the old guard there are having to learn this new fangled tech that's like 20 years old.

  • @ilyavasylevsky3229
    @ilyavasylevsky3229 2 месяца назад +2

    Yeap, confirm, exact same with tutorials, I start and after few steps just roing on my own not following tutorial...

  • @noredine
    @noredine 2 месяца назад +2

    MONADS! How do they work?

    • @pauljarski7590
      @pauljarski7590 2 месяца назад +4

      A monad is just a monoid in the category of endofunctors.

    • @yayinternets
      @yayinternets 2 месяца назад +1

      MATHS

  • @Tomyb15
    @Tomyb15 2 месяца назад

    Just try it. It can be as hard and obtuse as you want it to be. It doesn't have to be, but like with any truly functional language, it's gonna be hard to break out of old imperative habits when you start. In fact, I'd say Rust can be harder than haskell sometimes, as Rust imposes this linearity on types globally and you have to wrestle with the compiler across move semantics and lifetime annotations that also seem needless and obtuse (on the surface). But Rust has very good reasons for doing that.
    Also the tooling in haskell can be a bit of a pain to work with, but it's a bit beside the point.

  • @Heater-v1.0.0
    @Heater-v1.0.0 2 месяца назад

    It took about twenty years from me seeing the source code of a Fast Fourier Transform, in BASIC in some computer magazine, to actually understanding how it worked well enough to write my own FFT from scratch. Imagine if I had wanted to write my FFT in Haskell. Complexity multiplies on complexity so it might take me 300 years to do it! I guess that means of have an IQ of about 7. But what can I do.

  • @WHYUNODYLAN
    @WHYUNODYLAN 2 месяца назад

    Prime just needs to learn Haskell already; he's read so much about it that he's probably developed a whole mythos.

  • @notapplicable7292
    @notapplicable7292 2 месяца назад

    When Haskell chads talk about pure fuctions I start wondering if I am infact a functional bro just waiting to be born.

  • @AndrewSayman
    @AndrewSayman 2 месяца назад

    `git rebase -i` is a core part of my workflow. Gotta squash all of those commits that are just "FUCK WHY DOESN'T THIS WORK"

  • @robindeboer7568
    @robindeboer7568 2 месяца назад

    Im pretty sure folder instead of fold R killed me instantly XD

  • @fjodorstjulkins5179
    @fjodorstjulkins5179 2 месяца назад

    "Learn Haskell in 15 years!" sounds like a great Udemy course!

  • @sacredgeometry
    @sacredgeometry 2 месяца назад +2

    8:20 What on earth are you talking about? Undoing a merge is orders of magnitude easier than undoing a rebase.

    • @Reashu
      @Reashu 2 месяца назад

      You don't "undo" a rebase and turn it back into the original commits. You just revert the rebased commit(s), which is trivial.

    • @sacredgeometry
      @sacredgeometry 2 месяца назад

      ​@@Reashu You can undo a rebase by either aborting it if its still in progress or resetting --hard to the correct commit. So either by keeping a record of the hash or looking at the reflog.
      The point was that its a lot easier to get the branch back into a pre merge state than it is to get it into a pre rebase state.
      Reverting just creates a new commit that un does the changes.

    • @Reashu
      @Reashu 2 месяца назад

      @@sacredgeometry yes, and reverting via new commit is the way you should always do it if your code has been shared

    • @sacredgeometry
      @sacredgeometry 2 месяца назад

      @@Reashu Thats true but (and I might be misremembering this) that wasn't the context of this was it?
      He literally says he does rebases on pull using the git pull --rebase command.

    • @Reashu
      @Reashu 2 месяца назад

      @@sacredgeometry yes - you rebase your local changes on top of the shared branch so that when you push you don't include merge commits, which can get messy to revert

  • @drxyd
    @drxyd 2 месяца назад

    I've had to wrestle things into the Elm pattern before, it's such a nightmare having UI and application state mixed.

  • @ahmedkhaled7960
    @ahmedkhaled7960 2 месяца назад +10

    shellcheck is written in Haskell btw

    • @BeneSim
      @BeneSim 2 месяца назад

      Funny, instantly thought about the same when it was mentioned in the video ;) This has been burned into my brain because I needed to compile GHC for armv7l since some nix derivations used writeShellApplication from nixpkgs which uses shellcheck as a linter ... I believe GHC was the longest compile ever for me with Linux, gcc, llvm and the other usual suspects not even getting close to it ...

    • @samtheman1868
      @samtheman1868 2 месяца назад

      Really?

    • @RegrinderAlert
      @RegrinderAlert 2 месяца назад

      Pandoc as well

    • @NostraDavid2
      @NostraDavid2 2 месяца назад

      As is hadolint (Haskell Dockerfile linter)

  • @ktxed
    @ktxed 2 месяца назад

    rebase and conflicts, sounds good alright

  • @VitisCZ
    @VitisCZ 2 месяца назад

    I think the reason why after rewriting falcor you ended up with pretty much the same code is because you solved the exact same issue the exact same way as the person before you

  • @piq-dg3vz
    @piq-dg3vz 2 месяца назад

    haskell mentioned. LFG!

  • @Antagon666
    @Antagon666 2 месяца назад +1

    Compared to prolog, Haskell is the most intuitive programming language on the planet

    • @davidjohnston4240
      @davidjohnston4240 2 месяца назад +1

      That must be why I hate Haskell. I find Prolog straight forward.

  • @Omnifarious0
    @Omnifarious0 2 месяца назад

    Rebase does make sometimes. For example, using it when you `git pull` and someone has changed the branch you're on, it might well make sense, depending.
    But, in general, I absolutely despise it. It destroys history. And reverting is easy enough. You commit the revert change right on top of the change it's reverting, then you merge that into the branch you want reverted.
    Of course, I really hate git as well, and I use Mercurial to interact with almost all repositories.

    • @Tom-jy3in
      @Tom-jy3in Месяц назад

      same, git merge is superior in every way

  • @Aligarde
    @Aligarde 2 месяца назад

    Now I know what a burrito is! Thank you so much! (And thank you for the insights. :3)

  • @Tabu11211
    @Tabu11211 2 месяца назад

    A burrito is a monoid in the category of endofunctors.

  • @eliasmai6170
    @eliasmai6170 2 месяца назад +2

    i know of two people who uses Haskell on their day to day job.

    • @Octogenico
      @Octogenico 2 месяца назад +4

      They're skin walkers

    • @SaiyaDev
      @SaiyaDev 2 месяца назад +1

      Free 🇵🇸🇵🇸

  • @schtauffen-plays
    @schtauffen-plays 2 месяца назад

    rebase for short lived branches. merge for long lived (or shared) branches

  • @macroMindGames
    @macroMindGames 22 дня назад

    haha, 2000 was my last year of college ...i spent two semesters learning haskell in 1997 (spring and repeat in summer:)

  • @NullboyCode
    @NullboyCode 2 месяца назад +1

    bro theprimeagen really needs obsidian or emacs org mode

  • @Tanmaydeshpande-nl5jy
    @Tanmaydeshpande-nl5jy 2 месяца назад

    my eyes go to his shirt before his face

  • @adjbutler
    @adjbutler 2 месяца назад

    only 15 years??? wow!!! this guy is a genius! no cap!

  • @souravchandra
    @souravchandra 2 месяца назад

    There was a open source project called Rome for caching dependencies when you are using Carthage in your Xcode Project. I wanted to fix a small bug in the codebase. I kept staring at the code for 3 months and then I gave up.

  • @ancalagonyt
    @ancalagonyt 2 месяца назад

    The guy in the article did clearly learn something about Haskell after dabbling intermittently for years. But let's not pretend that it took him 15 years of solid effort to learn something about Haskell. He literally just dabbled occasionally, until that one time he tried in a basically serious way and made substantial progress.
    The problem people have when learning Haskell is that they think it's basically the same as any other language. But most of it is different from most other programming languages. If you've never used a functional language, that's a totally different mindset. But even if you have, pure functional is different.
    Haskell isn't really harder than anything else, it's radically different from anything else.

  • @GerinoMorn
    @GerinoMorn 5 дней назад

    28:00 I have such a class. I wrote it 3 times in PRD already, with probably 30 or 300 draft versions . And it's also caching problem. It's still awful.

  • @Jabberwockybird
    @Jabberwockybird 2 месяца назад

    A monad is like a burrito. How is that different from a module?

  • @diamondtulip6186
    @diamondtulip6186 2 месяца назад

    I have never ever used git rebase, merge was always enough. If I want to return to previous commit I just manually copy over newest `.git` subfolder to previous version thus making negative diff not loosing any previous commit.

    • @Tom-jy3in
      @Tom-jy3in Месяц назад

      exactly, whats the problem with just doing git checkout on the previous commit?

  • @mage3690
    @mage3690 2 месяца назад

    To "cotton on" to something is a Southernism from the Mark Twain era. When you're harvesting cotton, it sticks to everything with static electricity, hence the phrase. It means you decided something was/is a good idea, perhaps to an inflated degree.

    • @alexandertownsend5079
      @alexandertownsend5079 2 месяца назад

      So is like saying, "I am warming up to that" or "It's growing on me"?

    • @mage3690
      @mage3690 2 месяца назад

      @@alexandertownsend5079 yeah, but a little more post facto I think. The context I most often hear it in is "he cottoned on real quick," which has an identical meaning to "he caught on real quick" but with a bit more punch or flair.

  • @thaRealShady1
    @thaRealShady1 2 месяца назад

    I never got why people thought Haskell was that hard of a language. It really is not. Sure there are a tons of compiler extensions that make things a bit more complicated but it's the same for other languages (Java!). But the core of the language is actually pretty simple.wybe it's because of how the language is communicated. There is absolutely 0 need to know anything about category theory to understand Haskell.

  • @twoolivetreesarise
    @twoolivetreesarise 2 месяца назад

    Notebook? Usb support? Antiglare? What about battery life? I don't get it... what if I want to transfer my files or share them? How do I stop someone from hacking my notebook? So confused.

  • @tonydejesus3774
    @tonydejesus3774 2 месяца назад

    Work on primarily infra, roll forward is kinda the ONLY option we get =P

    • @yayinternets
      @yayinternets 2 месяца назад

      Mostly on databases, but you can still make it work there if needed with a lot of work.
      If you use something like Terraform and treat infra as code/state machine, life is much better.

  • @evandrofilipe1526
    @evandrofilipe1526 2 месяца назад

    I would be so mad if I wasn't constantly laughing

  • @GrimChu69
    @GrimChu69 2 месяца назад

    As long as you tell them that you know Git it doesn't matter if you know Git, kind of

  • @Elkmor2
    @Elkmor2 2 месяца назад +26

    People still mistakenly associate Haskell with programming languages while in fact it is just a mathematical riddle.

    • @lamspam
      @lamspam 2 месяца назад +2

      I almost think it's meant to serve as a barrier to obtaining a CS degree, just to see if a student can approach a programming problem from a completely different direction, but idk lol

    • @jasonleo
      @jasonleo 2 месяца назад

      😂

  • @drooplug
    @drooplug 2 месяца назад +4

    6:56 I watched. Theo video where he talks about how colleges should be teaching CS students git and how he wouldn't hire an engineer unless they knew how to use it.

  • @TatianaRacheva
    @TatianaRacheva 3 дня назад

    I agree on rebase vs. merge.

  • @andrewdunbar828
    @andrewdunbar828 2 месяца назад

    My favourite movie is "The Netbook".

  • @andrewdunbar828
    @andrewdunbar828 2 месяца назад

    Claims Git can be learned in 13 seconds
    Spends 13 minutes riffing on incomprehensible difficulties in Git

  • @con_sci
    @con_sci 2 месяца назад

    I actually known a guy who got fired largely because he wasn't able to learn git for weeks on the job

  • @cmelgarejo
    @cmelgarejo 2 месяца назад

    Chat never deployed anything to prod, thats why they dont use rebase