# evil-script: A Free Pascal scripting engine with JIT and DOS support

> evil-script is an embeddable, C-like scripting engine written in Free Pascal. It targets projects that need a lightweight interpreter with optional JIT compilation and even runs on DOS.

**Kagamma/evil-script** — Simple C-like scripting engine written in Free Pascal

- Repository: https://github.com/Kagamma/evil-script
- Stars: 34 · Forks: 7
- Language: Pascal
- License: MIT
- Published: 2026-08-22 · Updated: 2026-08-22 · Language: en
- Canonical page: https://hysenlabs.com/projects/kagamma-evil-script

## What evil-script is and who it is for

evil-script is a scripting engine written in Free Pascal, designed to be embedded into applications. It started as the scripting language for satania-buddy, a project that is not described further in the README, but the engine has since been spun off as a general-purpose tool. The target audience is Pascal developers who want to expose scripting to users without writing a full interpreter themselves. The syntax is C-like, which lowers the learning curve for many developers, though the implementation language is Pascal. The README lists supported platforms: DOS (go32v2), Windows (x86 and x64), Linux (x64 and AArch64). The author claims it should work on every platform except 8-bit and 16-bit systems, but that is a theoretical claim, not a tested one.

## The interpreter mechanism: indirect threading and JIT

The README states that the interpreter uses indirect threading, a technique where each bytecode instruction is represented as a pointer to the next instruction's handler. This avoids the overhead of a central dispatch loop by effectively threading the execution through the code itself. The claim is that this compares well to CPython in most cases, which is a performance statement, not a benchmark result from the repository. On x86-64 CPUs, the interpreter supports JIT compilation. The README says this makes it much faster than pure interpreter mode for number crunching. The JIT is optional, and the exact mechanism is not described in the README. The presence of JIT is a significant differentiator because most small scripting engines do not offer it, especially those written in Pascal.

## Building and running: the basic commands

The README gives three concrete commands. To build the standalone executable, run `fpc -O4 evil.pas`. This compiles the Pascal source with optimization level 4. To run a script, use `evil examples/hello.evil`. The examples directory is not listed in the README, but the hello.evil file is referenced as an example. For embedding, the README points to `Test.pas` and `evil.pas` as source references, and to a docs file at `docs/how-to-use.md`. There is no package manager or dependency installation step described. The build requires Free Pascal Compiler (FPC) version that supports the `-O4` flag, which is a standard optimization level. The fact that the build is a single command suggests a simple project structure, but it also means you need FPC installed on your system.

## Calling external functions: the SE_LIBFFI flag

To call external functions from DLLs or shared objects, the README instructs you to enable `SE_LIBFFI`. This is a compile-time flag, likely a conditional define in the Pascal source. The README does not explain how to enable it, but typical Free Pascal practice is to pass `-dSE_LIBFFI` to the compiler. The flag implies the use of libffi, a library that provides a foreign function interface. This is a key feature for integration, as it allows scripts to call into native libraries. However, the README does not document the syntax for declaring external functions in evil-script, nor does it mention any security implications. Enabling FFI is a powerful feature but also a potential risk if scripts are untrusted, as it allows arbitrary native code execution. The README does not address sandboxing or security at all.

## Documentation and examples: thin but present

The README links to a docs folder at `https://github.com/Kagamma/evil-script/tree/main/docs` and specifically to `docs/how-to-use.md`. The content of these files is not included in the material, so the depth of the documentation is unknown. The README itself is short, which suggests the project is at an early stage or that the author prefers code as documentation. The `Test.pas` file is mentioned as a reference for embedding, but its content is not shown. This is a limitation for adoption: a developer who wants to embed evil-script must read the source code to understand the API. The lack of a formal API reference or a tutorial in the README is a real gap. The presence of a docs folder is promising, but without seeing it, the quality is unverified.

## Performance claims and what they mean

The README makes two performance claims: the interpreter uses indirect threading and compares well to CPython, and the JIT on x86-64 is much faster than pure interpretation for number crunching. These are claims, not benchmark data. The repository does not include a benchmark suite or numbers. For an engineer evaluating the engine, this is a problem. The phrase 'compares well to CPython' is vague. CPython itself is not a performance leader, so the claim may be modest. The JIT claim is more specific: it is faster for number crunching, which is typical for JIT compilers. But the README does not say how much faster, or under what conditions. If you need predictable performance, you must run your own tests. The absence of benchmark scripts in the repository is a notable omission.

## Alternatives: poca and PascalScript

The README lists two alternatives: poca and PascalScript. poca is a project by BeRo1985, but the README gives no description. PascalScript is a scripting engine for Free Pascal that uses a Pascal-like syntax, not C-like. This is the key difference in approach: PascalScript is written for Pascal developers who want a Pascal-compatible scripting language, while evil-script offers a C-like syntax, which may appeal to developers coming from C or JavaScript. The README also links to a Google Sheets spreadsheet, which likely compares features, but the content is not provided. Without details on poca, the comparison is incomplete. An engineer should look at PascalScript if they prefer a Pascal-like language and a more mature ecosystem, as PascalScript has been around longer. evil-script's C-like syntax and JIT are its differentiators.

## Maintenance and license considerations

The repository has recent releases, with the last push on 2026-08-20 and releases on that date, 2025-09-18, and 2025-09-05. This indicates active maintenance, at least at the time of the material. The license is MIT, which is permissive and allows commercial use, modification, and redistribution with attribution. This is a low-risk license for embedding. The README does not mention any dependencies beyond FPC and optionally libffi. The maintenance cost for an adopter involves tracking updates, as the project is small and may have breaking changes between releases. The lack of a changelog in the README means you must inspect each release to understand changes. The project is not archived, which is a positive sign, but the small size and single maintainer imply that support is limited.

## Conclusion

Adopt evil-script if you need a small, embeddable C-like scripting language in a Free Pascal project, especially if you target DOS or want optional JIT on x86-64. Avoid it if you require a mature ecosystem, extensive documentation, or a pure interpreter with no external FFI complexity. Before adopting, verify the FFI path with SE_LIBFFI on your exact platform, confirm the JIT works on your x86-64 CPU, and review the docs folder for embedding details, since the README gives only minimal guidance.

## FAQ

### What are the three types of evil?

That question has nothing to do with this repository. evil-script is a C-like scripting engine written in Free Pascal, MIT licensed, built with fpc -O4 evil.pas and run as evil examples/hello.evil.

### What is considered evil speech?

The repository does not address speech or morality. What it contains is a scripting engine with examples for coroutines, generators, closures, JSON and import, plus an IDE folder and a VS Code extension.

### Did God create evil according to the Bible?

Nothing in this repository is about theology. It is a Pascal implementation of a C-like language, tested per the project's own statement on DOS, Windows and Linux, with an optional JIT on x86-64 and a compile-time switch for calling native libraries.

## Sources

- [Official README](https://github.com/Kagamma/evil-script#readme)
- [Project repository](https://github.com/Kagamma/evil-script)
- [Release notes](https://github.com/Kagamma/evil-script/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/kagamma-evil-script
