Can I use ironruby that different from other implementation of ruby? - ruby

I am taking a ruby class this semester. In my book it said that there is an implementation of ruby for VS called IronRuby. I'd like to use visual studio that I use any way for work. My only concern is to know if there's significant difference (if any) with the other rubies so that I can go ahead and Use VS2012? In class we use a book called "Ruby Programming Language by Matsumoto"
Thanks for helping.

If you're just doing the exercises in the book, you should be fine.
Personally, I would not use it because:
IronRuby hasn't had a stable (or alpha) release in years, and its future is uncertain (little project activity and missing lead developers).
It's not 100% compatible with MRI, so you may run into weirdness, though I haven't been able to find a more detailed RubySpec.
More Ruby is written and tested on Unix-like machines than Windows, so if you need to use gems, you may run into weird issues with IronRuby that don't occur in MRI.
You should spend most of your time learning in irb, so Visual Studio doesn't really help you :). (irb is the interactive prompt -- you can test your code in real-time, instead of having to save and run [or compile].)

Related

Where can I compile my ruby code?

I started programming on ruby at codecademy but where can I compile my codes on doing a website?
When I was making some lessons on C I used codeblocks to run codes. I know any text editor can run a HTML code. So what about ruby?
Thank you.
I'll take a stab at answering the question that I think you're asking, but I'm not 100% sure here.
Ruby is an interpreted language (what does that mean? Not a whole lot nowadays. If you'd like a more in depth discussion on the distinction or lack thereof between interpreting vs compiling, read Jorg's comments below). To execute ruby code, you'll need to install ruby. Fortunately for you, this is freely available on any major platform. If you're on something unix-y (eg, linux or mac), I'd strongly recommend installing ruby via something like rvm or rbenv. If you're on windows, you can either go the cygwin route and pretend it's a unix-y environment, or there are prebuilt installers out there. Googling 'install ruby' should have some sites that can help you at or near the top of the search results.

Ruby GUI support on OSX Mavericks (Not Shoes or Ruby Motion) plus OSX app package support

This has been asked many times. Some of the answers are pretty old now. I have looked around everywhere for 2 things.This the last resort before I give up. Looking for:
Bindings that will enable GUI programming using Ruby (not Shoes) using Mavericks. I have found plenty bindings but with no activity for the past 3 or 4 years, with the exception of RubyMotion which seems very expensive while not taking advantage of Xcode features / does not have an IDE.
Way to package app for users as a regular OSX app so the user does not have to install anything by hand on OSX (if mutiplatform even better to target Windows too)
I have fallen in love with Ruby but without a means to tackle the above will be difficult to deploy for users, while I am not interested in Rails.
Feels like Rails popularity has in effect killed Ruby by putting it into a niche when it could be so much more.
Any new news on either of these 2 fronts or everything is abandoned / dead ?
Should I move on with Python / Objective-C ? (Which I like both but enjoy Ruby more)
I succesfully compiled scripts with tk, green shoes and gosu as a GUI to an executable with ocra but only have experience doing so on windows. If you want an actual, cross platform GUI try the java swing framework with jruby, here an example.
If you deploy a JAR or an executable nu further installations are needed.
I suppose you use MRI ruby now, the step to jruby is not so difficult.
require 'java'
# With the 'require' above, we can now refer to things that are part of the
# standard Java platform via their full paths.
frame = javax.swing.JFrame.new("Window") # Creating a Java JFrame
label = javax.swing.JLabel.new("Hello")
# We can transparently call Java methods on Java objects, just as if they were defined in Ruby.
frame.getContentPane.add(label) # Invoking the Java method 'getContentPane'.
frame.setDefaultCloseOperation(javax.swing.JFrame::EXIT_ON_CLOSE)
frame.pack
frame.setVisible(true)
RubyMotion is the best alternative. But if don't want to spend the money you should be able to use macruby.
Here are some resources
http://blog.phusion.nl/2010/03/12/creating-our-very-first-mac-application-with-ruby-how-exciting/
I must say that using macruby for a big project might not be a good idea. You should expect stuff breaking and few support. As of 2015, the [MacRuby page on GitHub][3] says that the project is in an indefinite hiatus due to the changes made by Apple in the Objective C garbage collection support that MacRuby depends on. They suggest using RubyMotion.
RubyMotion seems to be really good for what you want but for development the lack of a IDE is really a huge downside. Also from my experience rubymotion only comes handy if you already know the cocoa framework really well.
So my recommendation is for you to test rubymotion if you can. They give your money back in the first 30 days if you only want to try it out. So if you have the money give it a try.
If you are new to osx development and only want to develop for osx I think you should go with objective-c. The language is not that bad and you will get the best development environment available for it for free.

Converting OCaml to F#: Is there an OCaml IDE with GUI debugging like Visual Studio

I am converting several modules from OCaml to F#. To hunt bugs and verify some of the finer differences I am running both versions against the same test case at the same time.
For F# I am using the Visual Studio debugger and for OCaml I am using ocamldebug. Since Visual Studio is a GUI and ocamldebug is a command line, making the comparisons requires more attention than back and forth visual scanning.
I was wondering if there is any OCaml IDE that supports a GUI debugger with stepping while showing the source line highlighted and separate window to display values.
EDIT
I did some more looking after Jack posted an answer and then remembered why I didn't pick one a few months ago when I did this.
The reasons I am passing on the ones I find and staying with the OCaml command line tools are
The command line tools come with the compiler, so they are current and work. There is some documentation on the tools, but honestly I did have to spend a few hours writing my own ocamldebug manual with examples to become proficient with ocamldebug.
They rely on EMACS. It's not EMACS but me; I just hate the way it works. Also all of the tools working with EMACS I found they are just wrappers around ocamldebug. So nothing gained but more memorization of commands. Note: EMACS is actively maintained and updated.
They rely on Eclipse. I have used Eclipse a lot for working with ANTLR, but I only make a system every few years and have very good notes on it so it is worth my time. Once I get Eclipse working for a major ANTLR release, I don't update it again for years. For the small amount of time I plan on debugging OCaml, the cost is too high. Note: Eclipse is actively maintained and updated.
They don't do debugging. Since there are so few GUI tools for OCaml, even an enhanced editor is a benefit for some. Not for me at this time.
The tool/plug-in has not been maintained for some years.
This not a put down of OCaml, just the details as I find them. I don't have a problem with OCaml, I just wish I was more productive with it.
I think most people are just using the OCaml debugger (ocamldebug) from within emacs (see the bottom of that page for details).
I don't know if it supports debugging (yet), but the TypeRex OCaml Programming Studio looks like an interesting project.
Finally, there are some old, unmaintained Eclipse plugins you could try (e.g., Camelia), though I suspect they've bit-rotted for too long to be of much use at this point.
I was unable to find an OCaml GUI debugger with the same ability as Visual Studio using F# that meet my requirements.
If someone does find one or creates one and post that as an answer I will gladly give them them accept vote.
I was wondering if there is any OCaml IDE that supports a GUI debugger with stepping while showing the source line highlighted and separate window to display values.
I'm only just getting back into OCaml and Linux now after a 4 year break but, last I looked, Linux had very poor GUI libraries and OCaml had very poor interoperability so nobody ever got very far writing non-trivial GUI applications in OCaml.

What is the significance for Ruby programmers of SAP's new implementation of Ruby?

SAP announced Blue Ruby, a version of Ruby that runs inside the ABAP Virtual Machine.
This seems to lend additional credibility to the Ruby language but, except for SAP developers, does this have any applicability to the rest of the Ruby community?
I'm just wondering what other significance this may have. Additional job opportunities, perhaps, for Ruby developers to be hired to work on SAP projects?
Any other potential benefits for Ruby programmers?
Also, something I'm not clear about: Besides MRI and JRuby, how many different implementations are there and why do I, as a Ruby programmer, need any implementation except the MRI? I understand I might need JRuby if I want to integrate with Java libraries. Are there any other times I might need to look into an implementation besides the MRI or JRuby?
I notice that Blue Ruby is compiled. Is that a big benefit and would this be the first compiled version of Ruby?
Sorry - maybe too many questions but this is being discussed as a big deal except I'm not sure why/if it really is. Would be grateful to get some feedback from people who understand Ruby (and I.T.) better than I do.
There are actually quite a few alternative implementations. The reason for so many versions is partly because while Ruby itself has a lot of fans, MRI is often considered to be not quite as nice as the language it hosts.
This is a list of all the other Ruby implementations I know of:
MRI
JRuby for Java. Its speed advantage isn't as great now that Ruby 1.9 is out, but it's still a big player for its integration with Java.
IronRuby (still in development) for .NET
MacRuby for making native Mac OS X applications. It's currently based on Ruby 1.9, but they're going to release a new LLVM-based virtual machine for the next version, which looks to offer a major speed boost and will hopefully be portable to other LLVM target platforms.
MagLev (still very much in development) for high-capacity Web apps. It will probably be a commercial product.
Rubinius is a ground-up reimplementation meant as an alternative to MRI with a much cleaner foundation.
I doubt Blue Ruby will have much of an impact on the general software development landscape. It will probably be nice for SAP programmers and allow them to cast a wider net for potential hires since Ruby is somewhat more popular than ABAP.
All of the current Ruby implementations are compiled to bytecode. Contrary to SAP's claims, as of Ruby 1.9, MRI itself includes a bytecode compiler, though the ability to save the compiled bytecode to disk disappeared somewhere in the process of merging the YARV virtual machine. JRuby is compiled into Java .class files. I don't have a lot of details on MagLev, but it seems safe to say it will take that road as well.
Each implementation has its own use cases. JRuby is useful for much the same reasons Jython is. IronRuby will be useful in a .NET environment, when it exists in a usable state.
Things like this make Ruby more acceptable on the Enterprise level, and hasten the spread of Good Programming Languages.
Of course, Blue Ruby is intended for SAP related people. I don't think is going to have much more of an impact on the Ruby community because most Ruby developers are not related to ABAP development.
The main purpose of Blue Ruby is to bring a powerful Scripting Language into the ABAP world, providing more tools for ABAP developers.
You can read my blog on Blue Ruby providing an SE16 (Data table explorer) emulator.
https://weblogs.sdn.sap.com/pub/wlg/14222
Greetings,
Alvaro "Blag" Tejada Galindo.
Senior ABAP Consultant - SAP Mentor.

Which ruby interpreter are you looking forward to?

There are multiple Ruby implementations in the works right now. Which are you looking forward to and why? Do you actively use a non-MRI implementation in production?
Some of the options include:
Ruby MRI (original 1.8 branch)
YARV (official 1.9)
JRuby
Rubinius
IronRuby - Ironruby.net
MagLev (Thanks Julian) Github link
MacRuby (Thanks Damien Pollet)
Maglev. It will have the speed benefit of all the optimization that has gone into a major Smalltalk VM over many, many year. Plus it will automatically persist all your data pretty much automatically so there is no more need to monkey around with Object-Relational mapping layers and so on.
Ruby 1.9 (YARV) gives us a good idea as to where ruby is headed, but I wouldn't recommend using it for production use. While it's certainly much faster than 1.8, even some parts of the syntax keep changing, so I don't think you could call it stable. It does have some interesting new features and syntax which will surely find their way into all the other implementations over time.
JRuby and IronRuby are useful in that they give ruby access to a whole range of new libraries and environments where ruby couldn't be used otherwise. I've not found much use for them myself yet, but think it's great that they exist. They may allow ruby to infiltrate corporate environments where it wouldn't otherwise be permitted. That can only be a good thing.
Rubinius and Maglev are probably the most interesting projects, but also those where their benefit to the community is likely to be furthest into the future. Rubinius may well develop into a cutting edge 'pure' VM for the ruby language, allowing ruby code to run much faster than it can now. Maglev too seems extremely promising, backed as it is by 20+ years of VM experience. It will also provide features over and beyond a standard VM, but of course these will come at the cost of code portability.
Overall though, what I'm most excited about is the competition between these implementations. Having competing projects all working to make ruby better can only make the ruby ecosystem stronger. From what I've seen too, while the competition exists it is friendly; each project giving and taking ideas from each other. The work done by the JRuby and Rubinius teams in creating a ruby spec is probably the most important outcome so far, as it will help ensure that all implementations remain compatible.
jRuby is stable and reliable today. Maglev is very promising.
No one mentioned MacRuby yet? I guess it's a bit Mac-specific now, but it could probably be made to compile to the GNU or Étoilé objective-c runtimes too.
Also, I'm waiting for Maglev :)
What about Enterprise Ruby? This has been out there for a while.
https://www.phusionpassenger.com/enterprise

Resources