Re: NodeJS REPL
I wanted one of these the other day. Great stuff. I'm looking forward to toying around with it as well. On Wednesday, October 12, 2011 at 5:44 PM, Michael Fogus wrote: > David's right about :nodejs. Thank you for this contribution. I can't wait to > play around with it. If some ideas come to mind I will provide feedback. > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > (mailto:clojure@googlegroups.com) > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > (mailto:clojure+unsubscr...@googlegroups.com) > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: NodeJS REPL
David's right about :nodejs. Thank you for this contribution. I can't wait to play around with it. If some ideas come to mind I will provide feedback. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: NodeJS REPL
Nice! I think :target :nodejs is just about guaranteeing that some Node.js definitions like 'require' are in place and providing a more sensible print fn. David On Wed, Oct 12, 2011 at 11:48 AM, kurtharriger wrote: > I took a stab at writing a repl for nodejs. > > The node documentation has an example of starting a repl that listens > on a socket: > http://nodejs.org/docs/v0.3.1/api/repl.html > > Using this I attempted to implement repl/IJavaScriptEnv with some > degree of success. I had a little bit of trouble determining when > nodejs had finished writing the results since it may span multiple > lines and there doesn't appear to be a stop sequence that indicates > its done writing. I figure for now I could just read, sleep for a > second, and check if anything more available. But for now I've at > least some simple communication which would be good enough for me. > > What I'm not really sure about is how :target :nodejs changes the > compiler output and what I need to do to load the correct bootstrap > files? > > I tried (repl/load-file ctx "cljs/core.cljs") on setup but that > doesn't seem to work. I also tried to compile an completely > empty.cljs file to nodejs and run this into node but this isn't > working for me either. > > Anyone know a bit more about the node compilation that could help me > bootstrap the repl environment? > My work in progress is here: > https://github.com/kurtharriger/clojurescript/tree/wip/node-repl > > start node repl listening on 5001: > node node/repl.js > > connect with clojurescript: > script/replnode > > To see what is actually getting sent to the node process I usually > just use: > nc -l 5001 | tee out.txt > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
NodeJS REPL
I took a stab at writing a repl for nodejs. The node documentation has an example of starting a repl that listens on a socket: http://nodejs.org/docs/v0.3.1/api/repl.html Using this I attempted to implement repl/IJavaScriptEnv with some degree of success. I had a little bit of trouble determining when nodejs had finished writing the results since it may span multiple lines and there doesn't appear to be a stop sequence that indicates its done writing. I figure for now I could just read, sleep for a second, and check if anything more available. But for now I've at least some simple communication which would be good enough for me. What I'm not really sure about is how :target :nodejs changes the compiler output and what I need to do to load the correct bootstrap files? I tried (repl/load-file ctx "cljs/core.cljs") on setup but that doesn't seem to work. I also tried to compile an completely empty.cljs file to nodejs and run this into node but this isn't working for me either. Anyone know a bit more about the node compilation that could help me bootstrap the repl environment? My work in progress is here: https://github.com/kurtharriger/clojurescript/tree/wip/node-repl start node repl listening on 5001: node node/repl.js connect with clojurescript: script/replnode To see what is actually getting sent to the node process I usually just use: nc -l 5001 | tee out.txt -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en