@cirosantilli/_file/webpack/webpack/template Updated +Created
webpack/template contains a reasonable starter template.
This will produce, under dist/ the following minimized files:
You can also run this test with the development server on localhost:9000:
npm start
which uses unminimized outptus, and automatically push reloads the page whenever you change any of the input files!
Finite element method Updated +Created
TODO understand, give intuition, justification of bounds and JavaScript demo.
Forester Updated +Created
Intro/docs: www.jonmsterling.com/jms-005P.xml. It is very hard to find information in that system however, largely because they don't seem to have a proper recursive cross file table of contents.
This is the project with the closest philosophy to OurBigBook that Ciro Santilli has ever found. It just tends to be even more idealistic than, OurBigBook in general, which is insane!
Source code: sr.ht/~jonsterling/forester. Not on GitHub, too much idealism for that.
"Docs" at: www.jonmsterling.com/foreign-forester-jms-005P.xml Sample repo at: github.com/jonsterling/forest but all parts of interest are in submodules on the authors private Git server.
They have \Include like OurBigBook, nice: www.jonmsterling.com/jms-007L.xml, but OMG that name \transclude{xxx-NNNN}!! It seems to be possible to have human readable IDs too if you want: www.jonmsterling.com/foreign-forester-armaëlguéneau.xml is under trees/public/roladex/armaëlguéneau.tree.
Headers have open/close:
\subtree[jms-00YG]{}
OurBigBook considered this, but went with parent= instead finally to avoid huge lists of close parenthesis at the end of deep nodes.
One really cool thing is that the headers render internal links as clickable, which brings it all closer to the "knowledge base as a formal ontology" approach.
Does not encourage human readable IDs, uses stuff like jms-00YG.
The markup has relatively few insane constructs, notably you need explicit open paragraphs everywhere \p{}?! OMG, too idealistic, not enough pragmatism. There are however a few insane constructs:
  • [](): markdown like links
  • [[bluecat]]: wikilinks (but to raw IDs only, you can't seem to be able to do [[blue cat]]
  • #{} and ##{} for inline and block maths, though that might just be a sane construct with an insane name
The markup is documented at: www.jonmsterling.com/foreign-forester-jms-007N.xml
Jon has some very good theory of personal knowledge base, rationalizing several points that Ciro Santilli had in his mind but hadn't fully put into words, which is quite cool.
OCaml dependency is not so bad, but it relies on actually LaTeX for maths, which is bad. Maybe using JavaScript for OurBigBook wasn't such a bad choice after all, KaTeX just works.
Viewing the generated output HTML directly requires security.fileuri.strict_origin_policy which is sad, but using a local server solves it. So it appears to actually pull pieces together with JavaScript? Also output files have .xml extension, the idealism! They are reconsidering that though: www.jonmsterling.com/foreign-forester-jms-005P.xml#tree-8720.
The Ctrl+K article dropdown search navigation is quite cool.
\rel and \meta allows for arbitrary ontologies between nodes as semantic triples. But they suffer from one fatal flaw: the relations are headers in themselves. We often want to explain why a relation is true, give intuition to it, and refer to it from other nodes. This is obviously how the brain works: relations are nodes just like objects.
They do appear to be putting full trees on every toplevel regardless how deep and with JavaScript turned off e.g.:which is cool but will take lots of storage. In OurBigBook Ciro Santilli only does that on OurBigBook Web where each page can be dynamically generated.
Front-end web framework Updated +Created
You need those because it is hard to do the following:
  • client JavaScript sends a request to server
  • server sends back data
  • client updates what the user sees
This is hard to do notably because when the update happens, several things might need to change on the webpage at the same time.
Notably, new elements might need to be added to the webpage, which in turn means that new bindings such as button clicks have to be added to those, in a way that keeps the page working.
The only way to do this basically is to have a functional dependency graph that keeps everything in the page in working state as updates come.
gothinkster/realworld Updated +Created
Basically puts together every backend with Front-end web framework to create the exact same website.
The reference live demo can be found at: demo.realworld.io/#/ It is based on Angular.js as it links to: github.com/gothinkster/angularjs-realworld-example-app TODO backend?
There are however also live demos of other frontends, e.g.:
Note that all those frontends communicate with the same backend.
As of 2021 Devs are seemed a bit too focused on monetizing the project through their "how to use this project" premium tutorial, and documentation could be better: just getting the hello world of the most popular backend with the most popular frontend is not easy... come on.
github.com/gothinkster/realworld/issues/578 asks for community support, as devs have moved on since unfortunately.
Remember:
  • by default, the frontends hardcode the upstream public data API: https://conduit.productionready.io/api so you have to hack their code to match the port of the backend. And each backend can have a different port.
  • when you switch between backends, you must first manually clear client-side storage cookies/local new run will fail due to authentication issues!
Important missing things from the minimum base app:
First you should the most popular backend/frontend combination running, which is the most likely to be working. We managed to run on Ubuntu 20.10, React + Node.js Express.js as described at github.com/gothinkster/node-express-realworld-example-app/pull/116:
Then just:
npm install
npm start
on both server and client, and then visit the client URL: localhost:4100/
One cool thing is that the main repo has unified backend API tests:
git clone https://github.com/gothinkster/realworld
cd realworld
git checkout e7adc6b06b459e578d7d4a6738c1c050598ba431
cd api
APIURL=http://localhost:3000/api USERNAME="u$(date +%s)" ./run-api-tests.sh
so the per-repository tests are basically useless, and that single test can test everything for any backend! There is no frontend testing however: github.com/gothinkster/realworld/issues/269 so newb.
How to convert async to sync in JavaScript Updated +Created
God, it's impossible! You just have to convert the entire fucking call stack all the way up to async functions. It could mean refactoring hundreds of functions.
To be fair, there is a logic to this, if you put yourself within the crappiness of the JavaScript threading model. And Python is not that much better with its Global Interpreter Lock.
The problem is that async was introduced relatively late, previously we just had to use infinitely deep callback trees, which was worse:
myAsync().then(ret => myAsync2(ret).then(ret2 => myAsync3(re3)))
compared to the new infinitely more readable:
ret = await myAsync()
ret2 = await myAsync2(ret)
ret3 = await myAsync3(ret3)
But now we are in an endless period of transition between both worlds.
It is also worth mentioning that callbacks are still inescapable if you really want to fan out into a non-linear dependency graph, usually with Promise.all:
await Promise.all([
  myAsync(1).then(ret => myAsync2(ret)),
  myAsync(2).then(ret => myAsync2(ret)),
])
And then, after many many hours of this work, you might notice that the new code is way, way way slower than before, because making small functions async has a large performance impact: madelinemiller.dev/blog/javascript-promise-overhead/. Real world case with a 4x slowdown: github.com/ourbigbook/ourbigbook/tree/async-slow.
Anyways, since you Googled here, you might as well learn the standard pattern to convert callbacks functions into async functions using a promise: stackoverflow.com/questions/4708787/get-password-from-input-using-node-js/71868483#71868483
Figure 1.
async function Teletubbies meme
. Source. TODO find original source.
List of personal knowledge base software Updated +Created
TODO look into those more:
Major downsides that most of those personal knowledge databases have:
  • very little/no focus on public publishing, which is the primary focus of OurBigBook.com
  • either limited or no multiuser features, e.g. edit protection and cross user topics
  • graph based instead of tree based. For books we need a single clear ordering of a tree. Graph should come as a secondary thing through tags.
Closed source dump:
Maxwell's equations in 2D Updated +Created
Node.js Updated +Created
WellSync, if you are gonna useSync this wonky language thing inSync one place, you might as well useSync it everywhereSync and make it more decent. See also: how to convert async to sync in JavaScript.
One page to rule them all Updated +Created
It is true that one image is worth a thousand words, but unfortunately it is also true that one image takes up at least as much bytes as a thousand words!
Having one single page to rule them all is of course the ideal setup for a website, as you can Ctrl + F one ToC and quickly find what you want.
And, with Linux Kernel Module Cheat Ciro noticed that it is very hard to write so much intelligent prose that becomes larger than reasonable to load on a single webpage.
He then started using this technique for everything he writes, including this page and Chinese government.
However, if there are too many images on the page, the loading of the last images would take forever in case users want to view the last sections.
There are two solutions to that:
Ciro is still deciding between those two. The traditional approach works for sure but loses the one page to rule them all benefits.
The innovative approach will work for interactive viewing, but archive.org will fail to load the images for example, and there may be other unforseen consequences.
Wikimedia Commons is awesome and automatically converts and serves smaller versions of images, so always choose the smallest images size needed by the output document. Readers can then find the higher resolution versions by following the page source.
This also comes to mind: motherfuckingwebsite.com
zettelkasten.de/posts/overview/ from zettelkasten:
How many Zettelkästen should I have? The answer is, most likely, only one for the duration of your life. But there are exceptions to this rule.
OurBigBook Library Updated +Created
Base JavaScript library that implements the OurBigBook Markup. Use by both:
Pandoc Updated +Created
This is good software.
If it only it were written in JavaScript instead of Haskell (!?), then Ciro might have used it as the basis for OurBigBook Markup.
Phaser.js Updated +Created
Likely the best JavaScript 2D game engine as of 2023.Uses Matter.js as a physics engine if enabled. There's also an alternative (in-house?) "arcade" engine: photonstorm.github.io/phaser3-docs/Phaser.Physics.Arcade.ArcadePhysics.html but it appears to be simpler/less robust (but also possibly faster).
TODO any 2D first person examples a bit like Ciro's 2D reinforcement learning games?
The examples are present under:
git clone https://github.com/photonstorm/phaser3-examples
but note that that repo is huge, about 4.5 GiB on local disk, as is has tons of assets.
The demos also include a Monaco-editor based sandbox mode where you can edit code directly on the web and see the game update which is a really sweet addition.
Programming language Updated +Created
A language that allows you to talk to and command a computer.
There is only space for two languages at most in the world: the compiled one, and the interpreted one.
For 2020 now, when you have a choice, you must go for:
  • Python as the interpreted one
  • C++ for compiled
Those two are languages not by any means perfect from a language design point of view, and there are likely already better alternatives, they are only chosen due to a pragmatic tradeoff between ecosystem and familiarity.
Ciro predicts that Python will become like Fortran in the future: a legacy hated by most who have moved to JavaScript long ago (which is slightly inferior, but too similar, and with too much web dominance to be replaced), but with too much dominance in certain applications like machine learning to be worth replacing, like Fortran dominates certain HPC applications. We'll see. Maybe non performance critical scripting languages are easier to replace.
C++ however is decent, and is evolving in very good directions in the 2010's, and will remain relevant in the foreseeable future.
Bash can also be used when you're lazy. But if the project goes on, you will sooner or later regret that choice.
The language syntax in itself does not matter. All that matters is how many useful libraries and tooling it has.
This is how other languages compare:
  • C: but cannot make a large codebase DRY without insanity
  • Ruby: the exact same as Python, and only strong in one domain: web development, while Python rules everything else, and is not bad on web either. So just kill Ruby, please.
  • JavaScript: it is totally fine if Node.js destroys Python and becomes the ONE scripting language to rule them all since Python and JavaScript are almost equally crappy (although JavaScript is a bit more of course).
    One thing must be said tough: someobject.not_defined_property silently returning undefined rather than blowing up is bullshit.
  • Go: likely a good replacement for Python. If the ecosystem gets there, will gladly use it more.
  • Java: good language, but has an ugly enterprisey ecosystem, Oracle has made/kept the development process too closed, and API patenting madness on Android just kills if off completely
  • Haskell: many have tried to learn some functional stuff, but too hard. Sounds really cool though.
  • Rust: sounds cool, you will gladly replace C and C++ with it if the ecosystem ramps up.
  • C: Microsoft is evil
  • Tcl, Perl: Python killed them way back and is less insane
  • R, GNU Octave and any other "numerical computing language": all of this is a waste of society's time as explained at: Section "Numerical computing language"
  • Swift: Ciro would rather stay away from Apple dominated projects if possible since they sell a closed source operating system
Publish Notion content Updated +Created
But non-paid plan currently disables "Search engine indexing" of that sharing, so it's useless. There's an "Allow duplicate as template" button though which is nice.
URLs are horrendous however, e.g.: lofty-flower-be4.notion.site/aa-2274c59a06124d5b974b781a67340670 Only the aa in that came from us. They don't even have the guts for a fixed subdomain.
Also it does not work without JavaScript, no SSR, everything is dynamic.
They don't show multiple input pages on the same render, e.g.: lofty-flower-be4.notion.site/aa-2274c59a06124d5b974b781a67340670 does not contain the child lofty-flower-be4.notion.site/bb-45df7212a2e14e04b3f9604035c7acf4 as already implemented on OurBigBook Web Dynamic Article Tree.
Cross page links to work fine. But you don't link to explicit IDs, only internal hidden IDs. This can be even slightly confusing to users as multiple identical options can show up when you start creating a link. They do try to disambiguate with the parent page however.
So this is a reasonable single-person publishing platform for your notes.
Someone made and sold a helper for it:
Quantum circuit description language Updated +Created
These are a bit like the Verilog of quantum computing.
One would hope that they are not Turing complete, this way they may serve as a way to pass on data in such a way that the receiver knows they will only be doing so much computation in advance to unpack the circuit. So it would be like JSON is for JavaScript.
Quantum computer simulator Updated +Created
Bibliography: