The AI Works community logo The Blockchain Works community logo The Functional Works community logo The Golang Works community logo The Java Works community logo The JavaScript Works community logo The Python Works community logo The Remote Works community logo The WorksHub company logo

We use cookies and other tracking technologies to improve your browsing experience on our site, analyze site traffic, and understand where our audience is coming from. To find out more, please read our privacy policy.

By choosing 'I Accept', you consent to our use of cookies and other tracking technologies.

We use cookies and other tracking technologies to improve your browsing experience on our site, analyze site traffic, and understand where our audience is coming from. To find out more, please read our privacy policy.

By choosing 'I Accept', you consent to our use of cookies and other tracking technologies. Less

We use cookies and other tracking technologies... More

Login or register
to publish this job!

Login or register
to save this job!

Login or register
to save interesting jobs!

Login or register
to get access to all your job applications!

Login or register to start contributing with an article!

Login or register
to see more jobs from this company!

Login or register
to boost this post!

Show some love to the author of this blog by giving their post some rocket fuel 🚀.

Login or register to search for your ideal job!

Login or register to start working on this issue!

Login or register
to save articles!

Login to see the application

Engineers who find a new job through Python Works average a 15% increase in salary 🚀

You will be redirected back to this page right after signin

Support PREPL format

Work started
Pull requests: 0
Contributors: 4
Level: Intermediate
  • Clojure
Work started
Pull requests: 0
Contributors: 4
Level: Intermediate
  • Clojure

On GitHub

Clojurescript selfhost library
More info >

Issue posted by: 
viebel's avatar

Yehonathan Sharvit

Description

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)

    Use Open Source to hire or get hired

    On GitHub

    Clojurescript selfhost library
    More info >

    Issue posted by: 
    viebel's avatar

    Yehonathan Sharvit

    Use Open Source to hire or get hired

    Support PREPL format
    View on GitHub