Тёмный
No video :(

I programmed in TypeScript like in Haskell (Lazy Evaluation) 

Tsoding
Подписаться 31 тыс.
Просмотров 51 тыс.
50% 1

Hey!
In today's video I tried to explain Lazy Evaluation using TypeScript for all of the examples instead of Haskell. TypeScript is a superset of JavaScript which adds static typing on top of it. The combination of functional background of JavaScript and the strong static typing makes TypeScript a perfect environment for exploration of Haskell concepts but with a more familiar for mainstream developers programming language.
Hope you will find this explanation approach useful!
Links:
- Source Code: github.com/tso...
- Deno: github.com/den...
- The Computerphile Video: • Infinite Data Structur...
- Similar Video of Mine: • Haskell for JavaScript...
- Patreon: / tsoding
- Twitch: / tsoding

Опубликовано:

 

26 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 155   
@valcron-1000
@valcron-1000 4 года назад
Please bring HaskellRank back! I was a really cool series
@kid-vf4lu
@kid-vf4lu 4 года назад
+1 HaskellRank is why I started.following this channel
@dimitrimitropoulos
@dimitrimitropoulos 4 года назад
@@kid-vf4lu same
@nirgle
@nirgle 4 года назад
A great demonstration of the sheer power of vim
@UODZU-P
@UODZU-P 4 года назад
I was honestly not prepared for this level of memery
@NikolajLepka
@NikolajLepka 4 года назад
It's funny, Idris -- which is in large parts based on Haskell -- forewent lazy evaluation in part because it made it unclear whether lists were infinite or not. Instead, it marks infinite and lazy types explicitly, while still allowing for Haskell's nice parenthesis-free calling semantics.
@LambOfDemyelination
@LambOfDemyelination 4 года назад
3:17 kinda cucumbersome
@Skeptyle
@Skeptyle 4 года назад
lmfao
@DevinRhode2
@DevinRhode2 4 года назад
Greatest thing I've seen in like 20 days of funemployed researching
@CodeWeaver
@CodeWeaver 4 года назад
Minor quibble, but this needed more commentary about memoization. Repeated evaluations of a lazy value in these examples would result in re-evaluation of the computation. In Haskell, this doesn't happen, because the first attempt to evaluate it locks in the evaluated value for all future calls -- even if you share that lazy value out _before_ you force it -- ie, all references to the shared value share the forcing. It won't ultimately remove the dangers of 'thunk buildup' like you had with begin() in the range function, but it often can remove the situations in which it's a problem, and the inefficiencies in _not_ having memoization can put a damper on using this useful style. It may not be the main thing you wanted to talk about, but with the comparisons with Haskell, this is a nontrivial difference. (And one that _could_ probably be authored in TypeScript). Otherwise you're not _quite_ getting 'the full Haskell experience'. That said, this was a pretty nice talk!
@Tsoding
@Tsoding 4 года назад
Yeah, I forgot to cover memoization, thanks for bringing it up! This "talks" are semi-improvised and sometimes I may completely forget to mention something. :D I'll keep working on improving the quality.
@dupersuper1000
@dupersuper1000 4 года назад
Also, for silly reasons related to JS runtime implementation, it might be worth looking into a “trampoline” function or other techniques for stack-safe recursion.
@halfsourlizard9319
@halfsourlizard9319 15 дней назад
1:11:30 Yesssss, I was *hoping* that the punchline was going to be Sieve of Eratosthenes ... Such a classic / nice example ... So satisfying!
@lclutz
@lclutz 4 года назад
Great video tzozin. You're making the most interesting technology related content on the internet right now imo. Keep it up 😘
@xetera
@xetera 4 года назад
I wish this video and the json parser one was edited down to like 10-20 minutes so I could show other people without asking them to watch an hour and a half video :(
@driden1987
@driden1987 4 года назад
Xetera been there!
@MaxPicAxe
@MaxPicAxe 4 года назад
Edit it yourself then xD
@mksybr
@mksybr 4 года назад
As well as MaxPicAxe's suggestion the code is relased under MIT, so you should be welcome to create a shorter video demonstrating (IANAL)
@fabiolirafilho
@fabiolirafilho 4 года назад
this is why I love computer science. thanks for this university level class, tsogod.
@draakisback
@draakisback 4 года назад
Very nice video. As RU-vidr and educator myself I can appreciate how you've done all of this.
@halfsourlizard9319
@halfsourlizard9319 15 дней назад
54:00 Re: Haskell fanatics: You're absolutely right. Trying to 'debug' performance problems in a lazy language is mind-bendingly difficult -- anything that you do to investigate, while it won't change input -> output mapping, *may* change what gets evaluated and when. If you want to checkmate a Haskell fanatic's 'silver-bullet' arguments, ask them why `seq` exists.
@pavl1to
@pavl1to 4 года назад
Русский акцент ни с чем не спутаешь)) Спасибо за видео.
@BHy4OK
@BHy4OK 4 года назад
но надо признать он неплохо старается
@vivinvivin3020
@vivinvivin3020 4 года назад
Я уверенно говорю по-английски. Неправильно, но уверенно. " Мне бы так 😪
@halfsourlizard9319
@halfsourlizard9319 15 дней назад
So, this is really call-by-name, rather than lazy evaluation -- things are evaluated only when needed ... but may be evaluated repeatedly. Also, your intuition that thunks are not used to implement this is generally right; traditionally, graph reduction has been used ... afaik, modern GHC uses some more-sophisticated abstract machine (It was STG at some point, but I'm not sure what's being used now.).
@gunncode
@gunncode 4 года назад
Liked instantly for using deno.
@fasogoss
@fasogoss 2 года назад
I wish there was an alternate universe where tsoding was by Dad and I will sit by his side and learn programming hahaha. Love your videos Dad
@HeatCrawler
@HeatCrawler 4 года назад
Amazing! Also, I would recommend some if/else clean up, the code will look more impressive. You don't need an "else" if the function returns. A lot of indentation will change, the source code will be more readable. But I love it! Thank You!
@pictureus
@pictureus 4 года назад
The method that called panic was unwrap which if None in Rust will panic. The developer haven't taken care of the outcome None. Cool video btw :)
@VulcanOnWheels
@VulcanOnWheels 4 года назад
3:17 Am I the only one who hears "cucumbersome" at this point?
@mvmo4744
@mvmo4744 4 года назад
Nice, now i do have a new video for my next few toilet visits, thanks xD
@zcizzorhandz5567
@zcizzorhandz5567 3 месяца назад
"I programmed in TypeScript like in Haskell (Lazy Evaluation)" == *I skated on my skateboard like a Lamborghini (Acceleration)*
@anthonytonev1357
@anthonytonev1357 3 года назад
tsodin, TS - typescrypt, Oding - god of wisdom. Tsoding - God coding, God of coding confirmed.
@insertoyouroemail
@insertoyouroemail 4 года назад
It would be cool to have keywords effect/do what are to () => a what async/await is to Promise
@zamfofex
@zamfofex 4 года назад
This is called “you just invented monads”.
@insertoyouroemail
@insertoyouroemail 4 года назад
@@zamfofex I'm a professional Haskell programmer. I like to think of this proposal as prometheus stealing fire from the gods (Haskell programmers) and giving it to mortals (javascript programmers). Please forgive any hubris on my part. ;)
@zamfofex
@zamfofex 4 года назад
@@insertoyouroemail I see, that’s fair enough. But I feel like what would be actually interesting would be some way to not have to annotate monadic operations in JavaScript - to have them be entirely transparent. Or even to _indeed_ annotate them, but have the notation be agnostic to which kind of monad it is (as opposed to introducing a different notation for each kind of monad). If you want a way to annotate specifically “creating a function without arguments”, and “invoking a function without arguments”, then there is really no need to reinvent the wheel with new keywords, you can just use existing notation: “() => expr” and “expr()”.
@insertoyouroemail
@insertoyouroemail 4 года назад
@@zamfofex This is called "you just invented do-notation" ;)
@dupersuper1000
@dupersuper1000 4 года назад
Zambonifofex that would be awesome to have. But unfortunately, the JS runtime does not track different kinds of monads, except for the built-in ‘Promise’ type. But even ‘Promise' fails to adhere to monad laws. When you resolve a ‘Promise’ it will automatically un-nest itself, and give you the type ‘T’, when it should just give you the inner promise. This also has the effect of swallowing errors if you don’t explicitly chain the ‘catch’ method for the inner promise.
@Tsoding
@Tsoding 4 года назад
Keep in mind that all of the code was written using Deno v0.31.0. Things may change in the future versions and the code may stop working. For the latest version of the code examples please visit: github.com/tsoding/lazy If something doesn't work in the latest examples feel free to report an issue or submit a Pull Request.
@3266711732665514
@3266711732665514 2 года назад
hung, you are a great human!
@angrykillerpigeons
@angrykillerpigeons 3 года назад
in js you can use spread operator to call the rest on an array let [head, ...tail] = [1,2,3,4,5] head = 1 tail = [2,3,4,5]
@omaramo190683
@omaramo190683 2 года назад
still my fav video
@andrepadez
@andrepadez 2 года назад
I love this, you just gained another subscriber! thanks
@user-dc3zl4ps9s
@user-dc3zl4ps9s 2 года назад
In short-circuit evaluation. We can do just a() && b()
@efzet76
@efzet76 Год назад
This is fun to watch, eventho it hurts my brain ! :P
@halfsourlizard9319
@halfsourlizard9319 15 дней назад
Why do people who come from Java / OO use `T` as the first type parameter? In functional languages (Haskell, SML, etc.) we start with `A` ... which seems like the obvious place to start.
@lucascyrne
@lucascyrne 4 года назад
Can you make a serie of videos where you make haskell rank challenges without any built in function? only pure functional and haskell concepts like pattern matching or list comprehension? Thanks for your content, it's amazing! (:
@gregfletcher2360
@gregfletcher2360 4 года назад
Great video! I hope that you do some more fp in Typescript again!
@jailandrademx
@jailandrademx 4 года назад
thanks for upload this video, I miss the streaming that day :(
@BradenBest
@BradenBest 2 года назад
I'm confused why one would bother with taking a slice of an infinite lazy list as opposed to just... calling a function. If lazy values essentially are functions, why even make the distinction? You could just make a structure {start, length, fn} that when parsed will generate your list {1, 10, n => n * n} -> [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
@CarterColeisInfamous
@CarterColeisInfamous Год назад
37:54 array destruction
@alexanderskladovski
@alexanderskladovski 3 года назад
32:30 turing complete type system
@plchldrr
@plchldrr 2 года назад
1. Sincerely thank you for showing me how deno works and how great it is 2. -Ternary operator ?: shortcircuits too-
@hansschenker
@hansschenker 3 года назад
RxJs - Reactive Extensions for Javascript, also have lazy behavior baked in - Would you show some example in RxJs too? In Novosibirsk people have much time to reason about programming concepts!^_^!
@ceorecdeclec9774
@ceorecdeclec9774 4 года назад
47:42 I had the same problem. The stack can overflow if you store too many values because it isn't about how many levels deep, its about each of those levels adding to the stack, or in this case, one big level adding to the stack
@MonkeeSage
@MonkeeSage 4 года назад
Also begin() was not a tail call since 1 was being added to it, so even if deno supports tail call optimization it wouldn't have worked.
@snoopy8870
@snoopy8870 2 месяца назад
can you do same thing with js doc?
@valenciawalker6498
@valenciawalker6498 Месяц назад
Thank youu
@old_gaffer
@old_gaffer 3 года назад
I don't think you need to make return type Lazy - only arguments should suffice. Was there a specific reason you chose to wrap all return statements in lambdas as well - that seemed redundant? (This is in reference to lazySum and lazyFirst)
@old_gaffer
@old_gaffer 3 года назад
Never mind - at 1:02:38 I finally figured that you were trying to make the "ultimate Haskell experience" and not merely show the benefits of lazy evaluation.
@stephenkamenar
@stephenkamenar 4 года назад
1:18:04 javascript nor typescript even use semicolons, lol. (that said there's very rare edge cases where you could need one)
@LambOfDemyelination
@LambOfDemyelination 4 года назад
But you should include them.
@ireneuszgabrys
@ireneuszgabrys 4 года назад
​@@LambOfDemyelination not rly. You have to put one as first character if your line starts with bracket. Or If you want to have code from two lines written in single line then you will separate them with semicolon. That's it. I never use semicolons in personal projects. And if you uglify code then semicolons will be added automatically anyway to satisfy second case I mentioned above. I personally found it strange that JS world put semicolons because they think they are needed and Python world don't do it but they could just like in JS for the same reasons like having two things in single line. Try for yourself :) You can for example use code formatter prettier. Set options for semicolons and then for no semicolons. See the difference and you will see how not mandatory they are. It's perfectly safe.
@LambOfDemyelination
@LambOfDemyelination 4 года назад
@@ireneuszgabrys Standardised JavaScript requires semicolons. Some JavaScript interpreters will insert semicolons in for you, like V8... It's called ASI (Automatic Semicolon Insertion). It wouldn't exist if semicolons weren't part of the language. You can end up with some really ugly looking situations/errors if you don't use semicolons.
@ireneuszgabrys
@ireneuszgabrys 4 года назад
​@@LambOfDemyelination I know about ASI so I don't understand why I have to do something by hand that was deliberately automated. Those tools: Babel, Uglify, Prettier, TypeScript and more (basically all that parse code to AST) will add semicolons as well. My question remains: why do it manually? Errors that the JS community is scarred of are because of not knowing the first case I was talking about.
@dupersuper1000
@dupersuper1000 4 года назад
Farzher I don’t think anyone else in the comments has mentioned this, but ‘return’ statements should always include semicolons, and the expression to the right of the ‘return’ keyword should always be wrapped in parentheses when it it extends to multiple lines in the file. Both of these rules will prevent some weird edge case behaviors.
@HeatCrawler
@HeatCrawler 4 года назад
Everything will work great with the compose implementation in JS.
@telnobynoyator_6183
@telnobynoyator_6183 4 года назад
"If it compiles it works" is not the point of rust. If it compiles, it's guaranteed to be memory safe, except if you explicitly tell it to ignore memory safety checks. Of course having your program guaranteed not to segfault will probably force you to write better code.
@Muttisuri
@Muttisuri 4 года назад
Following the code with deno I was systematically getting an "Object is possibly 'null'" error on the LazyList part... Edit 0: It seems that when I let the autocomplete use Optional Chaining it does work...
@Tsoding
@Tsoding 4 года назад
What version of deno are you using?
@Muttisuri
@Muttisuri 4 года назад
@@Tsoding Deno: 0.36.0 v8: 8.1.310 ts: 3.8.3 Vscode: 1.43.1 PS: I'm on windows but I'm using WSL (shouldn't affect something like this) PS2: I'm surprised I got a direct response :)
@Tsoding
@Tsoding 4 года назад
@@Muttisuri Yep! I can reproduce the problem on Deno v0.36.0. The error caused by the strict null check that was not present in v0.31.0 at the time of the video recording. This is how you fix it: github.com/tsoding/lazy/commit/66ee9d29184d2681f802730c6a635a95b4f1d791 Thanks for letting me know about the problem!
@aibh7903
@aibh7903 4 года назад
Have you ever considered using ReasonML?
@dupersuper1000
@dupersuper1000 4 года назад
Aibhstín indeed, Reason is basically TS on steroids. And there is the (still technically under construction) Relude library which implements Haskell-like type-classes. It’s quite the powerful language...
@fredow123456
@fredow123456 4 года назад
very interesting! thank you. btw you should use undefined type instead of null in Typescript i think!
@dupersuper1000
@dupersuper1000 4 года назад
Wodman It’s really a serious debate whether you should use undefined or null for expressing different kinds of “nothing.” In practical terms, either one will suffice most of the time, but the main issue is consistency. Both types are heavily overloaded with other concepts in the ecosystem. E.g. “null” is often used to mean “unset value,” “missing value,” “error in computation,” “stream ended,” and a whole host of other context-dependent ideas. “undefined” has a similar set of overloaded meanings, but tends to connote the idea that the “nothingness” is unintentional. As in, accessing an undefined property on an object means that the property was never intended to exist. It just depends on your paradigm, and the libraries and frameworks you use, as well as the conventions of your team.
@Gruak7
@Gruak7 2 года назад
This whole video should be wrapped in a function
@ishdx9374
@ishdx9374 3 года назад
TSoding
@sefirotsama
@sefirotsama 3 года назад
that was awesome.
@user-hd7ju4wu4b
@user-hd7ju4wu4b 2 года назад
Ай маст сэй ай рили энджой йё контент
@user-rf3zi7pt8r
@user-rf3zi7pt8r 4 года назад
Блин, красавчик - шикарный английский.
@dewijones92
@dewijones92 4 года назад
thanks for this
@halfsourlizard9319
@halfsourlizard9319 15 дней назад
42:30 It's almost unreasonable how many good ideas there have been in functional languages that have been 'soaked up' by normie languages ... Wonder if dysfunctional (?) / nonfunctional (?) people will ever 'do the induction' and realise that we ought to replace all of the derpy OO / procedural languages with functional ones ...
@halfsourlizard9319
@halfsourlizard9319 15 дней назад
The largest benefit of functional languages is equational reasoning / referential transparency. You can't 'soak [that] up' incrementally; it's a fundamental property of purity that cannot be added to a language with effects.
@kerron68
@kerron68 2 года назад
1:01:49 how dare you bash my cult!
@bonchonmaru
@bonchonmaru 11 месяцев назад
I'm 3 years late to the party, but this was a great video! I'm just not sure how to apply what I just learned. What advantage does this give over traditional approaches (like using loops)? I can see that it has the potential to be more memory efficient since we're not storing an entire datastructure in memory. What other benefits are there and would you ever use this pattern in more procedural languages?
@martinalcala4823
@martinalcala4823 4 года назад
Generators inJavaScript are perfect for lazy evaluation
@dulanjala
@dulanjala 4 года назад
I think you ran demo on top of itself or something make it crash like that... and i thought in rust unwrap is when you want it to crash and burn since something is really wrong. but here i think it was Options args that made it crash, strange... they didn't handle it "gracefully"
@Baptistetriple0
@Baptistetriple0 2 года назад
very interesting video, but I wonder why your chat shit on every language other than haskell, like the the rust error at the beggining, it is a voluntarry error from the devs (you can see it because the unwrap method is being called on a result type, which means "if this is an error just crash the program"), and yes javascript has it flaws but I don't think programming complex web applications UI is better in haskell
@DanDart
@DanDart 4 года назад
"It is not a tarball" - tsoding
@koalabear9967
@koalabear9967 4 года назад
"I don't understand why you need all these shell scripts". Javascript developers man, javascript developers. npm install pad-left. They're not terribly sane.
@dupersuper1000
@dupersuper1000 4 года назад
Koala Bear indeed, it’s Stockholm syndrome. And nobody realizes it.
@devincustodio2258
@devincustodio2258 2 года назад
cucumbersome
@andrasnadas9818
@andrasnadas9818 3 года назад
1:21:55 You just got a bigger prime number by typing some random digits, than the one You wanted to test... xD
@halfsourlizard9319
@halfsourlizard9319 15 дней назад
17:20 Wait ... are there still people who believe that static typing isn't the obvious / only choice!?
@toxicdesire8811
@toxicdesire8811 4 года назад
51:44 will be back later.
@kawaikaede2269
@kawaikaede2269 2 года назад
comfy
@omri9325
@omri9325 4 года назад
Isn't lazy of lazy is same as regular lazy? Like in typescript notation: Lazy is same as Lazy ?
@lostarts9946
@lostarts9946 4 года назад
Lazy would type to () => () => number
@omri9325
@omri9325 4 года назад
@@lostarts9946 I meant to ask if `Lazy` should automatically (implicitly?) flatten itself to `Lazy` like show promises do it. It saves a lot of annoying errors. like how `Promise.resolve(Promise.resolve('value'))` is same as `Promise.resolve('value')` I'm not that sharp on the terminology, but I think it's called monadic flatmap.
@dupersuper1000
@dupersuper1000 4 года назад
Lordious it should never automatically unwrap the inner ‘Lazy’ type. The flatmap function should be called explicitly if that behavior is desired. The behavior of ‘Promise’ is a big problem IMO. And I’m not the only one who thinks so. Just look at this heated debate from year ago: github.com/promises-aplus/promises-spec/issues/94
@geektarded
@geektarded 4 года назад
If your goal is to write unreadable / unmaintainable code, then you have accomplished that. Why do functional programmers abstract / genericize their code so much that the specifics of what a function is actually doing is lost. It is like abstracting all of your code to Func. This is code only a mathematician would love...and code that every application developer would hate. Some people are too smart for their own good.
@dupersuper1000
@dupersuper1000 4 года назад
Geektarded I completely disagree. This is very understandable for anyone who is well-versed in functional programming. That the same critique could be made of other styles, like using inheritance in OOP. Why would you want to call a method that isn’t defined directly on the object you are using? Why use such a crazy indirection? Now I have to go look in a separate file to see what the function does, and god forbid it’s actually some overridden method from another parent class... You see, people write code that seems complex until you get used to the patterns. The nice thing about the functional style is that you can be sure that the type signature tells you most of what you need to know about a function, because the function is not allowed to perform side-effects. All it can do is compute the return type from the input types. The function’s name should tell you the rest of what you need to know about it. So if you know the types, you’re good.
@samuraijosh1595
@samuraijosh1595 Год назад
when you work with those abstracted functions over and over knowng how they work under the hood, you'll embrace them as much as you embrace your print function in python.
@geektarded
@geektarded Год назад
@@samuraijosh1595 C# developer here so we have many (not all) of the good parts of functional programming available to us thanks to Erik Meijer.
@user-zt1hx3ci2v
@user-zt1hx3ci2v 6 месяцев назад
Я знаю, братик, только на стримы не ходил =)
@feihcsim7045
@feihcsim7045 4 года назад
Anyone else want to just hug Alexey?
@MaxPicAxe
@MaxPicAxe 4 года назад
Instant like, for using duck duck go
@Someniatko
@Someniatko 4 года назад
your voice sounds like Life of Boris
@ne4to777
@ne4to777 2 года назад
Хорошая попытка, но на 91к сито уходит в переполнение стека. Мои соболезнования. Надеюсь, когда-нибудь оно станет по настоящему бесконечным
@sefirotsama
@sefirotsama 3 года назад
"A SINGLE EXECUTBLE! WHY NODEJS IS NOT LIKE THAT?"
@dimitrimitropoulos
@dimitrimitropoulos 4 года назад
You should check out ramda.js
@MrSjcris
@MrSjcris 4 года назад
deno it's not node JS !
@UODZU-P
@UODZU-P 4 года назад
when you want to put lambda calculus into javascript
@MuslihAlAqqad
@MuslihAlAqqad 3 года назад
Hi Tsoding, would you mind to share how to be a great coder like you? :smile:
@it1shka
@it1shka 4 года назад
you speak with strong soviet accent comrade
@ishdx9374
@ishdx9374 3 года назад
because he is, check his github or literally anything
@joseoliveira8423
@joseoliveira8423 3 года назад
Hey man! You are a GOD! I want to recommend you fp-ts. This is an awesome library for FP. I would love to see some content from you using this library. github.com/gcanti/fp-ts
@mateusfccp
@mateusfccp 4 года назад
The error happened because someone used unwrap. Like, why use Rust if you are going to unsafely unwrap the Options?
@smolus0512
@smolus0512 4 года назад
5:30 Dude you can literally do the same with node. Its just the second link on downloads page and not the first one xd
@old_gaffer
@old_gaffer 3 года назад
No, you can't. NodeJS doesn't ship as single executable.
@smolus0512
@smolus0512 3 года назад
@@old_gaffer Yes it does. You choose "binary" option in the downloads section and you get a folder with a standalone node.exe inside.
@old_gaffer
@old_gaffer 3 года назад
@@smolus0512 and node_modules and install_tools.bat and node_etw_provider.man and nodevars.bat and npm.cmd and npx and npx.cmd,etc... That can hardly be called "standalone".
@smolus0512
@smolus0512 3 года назад
@@old_gaffer It comes with extra stuff in the folder but you can just delete it if you dont want it. The node.exe file works standalone
@old_gaffer
@old_gaffer 3 года назад
@@smolus0512 Sure, but I think he was referring to why NodeJS can’t have a single executable with batteries included - the same way Deno does. If you watch here ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-HjdJzNoT_qg.html you’ll see that in that single binary you get everything: runtime, package manager, dependency inspector, etc… in one word: everything and it's truly standalone (single file).
@mateusvahl5072
@mateusvahl5072 4 года назад
this is not a silver bullet
@unev
@unev Год назад
let's hang out
@unev
@unev Год назад
or in?
@unev
@unev Год назад
just hang on
@TodorescuProgramming
@TodorescuProgramming 4 года назад
most of this can be done with js (es6) , without the types
@vivinvivin3020
@vivinvivin3020 4 года назад
"Types help you to find mistakes"
@dupersuper1000
@dupersuper1000 4 года назад
Tudor Todorescu I prefer to write the type signature of my function first, since I generally know what it is supposed to do before I implement it. The type signature helps me implement it correctly 90% of the time. The other 10% can be verified with tests.
@robertotomas
@robertotomas 4 года назад
Deno has too much crap packed into it. That’s something that is going to change they’re going to first add more and later take away. And that in a nutshell is why.
@dupersuper1000
@dupersuper1000 4 года назад
Roberto Tomás it’s easy to *say* they will take stuff away, but once a bunch of big companies have dependencies on those features, they will never take them out. Maybe they will deprecate them.
@johnnyphoney5669
@johnnyphoney5669 4 года назад
1:11:25 Yes, because you should say "what is it called", not "how is it called", of course unless you forget how to use your mouth to make a sequence of sounds which many people would interpret as that word you're trying to pronounce.
@dupersuper1000
@dupersuper1000 4 года назад
Mr. UncleChu Both methods are fine... In many languages, the word used is the equivalent of “how” in English. In others, they use the equivalent of “what.” If you think about it, both of those English words make sense, because “what to say” and “how to say it” are extremely similar concepts, if not identical. The heart of the idea could be expressed as, “I have a concept in my mind which can be expressed in language, but I’m not sure about the proper way to express it in words.” I find that people who primarily speak Spanish, French, or other Latin-based languages also tend to say “how it is called,” “how you say,” “how they say,” etc.
Далее
Haskell for JavaScript programmers
16:51
Просмотров 57 тыс.
Secret Haskell Composition Technique
26:44
Просмотров 23 тыс.
Х.евая доставка 😂
00:23
Просмотров 1,3 млн
Top 10 Types of Software Developers
20:39
Просмотров 704 тыс.
Programming w/o Language
1:47:00
Просмотров 47 тыс.
The Most Legendary Programmers Of All Time
11:49
Просмотров 551 тыс.
TypeScript Origins: The Documentary
1:21:36
Просмотров 284 тыс.
Why Linux Has This Syscall?!
2:05:25
Просмотров 50 тыс.
Switching to TypeScript
2:32:06
Просмотров 18 тыс.
as const: the most underrated TypeScript feature
5:38
Просмотров 116 тыс.
It's time for change, it's time for Linux.
10:53
Просмотров 211 тыс.