A programming language designed to be spoken aloud.
Spock uses natural language constructs optimized for speech recognition — say "quote hello world unquote" instead of wrestling with punctuation that voice interfaces can't handle.
print quote hello world unquote
A more complex example — Fibonacci sequence:
declare a
declare b
declare c
set a as zero
set b as one
while ten begin
set c as call sum with a and b
print c
set a as b
set b as c
finish
git clone --recurse-submodules https://github.com/zoravur/spock.git
cd spock
uv venv && uv pip install antlr4-python3-runtimeFor live speech recognition, also install:
uv pip install librosa soundfile faster-whisper torch torchaudio-
Start the whisper streaming server:
python whisper_streaming/whisper_online_server.py --model small --lan en --port 43001
-
In another terminal, speak your code:
arecord -f S16_LE -c1 -r 16000 -t raw -D default | nc localhost 43001 | .venv/bin/python spock/main.py
Say "flush" to execute the buffered code.
- Linux with ALSA (for
arecord) or equivalent audio capture - NVIDIA GPU (for local Whisper) or use
--backend openai-apiwith an API key
Run .spk files directly:
.venv/bin/python spock/main.py test/v2grammar/hello.spkSee the test/v2grammar folder for more example programs.