Many JavaScript roles are advertised as "Full Stack", but what does that really mean?
This talk takes a look at what could be meant by a stack and discusses the reasons to focus on first-principles rather than specific technologies.
5. Ian Thomas | @anatomic
Data Structure
1
2
3
5
4
Last In First Out
5
Data
Container
P
u
s
h
P
o
p
API
A stack is an abstract data type that
serves as a collection of elements, with
two main operations: push and pop
6. Ian Thomas | @anatomic 6
Physical
Data Link
Network
Transport
Session
Presentation
Application
Networking
Conceptual models to help
define the abstraction layers
involved in systems
interconnection. Media
Layers
Host
Layers
Application
Transport
Internet
Link
OSI Model TCP/IP
No concept of a physical layer
HTTP, HTTPS,
FTP, SMTP
MIME, TLS
UDP, TCP, etc.
IP, IPsec, ICMP
Packets, PPP,
SLIP, etc.
Media, signal &
binary
transmission
Sockets
7. Ian Thomas | @anatomic 7
LAMP
MEAN
JAM
MERN
WAMP
Linux
Apache
MySQL
PHP
Mongo
Express
Angular
Node.js JavaScript
APIs
Markup
Mongo
Express
React
Node.js Windows
Apache
MySQL
PHP
T3
Solution
hps://en.wikipedia.org/wiki/Solution_stack
TypeScript
Tailwind
tRPC
(Next +
Prisma)
13. Ian Thomas | @anatomic 13
SPA iOS App
Android
App
3rd Parties
API
DB
Client
Server
14. Ian Thomas | @anatomic 14
SPA iOS App
Android
App
3rd Parties
DB
Client
Server API
Load Balancer
CDN
DB
Primary Read Replica
Worker
3rd Parties
Cache
Message Broker
API Instance
16. Ian Thomas | @anatomic 16
SPA iOS App
Android
App
3rd Parties
DB
Client
Server
Load Balancer
CDN
DB
Primary Read Replica
Worker
3rd Parties
“Full Stack”
Framework
Server
Client
API
Cache
Message Broker
17. Ian Thomas | @anatomic
Software is built on
layers of abstraction
17
18. Ian Thomas | @anatomic 18
Client Server
Node.js
Browser
Application
Framework Libraries
DOM API / BOM
API
JavaScript
runtime
Operating
System
Hardware
Application
Framework Libraries
Node.js APIs
JavaScript
runtime
Operating
System
Hardware
Abstraction
19. Ian Thomas | @anatomic 19
Client Server
Node.js
Browser
Application
Framework Libraries
DOM API / BOM
API
JavaScript
runtime
Operating
System
Hardware
Application
Framework Libraries
Node.js APIs
JavaScript
runtime
Operating
System
Hardware
Abstraction
Full Stack frameworks hide much of the detail of the
underlying layers. This can be great for productivity if
your use-case fully aligns with their design
decisions, but tricky to resolve if your requirements
deviate from the happy path…
20. Ian Thomas | @anatomic 20
SPA iOS App
Android
App
3rd Parties
DB
Client
Server
Load Balancer
CDN
DB
Primary Read Replica
Worker
3rd Parties
“Full Stack”
Framework
Server
Client
API
Cache
Message Broker
21. Ian Thomas | @anatomic
The JavaScript Language
21
Syntax, semantics and specification
ECMAScript® 2022 Language Specification
22. Ian Thomas | @anatomic
“ECMAScript as defined here is not intended to be
computationally self-suicient; indeed, there are
no provisions in this specification for input of
external data or output of computed results.”
22
23. Ian Thomas | @anatomic
The JavaScript Language Specifies…
23
● Data types
● Language Syntax & Semantics
● Global Object
● Fundamental Objects
● Numbers & Dates
● Text
● Indexed & Keyed Collections
● Error Handling
● Memory Management
● Reflection
● Promises, Generators, Async/Await
● …
Also, the specification includes direction
regarding execution contexts, agents, additional
features for web browsers but crucially nothing
regarding the event loop…
24. Ian Thomas | @anatomic
“...it is expected that the computational
environment of an ECMAScript program will
provide not only the objects and other facilities
described in this specification but also certain
environment-specific objects…”
24
25. Ian Thomas | @anatomic
The JavaScript Environment
25
DOM, Node.js, Deno…
26. Ian Thomas | @anatomic 26
libuv
v8 hp
c-ares zlib …
Your Application
node_modules
Node.js Bindings C++ addons
Node.js
NPM
Userland
Operating System
Server Context
Node.js Standard Library Core JavaScript
27. Ian Thomas | @anatomic 27
Browser Context (window)
libevent
Renderer
(V8)
Your Application
ECMA modules / 3rd Party Scripts
DOM BOM
Browser
Self-hosted/3rd
party
Userland
Operating System
Core JavaScript
Browser
Process
GPU …
28. Ian Thomas | @anatomic 28
Browser Context (window)
Your Application
ECMA modules / 3rd Party Scripts
DOM BOM
Operating System
Core JavaScript
libuv
v8 hp
C-ares zlib …
Your Application
node_modules
Node.js Bindings C++ addons
Operating System
Server Context
Node.js Standard Library Core JavaScript
libevent
Renderer
(V8)
Browser
Process
GPU …
29. Ian Thomas | @anatomic
How Is JavaScript Executed?
29
V8 and friends
Other JavaScript runtime implementations are
available, but for ease of comparison this
presentation focuses on V8.
30. Ian Thomas | @anatomic 30
JS Source
Code
AST Bytecode Machine Code
Parser Interpreter
Optimising
Compiler
De-optimised
code
V8 Execution Pipeline
How your code is parsed, interpreted and potentially compiled for high-performance execution
Ignition
Turbofan
35. Ian Thomas | @anatomic
What Happens When…
35
Let’s have a look at a couple of concrete examples, starting with a
very basic function defined on the Object global
36. Ian Thomas | @anatomic
Object.defineProperty
36
● Part of the ECMAScript Language Specification
● Implemented in C++ as part of V8
● Consider how a language with dynamic typing can be implemented
in a language with static typing
37. Ian Thomas | @anatomic
Array.prototype.sort
37
● Part of the ECMAScript Language Specification
● Implemented in Torque as part of V8
● Dierent sorting algorithms are used by dierent
JavaScript engines
● Previous implementation was Quicksort in JavaScript
● Current V8 implementation uses Timsort
● Can you think of some edge cases/problems that may
aect the implementation of sorting for JavaScript?
● Learn more on the V8 Blog
Timsort Quicksort Mergesort
Worst-case perf O(n log n) O(n2
) O(n log n)
Best-case perf O(n) O(n log n) O(n log n)
Average perf O(n log n) O(n log n) O(n log n)
Worst-case space
complexity
O(n) O(log n) O(n)
38. Ian Thomas | @anatomic
fetch()
38
● Part of the HTMLSpecification
● Defined in detail in the Fetch Living Standard
● Not provided by V8
● In Node.js, it’s a layer on top of the Node.js standard library
○ Undici (npmjs.org/package/undici)
○ Pull Request #41749 · nodejs/node - lib: add fetch by targos
39. Ian Thomas | @anatomic 39
Client Server
Node.js
Browser
Application
Framework Libraries
DOM API
JavaScript
runtime
Operating
System
Hardware
Application
Framework Libraries
Node.js APIs
JavaScript
runtime
Operating
System
Hardware
40. Ian Thomas | @anatomic 40
The rise of “full stack developer”
Google Search Trends - “Full Stack Developer” Topic Feb 2013 - Feb 2023
41. Ian Thomas | @anatomic 41
The rise of “full stack developer”
Google Search Trends - “Full Stack Developer” Topic Feb 2013 - Feb 2023
42. Ian Thomas | @anatomic
Whose Stack Is It Anyway?
● Software is built on layers of abstraction
○ learn to recognise the level you’re working at
○ Focus on the needs of the layer above and the opportunities from the layer below
● Being truly full-stack is likely impossible
○ leaning on first-principles will help you feel comfortable adapting to new technologies and
solutions
● It’s ok to start high level and work your way down the layers
○ If you’re a new engineer, try not to think of yourself as a “React” developer, etc.
○ If you’re a senior engineer, help coach foundational knowledge and behaviours that provide
value over the span of a career
42