Aerilius is correct. It was rewritten into C++. That way it can be used on all out platforms if needed. (And I wasn’t doing that conversion - I just consulted.)
Personally I prefer extensions to remain extensions in general. They are more flexible to maintain and update. And open an extension provide specialized functionality that does’t apply widely. But there are some which is generic enough to justify adopting into SU itself. SI is one of them.
Whenever I looked again into it, nothing has changed unfortunately.
But with Web Assembly, the languages can be bridged, basically the language does not matter. Still, having the same interface is what matters, but that’s the whole point of an API?
There is even a ruby-wasm project, so Ruby code can be made available to SketchUp for Web, without that developers actually need to rewrite all their code. And an extension API that can be targeted through WASM could then also become the major supported API for the desktop, replacing the Ruby API while staying compatible.
I can see there may be some benefits to having the same language for processing the model and the UI, so giving a more direct connection and removing the asynchronicity, and opening-up opportunities for more integrated UI elements.
To me, developing for both platforms only seems feasible for either very small plugins or development by larger companies that can afford to have dedicated developers for each version.
What it may do, is force more of the complex plugins to move towards cloud-based processing, so the plugin itself just provides a front-end and more or less the same service can be offered on both platforms.
correct, that is a browser thing.
Actually, I use JS a lot outside of the browser, to do all sorts of automation, like quickly setting up a webserver, or even “building” my SketchUp extensions (things like combining everything in one file, changing the version numbers, removing some constant definitions from the sources, …)
I’ve not seen a way to make Ruby for a web-app compatible with the Ruby we ship with SketchUp. ruby-wasm is built on mruby - which is not the same as your vanilla Ruby. You don’t have all the features and the same stdlib.
There’s also technical challenges with running inside of a browser - which sandbox everything off from the system. you can forget file and system access like you get in the desktop app - that’s all locked down from within a browser.
1:1 compatible API on the web with the existing Ruby API on desktop would be great - but so far we’ve not found any feasible way of doing that.
That might not make too much of a difference for your typical SketchUp extension, as you’re calling into a thin wrapper on top of our C++ code. Most bottlenecks that people are running into is the underlying logic in SketchUp, not in Ruby itself.
Yes and no… an extension will always do more than just calling the sketchup api methods. It will do calculations based on data it gets from the api, iterate enumerables, check if a hash contains a key etc…
In one extension I made I had to calculate for a lot of point3ds if they are very close to each other to detect “touches”. Not too special, you iterate all of them, and iterate again starting at i+1 and see if they (almost) match.
In the end I shipped the extension with a .net executable. Now… I do understand that this still might have to do with the sketchup api then, since in ruby I used a Geom::Point3d where in .net I quickly made my own point3d class.
Atm, I am creating something that does write binary files. Also pretty slow in comparison to writing the same file in .net
Not that I do not like ruby though, but for some reason I have always looked for ways to do heavy things in other languages, and shipping that with the extension, giving other issues sometimes
Yes, I had the same issue in Vertex Tools. However, most extensions we see going through Extension Warehouse reviews are not in this category and do more than well enough in pure Ruby.
I mentioned this because often we see people ask for an API in another language - with the assumption that everything would be faster. Same thing we saw with request for 64bit SketchUp - the expectation of the ask didn’t fit reality.
The good news is that C# can already be run on Wasm. There is currently no direct C# to Wasm compiler. However, the current approach is to compile the mono runtime along with CIL assemblies in to Wasm bytecode. This allows for existing C# code to be run on Wasm inside the browser. More detail can be found in the mono-wasm Github repo.
So I’m wondering if C# would be a better development language for the SU4Web platform ?