0

In his book JavaScript for impatient programmers (ES2020 edition) Axel Rauschmayer depicts a big picture for the possible platforms for JavaScript (cf. picture).

I am aware of the vast amount of possible JavaScript Engines and the popular ones like e.g. V8 written in C++. But I was wondering what is part of the Platform core and the JS standard library mentioned by Rauschmayer. Is there any other source, that explains or shows what is part of those modules. I am not sure whether the picture can be seen as an official architecture. But somewhere Dr. Rauschmayer probably has its knowledge from.

  • The foundational layer consists of the JavaScript engine and platform-specific “core” functionality.
  • Two APIs are hosted on top of this foundation:
    • The JavaScript standard library is part of JavaScript proper and runs on top of the engine.
    • The platform API are also available from JavaScript – it provides access to platform-specific functionality. For example:
      • In browsers, you need to use the platform-specific API if you want to do anything related to the user interface: react to mouse clicks, play sounds, etc.
      • In Node.js, the platform-specific API lets you read and write files, download data via HTTP, etc.

enter image description here

quizmaster987
  • 549
  • 1
  • 6
  • 15
  • 1
    I think he's getting at the differences between using a node.js implementation and a browser implementation. There are things you can do in node (for example reading files on the disk) that a browser (for obvious reasons) can't do. So "JS standard library" is everything common to both in JS, e.g. `if`, `function()`, etc. The platform core is the part of the engine that does none standard thing, e.g. file reads – Liam Jan 07 '21 at 12:03
  • "*JS standard library*" is a weird term. I think he refers to the [built-in](https://stackoverflow.com/questions/11632731/in-ecmascript-how-are-some-of-native-objects-also-built-in?rq=1) [native objects](https://stackoverflow.com/questions/8052578/what-is-an-ecmascript-native-object) (as opposed to the builtin host objects that form the "Platform API"), but "*standard library*" normally refers to [some built-in non-global libraries](https://github.com/tc39/proposal-built-in-modules). – Bergi Jan 07 '21 at 13:06
  • @Liam > `The platform core is the part of the engine that does none standard thing, e.g. file reads` > as far as I understood it in this chapter topics like reading files is enclosed in the Platform API (cf. the last bullet point). And the structure of the picture counts for both, no matter if browser or Node.js. So Node.js will contain in its Platform API stuff like "reading files" whereas the browser will contain in its Platform API stuff like "listen to mouse clicks". That leaves aside, what remains for both "types" in the platform core. – quizmaster987 Jan 07 '21 at 13:48
  • 1
    @quizmaster987 Platform core is the non-JS part of the implementation of the Platform API. Eg. the DOM implementation and rendering engine (but not its JS bindings), in node it would be the syscalls, the C++ file API, or the event loop (although in node.js this layer is admittedly very thin, as most of the code is about exposing these to JS) – Bergi Jan 07 '21 at 13:53

0 Answers0