• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

Running Ruby code in a web browser

Scheduled Pinned Locked Moved Developers' Forum
6 Posts 4 Posters 377 Views 4 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    Aerilius
    last edited by 5 Feb 2013, 00:48

    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 a Sketchup::Edge: http://repl.it/Hpd/1/ ☀

    „That's one small edge for man, one endless circle for mankind.“

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 5 Feb 2013, 08:54

      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.

      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • A Offline
        Aerilius
        last edited by 5 Feb 2013, 10:24

        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.

        1 Reply Last reply Reply Quote 0
        • T Offline
          thomthom
          last edited by 5 Feb 2013, 11:08

          Ugh, I hope there is no switch from Ruby to JS. I am really not fond of the JS syntax.

          Thomas Thomassen — SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • D Offline
            Dan Rathbun
            last edited by 5 Feb 2013, 23:01

            @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.

            I'm not here much anymore.

            1 Reply Last reply Reply Quote 0
            • O Offline
              oneclcika Newcomers
              last edited by 25 Oct 2023, 12:34

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Buy SketchPlus
              Buy SUbD
              Buy WrapR
              Buy eBook
              Buy Modelur
              Buy Vertex Tools
              Buy SketchCuisine
              Buy FormFonts

              Advertisement