Arc Forumnew | comments | leaders | submitlogin
1 point by antiismist 5813 days ago | link | parent

Is there any way to shoot the text over to an already running interpreter and capture the output (to delay startup times..)?


2 points by almkglor 5813 days ago | link

Possibly some mkfifo hackery in Linux?

Possibly do something stupid like:

  mkfifo to_arc
  mkfifo from_arc
  ./arc.sh < to_arc > from_arc
Then just pipe commands through the to_arc and from_arc FIFO's? (this is untested)

Edit: Alternatively, you might want to do this in a thread on an existing arc session, again still using mkfifo hackery:

  (w/infile i "to_arc"
    (w/outfile o "from_arc"
      (w/uniq invalid
        (def foo ()
          (let ip (read i invalid)
            (if (isnt ip invalid)
                (write (eval ip) o)))
          (foo)))))
  (thread (foo))

-----