Question

Came across IronRuby and thought it was pretty interesting. Decided to give it a try.

I have some ruby scripts that I would like to distribute. However, my audience may or may not have ruby installed on their systems, but they would have .net, so I thought I'll just write bundle together a C# GUI along with the iron ruby dll's so that they can run these ruby scripts without having to install ruby. And I could also take advantage of making GUI's in C#.

So I decided to test it by simply running a file

ScriptEngine engine = Ruby.CreateEngine();
engine.ExecuteFile("hello_world.rb");

hello_world.rb contains one line

3.times { p 'hello' }

Then I let my application run and wait...
Several seconds later it printed hello to the console 3 times.

Is it supposed to take a long time for it that ruby engine? I guess I could start the engine and then leave it running for the duration of the program, but having to wait for it to start up can be boring.

I am using IronRuby 1.0 built for .net 2.0 if it makes a difference (I haven't tried 1.1 but it's advertised for .net 4 which I don't want to use)

Was it helpful?

Solution

It's probably just the JIT compiling everything at the beginning. If you want to test this out, execute a different script right after the hello world one, it should print to the console instantaneously.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top