I’m looking to write a javascript heavy clientside program with a
something serverside backend that connects to the free maxima math
program. I have extensive knowledge of ruby on rails, so I would prefer
to call Maxima with ruby, but I don’t know if this is even possible. Its
fairly easy to call Maxima (with a lisp implementation) using ANSI C, it
is a little less easy to implement using JAVA with a lisp implementation
like Armed Bear, but I don’t see any information about using Maxima with
Ruby or Ruby on Rails.
Since Maxima as far as I can tell is the number one most powerful
open-source math program, and RoR is my favorite open-source web
framework, it would seem like a good fit. Has anyone implemented any
math heavy applications with RoR, and can you give me any advice (anyone
know if RoR and maxima is possible) ??
Thanks that did the trick. Do you know if there is an easy way to get
the last result, or everything without having to do so many “gets”? I
tried .each and readlines but with not much success. Or at least a way
to determine when the last line has been "get"en without error-ing out?
max = IO.popen(“maxima”, “w+”)
=> #IO:0x201bccc
max.puts “1+1;”
=> nil
max.gets
=> “Maxima 5.15.0 http://maxima.sourceforge.net\n”
max.gets
=> “Using Lisp SBCL 1.0.17\n”
max.gets
=> “Distributed under the GNU Public License. See the file COPYING.\n”
max.gets
=> “Dedicated to the memory of William Schelter.\n”
max.gets
=> “The function bug_report() provides bug reporting information.\n”
max.gets
=> “(%i1) \n”
max.gets
=> “(%o1) 2\n”
max.puts “1+9;”
=> nil
max.gets
=> “(%i2) \n”
max.gets
=> “(%o2) 10\n”
max.gets
max.readlines.last
^CIRB::Abort: abort then interrupt!!
from /opt/local/lib/ruby/1.8/irb.rb:81:in irb_abort' from /opt/local/lib/ruby/1.8/irb.rb:243:insignal_handle’
from /opt/local/lib/ruby/1.8/irb.rb:66:in start' from (irb):2:incall’
from (irb):2:in `readlines’
from (irb):2
When you run max.readlines.anything script/console freezes
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.