5 ms·
Most of the project is and will still be written in Rust, a statically typed language, so saying that the "project" will drop static types is an overstatement.
by vimslayer 6y ago
Most of the project is and will still be written in Rust, a statically typed language, so saying that the "project" will drop static types is an overstatement. Based on the design document where the devs talk about this, the TS code in question is about 10k lines of glue code between Rust & userland JS/TS.
- jsf01 6y agoIf it’s only 10k lines of glue code how are they running into minutes long compiles?
- pfraze 6y agoPresumably that's what the Deno team is wondering
- deleted 6y ago[deleted]
- cjhopman 6y agoHaven't looked at their build, but it's almost certainly the case that they are generating some sort of rust binding from the typescript code and the compilation times are actually from needing to recompile rust.
- stefan_ 6y agoWhy is anyone in the world manually writing 10k lines of glue code? You don't need TS or JS, you need.. a computer.
- jtdev 6y agoPlease, elaborate.
- andybak 6y agoI suspect there might be more than one definition of "glue code" at play here.
- tzs 6y agoI would guess that he means that when you have a lot of glue code it tends to be repetitive and so writing tools to write the glue code can be a win. Let's say you have implemented a service that exposes API X to its users, and let's say you have an internal service that provides the actual functionality you are trying to expose but uses API Y. Hence you need glue code that translates between X and Y. There might be hundreds of API calls in X but the glue code is all going to be of the same general form: translate the X parameters to corresponding Y parameters, call the matching Y function, and then translate results back. Within all these glue functions there will be a lot of common actions. X calls with integer parameters for instance might pass them as ASCII strings and Y might expect integers as 64-bit big-endian binary. In this situation there is a good chance you can make a table that lists each X call, the types of its arguments and results, the Y call to map it to, and some flags to indicate that some things need special handling and what those are. You can then have a program, probably a fairly short and straightforward program, that reads that table and writes out the glue code for you, sticking in comments marking places where you need to edit it to deal with those places marked as needing special handling.
- BoorishBears 6y agoCodegen?
- chmln 6y ago10K is a lot of code. As a maintainer of a popular 3k LOC typescript library, even at 1k LOC you start running into frequent type-related bugs with JavaScript
- subaru_shoe 6y ago10k is a lot of code? No way that is a lot of code or at least it’s not a lot for senior devs.
- recursive 6y agoIt's enough to benefit from types, assuming no large swathes of inline literals.
- timkam 6y agoThis certainly depends on what the code does and on the use case, i.e. on how critical reliability and performance are. 10k code in a simple web application prototype that will be trashed in 3 months is not "a lot", because it's not critical and piling up technical dept is not a problem. 10k code to specify the core algorithms in a mission-critical, long-living system is "a lot", or at least "much more", because it needs to be crafted and maintained with immense care.
- jlg23 6y agoUnless one is paid in LOC I'd expect a senior dev to write less code than a novice...
- Dork1234 6y agoAs someone who has maintained multiple legacy projects, 10k is not a lot of code. I normally run into single files in the 10k range, if it wasn't for NP++ and VSCode I would go insane just trying to scroll.
- tigershark 6y agoNo, it’s not. 10k loc is a small project.
- 6y ago
- herogreen 6y agoIf compilation times are a problem with typescript I do not see how Rust will help.
- darksaints 6y agoMaybe that means it is not as bad as it sounds, but if it's true it makes no sense to me. How could you possibly have minutes of compile time on so few lines of code? The typescript compiler isn't that slow. I've witnessed teams that have switched from static typing to dynamic typing before, due to complaints about compile times and a lack of ability. It doesn't take long before their testkit balloons and they spend 10x the time on testing, dwarfing any savings they made by eliminating compilation. Or worse, the code turns into something magical but untouchable, lest something break...eliminating the ability that they imagined they would get.