Skip to main content

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.

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

jitter_llm-0.1.0.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jitter_llm-0.1.0-py3-none-any.whl (33.8 kB view details)

Uploaded Python 3

File details

Details for the file jitter_llm-0.1.0.tar.gz.

File metadata

  • Download URL: jitter_llm-0.1.0.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for jitter_llm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 db412ea4e2b2e8af495412c769cec387d28202722e30f7321f37ba03982d8210
MD5 44db3bd6df310643e7620ad871ecf8d4
BLAKE2b-256 5de3a3ef12252b08142005b2101aa1404d8a66b493f1bf7d189b07c68c8ce0f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for jitter_llm-0.1.0.tar.gz:

Publisher: release.yml on JasonSteving99/Jitter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jitter_llm-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: jitter_llm-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for jitter_llm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8faf029b9a2a317020f4113c8f6b38a0c77eaa3acb7c0b8d8cbecdaa59f982e4
MD5 64100f2442e645c4d830fcba424a3b04
BLAKE2b-256 db86ed96fb5b3c318ad6cee63a08a0e0e1924631b42ef9cef46d1ad32878e896

See more details on using hashes here.

Provenance

The following attestation bundles were made for jitter_llm-0.1.0-py3-none-any.whl:

Publisher: release.yml on JasonSteving99/Jitter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page