-
What is Keikaku? A dynamic, interpreted programming language with a plan-themed keyword vocabulary, first-class generators (with delegation and bidirectional communication), async/await, and structured error handling. The name means “plan” in Japanese.
-
How do I run Keikaku code? Launch the REPL with
keikaku, or execute a source file withkeikaku script.kei(.keiis the file extension). -
How do I declare a variable? Use
designate name = valuefor explicit declaration, orname := valuefor quick assignment. -
How do I print output? Use
declare(...), e.g.declare("Count:", count). -
What replaces if/else?
foreseefor the first branch,alternatefor additional conditions, andotherwisefor the default. -
What loops does it have? One keyword,
cycle, in three forms:cycle while cond,cycle through collection as item, andcycle from a to b as i. -
How are functions and generators defined? Functions use
protocol; generators usesequence. Aprotocolwith multipleyields behaves as a generator. -
How do I advance a generator? Call
proceed(gen); execution runs to the nextyieldand pauses. -
What is
delegate? Yield-from:delegate other()yields all values from another generator or list inline. -
How does a generator receive values from the caller? With
receive()inside the generator andtransmit(gen, value)from the caller; the generator can yield a response computed from the received value. -
Can I inject an exception into a running generator? Yes:
disrupt(gen, error)raises it at the generator’s suspension point, where an in-generatorattempt/recovercan catch it and continue. -
How do generator expressions work? Inline lazy sequences in parentheses:
(x * x for x through list), with an optional filter(x for x through list where cond). -
How does async work? Define
async protocol(orasync sequence) functions, useawaitto pause until a promise resolves or a generator yields, and construct resolved promises withresolve(value). -
What scheduling primitives exist?
defer(delay, fn, args...)schedules a call for later, andsleep(ms)pauses execution for a number of milliseconds. -
How do I handle errors? Wrap risky code in
attempt:and handle failures inrecover error:; the error is bound in the recover block. -
What is the
anomalyblock? A block that executes regardless of standard checks, intended for intentional deviations and prototyping. -
What data types are supported? Integers, floats, strings, booleans, lists (
[1,2,3]), and dictionaries ({key: val}). -
What built-in functions are available?
measure(length),span(n)(range list),text/number(conversions),classify(type name), plusdeclare,proceed,transmit,receive,resolve,defer, andsleep. -
How is Keikaku implemented? An ANTLR grammar front end with a C interpreter core, built via CMake/Makefile, with Shell packaging scripts and Python tooling.
-
How do I install it? Arch:
makepkg -siinpackaging/arch. Debian/Ubuntu/Kali:packaging/debian/install.sh. Windows: cross-compile withpackaging/windows/build_exe.sh(needs mingw-w64-gcc). Any OS:cmake .. && make && sudo make install.
REGAAN R