How JavaScript works: Parsing, Abstract Syntax Trees (ASTs) + 5 tips on how to minimize parse time
https://blog.sessionstack.com/how-does-javascript-actually-work-part-1-b0bacc073cf
How JavaScript works: an overview of the engine, the runtime, and the call stack
nix-repl> 0.300001 # 6 digits after comma
0.300001
nix-repl> 0.3000001 # 7 digits after comma
0.3
#include <stdio.h>
int main(int argc, char *argv[])
{
double a = 0.1;
double b = 0.2;
double result = a + b;
printf("%.17f", result);
return 0;
}
result:
0.30000000000000004
live demo: https://godbolt.org/z/WfxGTbxGa
- https://www.npmjs.com/package/pretty-format Stringify any JavaScript value.
https://figwheel.org/docs/reloadable_code.html
powered by: Google Closure Compiler
send incremental updates to runtime
generate html report for javascript errors
https://github.com/poppinss/youch
https://github.com/filp/whoops
https://github.com/topics/garbage-collector
https://github.com/ivmai/bdwgc/wiki/Known-clients
general purpose, garbage collecting storage allocator
This is a garbage collecting storage allocator that is intended to be used as a plug-in replacement for C's malloc.
used by Nix, Harmonia
Garbage Collector in Javascript
https://github.com/Joris-van-der-Wel/meridvia
Step-by-step development of a Scheme-to-x86 compiler
http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf
the interpreter is an editor too
implementation details of the original nix interpreter
TLDR for now, but has all the details on performance optimization
see nix-thesis.md
- https://github.com/svanderburg/nijs - NiJS: An internal DSL for Nix in JavaScript
- https://github.com/svanderburg/slasp - library for asynchronous programming
- https://github.com/YZITE/nix2js - Nix → Rust → JavaScript
- https://en.wikipedia.org/wiki/Lazy_evaluation
- https://ericnormand.me/podcast/how-do-you-implement-lazy-evaluation
- https://berkeley-cs61as.github.io/textbook/an-interpreter-with-lazy-evaluation.html
- Structure and Interpretation of Computer Programs: An Interpreter with Lazy Evaluation
- Implementing lazy functional languages on stock hardware: the Spineless Tagless G-machine. by Simon Peyton-Jones
- Lazy Evaluation. by Jaemin Hong
- https://github.com/dtao/lazy.js - library for lazy functional programming, 6K stars, npm, npm packages depending on lazy.js
- https://github.com/wonderlang/wonder - lazy functional programming language
- https://github.com/baconjs/bacon.js
- Stop working on individual events and work with event-streams instead.
- npm packages depending on baconjs
- https://github.com/ricokahler/lazy 10 stars
- https://github.com/SoundRabbit/SR_LazyEvaluation_JS
- https://github.com/jadaradix/lazy-evaluation
- https://github.com/ionutcirja/lazy-evaluation
generator = function*
- https://github.com/zh-rocco/lazy-evaluation
- https://github.com/milahu/zh-rocco---lazy-evaluation - english translation of readme
- https://github.com/evinism/lazarr
lisp interpreter in javascript
- https://github.com/maryrosecook/littlelisp - 600 stars
- https://github.com/jcubic/lips - 300 stars
- https://github.com/willurd/js-lisp - 50 stars
- https://chidiwilliams.com/post/how-to-write-a-lisp-interpreter-in-javascript/#interpreter
- https://stackoverflow.com/questions/13575498/lazy-evaluation-and-reactive-programming
- lazy evaluation is a language facility that allows the existence and manipulation of infinite data
- infinite in the sense that you can pull off as much as you want and still have some left over.
- you don't "loop forever"
- performance gains
- only compute as much of an answer as you need to do more work, and then keep around a holder (typically called a "thunk") that will let you do more work when you need it
- reactive programming is a programming paradigm oriented around data flows and the propagation of change
- express static or dynamic data flows
- define ("declare") how data flows will be propagated
- the underlying execution model will automatically propagate changes through the data flow
- without explicitly having to implement it using callbacks and function pointers
- most people will call GUI frameworks reactive.
- in language like C or C++, you typically do reactive programming via function pointers or callbacks, without an explicit notion of lazy evaluation
- express static or dynamic data flows
- in functional reactive programming (FRP), you declaratively specify reactive data
- implemented "under the hood" using the laziness of the Haskell language
- if you look at libraries like Bacon.js or Lazy.js, it really seems that under the hood their implementation can easily be realised by using the reactive paradigm (eg, with streams)
- stream of events
- lazy evaluation is a language facility that allows the existence and manipulation of infinite data
reactive frameworks for javascript in a web browser
https://github.com/krausest/js-framework-benchmark
IMHO the clear winner is solidjs
compare: vanillajs fullweb-helpers solid svelte react vue
headless reactive frameworks for nodejs
src: https://github.com/sindresorhus/awesome-nodejs
RxJS - Functional reactive library for transforming, composing, and querying various kinds of data.
Kefir.js - Reactive library with focus on high performance and low memory usage.
Marble.js - Functional reactive framework for building server-side apps, based on TypeScript and RxJS.
"is the new version faster or slower?"
frameworks for testing of REST API performance
intended to benchmark HTTP requests
https://blog.yuzutech.fr/node-investigating-performance-regression/
Based on this knowledge, we identified a practical JavaScript coding tip that can help boost performance:
don’t mess with prototypes
(or if you really, really need to, then at least do it before other code runs).
bad:
Object.setPrototypeOf(Array.prototype, {})