4 ms·
This is a sincere question, if you're doing science, why would you want to use ruby over python?
by hogu 15y ago
This is a sincere question, if you're doing science, why would you want to use ruby over python?
- briteside 15y agoMy answer to this question is transparency. At my company Brighter Planet we write all of our scientific/methodological code in Ruby so that people with basic technical skill can understand what's going on. The ability to create expressive DSLs is really crucial.
- pwang 15y agoThat's very interesting. What sorts of DSLs are you creating, or can you say?
- noahnoahnoah 15y agoI have a similar answer - I'm a data analyst at a company full of rubyists. I can (and do) use R for most of my analyses, but there's a cost in transparency -- I can't realistically ask someone to review my R code when they don't know the language, and the bus factor is high if anything I write in R is at all important. That's why I'm trying to use Ruby where possible, even at the cost of a small productivity hit. The benefits of others being able to read my code far outweigh the few extra minutes it takes for me to do something (and in many cases, the sheer brevity of Ruby as a language means it's faster, simply because it's less typing). I'd love to see SciRuby become a more useful project, and I'd love to contribute. Unfortunately, they don't make it especially easy to get involved -- the mailing list points people to the roadmap, but it's not at the level of detail where someone could jump in (and the component gems don't seem much better), so it's a bit hard to know where help would actually be useful.
- mohawkjohn 15y agoNoah -- I'd love to get your thoughts on how to make it easier to include people in our project. Would you be willing to send me an email? john dot woods at marcottelab dot org.
- muuh-gnu 15y agoYou could have asked this question anybody who tried to write SciPy or NumPy before they existed: "if you're doing science, why would you want to use python over fortran?" Or, befor ROR existed, "if you're doing web development, why would you want to use ruby over java/perl?". Your question is basically asking why anybody would ever try something outside of an established ecosystem. The reason is, they like ruby so much that they want to use it for number crunching too, and not to have to use a less appealing language. They want to build an ecosystem so other people can join and contribute and grow together and maybe outgrow python. They want ruby to win so much that they are willing to work on duplicating a framework existing somwhere else.
- jtprince 15y agoIn addition to the point muuh-gnu makes, we wonder if ruby will be able to add something fresh to scientific computing. In a recent interview[0], I outline some thoughts on this: 1. Because of its consistent object oriented design and because everything returns a value, chaining is natural in Ruby. 2. Avoid index errors and for loops with powerful block Enumerators. 3. Scientific data and services are moving to the web, and Ruby is a great web language (although it is incorrect to call it 'just' a web language). 4. The Ruby community is highly innovative and dynamic, so we can collectively generate solutions quickly. (see the interview for more explanation) Some of these points are more vision than reality at this point, but we think ruby has great potential as a science language. The other reason this makes sense is that folks are already doing science in ruby (and have been for some time) and many tools already exist--we are building on a good foundation and just hoping to extend it to make things better/simpler. [0] http://www.floss4science.com/interview-sciruby-team/ http://www.floss4science.com/interview-sciruby-team/
- zhemao 15y ago1. Everything in Python and every function returns a value, but that method just happens to be None if you don't explicitly return. You could probably pretty trivially implement a class that wraps an object and returns the object itself if one of its methods returns None. 2. Python has list comprehension, iterators, and generators, which also allow you to loop without for loops or explicit indexing 3. Python also has lots of web frameworks/libraries. 4. Are you saying the Python community is not (as) innovative? I'm not saying this project is completely without merit. I know that many people prefer Ruby's syntax and preferences to those of Python. But I think it is disingenuous (and somewhat insulting to Python developers) to claim that this project has any potential benefit beyond allowing Rubyists to do scientific computation in their preferred language.
- zhemao 15y agoAs for #1, I've just implemented it. https://github.com/zhemao/chainsmoker https://github.com/zhemao/chainsmoker