   (.flush out))
 
 (defn read-response [^BufferedReader in]
-  (let [sb (java.lang.StringBuilder.)]
+  (let [sb (StringBuilder.)]
     (loop [sb sb c (.read in)]
       (cond
        (= c 1) (let [ret (str sb)]
                  (print ret)
-                 (recur (java.lang.StringBuilder.) (.read in)))
+                 (recur (StringBuilder.) (.read in)))
        (= c 0) (str sb)
        :else (do
                (.append sb (char c))

(defn repl-env
  [& {:keys [host port] :or {host "localhost" port 5001}}]
  (let [repl-env (socket host port)
        base (io/resource "goog/base.js")
        deps (io/resource "goog/deps.js")]
    (node-eval repl-env (slurp (io/reader base)))
    (node-eval repl-env (slurp (io/reader deps)))
    repl-env))

  (:refer-clojure :exclude [loaded-libs])
  (:require [clojure.string :as string]
            [clojure.java.io :as io]
            [cljs.env :as env]
            [cljs.analyzer :as ana]
            [cljs.compiler :as comp]
            [cljs.repl :as repl]
            [cljs.closure :as cljsc])
  (:import cljs.repl.IJavaScriptEnv
           java.net.Socket
           java.lang.StringBuilder
           [java.io BufferedReader BufferedWriter]))

(def current-repl-env (atom nil))
(def loaded-libs (atom #{}))

(defn socket [host port]
  (let [socket (Socket. host port)
        in     (io/reader socket)
        out    (io/writer socket)]
    {:socket socket :in in :out out}))

(defn close-socket [s]
