by piotr5 » Fri Jun 12, 2015 11:33 pm
yes, that's alsoo my main concern: if you write centralized sourcecode for the algorithm and hide the details elsewhere, I somehow doubt gdb is fit for that task. you'd need to define several layers of abstraction into your program, and in the same way as you now can choose between single-stepping assembler and code, you should get the possibility to skip stepping into some functions based on the file they're contained in. i.e. single-step only c++ files and not headers. and the problem of tracking data which has no physical location in ram (but instead on disc) too requires some improvements in gdb.
anyway, concretely I tried to implement a program searching for prime-numbers. eventually memory is full, so disc-space is used for storing them. the goal is to fill a 4TB disc with prime-numbers and divisors of non-primes. (i.e. crack weak encryption in constant time.) writing and reading disc is a parallell process. you initiate it and eventually hardware has done the job while CPU continues working. so I wrote a class emulating the behaviour of a vector. but then I started thinking: eventually those 4TB are full, maybe I'll add new drives but in effect drives located in the net are a better solution. so if I want a really huge array of divisors, with the computer working several years on its creation, how do you index that? what is a realistic index-width? if after years you notice you want to continue doing this for centuries, how do you change index-width? maybe work without any index at all? but then, how does a container look, indexed by a truely arbitarily large number? the number could become so large that the index for the array storing that index for my primes becomes bigger than 64 bit? in other words, in c++ the major problem is that if the developers of some lib didn't even think of making some constants changeable, you need to copy their code and implement that adjustment yourself. (beware of closed-source code then.)
so in the end I do wish for a better programming language than c++. but instead of limiting its freedom, it should enhance it! just take the headers provided by a lib, tell the compiler what changes you want, and the binary-format lib will then work with all these changes! and I mean that not just for classes, sometimes functions perform 2 tasks that could easily be split into 2 functions. if there is a way of seeing functions as classes, then this kind of splitting should be accessible through the dot-notation...
in other words, imho all sequential stuff should be banned from functions and put into some other variable-type. anybody seen something like that?