Last update April 29, 2012

Coming From /
Python



From NG:digitalmars.D/6990:

I would like to know your opinions regarding the prospects of D against the modern rising trend-setters like Python and 'the OO' Ruby.

The Top 5 differences/distinctions, please.

Any D and Ruby/python interoperation chances/benefits?

Thanking you, Irfan.


From NG:digitalmars.D/6997:

http://www.scratch-ware.net/D/ (now http://www.scratch-ware.net/dfiles/)

I've ported over the Python/C API to D so you can embed Python into D or extend Python from D.

Aside from that, at least on the Python vs. D front, there's not really much else for comparison. They're really two different languages with their own distinct advantages over eachother, depending on what you're trying to do.


From NG:digitalmars.D/7002:

A combination of D and Python could be very productive indeed. You still get the breakneck development speed Python is famous for, but you don't have quite as delecate a balancing act between speed and power, as D isn't all that hard to write either. -- andy


From NG:digitalmars.D/7004:

Anyways, I know enough about Python to toss out some differences.

  1. In D everything is REALLY compiled. I know that you can emulate it in Python by embedding .py into .exe's, but it's not quite the same.
  2. Since it's natively compiled I'd bet that D program would typically run faster (and probably use less memory). I'm sure there are exceptions to that, but that should generally be the case.
  3. In Python, whitespace (tabs or spaces) is used to denote blocks. I prefer D's use of curly braces {}.
  4. Can you use Python for systems programming? I don't think so.
It's important to realize that D and Python are good at different things. Python is meant to be a scripting language, and it fills that role nicely. D is meant to be efficient and close to the machine (inline assembly is even available).

Also, there are many libraries, wrappers, and interfaces available for Python that do many cool things. D's library support will grow, but I doubt it will catch up to Python anytime soon.

Articles

Related page

See also: Python/D

FrontPage | News | TestPage | MessageBoard | Search | Contributors | Folders | Index | Help | Preferences | Edit

Edit text of this page (date of last change: April 29, 2012 4:16 (diff))