Running Ruby code in a web browser
-
repl.it is a Ruby (and more) interpreter compiled into JavaScript. We can use it to run Ruby scripts completely in the browser (ie. no server is required to evaluate code and return the result).
I've built an example to create aSketchup::Edge
: http://repl.it/Hpd/1/โThat's one small edge for man, one endless circle for mankind.โ
-
Interesting.
So, when can we expect a fully virtualized SketchUp sandbox?
@aerilius said:
โThat's one small edge for man, one endless circle for mankind.โ
I see what you did right there.
-
Not sure whether the Trimble license allows that (ie. replication of the API).
A dummy API for testing outside of SketchUp could be useful (or we could have a real 3d ascii terminal modeler).What I find most remarkable is that we actually don't need to fear switching from Ruby programming to JavaScript (if that plays a role in the future of SketchUp). Maybe there is a way to compile Ruby code directly into JavaScript (without the detour over a slow virtualized Ruby interpreter in JS). I don't expect noticeable performance impact, and we would benefit from that Ruby is a nice language with real modules/classes etc.
-
Ugh, I hope there is no switch from Ruby to JS. I am really not fond of the JS syntax.
-
@aerilius said:
Maybe there is a way to compile Ruby code directly into JavaScript (without the detour over a slow virtualized Ruby interpreter in JS).
@unknownuser said:
(http://en.wikipedia.org/wiki/RubyJS)":a0zse4if]RubyJS is a port of Google Web Toolkit to the Ruby programming language. RubyJS trans-compiles Ruby source code to JavaScript, which allows running client-side applications in a web browser.
-
This post is deleted!
Advertisement