On Tuesday, May 12, 2015 at 12:57:48 PM UTC-5, Rustom Mody wrote: > On Tuesday, May 12, 2015 at 10:45:39 PM UTC+5:30, Stefan Ram wrote: > > Rob Gaddi writes: > > >Is that a true array or a linked list? "It's a high level language, > > >that's just an implementation detail." Yes, but it's an implementation > > >detail that determines whether even the simple act of looking up element > > >n is O(1) or O(n). > > > > The complexity is given in the documentation of high-level languages. > > > > For example, from the documentation of the Java standard library: > > > > »This implementation provides constant-time performance > > for the basic operations (get and put),« (java.util.HashMap) > > > > C++: > > > > Section 23.2.1 specifies the complexity, such as »compile time«, > > »constant«, »linear« for container operations. > > > > But the abstraction mechanisms (templates, polymorphism) > > often allow one to change the implementation quite easily. > > This is regarded in some circles as one of the big open problems in CS > https://existentialtype.wordpress.com/2014/09/28/structure-and-efficiency-of-computer-programs/ > [and the position paper therein] > viz how to integrate the elegance of high-level languages > with the precision of complexity analysis of machine language
The answer is you don't. You *don't* because you can't. And you *can't* because you don't know what you want to do yet. That is why you have very high-level languages that allow you to rapidly prototype ideas, test them, and then, depending all the other constraints, move them to lower-level language implementations. So don't try it. Everyone gets it wrong and now we have a plethora of languages which all do the same thing, without really knowing what they want as an overarching design or purpose. Mark -- https://mail.python.org/mailman/listinfo/python-list