nah is a slim almost-lisp-like scripting language.
it's primary goal is to be used as an embedded language (nahofte in Persian means embedded): it's a single-header-only stb-style library written in C89, it just depends on some standard libraries and dosn't use malloc.
just copy-paste nah.h into your project and use it like this:
#define NAH_IMPLEMENTATION
#include "nah.h"
int main(void) {
NahValue value = nah_eval_string("(+ 1 2 3 4)");
nah_print_value(value);
return 0;
}you can introduce C functions and macros (not implemented yet!) to extend the language, see nah.c for example. see INTERFACE section of nah.h for more functionalities.
nah's language is like lisp, but without lambda functions: first expresion of a list has to be a symbol!
additionally, nah's language has a synatx sugar for (do ...). it's like this:
(do (a b c d) (x y z) (u v w))
==
{ a b c d; x y z; (u v w)}
or, if you don't care about reslut of (u v w) it can be like { a b c d; x y z; u v w; }.
for example this is a valid script:
{
var a 0;
var b 1;
var c;
while (< a 1000) {
set c (+ a b);
set a b;
set b c;
};
a
}
it's under public domain licnese and mit lincense, which ever you prefer. see end of nah.h for complete information.