开发者

Programming Language: What language has both Python & Ruby features? [closed]

开发者 https://www.devze.com 2023-01-11 11:38 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 12 years ago.

I came across this great comparison chart between Python & Ruby.

I'm looking for a programming language that is truly a blend between Python and Ruby (with a slight lean towards Python).

I really like in Ruby that everything is an object (unlike Python). However, I really like in Python that things are immutable, so that code maintenance is much easier as well as built-in Unicode support (unlike Ruby).

Does anyone know of a good programming languages that has the best of both Python and Ruby.

I've attempted to make a feature listing below.

Language Features   

Everything's an Object     YES***
Namespaces               yes
Constants                 YES***
Generators               yes
Iterators                 yes
Coroutines               yes
Continuations            no

Classes 

Multiple Inheritance       NO***
Interfaces              no
Class Includes*         no
Nested Classes             yes
Properties               yes
Operator Overloading       yes

Functions   

First-Class Functions      yes
Anonymous Functions     yes
Keyword Arguments         yes
Closures                   yes
Decorators               yes

Collection Objects  

Tuples                   NO***
Lists                     yes
Hashes                   yes

Strings 

String Type              yes
Char Type                  no
Symbol Type              no
Immutable                  yes
Interned                    yes
Heredocs                    no
Multiline Strings          yes
Unicode Support          yes

Regular Expressions 

Regex Literal              no
Named Groups                yes
Lookaheads                yes
Lookbehinds              yes
Yes/No Pattern            yes
Unicode Support          yes

Lua looks interesting,开发者_运维技巧 though I'm having a difficult time finding enough information on it to determine if it's a good middle language between Python and Ruby.


I don't understand what you mean by "everything is an object", as far as I know Python has no primitives either (you can derive from the basic integer type in Python 3 for example.)

I've used both, and although I prefer Python, Ruby is no doubt a very potent language, so instead of going by a chart, install both and see which you prefer programming in. If you still can't decide, look at the surrounding environment (how good is the standard library, tools, docs etc.)

Ruby and Python has different "idioms", and underlying philosophies which most probably differs on some points, which might be worth investigating.


Check out groovy. Also it has great feature that have Python and Ruby and some other popular langages, but most of dynamic languages lacks - IDE support ( by NetBeans, Eclipse and IDEA ). Differences from python and differences from ruby

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号