jRuby?
I am self-taught with both Python (& jython) and Ruby and do not do not Java or have skills enough to write an md extension.
Recently I came across info on a jRuby extension for md (which seems useful given jython is not being active update beyond Python 2.7 — and personally I find Ruby to give clearer code than Python.
However, this md jRuby extension was developed about 10 year's ago {see here: https://github.com/arvicco/moneydance-ruby}. This extension does not work on latest md - it gives an error_loading_ext_file com.md.apps.md.controller OutdatedExtensionException error when trying to install it.
Sean Reilly from md suggests that “The out-of-date exception is probably mostly because of the extension metadata not indicating that it is compatible with the updated moneydance data model that arrived with the 2015 update. I expect it would be easy to update the extension to work with MD2021.”
Unfortunately, I do not have the skills to update the extension.
My questions are:
Does anyone else think getting md to use jRuby (instead of jPython) is a worthwhile idea? Sean Reilly has indicated that he might consider the possibility of making jRuby a 1st-party language in Moneydance (but this would only be worthwhile if enough users thought that this was a good idea).
Has anyone else successfully got jRuby to run with the current md? If so, could you share information on how this can be done?
From my experience, everything done already in jython should easily be able to be done in Ruby (jRuby). The syntax is very similar (but in my view cleaner to use). I personally have a big jython script which I have updated from 2015 to present which I was going to have to convert to Ruby if I could get jRuby working — but I don't envisage a great deal of difficulty in converting the syntax from Python to Ruby.
Any thoughts or comments would be welcomed!
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Stuart Beesley ... on 27 May, 2021 05:13 PM
OK, I've just spent (wasted ;->) two days trying to get this to work... It's much more than just updating the meta_info.dict file with the line "minbuild" = "1000" to prevent the OutdatedExtensionException error.
Whilst I know nothing really about Ruby/JRuby, even the basic rake (make) tool fails for me (complaining about the ANT calls).
I've tried updating all the libraries, jars, JRuby, Rake versions (and some of the code where it fails) etc and I've built a new ANT build script and with some knife and forking, I have managed to get the Ruby console appear, once.. 😏 (I was happy for about 3 minutes)
There seems to be ongoing issue with class loading, bundled jars, writing to tmp folders amongst other things.. And the errors change/pop up randomly.
Like I say, I got it up once, but then after MD restart, it's broken again.
So, I would say that if someone more knowledgable (on JRuby etc) spent some time on this, then yes it would work (given, I've had it loaded already once).
BUT..... I'm not sure I agree with adding another scripting tool into Moneydance
I'm not saying Jython is great and I make no comment on whether JRuby is better. But I just don't think we need yet another scripting tool. It strikes me that JRuby is somewhere between Jython and Java (in that you can compile it etc).... I have to say, if you are doing this, why not just jump to Java?
The reason I don't think we should have two scripting tools is that people will write extensions in both. Then users will end up with Jython and JRuby in memory and cause a high memory usage.
I personally think that Jython as a pure script tool works fine and it can do everything you need it to do; and I think everything that Java can do due to it's java integration. There is no build/compile complexity.
BUT I do accept that Jython is stuck on 2.7 and whilst v3.x is 'in progress', perhaps it will never appear.... So what is a better option..?
So, perhaps a better question (for IK) it what's the right scripting tool for the future.. Pick one and dump the other, but not have both... Of course, we will always have Java too.
Just my humble thoughts
2 Posted by Stuart Beesley ... on 27 May, 2021 06:55 PM
UPDATE: (I hate giving up)... It's just fired into life and is surviving restarts.. I can now get it to run .rb files.. The console is not working properly (due to irb/completion not loading)... But here is a SS showing JRuby iterating txns in MD..
3 Posted by davidcullen on 27 May, 2021 10:57 PM
Stuart,
I appreciate all your efforts.
I agree with your thoughts and hopefully IK can fix the use of outdated jython (picking the right scripting tool for the future etc) in a future md update.
Until then, I will stick with jython for now.
Support Staff 4 Posted by Sean Reilly on 28 May, 2021 10:50 AM
Hi All,
Stuart's got a good point in that adding more scripting environments would bloat moneydance to a point where it could become too slow on older devices. There's also the downside that I don't know Ruby at all and wouldn't feel comfortable adopting it, whereas I've been using python since 1994 and it is generally viewed as an easy to learn but still powerful scripting language. Every experience I've had with Ruby has involved versioning hell that I'd hate to have to deal with in a plugin environment like with Moneydance.
I know it's also possible to have a python 2 (or 3, if jython progresses) embedded environment on iOS and Android which would be nice in the future.
If I were to pick a different language than python, then I think I'd probably go with javascript simply for it's high level of cross-platform support. I'm not a fan of javascript, but I think it would be more universally accessible than Ruby.
Thanks,
Sean
davidcullen closed this discussion on 04 Aug, 2021 07:20 AM.