bcl
json2jsii
bcl | json2jsii | |
---|---|---|
7 | 1 | |
14 | 19 | |
- | - | |
9.5 | 9.5 | |
7 days ago | 6 days ago | |
Go | TypeScript | |
GNU General Public License v3.0 or later | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
bcl
-
HCL: Toolkit for Structured Configuration Languages
Another take on replacing HCL with something more sensible:
BCL https://github.com/wkhere/bcl
-
Show HN: Togomak – declarative pipeline orchestrator based on HCL and Terraform
I agree with you that HCL sucks when it comes to variables.
Other thing that is funny: no user-defined functions, being unable to use function calls in string interpolations, but allowing variables... so it is like saying: we have this parser and at some points it allows expressions, at some other point not. This seems wrong.
At the same time I agree or at least understand original author's intent to squeeze HCL to maxinum. There is something appealing in HCL visual form, at least when defining resources. Maybe it's just (almost) simplest form of defining such structures that can exists.
This is why I started to work on my own format for configuration, visually similar but with different model of evaluation.
Here is the first attempt: https://github.com/wkhere/bcl
Disclaimer: I named it BCL, 'B' stands for Basic, to somehow relate to HCL and make it easily pronounced. But later I discovered that another BCL is used as Google to configure the Borg platform and seems to be massively hated ;) So I look for the better name..
-
Ask HN: Show me your half baked project
I am crafting BCL, own configuration language.
https://github.com/wkhere/bcl
I started this when I was unable to squeeze certain usage patterns from HCL, like: variables living in the same scope as the file, evaluating variables in one pass with parsing, easily using external (environment) variables; plus, a simplified syntax.
The implementation is mostly done: you can defined blocks holding key-value pairs and use numerical, string and bool expressions in them. I will add lists and nested blocks.
At this very moment I am rewriting a parser from yacc-based to a Pratt top-down parser with vm, heavily inspired by the excellent book "Crafting Interpreters".
-
That's a Lot of YAML
https://github.com/wkhere/bcl
Will not immediately help for all of YAML usages, but at least for defining resources in a Terraform-like style. In fact, it's already it's already helpful as a replacement for HCL in one internal project, that was a final motivation to hack it.
In a bigger picture, I have no idea how to help with YAML omnipresence in Kubernetes. More than a half of my problems in a $daily_job is how crude is consolidating a final Helm chart from different sources. I am not saying that Helm would be inherently a bad tool or my company has chosen pretty bad way of using it - I guess everyone is doing their best considering the ciscumstances. But manipulating textual templates is just too error prone, and the detection of errors happens too late. I dare to say - Kubernetes would do much better with custom format based on a C-like syntax, instead if trying to prove how cool YAML is, especially when it isn't.
- BCL - a simplified HCL-like configuration format (WIP)
-
What Is Wrong with TOML?
Related:
just few days ago I crafted together some ideas i had couple of years already for a configuration language, syntactically like HCL but without HashiCorps idiosyncrasies.
Here it goes, BCL (_Basic_ Configuration Language, for a lack of better name yet), Go prototype, I can code Python port and possibly several other as well..
https://github.com/wkhere/bcl
json2jsii
-
That's a Lot of YAML
The more I look at it, the more I think that Deno is actually a perfect fit for infrastructure as code.
The first reaction I get is usually "What, JavaScript!?". Here is why its better than it looks like.
Deno easily runs TypeScript without a compile step. TypeScript is a very mature, developer friendly language that was designed to model the super complicated types often seen in JS. This includes unions and intersections which help you model complex rules between optional properties, as well as template literal types which can help you restrict string constants. As it so happens, those same types of objects are present in our configurations.
TypeScript is also flexible about how much you'd like to model. Do you want only properties with really nice autocomplete with docs from the language server? Sure we can do just that. Do you want to only allow strings that look like a time duration for that property? Can be done too with template literal types. You choose where to invest your energy.
Building abstractions on top of IaC is seen as painful and obscure. TypeScript has tools to help you avoid that, such as api-extractor: https://api-extractor.com/ - it can enforce that all your function abstractions are documented and it can generate that documentation for you.
The larger ecosystem also comes with a lot of ready-made codegen tools that can help, from small modules such as json-schema-to-typescript (https://www.npmjs.com/package/json-schema-to-typescript) to larger mature projects such as jsii and https://github.com/cdklabs/json2jsii . They can be used to build the tooling to import things like CRDs and other external schemas.
What about running arbitrary code, launching rockets, turing completness? This is where Deno comes in, with its permissions model (https://docs.deno.com/runtime/manual/basics/permissions). You can allow only a subset of commands (lets say, `helm` and `kustomize`, while you're migrating away from them), a subset of (writable) directories, accessible network hosts - or none at all.
What about the pains of managing JS modules? Deno lets you import files directly from URLs. It also allows you to set private tokens in env vars to ensure the imports succeed: https://docs.deno.com/runtime/manual/basics/modules/private - as a result, you can manage your IaC libraries the way that makes sense to you, without dealing with the unwieldy package managers of the node ecosystem.
What are some alternatives?
yj - CLI - Convert between YAML, TOML, JSON, and HCL. Preserves map order.
www.yaml.org - The yaml.org website
toml - Tom's Obvious, Minimal Language
noyaml - A silly emotional rant about the state of devops tooling/the infrastructure sector in 2018. #noyaml.com
cue - The home of the CUE language! Validate and define text-based and dynamic configuration
blooddy_crypto - ActionScript (AS3) library for processing binary data. This library contains MD5, SHA-1, SHA-2 ( SHA-224 и SHA-256 ), Base64, CRC32 algorithms, JSON encoder & decoder as well as PNG and JPEG encoders.
TOSIOS - The Open-Source IO Shooter is an open-source multiplayer game in the browser
LIBUCL - Universal configuration library parser
honeysql - Turn Clojure data structures into SQL
yq - yq is a portable command-line YAML, JSON, XML, CSV, TOML and properties processor
hjson - Hjson, a user interface for JSON