Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geb-morphism frontend #103

Open
mariari opened this issue Apr 26, 2023 · 0 comments
Open

geb-morphism frontend #103

mariari opened this issue Apr 26, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request frontend

Comments

@mariari
Copy link
Member

mariari commented Apr 26, 2023

I am sick of writing terms by hand.

(def silly-example
  (comp (mcase nil->list
               (comp cons->list (cons-on-cons geb-bool:true)))
        cons->list *cons*))

is a pain to write, as I have to remember reverse order due to comp, and to evaluate this I have to call gapply on this value. We further can't AOT anything as we are just defining a term bare.

What we need is a DSL

I suggest this

(define-morphism silly-example ()
  *cons*
  cons->list
  (mcase nil->list
         (comp cons->list (cons-on-cons geb-bool:true))))

which reads the arguments as in forth, meaning it's in arrow order which is a more natural way to realistically work

The above expression should expand into something like

(def silly-example
  (optimze
    (comp (mcase nil->list
                 (comp cons->list (cons-on-cons geb-bool:true)))
          cons->list *cons*)))

(defun silly-example (value)
  (gapply silly-example value))

Further, I want more standard library increases, but this should be the first of many such changes

@rokopt rokopt added the enhancement New feature or request label May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend
Projects
None yet
Development

No branches or pull requests

3 participants