Fork me on GitHub
#babashka
<
2019-12-31
>
Nate Sutton00: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

Nate Sutton12:12:27

that's just what I wanted, thanks!!

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.

Nate Sutton02:12:35

you could use inquirer.js itself with clojurescript

Nate Sutton02:12:51

I'm pretty sure

Nate Sutton02:12:10

I mean I'd love something like that available in babashka, though

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

Nate Sutton03:12:37

you could build it using graalvm

Nate Sutton03:12:48

like babashka is

Nate Sutton04:12:05

oooooh that's cool

Nate Sutton04:12:12

so, you can use something like shadow-cljs and compile your app for node and then use the npm packaged called "pkg" to bundle your js file with a node vm as an executable binary

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

Nate Sutton13:12:11

that's really nice, I like it

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