Fork me on GitHub
#babashka
<
2019-12-31
>
deleted00:12:56

is there a way to start a repl after executing some code? mainly I want to require something and switch to that namespace

mruzekw02:12:34

Is there a babashka-compatible equivalent to https://github.com/SBoudrias/Inquirer.js/

mruzekw02:12:02

I currently have a CLI tool that uses interactive lists as its interface. I wondered if I could port that to Clojure.

mruzekw02:12:23

I mean, I’m fine with sticking with JS as a host platform, but thought it would be cool to play with Babashka

mruzekw03:12:10

This would be distributed, so I’m considering the pros and cons of keeping it on JS

mruzekw03:12:50

I have always wondered how to paint interactive UI in the terminal. Albeit a selectable list

sogaiu04:12:34

yes, though i think i've seen the exe binary part being done in more than one way

borkdude13:12:00

would it be useful to have .ServerSocket and .Socket in bb? e.g. this now runs:

(require '[babashka.wait :as wait])

(defn socket-loop [^.ServerSocket server]
  (with-open [listener server]
    (loop []
      (with-open [socket (.accept listener)]
        (let [input-stream (.getInputStream socket)]
          (print (slurp input-stream))
          (flush)))
      (recur))))

(defn start-server! [port]
  (let [server (.ServerSocket. port)]
    (future (socket-loop server))
    server))

(defn stop-server! [^.ServerSocket server]
  (.close server))

(let [server (start-server! 1777)]
  (prn (wait/wait-for-port "127.0.0.1" 1777))
  (stop-server! server))

borkdude13:12:07

with the change on master

mruzekw21:12:18

Re: CLI tool Does GraalVM with JS reduce runtime like for Java?

borkdude21:12:59

Best to ask #graalvm specific questions in #graalvm, don't know the answer to that

mruzekw21:12:47

No worries