text
stringlengths
0
1.62k
[1974.16 --> 1980.80] from that is that the v8 team took the typescript compiler and put it into their test suite so it wasn't
[1980.80 --> 1986.56] just ie now you have uh google chrome getting all the performance benefits from those patterns
[1986.56 --> 1993.08] hmm well that's interesting for sure beyond type annotations obviously that's your that's your flagstone
[1993.08 --> 1997.76] feature there uh you know the name typescript it's all about type annotations are there any other
[1997.76 --> 2005.76] big features that typescript adds to javascript um that are that are nice to have i i think i i would
[2005.76 --> 2012.00] sum it up as we do two things one is types and all of the great tooling and correctness proving that
[2012.00 --> 2018.48] that comes from that and the other is delivering features from the future today basically giving you
[2018.48 --> 2025.20] the ability to run down level or compile to down level right um i mean we started out with with with
[2025.20 --> 2030.40] delivering a bunch of es6 features but allowing you to compile them down level to es5 and es3
[2030.40 --> 2038.24] uh like like classes and arrow functions and so forth right and and now of course now ecma script
[2038.24 --> 2045.12] itself is catching up uh and es6 is almost ratified it's going to happen in in a month or two and and we
[2045.12 --> 2051.04] are catching up also in that we now support pretty much the full es6 language but now we're also
[2051.04 --> 2056.72] delivering features from the future again because we're we're starting to spike uh implementations of
[2056.72 --> 2063.28] decorators um and async await and some of the other features that are being considered for ecma script
[2063.28 --> 2070.88] seven and it's really sort of a repeat n plus one here uh of the same of the same phenomenon right because
[2070.88 --> 2078.64] the truth is that that even as even when ecma and a version of ecma script gets ratified it takes years
[2078.64 --> 2087.52] for that to actually permeate throughout the javascript ecosystem in some places it permeates
[2087.52 --> 2092.56] quickly like on the server where you can where you can arrange your own execution environment just
[2092.56 --> 2098.64] by installing a new version of node or or whatever right then you can pretty rapidly adopt but in the
[2098.64 --> 2104.96] browser i mean you don't really have control of that and it takes three four years before you can i mean
[2104.96 --> 2112.96] even today you can't necessarily say that you require ecma script five right i mean and we certainly
[2112.96 --> 2119.20] i mean it's getting truer and truer right but but look at when did ecma script five come out right i mean
[2119.20 --> 2125.76] that we're talking about what is it what is it in 2009 right i mean i think that silver just had their
[2125.76 --> 2133.44] vote for ie support like a week or two ago to whether they should remove early versions of i so that is
[2133.44 --> 2136.96] that's still a little conversation that the long-term support guys are still having
[2137.84 --> 2143.44] so so the reality probably is that it's going to be somewhere between three and five years before you
[2143.44 --> 2152.88] can assume ecma script six and that means until then you're going to need a transpiler or a down
[2152.88 --> 2159.36] leveler right and typescript delivers both in one and that's a that's a pretty compelling combination
[2159.36 --> 2166.56] i mean both that and the types right how do you guys decide on which features are going to go in
[2166.56 --> 2172.16] these early features so let's talk you know es uh seven which you know they're just now figuring some
[2172.16 --> 2176.64] things out some are probably going to go in some aren't you know i'm just looking at a compatibility
[2176.64 --> 2181.12] table there's some features i've never even heard of reflect reflect dot realm apparently that's a
[2181.12 --> 2187.36] proposed feature for es7 how do you decide when stuff goes in because you get in a situation where
[2187.36 --> 2191.36] all of a sudden you add let's say you add support for reflect dot realm and don't ask me what that
[2191.36 --> 2195.44] means but let's say you guys add that to typescript and then none of the you know it doesn't get
[2195.44 --> 2200.24] ratified or none of the browsers actually are ever going to support it do you guys pull it do you just
[2200.24 --> 2204.96] wait until you're sure something's going to go in how do you deal with that yeah so so first of all
[2204.96 --> 2210.08] i think reflect dot realm is is actually probably uh a runtime library feature so so that one
[2210.64 --> 2216.32] isn't isn't that hard and the runtime library features generally speaking you can just polyfill and it's
[2216.32 --> 2222.48] it's it's it's it's a pretty established uh sort of scheme for how you how you deal with that um
[2223.52 --> 2228.96] other features like modules for example modules were late to land in es6 you could argue that they
[2228.96 --> 2235.28] haven't fully landed yet either because the standard doesn't actually include a spec for a module loader
[2235.28 --> 2241.84] and and which ultimately means you know you're going to be dependent on someone externally to provide
[2241.84 --> 2249.84] that loader and then now now with with those well sometimes we have to guess right i mean in typescript
[2249.84 --> 2256.16] when we we realized early on that hey we're going to need some sort of module system one of the biggest
[2256.16 --> 2262.32] problems of javascript is the lack of modular compilation one of the things that was powering node.js
[2262.32 --> 2269.20] was you know the common js modules and and require js in the browser and amd modules and was sort of
[2269.20 --> 2274.00] becoming the norm for large-scale javascript application development which is where we wanted
[2274.00 --> 2281.20] to go so we had to have modules so we had to sort of do a best best guess effort of where modules were
[2281.20 --> 2287.44] going to go and try to make try to make our syntactic footprint as small as possible and then just go with
[2287.44 --> 2293.12] it and then let it ride out and that's what we did and then it turns out we we shot pretty close to the
[2293.12 --> 2300.16] target um but it's not just but it didn't land uh because those the current proposal didn't even
[2300.16 --> 2306.64] exist at the time um so now we've aligned and it turns out that we can support both and we can just
[2306.64 --> 2312.08] you know i mean we're not going to take stuff away i mean i've always i've always been a big believer in
[2312.64 --> 2316.72] backwards compatibility if you look at all all of my work and all the languages i've worked on they've
[2316.72 --> 2324.24] pretty much always been backwards compatible because if you if you give up backwards compatibility you
[2324.24 --> 2328.64] also give up your community and now the community can go shop around and maybe they'll come with you
[2328.64 --> 2333.60] or maybe they won't you know but listen you've got to be you've got to bring them along and honestly
[2333.60 --> 2338.96] it's the responsible thing to do too people have a huge investment in their in their code and so
[2339.84 --> 2344.64] so we're going to continue support what we what we previously supported but then we're also
[2344.64 --> 2350.40] supporting ecma script 6 modules and we expect people to migrate to that uh fully you know over
[2350.40 --> 2356.24] time but uh so so it's it's doable you end up with a little bit of baggage and you can you can park it
[2356.24 --> 2361.44] under a compiler switch or something you know and it's it's it's fun it's it's it was the right thing to
[2361.44 --> 2366.88] do i think but we are definitely committed to tracking the standards i i should say that
[2368.00 --> 2373.68] and and you can certainly see that in our work too even when you disagree with them yeah oh yeah
[2374.64 --> 2380.00] hey some of the things in the module system uh today i may not necessarily agree with but but
[2380.00 --> 2384.64] there it is and that that's water under the bridge right right i mean we we participate in the
[2384.64 --> 2391.92] standardization effort too so so you know right that but it's but yeah so is there a canonical place to
[2391.92 --> 2398.24] go for people to find these are the features that typescript adds that you know may or may not be
[2398.24 --> 2405.36] available in es6 or in the browsers today do you guys have a place oh like on top of on top of the
[2405.36 --> 2411.44] type system and on top of the javascript standard stuff like the additional features yeah or even
[2411.44 --> 2415.36] you know features that have not quite been standardized yet or are in the process that
[2415.92 --> 2420.88] you know you could perhaps use this in chrome today but you can use it in typescript and it'll
[2420.88 --> 2430.32] you know it'll handle everything well i i mean all of the type system is of course a feature that that
[2430.32 --> 2437.04] we add right and all of the notation for how you write down interface types and union types and tuple
[2437.04 --> 2442.16] types and blah blah blah and how does type inference work and how the generics work and all of that stuff
[2442.80 --> 2450.32] is is of course on top and and something that we spec in our in our language specification um if you're
[2450.32 --> 2455.84] curious about like yes seven features there's the on the github site there's the road map right and
[2455.84 --> 2460.96] we kind of roughly sketch out i mean even okay you don't know exactly where which feature is going
[2460.96 --> 2466.16] when but we've got a rough idea for you know this version and the next version so we we kind of put
[2466.16 --> 2471.52] that on the road map yeah the road there's a link to a road map on the there's a link to a road map on
[2471.52 --> 2478.16] the on the on the typescript front page on github so oh cool perfect that's helpful yeah
[2478.16 --> 2485.44] so let's talk a little bit about the compiler and the implementation of the compiler one thing you
[2485.44 --> 2491.68] said earlier enters which was kind of piqued my interest is about the compilers api yeah and how
[2491.68 --> 2496.40] important that was tell us about that and then also tell us like how it's implemented is it is it in
[2496.40 --> 2502.00] typescript i think you said it is but just because give us some of the details of the compiler okay it is
[2502.00 --> 2507.60] in typescript yes i mean like i said we we we believe in dark booting and then and we've actually we've had
[2507.60 --> 2512.64] several versions of the compiler but they were all written in typescript uh that the one that's
[2512.64 --> 2517.52] that's there now and that's on on github and the one that we're that we're currently shipping um
[2518.56 --> 2527.20] is uh it's about i'm gonna say probably 32 000 lines or thereabouts for the core compiler itself and
[2527.20 --> 2534.32] then another 15 to 20 000 lines for the language service about about 50 000 lines uh all all up um
[2534.32 --> 2541.52] um um before andrews has a chance to be a little humble he wrote most of the new version of the
[2541.52 --> 2546.00] compiler so he was just kind of brainstorming ways that we could be faster and lighter weight
[2546.64 --> 2551.52] and uh in his free time was coming up with these ideas i was like guys like i think we should go this
[2551.52 --> 2558.96] direction i'm like no we don't need to rewrite it we just we just released 1.0 and i said no no i i think
[2558.96 --> 2564.00] that's the way we should go and sure enough as as it started coming together it was like five times
[2564.00 --> 2569.60] faster than the original 1.0 compiler so he deserves a lot of credit for that and it's like pretty much
[2569.60 --> 2575.36] rewritten already by the time he had brought in brought in you guys the uh the results like was there
[2575.36 --> 2580.88] a big effort after that or it was pretty much done well i mean i yeah i i started it's it's actually
[2580.88 --> 2586.16] kind of interesting because there are a couple of things first of all that i i would say about how