Skip to content

zoravur/spock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spock

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.

Read the introduction →

Example

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

Installation

git clone --recurse-submodules https://github.com/zoravur/spock.git
cd spock
uv venv && uv pip install antlr4-python3-runtime

For live speech recognition, also install:

uv pip install librosa soundfile faster-whisper torch torchaudio

Usage

Live Mode (speak your code)

  1. Start the whisper streaming server:

    python whisper_streaming/whisper_online_server.py --model small --lan en --port 43001
  2. 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.

Requirements for live mode

  • Linux with ALSA (for arecord) or equivalent audio capture
  • NVIDIA GPU (for local Whisper) or use --backend openai-api with an API key

Testing

Run .spk files directly:

.venv/bin/python spock/main.py test/v2grammar/hello.spk

See the test/v2grammar folder for more example programs.

About

a programming language you speak out loud

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published