sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    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

      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
      • thomthomT Offline
        thomthom
        last edited by

        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

          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
          • thomthomT Offline
            thomthom
            last edited by

            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
            • Dan RathbunD Offline
              Dan Rathbun
              last edited by

              @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

                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