On Monday, 28 April 2014 at 09:27:33 UTC, John Colvin wrote:
On Monday, 28 April 2014 at 09:10:53 UTC, Chris wrote:
On Thursday, 24 April 2014 at 06:38:42 UTC, Suliman wrote:
I am following discussions about GC and some other 'critical'
improves in D language for a long time. I see a lot of
arguments and heaps of code, that often hard to understand
(for example Templates) even more complicated to use it.
I like D, but more and more I am playing with Python, and
understanding it's philosophy. And I like it because it's do
not have any overhead like C++. It's clean any easy to
understanding. As result it's harder to write bad code in it.
Does anybody make tests of speed most common algorithm in D
and Python. I am trying to understand which project better to
start in Python and which in D.
In my experience, it is better to start a new project with D,
not only because of speed. As a project grows, the
restrictions of Python become more apparent (and annoying). If
copyright is an issue, D is the better option, too. Python can
be decompiled easily. I don't know what kind of projects you
have in mind, but in our projects Python is always the
bottleneck and has to be rewritten in a different language
anyway, sooner or later.
My experience mirrors this exactly. I find Python quite quickly
becomes unwieldy for large projects, even if the performance is
not an issue.
As with all these things, YMMV; there are many large,
successful Python projects.
It is pretty good for interactive work, especially if you can
leverage the large body of work that the scientific community
has produced in python.
Yeah, Python is good for fast prototyping, that's why the
scientific community uses it. However, when it comes to using the
code for real world apps, you have to rewrite it in C/C++ or D
(or the like).
Choosing between D and Python:
Pretty much anything written in pure Python can be easily
demolished by D in terms of performance.
D doesn't have much provision for interactive work (work in
progress).
You can do 2-way communication between D and Python
(https://bitbucket.org/ariovistus/pyd)
Fast algorithms that you use in Python are often implemented in
C as extensions. D can call C code directly. C vs D is very
much splitting hairs when it comes to performance.
This is true, and this is one of the arguments I use, when it
comes to rewriting code in D, i.e. that D can interface
_directly_ to those libraries anyway.
D has a steeper learning curve, but it will teach you widely
applicable knowledge and skills.
And you can write sound code in D without templates and ranges
etc, if you don't understand the concepts yet. Once you
understand them, you can soup up your code with all the fancy
stuff.