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

Support PREPL format #5

Open
viebel opened this issue Mar 12, 2019 · 6 comments
Open

Support PREPL format #5

viebel opened this issue Mar 12, 2019 · 6 comments

Comments

@viebel
Copy link
Owner

viebel commented Mar 12, 2019

suggested by @raymcdermott

The motivation

I would like the same client code for the remote PREPL and the self-hosted PREPL
it’s just trying to make things conform to some standard mechanisms
so that whatever works with the other PREPLs will also work self-hosted

The implemenation details

that we could make a wrapper around the js/eval stuff that back the same data as the PREPL
the way I think about it is that the socket server is just a means to connect to a REPL
and the PREPL can distinguish between output and values <--- the main point of PREPL imho
so you only ever get one value per eval
so we need some key per eval (can just be a simple atom counter)
and then no interleaving
or something like that
main thing is I want to be able to use the PREPL data structures in bootstrapped CLJS

Here is a spec for a PREPL map:

(def tags #{:ret :out :err :tap})
(spec/def ::tag (spec/with-gen keyword? #(spec/gen tags)))
(spec/def ::val ::general/string-data?)
(spec/def ::ns ::general/string-data?)
(spec/def ::ms int?)
(spec/def ::form ::general/string-data?)
(def phase-indicators #{:read-source :macro-syntax-check :macroexpansion :compile-syntax-check
                        :compilation :execution :read-eval-result :print-eval-result})
(spec/def ::phase-error
  (spec/with-gen keyword? #(spec/gen phase-indicators)))

(spec/def ::eval-result
  (spec/keys :req-un [::tag ::val]
             :opt-un [::ms ::ns ::form ::phase-error]))

each :form must be evaluated and assigned a :val
klipse-clj should add a new eval function that returns a list of maps (and it will work because each map will have a :form and a tag (eg :ret or :out) and a :val)

@viebel
Copy link
Owner Author

viebel commented Mar 12, 2019

@raymcdermott is the description of the issue accurate enough?
Feel free to add more details

@workshub
Copy link

workshub bot commented Jun 2, 2020

This issue is now published on WorksHub. If you would like to work on this issue you can
start work on the WorksHub Issue Details page.

@workshub
Copy link

workshub bot commented Jan 25, 2021

@Verdinjoshua26 started working on this issue via WorksHub.

@workshub
Copy link

workshub bot commented Jan 29, 2021

@edi2212 started working on this issue via WorksHub.

@workshub
Copy link

workshub bot commented Feb 8, 2021

A user started working on this issue via WorksHub.

1 similar comment
@workshub
Copy link

workshub bot commented Feb 19, 2021

A user started working on this issue via WorksHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant