node-js 0.1.0

JavaScript as a fusevm frontend: a lexer/parser and compiler to fusevm::Chunk on a JsHost object heap, with no bespoke VM or JIT
Documentation
1
2
3
4
5
6
7
8
9
10
11
// Word frequency counting with objects and Math.
const text = "the quick brown fox the lazy dog the fox";
const counts = {};
for (const word of text.split(" ")) {
  counts[word] = (counts[word] || 0) + 1;
}
const entries = Object.entries(counts).sort((a, b) => b[1] - a[1]);
for (const [word, n] of entries) {
  console.log(`${word}: ${n}`);
}
console.log("max frequency:", Math.max(...Object.values(counts)));