Deno: q: how can this be a typescript runtime when typescript is first compiled to javascript ?

Created on 18 Apr 2020  路  25Comments  路  Source: denoland/deno

Most helpful comment

You are right, it isn't proprietary software. The source code is there if you are curious. @lucacasonato point is that from an end-user perspective, the implementation doesn't matter. Deno consumes TypeScript files and runs them without any external libraries or modules. Therefore it is a TypeScript runtime.

Understanding how a combustion engine works is not a requirement to know how to drive a car.

All 25 comments

Please ask questions like this in the Discord server https://discordapp.com/invite/TGMHGv6.

explanation for this question should be on the wiki page.
and i don't use discord , it ask me to give it my phone number

Why? It is an illogical question, so no need to add it to a wiki page.

why it is an illogical question?
please explain.

why it is an illogical question?

Well, if you're asking how it runs TypeScript then you've answered your own question: by compiling to JavaScript first. This is a given and ideally an implementation detail, no need to be directly written anywhere.

https://en.m.wikipedia.org/wiki/TypeScript

TypeScript is a strict syntactical superset of JavaScript, and adds optional static typing to the language.

@nayeemrmn i know how deno compile ts to js. i have read it.
my question is, when js is the thing that actually runs, how can it be a ts runtime.

@shian15810 i know what ts is.

it's a TS runtime because it can "run" TS code without the user having to do some conversion manually (the case with node)...

@nayeemrmn i know how deno compile ts to js. i have read it.
my question is, when js is the thing that actually runs, how can it be a ts runtime.

@mobop That's why I pointed out that the compilation is basically an implementation detail, making it a TS runtime as far as you're concerned.

Did you open this to point out a technicality? What exactly did you want written in the wiki? 馃檮

JS doesn't really run either. It is compiled into op codes in V8. 馃し Again, what would you expect a wiki to say?

@kitsonk ,
how deno is a typescript runtime?
does typescript's type information passed to V8?
does deno use vanilla v8 or it modified v8 to make it a typescript engine?

@nayeermn

Did you open this to point out a technicality? What exactly did you want written in the wiki?

yes, for technical details.
an explanation in the wiki on this topic.

No Deno does not pass typings into v8. It is raw JS.

V8 is not a Typescript engine because it can not deal with Typescript files. Deno is on the other hand because it can deal with typescript files. How this is implemented under the hood is completly irrelevant and the user should not care. A runtime is just a bit of software that is able to take in some data and execute it through some way. That is exactly what Deno does with Typescript.

@lucacasonato

How this is implemented under the hood is completly irrelevant and the user should not care.

what are you talking about? This is not a proprietary software. Why i shouldn't care about it's implementation details?

this is not a good mind set.

@ry

You are right, it isn't proprietary software. The source code is there if you are curious. @lucacasonato point is that from an end-user perspective, the implementation doesn't matter. Deno consumes TypeScript files and runs them without any external libraries or modules. Therefore it is a TypeScript runtime.

Understanding how a combustion engine works is not a requirement to know how to drive a car.

Understanding how a combustion engine works is not a requirement to know how to drive a car.

many of us my want to know. Because they are curious.

the combustion engine is displayed for everyone to see and inspect

And there are some excellent presentations on the internals of Deno. Right now Deno is in flux so some of them are quite dated, but a deep dive in the internals of Deno is likely not part of the end user documentation.

@kitsonk , i understand.
but for people who want to know the internal architectural details.

Again, at the risk of repeating itself, that is a wider community task.

how the community will know if the implementors don't documents it

how the community will know if the implementors don't documents it

The implementors are part of the community. And the documentation is called source code. Ry, myself, Kevin, Bartek and Bert have all given public talks which touch on the internals in several aspects. I am sure there are others. Kevin has a great blog post, though it is outdated and he doesn't want to refresh it until 1.0 ships, which makes total sense.

This is not the forum to get up to speed on the internals of Deno, or debating why the internals aren't on a wiki, nor is it the forum for asking a single line topic question.

@kitsonk , thank you.
I apology for wasting your and others time.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xueqingxiao picture xueqingxiao  路  3Comments

sh7dm picture sh7dm  路  3Comments

ry picture ry  路  3Comments

metakeule picture metakeule  路  3Comments

somombo picture somombo  路  3Comments