From 1e9192d2eda2cb016fc973c11c2529813c68902e Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Thu, 6 Nov 2025 21:31:24 -0800 Subject: add README --- README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..de5c6b1 --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ +# KaiScript + +#### KaiScript is a simple functional programming language implemented inside of the TypeScript type system and inside of the TypeScript language. + +This means that you can write programs inside TypeScript that evaluate without running the code. The inferred type of a KaiScript program is always exactly equal to the runtime value. + +## Using KaiScript + +To see what KaiScript is capable of, take a look at the guided tour here: [[EXAMPLES]](./examples/README.md) + +## Source code + +https://git.aberrantflux.xyz/kai-script.git/ + +## FAQ + +> Why would I want to use this? + +You probably wouldn't! + +> Why did you make this? + +TypeScript has a fantastic type system that is somewhat underappreciated in the public consciousness. Writing this was super fun, and I discovered a lot along the way. You should do it too! If you're interested in trying, I recommend not looking at the implementation of KaiScript. **Most of the fun is in figuring it out for yourself**. + +> How can I write imperative code? + +You can't. + +> How can I publish a package for KaiScript? + +KaiScript doesn't have its own package manager, but it works natively with npm. +If you've written a useful library, just export it like so: + +```typescript +export const myKaiScriptFunction = "fn(...)"; +``` + +Publish it to npm, and anyone else can easily use it via template literals: + +```typescript +import { myKaiScriptFunction } from "my-kai-script-function"; +export const usesLibrary = `call(${myKaiScriptFunction}, args)`; +``` -- cgit v1.2.3-70-g09d2