SapphireSteel Forum
Welcome, Guest. Please login or register.
May 25, 2013, 06:54:18 AM

Login with username, password and session length
Search:     Advanced search
Welcome to the SapphireSteel forum - for discussion of the Ruby In Steel and Amethyst IDEs
3884 Posts in 800 Topics by 669 Members
Latest Member: m
* Home Help Search Login Register
+  SapphireSteel Forum
|-+  General
| |-+  Ruby In Steel
| | |-+  hot swap support
« previous next »
Pages: [1] Print
Author Topic: hot swap support  (Read 1364 times)
amiracam
Jr. Member
**
Posts: 69


« on: February 09, 2012, 09:12:59 AM »

Is this coming ? is it possible via the underlying VS infrastructure ?

thanks
Logged
Dermot
Administrator
Hero Member
*****
Posts: 1005


« Reply #1 on: February 09, 2012, 12:31:23 PM »

I'm assuming that you mean 'Edit-and-Continue' (EnC) in Visual Studio. Is this correct? The term 'hot swap' seems to be used to mean a different things to different people.

If you do mean real EnC (that is the ability to alter code - not just data - in the debugger, and get the compiler recompile and then continue) this is supported by the VS infrastructure, but it depends also on compiler support. As far as I'm aware there's no Ruby compiler that does that right now. If there was we could do it.

However, just thinking about this, you can fake it to some extent by 'eval'ing code in the Immediate Window or the Ruby Console and if that happens to replace a class or a method, then that's what would happen. It wouldn't be synced with the source code at that point. We could relatively easily allow you to mark off a block of code and 'eval' it - like SmallTalk, for example.

BUT ... this isn't real EnC, because you need to be able to rewind the 'program counter' of the Ruby interpreter to re-execute the method that you've just altered (if you just altered one line in a method say). This is quite difficult to do - probably possible, but without real compiler support it's likely to crash Ruby.

Dermot

Logged
amiracam
Jr. Member
**
Posts: 69


« Reply #2 on: February 09, 2012, 09:55:11 PM »

well, I'm using hot swap because its the term Java came up for what they did some twenty years after Smalltalk had done so. But yes, it would be an edit and continue. The 3rdRail IDE  folks states that they can do that and I actually spoke directly with a human being in support. There IDE is built on top of the JVM which is how they claim that they achieve hot swap. I don't have their IDE so I can't attest to it. The Rubymine forum annoyingly has refused to answer and I do have a license of Rubymine and so I know that they can't.

Its a powerful feature which is very conducive to test driven development i.e. coding in the debugger that us Smalltalkers are so used to doing. Perhaps the JRuby compiler could do so.?

Logged
Dermot
Administrator
Hero Member
*****
Posts: 1005


« Reply #3 on: February 10, 2012, 06:39:50 AM »

I didn't know that 3rdRail was being actively developed anymore since Embarcadero took it over - I think they are still on Rails 2.

I think you have to be careful what you mean by 'hotswap'. I can't see how you can do real EnC (Edit & Continue) without the ability to reset the program counter - and from what I know of JRuby, you can't do that - I've written the debugger interface into JRuby and I've a fair knowledge of how JRuby works internally. Still, I could be wrong there.

I agree with you about EnC - I use it *all* the time with C# - I do half my development while halted at a breakpoint!

I've haven't seen anything like what you can do with Visual Studio EnC - the ability to back up the program by a couple of lines (say), edit a line or two, step the lines, look at your result, and keep on doing it it until it's right. Even so, there are some limitations to Visual Studio's EnC - doesn't work with C for example, and even in C# it doesn't work with Linq and anonymous functions.

I'll look into the possibility of EnC in M Ruby (I've got a much better knowledge of the internals of Matz's stuff than JRuby). We're doing a reworking of the debugger right now for our next major release of RiS and it's a good time to look into things like that. If we could do real EnC would be really cool. As I've said, the VS debugger infrastructure supports EnC - but it's a matter to getting the interpreter to handle it

Dermot
Logged
amiracam
Jr. Member
**
Posts: 69


« Reply #4 on: February 10, 2012, 10:48:55 AM »

honestly , if you pull it off it would be huge, and should be huge in the Ruby community which is so  TDD driven. If you do it, I will pay for Parrallels , buy more ram, buy another Win7 license, and build you a statue in your likeness.

3rd Rails has not seen a release in almost two years. To clarify , I was not told that they do their "hot swap" via JRuby but rather via the JVM. Unfortunately, as interesting as I find it I have not yet taken the time to study the inner workings of VMs.

What would be the ETA for the next major release of RIS ? in the meanwhile , 1.9.3 support would be appreciated, hopefully it will coincide with Ruby 2.0 where apparently we may get named arguments akin to  Smalltalk's  keyword passing style.

Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!