Deno: How about draw picture of the Deno's architecture?

Created on 1 Jun 2018  ·  8Comments  ·  Source: denoland/deno

May be we could know how to code, but more eager to know the architecture. So could we have an article to introduce it more detailed?

Most helpful comment

image
PS the event-loop is pub/sub (dispatch.ts/go)
@ry Do you confirm this?

All 8 comments

Yes, a clear picture of the Deno's architecture can lead us newbies to explore the sources conveniently.

image
PS the event-loop is pub/sub (dispatch.ts/go)
@ry Do you confirm this?

@qti3e I like this graph and it's so clear, we can add it to README.

@monkingxue Thanks for the suggestion : )
But it's my point of view, and Ryan might want to present this project in some other ways...
let's wait till he says something...

@qti3e [ts compiler] [Fetch ts] Is it executed in V8?

@hufeng we have this Eval() function defined in main.go to evaluate a JS (not TS) string inside our V8 contex:
https://github.com/ry/deno/blob/b723ab126f5cc37b27d914e6cbdba9a4f9ce1c71/main.go#L100-L105

We use a similar way in Init() to load our main JS file:
https://github.com/ry/deno/blob/b723ab126f5cc37b27d914e6cbdba9a4f9ce1c71/main.go#L94-L97

As you see this uses a function called stringAsset(), you can check out go-bindata for more information... but for now we just need to know it loads a file, which is main.js.

main.js is a pre-compiled ts file in dist dir, look at this Makefile entity:
https://github.com/ry/deno/blob/b723ab126f5cc37b27d914e6cbdba9a4f9ce1c71/Makefile#L55-L57

Finally, we executed Deno's core js file inside V8, and that's the beginning of all magic : )

FYI; You can find codes related to ts compiler inside runtime.ts.

@qti3e thank you. ❤️

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hstarorg picture hstarorg  ·  93Comments

guybedford picture guybedford  ·  34Comments

rsp picture rsp  ·  33Comments

kitsonk picture kitsonk  ·  40Comments

ry picture ry  ·  57Comments