Skip to content
forked from AZHenley/Mirror

An LLM-powered programming-by-example programming language.

License

Notifications You must be signed in to change notification settings

boulirox/Mirror

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fork from the original project concept I don't claim any rights on this... I found this project super cool so I had to idea to expands it to be able to work with other programming languages and to also be able to create functions that simply do stuff without returning anything :) mirror_new_features

Mirror: An LLM-powered programming-by-example programming language.

For more details, see the blog post.

mirrorplayground

In the Mirror programming language, you define functions by providing sets of input-outputs pairs and you can call those functions. That is it. The entire program behavior must be specified through those examples.

signature is_even(x: number) -> bool
example is_even(0) -> true
example is_even(1) -> false
example is_even(222) -> true
example is_even(-99) -> false

is_even(12345)

Using the Mirror syntax, you give the function name, parameters and their types, and the return type as well as one or more examples with the expected result. It uses a strict syntax and supports a handful of types (including lists). You can create multiple functions and chain them.

After parsing, the "compiler" uses an LLM to generate JavaScript that satisfies the constraints expressed by the examples. You should review the generated code to verify it is correct, or provide more examples and recompile it. When you run it, the last value will be printed.

About

An LLM-powered programming-by-example programming language.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 54.7%
  • JavaScript 45.3%