Diesel is widely used in AutoCAD
This Dumb Interpretively Executed String Expression Language is the kernel of a macro language you can customize by adding C code and embedding it into your program.
It is short, written in portable C, and is readily integrated into any program. It is useful primarily for programs that need a very rudimentary macro expansion facility without the complexity of a full language such as Lisp or FORTH.
Try it online: https://dderevjanik.github.io/diesel-js/
Our DIESEL documentation with Examples: ./docs/DIESEL.md
Fourmilab DIESEL Documentation
Diesel JS is a JavaScript compilation of the DIESEL language using Emscripten. It is a simple and easy-to-use library that allows you to evaluate DIESEL expressions in JavaScript.
Diesel JS is compiled with
Install package npm i diesel
import { evaluate } from "diesel";
const result = await evaluate("$(+, 1, 2)");
console.log(result); // 3npx diesel '$(+, 1, 2)'
or by installing diesel-cli globally npm i -g diesel and then using diesel '$(+, 1, 2)'
https://dderevjanik.github.io/diesel-js/
Checkout Diesel Examples
AutoCAD extends DIESEL with additional functions and variables. This library does not support all of them, but it does support the most common ones. Functions like rtos and angtos are not supported in DIESEL JS.
In order to compile DIESEL into javascript, you need to have Docker installed (emscripten is used to compile the C code into WebAssembly).
npm run compile-diesel
npm iinstall dependenciesnpm testto run unit tests (based on Fourmilab DIESEL tests)ts-node ./src/cli.ts -hto run the CLI
- Add AutoCAD functions (
rtos,angtos, etc.) - Publish to NPM