jbrukh / gpt-jargon

Jargon is a natural language programming language specified and executed by LLMs like GPT-4.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jargon: formalize `/execute procedure(parameter1,...,parametern)`

rabsef-bicrym opened this issue · comments

I'm not identifying how parameters are intended to be called against procedures. I think this could be formally specified making better, more specific, calls to execute.

It might be good to use something other than a comma, that is more obscure. A pipe character, for instance. This could help it differentiate from commas in the PARAMETERs and PARAMETER delimiters.

As of v0.0.10, basic params that are specified look like:

# sum two numbers
+++ func($x, $y)
- Return sum
+++

Most readable way to pass might be to define the variables first. Remember you can also use axioms to modify how parameters are passed inline.

You can also specify what you want the return values to look like. This doesn't need to be spec'd, it can just be divined by the interpreter.

    # sum two numbers
    +++ func($x, $y) returns only numbers
    - Return sum
    +++

    > [error!]

But maybe more idiomatic way would be via axioms:

    # sum two numbers
    +++ func($x, $y)
    * Returns only numbers
    - Return sum
    +++

You can still pass parameters as variables:

$msg = "Dear Santa,
I want a train for Christmas."

+++ display($msg, $num)
- Display $msg $num times
+++

/display($msg, 10)