Configuration as Code with ECMAScript
Great little writeup ! After mangling YAML, HCL, JSON for years as an ops engineer, I have come to the same realisation. In fact, I have put this into practice in production pipelines by using: jkcfg for the last couple of years. Two data points: 1. Zero developer support contract rate around YAML syntax and templating issues 2. High number of contributions in our private typescript configuration library from developers. Using typescript as an ops frontend has made operations a lot more approachable to folks.
Recently I took what learnt in the last 2 years using jkcfg/typescript and taken it to Deno in form of an opinionated port of jkcfg called: dxcfg. Its early days, but I would bet on Deno/typescript for future ops configuration.
CUE has moved to https://github.com/cue-lang/cue
Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.
Configuration as code for the masses
Node.js Application Configuration
I have used TypeScript for config in a few projects, with node-config, and it’s substantially better IME than JSON/YAML/etc. Yeah it’s unconventional to write configs in a general purpose language, and I understand why that would be undesirable. But having configs validated at compile time is great at preventing bugs.
I’m not sure I’d recommend node-config (it was chosen by a past team). Its magic undermines the confidence in type safety provided by choosing TypeScript in the first place. But it does give some good baseline conventions one can apply without all the magic.
Maintainable configuration files
Anyone have experiences to share about Dhall (https://dhall-lang.org)?
On their homepage they call it a "programmable configuration language that you can think of as: JSON + functions + types + imports"
Our endpoint system (eps) that manages and secures the communication between different actors in the IRIS ecosystem. Think of it as a distributed service mesh router as well as a decentralized message broker. Still evolving, use with caution. (by iris-connect)
I think parsing YAML or JSON into typed structures is the easier way to go. I e.g. do that in Golang using a little form validation and coercion library I've written. The end result is a nested, strongly typed data structure. Here's an example: https://github.com/iris-connect/eps/blob/master/settings.go (the accompanying form validation configuration: https://github.com/iris-connect/eps/blob/master/forms/settin...)
In my experience, a lot of the validation needs to be done at runtime anyway as type checking alone won't allow you to e.g. validate if a string is a valid regular expression. Also, I think using TypeScript for configuration requires you to compile & interpret the configuration file in order to check it and obtain the data values. Not sure if I like that as it requires bundling the Typescript compiler with your program.
Advanced vm/sandbox for Node.js
This could be solved by having some kind of sandbox (https://github.com/patriksimek/vm2), but I agree it complicates it.
It would be cool if tsc had a flag —sandboxed or similar that does not allow any sideeffects (fs access, output, forking, net requests, etc)
OPS - Build and Run Open Source Unikernels. Quickly and easily build and deploy open source unikernels in tens of seconds. Deploy in any language to any cloud.
I'm pretty sure Deno just uses the open source TypeScript compiler: https://github.com/denoland/deno/tree/main/cli/tsc
My case involved generics (similar to , except I don’t recall why but the `length` property wasn’t appropriate in my use case), and after reading the crazy workarounds people came up with in a related issue I gave up on trying to be too precise in TS. Its type system is still very, very useful, but not as a means of specifying exact constraints—running code (with all corresponding drawbacks) would be required to validate given structure.
FlatBuffers: Memory Efficient Serialization Library
protobuf may very well be total overkill. What you wanted to do was strongly type your configuration. What you get is a complete RPC layer.
This might not even be warranted when inter-process communication is a primary concern. After all, there's nothing inherently wrong with using whatever data transfer mechanism your standard lib provides.
It's not just protobuf though. Almost every data format for serializing structured data suffers from pushing a jungle on you when all you asked for was a banana.
The least invasive format I know of is FlatBuffers. Doesn't push RPC on you. Allows you to parse a message even if you do not know this specific message's data structure in advance (like JSON).
A Rust implementation of the Starlark language
The Rust implementation has it as an experimental extension (https://github.com/facebookexperimental/starlark-rust/blob/m...)
Protocol Buffers - Google's data interchange format
2. Protobuf per se is just a serialization system, it does not push RPC "Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler." . It can be used in combination with RPC systems, but does not have to.
Jsonnet - The data templating language
No type support but I find jsonnet  pretty useful when you have tons of configuration files.
 - https://jsonnet.org/
JSON5 — JSON for humans
I've really come to prefer json5 as a config format: https://json5.org/
It's basically Json with comments, trailing commas, and unquoted object keys (and some other minor things).
Much nicer than real json as a config format, but still simple and declarative, not requiring an interpreter or being turing-complete.
Greetings Internet, I am Sir Dez, a marshal knight for your binary data.
Hello World! I am a marshal knight for your binary data. Please check it out :D
1 project | reddit.com/r/typescript | 13 Jan 2022
dprint – Code Formatter
1 project | news.ycombinator.com | 7 Dec 2021
Confusing Job Interview Take Home Assignment
1 project | reddit.com/r/Frontend | 17 Nov 2021
dprint: A pluggable and configurable code formatting platform written in Rust
1 project | news.ycombinator.com | 18 Oct 2021