Jsonnet is an excellent choice for a configuration language, such as for Kubernetes IaC (but also, any other complex config thatās hard to maintain by hand).
Unlike JSON and YAML, you can easily reuse snippets, create complex templates with logic that determines exact contents based on parameters, import arbitrary files, generate json/yaml/ini/python/etc from plain structures, and so much more. Yet, it remains just a description language, avoiding the complexity of using scripting languages to generate config files.
Jsonnet absolutely deserves to be more popular than it is, so Iām hoping my tutorial will inspire at least a few of you to give it a try.
I gave the āHermes Hackingā talk on the (excellent) React Native EU conference. Itās an introduction to how JavaScript engines work, for developers that have no background in parsers, compilers, or interpreters. I briefly cover lexing, parsing, AST interpretation, bytecode generation, garbage collection, with some Hermes-specific topics, and links to articles where you can learn more.
Part of my job is to make JavaScript thingsgofast. Speed is a feature, and when working in an interpreted language, squeezing every last bit of performance can be the difference between a great product and unusable garbage.
Anyway, how cool would it be to make JavaScript itself go faster? Iām not a C++ programmer, but that didnāt stop me before, so I thought Iād give it a try anyway!
The objective
Weāll make a common operation, JSON.parse(), faster. There are real world use cases where youād want to parse large JSONs, such as initial login to an offline-first app, or deserializing persisted state at launch. By making it twice as fast, it could have real impact on users, as opposed to optimizing some obscure microbenchmark.
The JavaScript engine weāll target is Hermes, used primarily by React Native. Improving V8 (Chrome, Node) or JSC (Safari, Bun) would have greater impact, but Hermes is relevant to my work.