Build your program Just-in-Time with LLM Assistance
Project description
Jitter
Jitter is an experiment in what it would look like to work in a programming language that enables you to interactively lay down the train tracks in front of you as you're going.
Instead of figuring out everything in advance and running it later, just litter your program with
NotImplementedErrors or call functions that don't even exist yet, and instead of letting your program crash, Jitter
will handle these cases at runtime by allowing you to implement the function just in time. So, rather than these
situations being the end of the road leading to some uncrecoverable crash, you can just lay down some more track in
front of you and keep on keepin on!
CoRecursive Programming Language Jam Submission
This project is my submission to a 2 week (1 week planning - 1 week implementation) programming language jam hosted in the CoRecursive Slack Community. Don't expect this to be a fully fledged, bulletproof project.
Design
Before
If you have functions like:
def foo():
print("In foo")
bar()
def bar():
print("In bar")
raise NotImplementedError("Oh no, this function's not implemented yet!")
and a program like this:
if __name__ == "__main__":
foo()
normally, you'd run into a crash, something like:
In foo
In bar
Traceback (most recent call last):
File "/Users/jasonsteving/Projects/PLJam/ex.py", line 10, in <module>
foo()
File "/Users/jasonsteving/Projects/PLJam/ex.py", line 3, in foo
bar()
File "/Users/jasonsteving/Projects/PLJam/ex.py", line 7, in bar
raise NotImplementedError("Oh no, this function's not implemented yet!")
NotImplementedError: Oh no, this function's not implemented yet!
:(
After
With Jitter, you can simply wrap your program like:
if __name__ == "__main__":
with Jitter():
foo()
and now, any time a NotImplementedError is reached, Jitter will automatically handle the error, pausing execution and asking you for a (re-)implementation of the offending function (potentially using LLM code-generation). Then, once you've given it the valid implementation, Jitter will edit the source code in place to replace the bad implementation with your new implementation, and then by way of stack inspection, Jitter will literally resume your program from where it left off, but this time using the new given implementation.
This idea is repeatable within a given session, so you can incrementally build out your program, laying one more piece of track in front of you at a time so that the program never dies just because something wasn't yet implemented yet.
Stretch Goal Idea
In the future, I may extend this to handle NameError, e.g:
File "/Users/jasonsteving/Projects/PLJam/ex.py", line 2, in foo
bar()
^^^
NameError: name 'bar' is not defined
to give you a chance to implement the non-existent function and keep going.
Install Using UV
Install Jitter using the below command:
$ uv add jitter-llm --optional cli
If you don't want to be able to autogenerate scaffolding for programs that can be implemented via Jitter, drop the --optional cli args.
Auto-Generate Scaffolding for Programs to Try Out Jitter
The fastest way to get started with Jitter and get a feel for it is to run something like:
$ mkdir -p "sample/text_box_repl"
$ uv run jitter --output_dir "sample/text_box_repl" --desc "A repl that echoes but allows users to choose the shape of the boxes"
Claude Code will then go off and generate the scaffolding for the program you described, leaving all the implementations as raise NotImplementedError("...") so you can implement the detailed behavior using Jitter. Btw, you may ask yourself "why not just have Claude Code go and implement the full implementation for me then? Why use Jitter at all?"...I encourage you to try out both! Try just giving Claude Code the exact same one liner prompt directly, letting it run in auto-accept-edits mode, and see if it produces something you're happy with! In my experience I've actually been surprised that Jitter actually seems to do a better job of building out the program more efficiently than Claude Code on its own, but hey, this is all an experiment.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jitter_llm-0.3.1.tar.gz.
File metadata
- Download URL: jitter_llm-0.3.1.tar.gz
- Upload date:
- Size: 37.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8323c0cf298a7d31e55af3b735c0de4ac8679a3c7c3daa4b60fb1aca36ee2c9
|
|
| MD5 |
4b9544e5c613938c0403843dc1cddb26
|
|
| BLAKE2b-256 |
240774834043b082800c79d04be170352a00c118c5188e42b05a2deb592ab60d
|
Provenance
The following attestation bundles were made for jitter_llm-0.3.1.tar.gz:
Publisher:
release.yml on JasonSteving99/Jitter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jitter_llm-0.3.1.tar.gz -
Subject digest:
b8323c0cf298a7d31e55af3b735c0de4ac8679a3c7c3daa4b60fb1aca36ee2c9 - Sigstore transparency entry: 238769990
- Sigstore integration time:
-
Permalink:
JasonSteving99/Jitter@51385be691a0cc2f21185fcf1a8bf89c02161607 -
Branch / Tag:
refs/tags/0.3.1 - Owner: https://github.com/JasonSteving99
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@51385be691a0cc2f21185fcf1a8bf89c02161607 -
Trigger Event:
release
-
Statement type:
File details
Details for the file jitter_llm-0.3.1-py3-none-any.whl.
File metadata
- Download URL: jitter_llm-0.3.1-py3-none-any.whl
- Upload date:
- Size: 47.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
634e32150a630b5f8c9f8afb571c14f896d5923026594d6bb9c2b4c5a2ee77ef
|
|
| MD5 |
2c35a2a495e4aa120c15f2081ddb671f
|
|
| BLAKE2b-256 |
8cb67919f5252aa2b8653201d1d54c0dfa913267721f1add21fd9ccf7ac34163
|
Provenance
The following attestation bundles were made for jitter_llm-0.3.1-py3-none-any.whl:
Publisher:
release.yml on JasonSteving99/Jitter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jitter_llm-0.3.1-py3-none-any.whl -
Subject digest:
634e32150a630b5f8c9f8afb571c14f896d5923026594d6bb9c2b4c5a2ee77ef - Sigstore transparency entry: 238769992
- Sigstore integration time:
-
Permalink:
JasonSteving99/Jitter@51385be691a0cc2f21185fcf1a8bf89c02161607 -
Branch / Tag:
refs/tags/0.3.1 - Owner: https://github.com/JasonSteving99
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@51385be691a0cc2f21185fcf1a8bf89c02161607 -
Trigger Event:
release
-
Statement type: