Skip to content

Latest commit

 

History

History

docs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

nix-eval-js/doc

javascript internals

https://blog.sessionstack.com/how-javascript-works-parsing-abstract-syntax-trees-asts-5-tips-on-how-to-minimize-parse-time-abfcf7e8a0c8

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

float precision

nix-repl> 0.300001 # 6 digits after comma
0.300001

nix-repl> 0.3000001 # 7 digits after comma
0.3

C++

#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

serialize data

live coding

figwheel

https://figwheel.org/docs/reloadable_code.html

powered by: Google Closure Compiler

send incremental updates to runtime

error reporting

generate html report for javascript errors

https://github.com/poppinss/youch

https://github.com/filp/whoops

Garbage Collector

https://github.com/topics/garbage-collector

boehm-gc

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

meridvia

Garbage Collector in Javascript

https://github.com/Joris-van-der-Wel/meridvia

similar problems

incremental compiler

inc: an incremental approach to compiler construction

https://github.com/namin/inc

Step-by-step development of a Scheme-to-x86 compiler

http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf

collaborative editing

the interpreter is an editor too

nix implementation

implementation details of the original nix interpreter

TLDR for now, but has all the details on performance optimization

Nix thesis

see nix-thesis.md

javascript bindings for nix

transpile nix to javascript

lazy evaluation

npm

simple

generators

generator = function*

functions

lisp interpreter

lisp interpreter in javascript

lazy evaluation vs reactive programming

  • 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
    • 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

NixExpr to Derivation

reactive programming in javascript

graphical

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

headless reactive frameworks for nodejs

src: https://github.com/sindresorhus/awesome-nodejs

RxJS

RxJS - Functional reactive library for transforming, composing, and querying various kinds of data.

Kefir.js

Kefir.js - Reactive library with focus on high performance and low memory usage.

Marble.js

Marble.js - Functional reactive framework for building server-side apps, based on TypeScript and RxJS.

benchmarks

performance regression testing

"is the new version faster or slower?"

not

frameworks for testing of REST API performance

intended to benchmark HTTP requests

performance

prototype patching is evil

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, {})