Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #84903

Re: [OT] fortran lib which provide python like data type

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <torriem+gmail@torriefamily.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'talks': 0.03; 'subject:: [': 0.04; 'languages,': 0.04; 'static': 0.04; 'class,': 0.07; 'dynamically': 0.07; 'memory.': 0.07; 'string': 0.09; 'constructor': 0.09; 'pointers': 0.09; 'segfault.': 0.09; 'things,': 0.09; 'works.': 0.09; 'suggest': 0.14; '(just': 0.16; 'c++.': 0.16; 'destructor.': 0.16; 'easier.': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'heap': 0.16; 'leaks': 0.16; 'least)': 0.16; 'objects.': 0.16; 'rarely': 0.16; 'scope.': 0.16; 'semantics': 0.16; 'subject:type': 0.16; 'subject:which': 0.16; 'subject:python': 0.16; 'apps': 0.16; 'wrote:': 0.18; 'subject:] ': 0.20; 'seems': 0.21; 'memory': 0.22; 'header:User-Agent:1': 0.23; 'certainly': 0.24; 'circular': 0.24; 'subject:like': 0.24; "haven't": 0.24; "i've": 0.25; 'references': 0.26; 'right.': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'words': 0.29; 'compared': 0.30; 'python).': 0.31; 'class': 0.32; 'quite': 0.32; 'says': 0.33; "i'd": 0.34; 'something': 0.35; 'beyond': 0.35; 'objects': 0.35; 'but': 0.35; 'really': 0.36; 'c++': 0.36; 'subject:data': 0.36; 'message-id:@gmail.com': 0.38; 'problems': 0.38; 'to:addr:python-list': 0.38; 'fact': 0.38; 'rather': 0.38; 'anything': 0.39; 'though,': 0.39; 'to:addr:python.org': 0.39; 'system.': 0.39; 'received:org': 0.40; 'even': 0.60; 'skip:u 10': 0.60; 'tell': 0.60; 'new': 0.61; 'course': 0.61; 'simply': 0.61; 'offer': 0.62; "you'll": 0.62; 'reach': 0.63; 'more': 0.64; 'management': 0.65; 'charset:windows-1252': 0.65; 'life': 0.66; 'side': 0.67; 'dont': 0.67; 'yes': 0.68; 'miss': 0.74; 'allocation': 0.74; '*and*': 0.84; 'leak': 0.84; 'lightweight': 0.84; 'perspective.': 0.84; 'routines': 0.84; 'outset': 0.91; 'prone': 0.91
X-Virus-Scanned amavisd-new at torriefamily.org
Date Fri, 30 Jan 2015 10:08:35 -0700
From Michael Torrie <torriem@gmail.com>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0
MIME-Version 1.0
To python-list@python.org
Subject Re: [OT] fortran lib which provide python like data type
References <mailman.18264.1422543630.18130.python-list@python.org> <4822a519-5814-433b-88ad-9bea8a2f83e3@googlegroups.com> <3c31aec4-0c0a-4eb9-aff4-e7b7aa76da21@googlegroups.com> <mafc1u$n1l$1@dont-email.me> <3d3ef587-a62d-4024-964c-0ac8be023ca3@googlegroups.com>
In-Reply-To <3d3ef587-a62d-4024-964c-0ac8be023ca3@googlegroups.com>
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.18313.1422637734.18130.python-list@python.org> (permalink)
Lines 51
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1422637734 news.xs4all.nl 2901 [2001:888:2000:d::a6]:39886
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:84903

Show key headers only | View raw


On 01/30/2015 09:27 AM, Rustom Mody wrote:
> ... if I restate that in other words it says that sufficiently
> complex data structures will be beyond the reach of the standard
> RAII infrastructure.
> 
> Of course this only brings up one side of memory-mgmt problems
> viz. unreclaimable memory.
> 
> What about dangling pointers?
> C++ apps are prone to segfault. Seems to suggest
> (to me at least) that the memory-management infrastructure
> is not right.
> 
> Stroustrup talks of the fact that C++ is suitable for lightweight
> abstractions. In view of the segfault-proneness I'd say they 
> are rather leaky abstractions.
> 
> But as I said at the outset I dont understand C++

Yes I can tell you haven't used C++.  Compared to C, I've always found
memory management in C++ to be quite a lot easier. The main reason is
that C++ guarantees objects will be destroyed when going out of scope.
So when designing a class, you put any allocation routines in the
constructor, and put deallocation routines in the destructor.  And it
just works.  This is something I miss in other languages, even Python.

And for many things, though it's not quite as efficient, when dealing
with objects you can forgo pointers altogether and just use copy
constructors, instead of the

blah *a = new blah_with_label("hello") //allocate on heap
//forget to "delete a" and it leaks the heap *and* anything
//that class blah allocated on construction.

just simply declare objects directly and use them:

blah a("hello") //assuming there's a constructor that takes a string
                //deletes everything when it goes out of scope

So for the lightweight abstractions Stroustrup talks about, this works
very well. And you'll rarely have a memory leak (only in the class
itself) and no "dangling pointers."

For other things, though, you have to dynamically create objects.  But
the C++ reference-counting smart pointers offer much of the same
destruction semantics as using static objects.  It's really a slick
system.  Almost makes memory management a non-issue.  Circular
references will still leak (just like they do on Python).  But it
certainly makes life a lot more pleasant than in C from a memory
management perspective.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[OT] fortran lib which provide python like data type 1989lzhh <1989lzhh@gmail.com> - 2015-01-29 21:39 +0800
  Re: [OT] fortran lib which provide python like data type beliavsky@aol.com - 2015-01-29 14:39 -0800
    Re: [OT] fortran lib which provide python like data type Rustom Mody <rustompmody@gmail.com> - 2015-01-29 17:40 -0800
      Re: [OT] fortran lib which provide python like data type Christian Gollwitzer <auriocus@gmx.de> - 2015-01-30 08:32 +0100
        Re: [OT] fortran lib which provide python like data type Rustom Mody <rustompmody@gmail.com> - 2015-01-30 08:27 -0800
          Re: [OT] fortran lib which provide python like data type Michael Torrie <torriem@gmail.com> - 2015-01-30 10:08 -0700
            Re: [OT] fortran lib which provide python like data type Rustom Mody <rustompmody@gmail.com> - 2015-01-30 09:31 -0800
              RAII vs gc (was fortran lib which provide python like data type) Rustom Mody <rustompmody@gmail.com> - 2015-01-30 10:02 -0800
                Re: RAII vs gc (was fortran lib which provide python like data type) Sturla Molden <sturla.molden@gmail.com> - 2015-01-30 21:28 +0000
                Re: RAII vs gc (was fortran lib which provide python like data type) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-01 14:00 +1100
                Re: RAII vs gc (was fortran lib which provide python like data type) Chris Angelico <rosuav@gmail.com> - 2015-02-01 14:21 +1100
                Re: RAII vs gc (was fortran lib which provide python like data type) Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-01-31 19:27 -0800
              Re: [OT] fortran lib which provide python like data type Michael Torrie <torriem@gmail.com> - 2015-01-30 11:15 -0700
                Re: [OT] fortran lib which provide python like data type Paul Rubin <no.email@nospam.invalid> - 2015-01-30 10:23 -0800
                Re: [OT] fortran lib which provide python like data type Christian Gollwitzer <auriocus@gmx.de> - 2015-01-31 09:27 +0100
                Re: [OT] fortran lib which provide python like data type Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-01-31 11:51 +1300
                Re: [OT] fortran lib which provide python like data type Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-31 10:49 +1100
                Re: [OT] fortran lib which provide python like data type Marko Rauhamaa <marko@pacujo.net> - 2015-01-31 14:22 +0200
                Re: [OT] fortran lib which provide python like data type Rustom Mody <rustompmody@gmail.com> - 2015-01-31 07:50 -0800
                Re: [OT] fortran lib which provide python like data type Marko Rauhamaa <marko@pacujo.net> - 2015-01-31 19:43 +0200
                Re: [OT] fortran lib which provide python like data type Rustom Mody <rustompmody@gmail.com> - 2015-01-31 18:30 -0800
                Re: [OT] fortran lib which provide python like data type Marko Rauhamaa <marko@pacujo.net> - 2015-02-01 09:38 +0200
                Re: [OT] fortran lib which provide python like data type Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-02 03:49 +1100
                Re: [OT] fortran lib which provide python like data type Marko Rauhamaa <marko@pacujo.net> - 2015-02-01 20:57 +0200
                Re: [OT] fortran lib which provide python like data type Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-02 12:59 +1100
                Re: [OT] fortran lib which provide python like data type Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-02 13:05 +1100
                Re: [OT] fortran lib which provide python like data type Marko Rauhamaa <marko@pacujo.net> - 2015-02-02 10:51 +0200
                Re: [OT] fortran lib which provide python like data type Chris Angelico <rosuav@gmail.com> - 2015-02-02 13:04 +1100
                Re: [OT] fortran lib which provide python like data type Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-02 18:01 +1100
                Re: [OT] fortran lib which provide python like data type Marko Rauhamaa <marko@pacujo.net> - 2015-02-02 10:52 +0200
                Re: [OT] fortran lib which provide python like data type Paul Rudin <paul.nospam@rudin.co.uk> - 2015-02-02 12:56 +0000
                Re: [OT] fortran lib which provide python like data type Marko Rauhamaa <marko@pacujo.net> - 2015-02-02 15:27 +0200
                Re: [OT] fortran lib which provide python like data type Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-02-02 16:08 +0000
                Re: [OT] fortran lib which provide python like data type Rustom Mody <rustompmody@gmail.com> - 2015-02-02 08:21 -0800
                Re: [OT] fortran lib which provide python like data type Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-02-02 16:52 +0000
                Re: [OT] fortran lib which provide python like data type Chris Angelico <rosuav@gmail.com> - 2015-02-03 04:25 +1100
                Re: [OT] fortran lib which provide python like data type Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-02-02 18:34 +0000
                Re: [OT] fortran lib which provide python like data type Chris Angelico <rosuav@gmail.com> - 2015-02-03 10:15 +1100
                Re: [OT] fortran lib which provide python like data type Matthew Barnett <auxlang@mrabarnett.plus.com> - 2015-02-02 02:35 +0000
                Re: [OT] fortran lib which provide python like data type Chris Angelico <rosuav@gmail.com> - 2015-02-02 13:45 +1100
                Re: [OT] fortran lib which provide python like data type Roy Smith <roy@panix.com> - 2015-02-01 23:12 -0500
                Re: [OT] fortran lib which provide python like data type Roy Smith <roy@panix.com> - 2015-02-01 23:14 -0500
                Re: [OT] fortran lib which provide python like data type Chris Angelico <rosuav@gmail.com> - 2015-02-02 15:47 +1100
                Re: [OT] fortran lib which provide python like data type Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-02-02 16:06 +0000
                Re: [OT] fortran lib which provide python like data type Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-01-31 17:59 +0000
                Re: [OT] fortran lib which provide python like data type Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-01 13:27 +1100
                Re: [OT] fortran lib which provide python like data type Paul Rubin <no.email@nospam.invalid> - 2015-01-31 22:26 -0800
                Re: [OT] fortran lib which provide python like data type Marko Rauhamaa <marko@pacujo.net> - 2015-02-01 09:58 +0200
                Re: [OT] fortran lib which provide python like data type Christian Gollwitzer <auriocus@gmx.de> - 2015-02-01 09:14 +0100
                Re: [OT] fortran lib which provide python like data type Marko Rauhamaa <marko@pacujo.net> - 2015-02-01 21:12 +0200
                Re: [OT] fortran lib which provide python like data type Michael Torrie <torriem@gmail.com> - 2015-02-01 17:50 -0700
                Re: [OT] fortran lib which provide python like data type Michael Torrie <torriem@gmail.com> - 2015-02-01 18:02 -0700
                Re: [OT] fortran lib which provide python like data type Marko Rauhamaa <marko@pacujo.net> - 2015-02-02 09:39 +0200
                Re: [OT] fortran lib which provide python like data type Michael Torrie <torriem@gmail.com> - 2015-02-02 09:25 -0700
                Re: [OT] fortran lib which provide python like data type Marko Rauhamaa <marko@pacujo.net> - 2015-02-02 19:57 +0200
                Re: [OT] fortran lib which provide python like data type Michael Torrie <torriem@gmail.com> - 2015-02-02 11:23 -0700
                Re: [OT] fortran lib which provide python like data type Marko Rauhamaa <marko@pacujo.net> - 2015-02-02 20:54 +0200
                Re: [OT] fortran lib which provide python like data type Michael Torrie <torriem@gmail.com> - 2015-02-01 18:02 -0700
                Re: [OT] fortran lib which provide python like data type beliavsky@aol.com - 2015-02-02 05:30 -0800
                Re: [OT] fortran lib which provide python like data type Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-31 10:50 +1100
                Re: [OT] fortran lib which provide python like data type Michael Torrie <torriem@gmail.com> - 2015-01-30 20:49 -0700
                Re: [OT] fortran lib which provide python like data type Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-31 22:04 +1100
                Re: [OT] fortran lib which provide python like data type Rustom Mody <rustompmody@gmail.com> - 2015-01-31 08:18 -0800
          Re: [OT] fortran lib which provide python like data type Sturla Molden <sturla.molden@gmail.com> - 2015-01-30 23:12 +0000
          Re: [OT] fortran lib which provide python like data type Michael Torrie <torriem@gmail.com> - 2015-01-30 20:35 -0700

csiph-web