Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #76818
| From | Marko Rauhamaa <marko@pacujo.net> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Python vs C++ |
| Date | 2014-08-22 23:06 +0300 |
| Organization | A noiseless patient Spider |
| Message-ID | <87siko9tlq.fsf@elektro.pacujo.net> (permalink) |
| References | <mailman.13248.1408625664.18130.python-list@python.org> <lt6tk2$118$1@dont-email.me> <mailman.13280.1408697414.18130.python-list@python.org> <87fvgoj2i8.fsf@elektro.pacujo.net> <lt85g5$mlq$1@dont-email.me> |
>> assembly
>> C
>> C++
>> Go
>> Java/C#
>> Python
>> Scheme
>> Bash
>
>
> My point is that this picture is incomplete: it shows the programming
> languages as *points* on the complexity line,
I don't see any points. I see words.
> whereas they are rather *intervals*. And these intervals have large
> overlaps.
Add line segments as wide as you'd like.
> Ousterhout's dichotomy. It's a good paradigm in many cases, but
> sometimes it might be preferable to have everything in a single
> language. And this is a good domain for C++.
I tend to think the opposite: C++ barely has a niche left. I definitely
wouldn't want to use C++ very far from its (very narrow) sweet spot.
> I'm currently implementing a numpy-like library for another language
> in C. I choosed C for the ABI/portability reason, but I am really
> missing C++ in many, many places. The code is an awful mess of macros
> to get simple metaprogramming facilities, i.e. to support different
> data types and operations. This is a domain where C++ would be the
> best choice, and only the stupid reason of possible runtime dependency
> guided the decision to use C.
C++'s "gift" to programming was to take static typing to its utmost
limits -- to the detriment of usability, learnability and
intelligibility. STL and Boost have been turned into totems that
supposedly turn a dire necessity into a virtue.
C's give to programming is the void pointer. It's the antithesis of C++,
but damn does it get you out of every bind -- no fuss, no semantic
handwringing.
My disillusionment with C++ came from the language's inability to
represent callbacks. C can do it (void *), C# can do it (delegates),
Java can do it (anonymous inner classes), Python can do it (methods),
Scheme can do it (closures).
Qt needs callbacks ("signals" IIRC). It doesn't use C++ to express them.
It uses a fricking metacompiler for them.
And Stroustrup's thick book didn't even seem to be aware of callbacks as
a paradigm and thus didn't show any examples of dealing with them. Too
bad Stroustrup wasn't aware of C#'s delegates; C++ should have defined
function pointers as delegates.
> Everything which needs string processing, but still has to run fast,
> is another good candidate. Compilers are certainly less painful to
> write in C++ than in C, and could still run with native speed. For
> sure it is much easier to do a compiler in Python, but this will come
> with a speed penalty (of the compilation, not the code, as evidenced
> by PyPy).
There is one big advantage C++ has over C: virtual method dispatching.
However, I have been able to come up with C idioms that make practical
method dispatching relatively painless.
Marko
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Python vs C++ David Palao <dpalao.python@gmail.com> - 2014-08-21 14:54 +0200
Re: Python vs C++ wxjmfauth@gmail.com - 2014-08-21 07:08 -0700
Re: Python vs C++ Rustom Mody <rustompmody@gmail.com> - 2014-08-21 07:10 -0700
Re: Python vs C++ Grant Edwards <invalid@invalid.invalid> - 2014-08-21 14:59 +0000
Re: Python vs C++ Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-08-21 23:12 -0400
Re: Python vs C++ Christian Gollwitzer <auriocus@gmx.de> - 2014-08-22 10:05 +0200
Re: Python vs C++ Chris Angelico <rosuav@gmail.com> - 2014-08-22 18:50 +1000
Re: Python vs C++ Marko Rauhamaa <marko@pacujo.net> - 2014-08-22 12:29 +0300
Re: Python vs C++ "Neil D. Cerutti" <neilc@norwich.edu> - 2014-08-22 08:51 -0400
Re: Python vs C++ Skip Montanaro <skip@pobox.com> - 2014-08-22 07:58 -0500
Re: Python vs C++ Marko Rauhamaa <marko@pacujo.net> - 2014-08-22 20:16 +0300
Re: Python vs C++ mm0fmf <none@mailinator.com> - 2014-08-23 17:47 +0100
Re: Python vs C++ Marko Rauhamaa <marko@pacujo.net> - 2014-08-23 19:54 +0300
Re: Python vs C++ Chris Angelico <rosuav@gmail.com> - 2014-08-22 23:00 +1000
Re: Python vs C++ Christian Gollwitzer <auriocus@gmx.de> - 2014-08-22 21:25 +0200
Re: Python vs C++ Stefan Behnel <stefan_ml@behnel.de> - 2014-08-22 21:58 +0200
Re: Python vs C++ Marko Rauhamaa <marko@pacujo.net> - 2014-08-22 23:06 +0300
Re: Python vs C++ Michael Torrie <torriem@gmail.com> - 2014-08-22 15:38 -0600
Re: Python vs C++ wxjmfauth@gmail.com - 2014-08-23 03:00 -0700
Re: Python vs C++ Chris Angelico <rosuav@gmail.com> - 2014-08-23 07:49 +1000
Re: Python vs C++ Rustom Mody <rustompmody@gmail.com> - 2014-08-23 05:38 -0700
Re: Python vs C++ Chris Angelico <rosuav@gmail.com> - 2014-08-23 23:00 +1000
Re: Python vs C++ Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-23 08:02 -0600
Re: Python vs C++ Rustom Mody <rustompmody@gmail.com> - 2014-08-23 07:21 -0700
Re: Python vs C++ Terry Reedy <tjreedy@udel.edu> - 2014-08-23 16:51 -0400
Re: Python vs C++ Chris Angelico <rosuav@gmail.com> - 2014-08-24 00:21 +1000
Re: Python vs C++ Terry Reedy <tjreedy@udel.edu> - 2014-08-23 15:09 -0400
Re: Python vs C++ Joseph Martinot-Lagarde <joseph.martinot-lagarde@m4x.org> - 2014-08-24 14:54 +0200
Re: Python vs C++ "Neil D. Cerutti" <neilc@norwich.edu> - 2014-08-25 09:01 -0400
Re: Python vs C++ Michael Torrie <torriem@gmail.com> - 2014-08-22 15:56 -0600
Re: Python vs C++ Chris Angelico <rosuav@gmail.com> - 2014-08-23 08:00 +1000
Re: Python vs C++ Marko Rauhamaa <marko@pacujo.net> - 2014-08-23 10:27 +0300
Re: Python vs C++ dieter <dieter@handshake.de> - 2014-08-23 07:56 +0200
Re: Python vs C++ Chris Angelico <rosuav@gmail.com> - 2014-08-23 16:11 +1000
Re: Python vs C++ Paul Rudin <paul.nospam@rudin.co.uk> - 2014-08-23 08:36 +0100
Re: Python vs C++ Chris Angelico <rosuav@gmail.com> - 2014-08-23 18:04 +1000
Re: Python vs C++ dieter <dieter@handshake.de> - 2014-08-23 07:48 +0200
csiph-web