World: r3wp
[!REBOL3 Proposals] For discussion of feature proposals
older newer | first last |
Maxim 13-Jan-2011 [607x3] | yes, in such a sense (expensive change), I understand. I will wait for brian to step up and get his opinion. I know we've spoken about this somewhat before, but not as head-on, for myself... With the recent talk about naming, IMHO it has put a new light on the possibility for this to be a bit more appreciated, adding ? at the end would now mean something concrete. let it be known that I do like errors, I am not against errors, I have been putting less and less error recovery in my code to make sure it crashes and I fix bugs early. its just that I can see many if not most ****? functions (my own included) being truthy and this is very usefull to facilitate control flow. This, as oposed to always putting error handlers in places where the error is only used as a negative reply, for which we can supply, IMHO, a reasonable value/standard. |
another proposal: have info? support more datatypes. it would be very nice for a single function to return information about any datatype in a single call. ex: >> a: make string! 1000 >> a: next append a "12345678" == make object! [length: 7 index: 2 size: 8 buffer: 1000 references: 1] | |
the references would tell us how massively this string is being used within the application and allow us to track if we are leaking data in a way that it will never be able to GC it. | |
Ladislav 13-Jan-2011 [610x3] | That "references:" may be expensive, since I doubt there is code doing that now. |
(very expensive, I dare to say) | |
...and, the GC is able to collect a string no matter how many references refer to it | |
Maxim 13-Jan-2011 [613] | on objects info? could just return all the various reflective properties it has (words-of spec-of) and a few more like ram being used by object. all types would benefit from this sorely lacking feature in REBOL. |
Ladislav 13-Jan-2011 [614] | (REBOL GC does not use reference counting) |
Steeve 13-Jan-2011 [615] | really ? Which algoritm is Rebol using then ? |
Ladislav 13-Jan-2011 [616] | I do not know, which one, but about this I am sure |
Maxim 13-Jan-2011 [617] | in any case, the idea is to put as much information there as is possible. this would be VERY usefull for debugging, dialecting, and inspecting untrusted coded |
Steeve 13-Jan-2011 [618] | I don't like these secrets |
Maxim 13-Jan-2011 [619] | one problem with reference counting is cyclical reference. they are hard if even sometimes impossible to collect in some sequences of execution. |
Ladislav 13-Jan-2011 [620] | (generally, reference counting is not a true garbage collection) |
Steeve 13-Jan-2011 [621] | cyclical references is a problem with any sort of algoritm. |
Maxim 13-Jan-2011 [622] | yeah but for a garbage collector its a major issue. |
Ladislav 13-Jan-2011 [623] | so, the proper GCs don't count references |
Maxim 13-Jan-2011 [624] | I do wonder how it knows that all references have been terminated. |
Ladislav 13-Jan-2011 [625] | You can understand the whole referencing business as a kind of a graph - A refers to B, B refers to C, C refers to A, ... |
Maxim 13-Jan-2011 [626x3] | ok, just read a few papers on current GC techniques (including MS's pretty competent algorithm) |
anyhow... we are a bit off topic from my original post. I now understand why GC is very slow on large datasets. | |
but its still possible to get that information, maybe it could be a refinement, as well as one for MEM stats (if its also heavy to resolve) | |
Ladislav 13-Jan-2011 [629] | but its still possible to get that information, - which one, references are not counted |
Maxim 13-Jan-2011 [630] | no but traversing the "heap" (which is what I am guessing he is doing) he can count all references to a particular item. and YES it wil be slow. but for debugging it could be EXTREMELY usefull. even more would be returning all the items which the GC has encountered which have references) |
Ladislav 13-Jan-2011 [631] | I do not say reference counting *cannot* be done. I say referece counting *is not* implemented. |
Maxim 13-Jan-2011 [632] | ah ok ;-) |
Ladislav 13-Jan-2011 [633x2] | (I may be wrong, though) |
but, taking into account, that it is not needed (the GC does not need to know that), it would be a waste of time/code | |
Gregg 13-Jan-2011 [635] | There are things I would rather see time spent on than the proposed INFO? enhancement. |
BrianH 13-Jan-2011 [636x3] | REBOL isn't heading towards less error triggering as a rule (though there may be less in practice); it is headed towards making errors trigger on more useful occasions. The principle is that errors are your friends, and if they aren't, we need to reevaluate them on a case by case basis. In some cases we have made things trigger an error in R3 that didn't in R2, with the hope of overall benefits in security, stability and debuggability. We even added ASSERT to explicitly trigger errors. |
In the case of LENGTH? and INDEX?, we are only allowing them to return none when passed none, using none as the equivalent of SQL's unknown, not N/A. And even those are a bit iffy - we are only planing to allow those to have fewer intermediate none checks when doing none pass-through on FIND and SELECT return values. However, the disadvantage is that errors aren't triggered close enough to the source of the error. Hopefully they will be triggered later by ASSERT calls. | |
My preference would be to not lose the valuable information about which values have length and which shouldn't be passed to LENGTH?. We definitely don't want too many nones to be propagated to data that doesn't expect them; none leaks are tough to track down, which is the whole purpose of the unset! type. | |
shadwolf 13-Jan-2011 [639] | maxim I vote for your proposal legth? to return none if the argument can't be traversed could be a test on the type of the tested thing but arfter ready your way to present this I'm kinda convinced ... As for the GC discussion I very liked the " it doesn't work like this but I don't know anything about how it works" isn't that a mutual exclusion ? |
BrianH 13-Jan-2011 [640x2] | Not really. We can determine from testing the ways that it *doesn't* work. |
We don't know the exact algorithm, but we know a lot about it, and that it's proprietary. | |
shadwolf 13-Jan-2011 [642] | that's the kind of high level discussion that should conclude by a high level documentation about memory management and gc predictions ... but probably better wasting the oportunity ... once again. I would not ask why? |
BrianH 13-Jan-2011 [643x3] | GC stuff that we can figure out from experimentation and conversations: |
- Mark and sweep - Not generational or copying - Probably zoned into block and binary/string zones. | |
Also, Carl has claimed that it is an algorithm that is unique to REBOL, though not gone into details. | |
Maxim 13-Jan-2011 [646] | I think adding a system like generational would be a big benefit to REBOL. my guess is that Carl has a twist on this idea. |
shadwolf 13-Jan-2011 [647] | it's not the first time we have this discussion years ago we had this discussion about GC and memory management it's a cyclic concern and a cyclic discussion until we don't DC it :) ( Document & Collect it) |
Maxim 13-Jan-2011 [648] | and because memory isn't released to the OS very often, I can make a fair guess that the GC doesn't compact on collect. |
shadwolf 13-Jan-2011 [649] | and clearly speaking about guru level stuff and not having a begining of a trail on such an issue makes me crazy just because noone wants to do this basic effort ... |
Maxim 13-Jan-2011 [650] | but the GC can only be speculated to. so there isn't alot of point in documenting assumptions. |
shadwolf 13-Jan-2011 [651] | anyway GC thing will tend to be less crucial with the default local vars in func no ? |
Maxim 13-Jan-2011 [652x2] | unless Carl did a document about it, which would be very nice. (hint hint ... RM-Asset guys? ;-) |
no since the memory allocated by any function still has to be managed by some sort of heap, since the data can and often does exist beyond the stack. | |
shadwolf 13-Jan-2011 [654x2] | maxim hum you know you do a splendid documentation full of stupidities to make Carl go on verbose mode and correct it that's what it's called preach the false to obtain the true :) |
that's some inverted spycology ... | |
Maxim 13-Jan-2011 [656] | spycology... hahaha... typo or not, its a good word. |
older newer | first last |