Most beautiful programming language feature | Chris Lattner and Lex Fridman

  Рет қаралды 44,075

Lex Clips

Lex Clips

Күн бұрын

Lex Fridman Podcast full episode: • Chris Lattner: The Fut...
Please support this podcast by checking out our sponsors:
- Blinkist: blinkist.com/lex and use code LEX to get a free week of premium
- Neuro: www.getneuro.com and use code LEX to get 15% off
- MasterClass: masterclass.com/lex to get 15% off annual sub
- Cash App: cash.app/ and use code LexPodcast to get $10
PODCAST INFO:
Podcast website: lexfridman.com/podcast
Apple Podcasts: apple.co/2lwqZIr
Spotify: spoti.fi/2nEwCF8
RSS: lexfridman.com/feed/podcast/
Full episodes playlist: • Lex Fridman Podcast
Clips playlist: • Lex Fridman Podcast Clips
CONNECT:
- Subscribe to this KZbin channel
- Twitter: / lexfridman
- LinkedIn: / lexfridman
- Facebook: / lexfridmanpage
- Instagram: / lexfridman
- Medium: / lexfridman
- Support on Patreon: / lexfridman

Пікірлер: 90
@DrBenVincent
@DrBenVincent 3 жыл бұрын
Would love to see one of the authors of Julia language interviewed here
@gabrielmachado5708
@gabrielmachado5708 3 жыл бұрын
That would be amazing. It is my favorite language.
@OGBhyve
@OGBhyve 3 жыл бұрын
In the meantime, check this out. kzbin.info/www/bejne/jJi9nmhppsydb7M
@Dr_KAP
@Dr_KAP 3 жыл бұрын
When your KZbin suggestions feed is full of 5 minute CLIPS of podcasts you’ve already seen- it’s seriously annoying and is just a tool for the channels to pick up more views. They all do it- Rogan etc. I’m going to block the clips channels so I only get the podcasts ! Sorry my rant, first world problems 😂
@reasonerenlightened2456
@reasonerenlightened2456 3 жыл бұрын
Why the programming languages are still not self-aware in the 21-st century !!!! That should really trouble you.
@nieczerwony
@nieczerwony Жыл бұрын
@@reasonerenlightened2456 what troubles me is that in 21st century, less and less ppl are aware of themselfs 😂
@jamesnankervis8029
@jamesnankervis8029 3 жыл бұрын
Algebraic Data Types and exhaustive pattern matching are beautiful language features that enable the creation of high quality libraries. Both of these are fundamental core features of Haskell, OCaml and F#.
@ekremdincel1505
@ekremdincel1505 3 жыл бұрын
Rust has it builtin too.
@hashiromer7668
@hashiromer7668 3 жыл бұрын
Was looking for this comment
@kelbiekelbie909
@kelbiekelbie909 3 жыл бұрын
My favourite features in JavaScript is the spread operator and optional chaining. One of the cool things about JavaScript is that you can use features like these before they are in the specification with tools like Babel, so you can technically add your own language features which I think is really empowering.
@sho3bum
@sho3bum 3 жыл бұрын
I felt the same way with list comprehension and the declarative style of programming which lead me on to a journey to haskell. The fact you can create everything in a declarative style makes it composable and composition is beautiful. Edit : typo
@LofiWurld
@LofiWurld 3 жыл бұрын
Talk about scratch next. The way you can drag block into each other, truly Elegant!
@marna_li
@marna_li 3 жыл бұрын
.NET (and C#) actually did something right when they added the notion of ValueTypes. A variable of type "int" (System.Int32), or even a "bool" value, may be like any other object from a class but they are being passed by value. I started with .NET, and when I went to Java at college, I got instantly confused that you had to constantly wrap primitive types in classes and lose the value semantics. In .NET this is handled for you by the runtime. The methods are always available on value types. Not to forget the type-erasure generics (Java) vs. runtime generics (.NET). In .NET value is an object, albeit with difference semantics for variables based on type.
@gabrielmachado5708
@gabrielmachado5708 3 жыл бұрын
The broadcast operator in Julia is amazing.
@antonios4553
@antonios4553 3 жыл бұрын
excellent clip! programming, from my beginner's eye, is a game unto itself; you called it a bicycle for the mind. In either case, it does need a more collaborative effect for change. How to convince the ruling bodies such as W3C of such proposals. Hmmm
@Daniel_WR_Hart
@Daniel_WR_Hart 10 ай бұрын
First-class functions are an addiction
@comscinerd2070
@comscinerd2070 3 жыл бұрын
0:16 list comprehensions are my favorite things ever!
@rw-xf4cb
@rw-xf4cb 3 жыл бұрын
Yeah bit addictive everything became a list comprehension even when it wasn't the best way - had to detox, then I found map!
@comscinerd2070
@comscinerd2070 3 жыл бұрын
@@rw-xf4cb what's map?
@rw-xf4cb
@rw-xf4cb 3 жыл бұрын
@@comscinerd2070 various languages have map function takes a function and an iterator and calls the function with an item off the iterator. Python map(myfunc, list) will run myfunc with one item off list. Python3 runs as generator so map would have to be consumed with a list(map(myfunc, iterator)) to get the same effect as list comprehension/python2 map. www.w3schools.com/python/ref_func_map.asp
@fred.flintstone4099
@fred.flintstone4099 3 жыл бұрын
I've used list comprehensions in Python, but I just think it made my code less readable, so I prefer to write it just as simple if statements and for loops instead.
@user-jg8lx7ss6u
@user-jg8lx7ss6u Жыл бұрын
Proud to see smart men talking about things that really matter. Great job, guys
@chmoder
@chmoder 3 жыл бұрын
The ROI / cost+benefit part of this is something I hope everyone can appreciate.
@reasonerenlightened2456
@reasonerenlightened2456 3 жыл бұрын
Why the programming languages are still not self-aware in the 21-st century ! That should really trouble you all.
@VijayaGopala
@VijayaGopala Жыл бұрын
It really annoys me when a novel language does not allow me to do ++i%=7; That is such an often-useful expression.
@bennri
@bennri Жыл бұрын
Useful but not readable. Like perl. I've made hundreds of efficient elegant perl scripts that just a week later I could not understand.
@schmetterling4477
@schmetterling4477 Жыл бұрын
But what does it mean? (Yes, I am using C regularly).
@VijayaGopala
@VijayaGopala Жыл бұрын
@@schmetterling4477 Advancing index in a ring buffer to the next item. The buffer size in this case is 7, can be any positive integer.
@isodoublet
@isodoublet 3 жыл бұрын
It's a little silly to say Int is not a built-in type in Swift. The implication seems to be that there are no special types in Swift, so everything is democratic and user-defined types are just as good as the built-ins. But that's silly since _some_ type has to have a special relationship with the compiler since _something_ has to talk to the hardware. In Swift, that's just e.g. Builtin.Int64, so the only reason Int doesn't have a special relatiosnhip with the compiler is because Builtin.Int64 does! To be fair to other languages, you should compare e.g. int in C with Builtin.Int64 in Swift, and you'll find that (apart from the fact that Builtin.Int64 has crummy syntax) they behave almost identically, as they must. What's more, the Builtin module is not really available for regular programs, only the stdlib. So even Int itself is a special type that an ordinary library developer couldn't write!
@simonkotchou9644
@simonkotchou9644 2 жыл бұрын
Functional options in languages like Python and Java are very satisfying to use. I'm glad functools has been basically integrated into newer python versions. The syntax and elegance of streams in java and builtin (map, reduce, filter) in python gets me everytime
@schmetterling4477
@schmetterling4477 Жыл бұрын
Functional languages don't scale. Functional expressions look simple, but they are abstracting your performance and scalability away. If all you have to do is to parse a 10k html page, that's fine, but don't try to do serious work on large data without knowing the structure of your data. The universe will end before your program does.
@Talk378
@Talk378 3 жыл бұрын
Linq in c# is 💯
@Gabagool22
@Gabagool22 3 жыл бұрын
agree
@prafesa
@prafesa 3 жыл бұрын
Yes!
@fred.flintstone4099
@fred.flintstone4099 3 жыл бұрын
I do agree, LINQ is amazing, well I do love the LINQ library, but I hate the built-in SQL-like LINQ into the language. It is really nice with to query data over an abstraction.
@bennri
@bennri Жыл бұрын
Python's long int. How many bits? It's as long as you need. No overflows.
@minionsystems
@minionsystems 3 жыл бұрын
I agree that libraries are important but making the language too extensible destroys readability because you think you know what "+" means but operator overloading can make it very difficult to understand the code you see because + could be redefined to be "-" making the code unreadable - the same is true for compile time macros. The use of int built into the language is less extensible but it allows the compiler to optimize better. Java, for instance, has both int and Integer - one is value and the other is Object. Really valuable for creating libraries are machine independent byte code, garbage collection and built in thread operators since the library can use these features transparently to the application.
@vibovitold
@vibovitold Жыл бұрын
"+" can be redefined to actually be "-". OK. can't an "add" method (function whatever) be redefined to actually "remove" just the same, causing the exact same confusion?
@minionsystems
@minionsystems Жыл бұрын
@@vibovitold Yes, but at least we know it is a function and not part of the language itself. It also makes it easier to insert back-door code. I can redefine + to do a proper add but also add a nearly invisible back-door. I.e. it makes the code more difficult to understand and troubleshoot.
@tobyn123
@tobyn123 3 жыл бұрын
Streams and lambdas make me love Java.
@wyqtor
@wyqtor Жыл бұрын
Kotlin and Scala do them a lot better, also on the JVM.
@user-xm9if5tu2v
@user-xm9if5tu2v 3 ай бұрын
0:59
@thibs0
@thibs0 3 жыл бұрын
Had a 2s hesitation before hitting the like button... because the "likes counter" was saying 256... and didn't want to make it 257 XD
@darkdudironaji
@darkdudironaji Жыл бұрын
Is Python the only language Lex knows? It's the only one I've ever heard him talk about.
@ericpmoss
@ericpmoss Жыл бұрын
I think he knows Lisp to some extent, but he often speaks as though he doesn't really get it.
@darkdudironaji
@darkdudironaji Жыл бұрын
@@ericpmoss Well yeah. Python is one of the easiest languages to get good at and Lisp is one of the hardest. If he only really knows python, that's a huge jump.
@Daniel_WR_Hart
@Daniel_WR_Hart Жыл бұрын
Does he ever specify what dialect of Lisp he uses?
@mattbowden1981
@mattbowden1981 3 жыл бұрын
I like promises in Javascript.
@gabrielmachado5708
@gabrielmachado5708 3 жыл бұрын
I like being able to add attributes dynamically to the objects (but I also hate it, because of the bugs it causes)
@spyroninja
@spyroninja 3 жыл бұрын
RxJS is sweet tho
@reasonerenlightened2456
@reasonerenlightened2456 3 жыл бұрын
Why the programming languages are still not self-aware in the 21-st century !!!! That should really trouble you.
@dylanl9532
@dylanl9532 3 жыл бұрын
swift function labeled parameters shouldn't have order
@chrisE815
@chrisE815 3 жыл бұрын
Did he answer the question?
@JoshBenore
@JoshBenore 3 жыл бұрын
Lex: You are literally creating suffrage in the world. Chris: Its for your own good and I'm totally justified before even considering your comment.
@PerfectlyNormalBeast
@PerfectlyNormalBeast 3 жыл бұрын
Native support for dozenal :)
@manantank
@manantank 3 жыл бұрын
First Class Functions !
@pawelpow
@pawelpow 3 жыл бұрын
Python: [x for x in range(1, 101) if myFunc(x)] Swift: (1…100).filter { myFunc($0) }
@gritcrit4385
@gritcrit4385 3 жыл бұрын
filter myFunc [1..100] guess the language
@kyovak
@kyovak 2 жыл бұрын
@@gritcrit4385 not Haskell
@nicholasroman8071
@nicholasroman8071 Жыл бұрын
You cannot underestimate JavaScript. I love Python. But in combination with typescript JavaScript is extremely elegant.
@Neurochrom
@Neurochrom 3 жыл бұрын
Operator overloading is not an invention of swift
@vegahimsa3057
@vegahimsa3057 3 жыл бұрын
Swift can't for (;;i++) ?
@noon310
@noon310 3 жыл бұрын
It can with while though.
@vegahimsa3057
@vegahimsa3057 3 жыл бұрын
@@noon310 it was the i++ I meant to ask about ... I guess not.
@aedd3307
@aedd3307 3 жыл бұрын
i+=1
@botfantasies6229
@botfantasies6229 3 жыл бұрын
Swift has the most beautiful syntax of the languages.
@ju7409
@ju7409 3 жыл бұрын
this. unfortunately swift is so restricted in use
@fred.flintstone4099
@fred.flintstone4099 3 жыл бұрын
Personally I really like C#.
@botfantasies6229
@botfantasies6229 3 жыл бұрын
@@fred.flintstone4099 I would expect nothing less from Fred Flintstone
@wyqtor
@wyqtor Жыл бұрын
Python and Julia for me. They both feel like writing pseudocode that can magically run. And without stupid OOP forced on you if you don't want it. And without superfluous braces, because we live in the age of linters and coding standards.
@botfantasies6229
@botfantasies6229 Жыл бұрын
@@wyqtor I definitely don't consider curly braces superfluous, they are like the brush strokes of a painting that give the art depth. Python reads like a book to me. Swift reads like code.
@kariabraham2998
@kariabraham2998 3 жыл бұрын
I LOVE CODEEEEEEEEEEEEEE
@alfredomulleretxeberria4239
@alfredomulleretxeberria4239 3 жыл бұрын
Code is a lot of different things, and each coder has their own distinguishing set of coding habits. What exactly do you like about code?
@deerlow1851
@deerlow1851 2 жыл бұрын
@@alfredomulleretxeberria4239 I like it because: According to the theory of everything, existence itself ( the entire universe and beyond) is a complex web of systems and subsystems stemming from a singular, simple rule. E.g, given 0 and 1 and a rule to build from these with iterable and growing complexity, when allowed to iterate infinitely, the complexity also grows infinitely, and such the universe is born. Coding is like harnessing this power of creation for yourself.
@greengoblin9567
@greengoblin9567 3 жыл бұрын
I agree fully. Arrays in c++ produce a lot of bugs
@isodoublet
@isodoublet 3 жыл бұрын
What?
@indycinema
@indycinema 3 жыл бұрын
I bet all that int beauty costs ya in compile time. this is a fine conversation tho.
@gjum42
@gjum42 3 жыл бұрын
Same way object orientation costs you in compile time; but you typically get it back in overall development time (debugging, onboarding), which is usually much more expensive.
@GordeevVladimirV
@GordeevVladimirV 3 жыл бұрын
Costs in run time too
@MrJigarparmar
@MrJigarparmar 3 жыл бұрын
I like function in HTML
@larryseyer
@larryseyer 3 жыл бұрын
i = :)
@sacredgeometry
@sacredgeometry 2 жыл бұрын
8:46 the absence of a c style for loops and the short hand incriminators in swift is annoying. It didn't aid design, not to mention their lacklustre implementation of terrible new design practices/ keywords and paradigms has made a massive mess of the language and thoroughly fucked them over. You can see it in the way the language is evolving. They make rash stupid design choices and then there is a tidal wave of poor choices to firefight the consequences of it. That said I will take it over ObjC any day. It sure as shit looks like its going to be just as bad as that ended up by the end though.
@luigi9064
@luigi9064 3 жыл бұрын
JavaScript is the most beautiful programming language
@jamesnankervis8029
@jamesnankervis8029 3 жыл бұрын
Are you kidding?! How many programming languages have you used?
@luigi9064
@luigi9064 3 жыл бұрын
@@jamesnankervis8029 4
@lawrencedoliveiro9104
@lawrencedoliveiro9104 3 жыл бұрын
But it doesn’t have PICTUREs or ISAM files, like COBOL! Honestly, how can you say your language addresses business needs better than COBOL?
Can Mojo run Python code? | Chris Lattner and Lex Fridman
16:11
Computer Science - Brian Kernighan on successful language design
1:00:06
University of Nottingham
Рет қаралды 307 М.
WHO LAUGHS LAST LAUGHS BEST 😎 #comedy
00:18
HaHaWhat
Рет қаралды 17 МЛН
КАРМАНЧИК 2 СЕЗОН 7 СЕРИЯ ФИНАЛ
21:37
Inter Production
Рет қаралды 525 М.
ИРИНА КАЙРАТОВНА - АЙДАХАР (БЕКА) [MV]
02:51
ГОСТ ENTERTAINMENT
Рет қаралды 14 МЛН
Swift Concurrency Manifesto | Chris Lattner and Lex Fridman
10:59
Will Javascript win? | John Carmack and Lex Fridman
12:39
Lex Clips
Рет қаралды 212 М.
Why i think C++ is better than rust
32:48
ThePrimeTime
Рет қаралды 279 М.
Красиво, но телефон жаль
0:32
Бесполезные Новости
Рет қаралды 122 М.
iPhone 16 с инновационным аккумулятором
0:45
ÉЖИ АКСЁНОВ
Рет қаралды 7 МЛН
WATERPROOF RATED IP-69🌧️#oppo #oppof27pro#oppoindia
0:10
Fivestar Mobile
Рет қаралды 17 МЛН
OZON РАЗБИЛИ 3 КОМПЬЮТЕРА
0:57
Кинг Комп Shorts
Рет қаралды 1,3 МЛН
تجربة أغرب توصيلة شحن ضد القطع تماما
0:56
صدام العزي
Рет қаралды 12 МЛН