A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.hashicorp.com/sentinel/docs/concepts/language below:

Policy Language | Sentinel | HashiCorp Developer

Sentinel defines and uses its own policy language.

The language was designed to be approachable by non-programmers, since there are many use cases where the individual defining policy may not be a developer. However, the language includes constructs that are familiar to developers to enable powerful policies.

To learn more about the language, please see the writing policy section or the language reference.

An example of the policy language is shown below:

Loading the playground...

Press "Run" to get policy output

To explain why Sentinel defines and uses its own language, the question can be more easily split into roughly two types of languages: configuration languages and programming languages.

Configuration Languages

Configuration languages are formats such as JSON, YAML, XML, etc. Many applications use configuration languages as their ACL format. Configuration languages are good for static, declarative information. ACL systems are a good fit for this. ACL systems are focused, providing the limiting options necessary to restrict access to a system.

Configuration languages are not good for dynamic or logical rules. They typically only contain limited conditions, loops, or functions. Further configuration is often declarative, which can introduce complexities to logical statements that depend on ordering.

The use cases that Sentinel was built for require the ability to perform complex behavior that didn't model well into a configuration format or a declarative form.

Programming Languages

The Sentinel language was designed with the following goals:

Prior to building our own language, Sentinel evaluated other languages. Some languages worked quite well. As we continued to develop Sentinel, we found that the flexibility and control over designing our own language outweighed the costs.

Because the language itself doesn't need to be general purpose, building a language focused on policy proved to be the best route for Sentinel. It allows us to build powerful tracing capabilities for debugging, make interesting performance choices, and extend the language as needed in the future.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4