# samshadwell/trumpscript

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/samshadwell-trumpscript).**

7,587 stars · 392 forks · Python · MIT · archived

## Links

- GitHub: https://github.com/samshadwell/TrumpScript
- awesome-repositories: https://awesome-repositories.com/repository/samshadwell-trumpscript.md

## Description

TrumpScript is a Python-based domain specific language and compiler extension that wraps the Python runtime to enforce custom grammar and vocabulary rules. It transforms a specialized, case-insensitive vocabulary and natural speech patterns into executable Python instructions.

The implementation distinguishes itself through strict constraints on source code, including a variable name system that restricts identifiers to a predefined whitelist and a numeric parser that rejects any integer not exceeding one million. It further utilizes a token-filtering preprocessor to remove filler words and non-functional phrases from the source code.

The project includes system-level execution restrictions that block compilation and running based on the host machine's operating system, locale, or hardware properties.

## Tags

### Programming Languages & Runtimes

- [Domain Specific Languages](https://awesome-repositories.com/f/programming-languages-runtimes/programming-language-varieties/domain-specific-languages.md) — Provides a specialized programming language based on Python with restricted vocabularies and unique grammar.
- [Domain Specific Languages](https://awesome-repositories.com/f/programming-languages-runtimes/domain-specific-languages.md) — Implements a specialized language that limits available variables and numeric types for a conceptual purpose.
- [Language Interpreters](https://awesome-repositories.com/f/programming-languages-runtimes/language-interpreters.md) — Interprets a programming language using a case-insensitive vocabulary based on specific speaking styles. ([source](https://github.com/samshadwell/trumpscript#readme))
- [Language Wrappers](https://awesome-repositories.com/f/programming-languages-runtimes/language-wrappers.md) — Wraps the Python runtime to transform natural speech patterns into executable instructions.
- [Token Filtering](https://awesome-repositories.com/f/programming-languages-runtimes/preprocessor-code-generation/token-filtering.md) — Uses a token-filtering preprocessor to remove filler words and non-functional phrases from source code.
- [Compiler Extensions](https://awesome-repositories.com/f/programming-languages-runtimes/python-compilers/compiler-extensions.md) — Extends the compilation process to filter tokens and restrict variable names before executing Python.
- [Speech-Style Token Filtering](https://awesome-repositories.com/f/programming-languages-runtimes/source-code-generators/specification-from-code-generators/natural-language-code-generators/speech-style-token-filtering.md) — Discards unnecessary words from the source code to make it resemble natural human speech. ([source](https://github.com/samshadwell/trumpscript#readme))
- [Syntax Extensions](https://awesome-repositories.com/f/programming-languages-runtimes/syntax-extensions.md) — Modifies how Python code is written and interpreted through token filtering and case-insensitivity.
- [Identifier Naming Conventions](https://awesome-repositories.com/f/programming-languages-runtimes/identifier-naming-conventions.md) — Restricts variable identifiers to a predefined list of approved words to enforce specific naming conventions. ([source](https://github.com/samshadwell/trumpscript#readme))
- [Deployment Target Restrictions](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-execution-environments/runtime-environments/runtimes/javascript-and-web-standard/secure-javascript-runtimes/execution-restrictions/deployment-target-restrictions.md) — Ensures the software only runs on specific operating systems or hardware to control the deployment target.

### Development Tools & Productivity

- [Vocabulary Mapping](https://awesome-repositories.com/f/development-tools-productivity/parser-modules/dynamic-grammar-compilation/grammar-compilation/vocabulary-mapping.md) — Maps a specialized, spoken-style vocabulary into instructions compatible with the Python runtime.
- [Restricted Runtimes](https://awesome-repositories.com/f/development-tools-productivity/isolated-execution-environments/python-execution-sandboxes/restricted-runtimes.md) — Provides an execution layer that limits numeric types and blocks compilation based on host hardware or locale.
- [Hardware and Locale Blocking](https://awesome-repositories.com/f/development-tools-productivity/platform-script-execution/dynamic-script-execution-environments/inline-script-execution/execution-blocking/hardware-and-locale-blocking.md) — Prevents the program from running on forbidden hardware by checking host system properties and locale.

### Data & Databases

- [Numeric Range Constraints](https://awesome-repositories.com/f/data-databases/data-querying/table-item-filters/numeric-range-filters/numeric-range-constraints/numeric-range-constraints.md) — Limits numeric values to integers strictly greater than one million to enforce specific data requirements. ([source](https://github.com/samshadwell/trumpscript#readme))

### Security & Cryptography

- [Host Hardware Restrictions](https://awesome-repositories.com/f/security-cryptography/security/policies/host-resource-access/environment-access-controls/runtime-environment-restrictions/host-hardware-restrictions.md) — Blocks compilation or execution based on the host machine's operating system, locale, or hardware origin. ([source](https://github.com/samshadwell/trumpscript#readme))

### Software Engineering & Architecture

- [Identifier Validations](https://awesome-repositories.com/f/software-engineering-architecture/naming-conventions/identifier-validations.md) — Restricts variable names to a predefined set of permitted strings during the semantic analysis phase.
- [Numeric Literal Constraints](https://awesome-repositories.com/f/software-engineering-architecture/optional-value-types/value-constraint-enforcers/numeric-literal-constraints.md) — Enforces a minimum threshold on integer literals by rejecting any number not exceeding one million.
- [Lexical Analysis](https://awesome-repositories.com/f/software-engineering-architecture/string-matching-algorithms/string-comparisons/case-insensitive-comparators/lexical-analysis.md) — Implements case-insensitive lexical analysis to map stylized vocabulary into executable programming logic.
