r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!REBOL3-OLD1]

BrianH
28-May-2009
[14523]
I really don't mind having some functions return no-value. The interesting 
decision to be made on a case-by-case basis whether no-value is an 
optional return or all the time, and whether no-value is generally 
an error when used, or not. #[none!] is the no-value that is generally 
usable as a value, or at least not an error most of the time. #[unset!] 
is th no-value that really is not a value, and most functions treat 
it as an error, but not all.
Dockimbel
28-May-2009
[14524]
I understand unset! values as an exception case where there's no 
value to work with. As such, IMHO, it should be treated as an error 
as much as possible. We should stick to the principle of least surprise. 
 

It wouldn't hurt if R3 unset! values were treated more consistently. 
But this is a deep topic, I remember that Ladislav had some interesting 
propositions about unset! (like, IIRC, removing it from user's eyes 
and keeping it internal only). While browsing about that, I've found 
a few interesting links :
http://www.rebol.net/cgi-bin/r3blog.r?view=0100
http://www.fm.tul.cz/~ladislav/rebol/rep.html#section-18
BrianH
28-May-2009
[14525]
Bug #564 and option 2 were the result of the last time (January) 
we decided on a consistent treatment of unset! values:

- As an error in value contexts, like assignment, function parameters 
that don't explicitly support it.

- As a noop in control contexts, where the value would normally be 
thrown away, like DO blocks. ANY and ALL were added to this group.
Maxim
28-May-2009
[14526x2]
funny, I hadn't realised that do blocks already ignore unset values... 
obviously.
so it makes sense with any and all too.
BrianH
28-May-2009
[14528x5]
We get a different answer every time we have this discussion :(
Yeah, and it doesn'tt make sense to ignore unset! with REDUCE because 
that is a value context. With CONSTRUCT it is treated as no-value 
and not inserted. Both of these are the right choice in their respective 
cases.
The main difference between ANY and DO, aside from ANY stopping early, 
is that ANY has a default value: none. Having a default value means 
that no-value is acceptable, so it returns the acceptable no-value. 
DO doesn't have a default value, so if the last expression generates 
no-value, that is passed along. That was the rationale for #564 and 
option 2, at least.
I'm actually OK with either option 2 or 3, but there are tradeoffs 
to either. Which reminds me: Which built-in functions in R3 return 
unset! values? I can only think of PRINT and PRIN, off the top of 
my head. WRITE returns a value in R3. Even ASSERT returns true.
I just remembered to check the behavior of the other *conditional* 
control functions: IF, UNLESS, EITHER and CASE. They all treat #[unset!] 
like option 3, as an error. I guess option 3 is the most consistent.
Steeve
28-May-2009
[14533x3]
Yeah, using the last A55, i got better perfs with my virtual block 
scheme (bug on files corrected).
On my small Celeron, i can do now: 
- 25000 read per sec.
- 20000 append/update per sec

quite good
(doing my test with recycle/ballast activated, so that the memory 
used stay low, arround 3500 Mb.
The test file containing 500000 records)
Oups !!! not 3500 Mb, but 3,5 Mb
Pekr
28-May-2009
[14536]
3.5MB :-)
Steeve
28-May-2009
[14537]
yes bytes not bits :)
Pekr
28-May-2009
[14538]
Steeve - what is the speed compared to R2?
Steeve
28-May-2009
[14539x6]
don't know
cause the scheme VBS has not been backported
..
sh*****t, i lost my post
I Don't write it back.
Summary:
We can't serialize vectors to save/load them into files.
We need decisions.

Designing vectors not serializable from the start was an error to 
my mind.
We need easy way (fast and not memory consuming) to convert and convert 
back vectors from binaries.
Pekr
28-May-2009
[14545x2]
yes, this world needs restart. I advice, before you post, press CTRL+A, 
then CTRL+C to get your post to clipboard first, to save your sanity 
:-)
Maybe it would be get to post your idea to R3 Chat, R3/Datytypes 
section, or as a wish to CureCode, as Carl will not be able to read 
it here ....
Steeve
28-May-2009
[14547x2]
yep, it's what i do usually, but sometimes i forgot
but we can discuss here about the proposal at first
Pekr
28-May-2009
[14549]
Yes ... things should be serialisable, chainable, and streamable 
- I still wait for Codecs and Parse to handle streamed data input 
.... :-)
BrianH
28-May-2009
[14550]
REBOL values only need to be serializable in REBOL format from the 
start - that is all the datatype! spec allows. That means MOLD and 
MOLD/all formats, and vectors support those peoperly as of alpha 
55. There are only so many operations that a datatype! can support 
internally. These operations are known as action! functions.


All other operations on a datatype! can be implemented as REBOL or 
native functions, and these functions can be added later if need 
be. They don't need to be there from the start. Codecs seem like 
a likely choice in this case, once the codec model changes to allow 
streaming. The current model is a just-for-now placeholder.


Welcome to the wonderful world of alpha software that is still being 
designed :)
Steeve
28-May-2009
[14551x2]
I just wanted to underline that it's not good to postpoint the design 
of vectors.

Currently their design is too limited to be usefull (not serialisable, 
no scalars operations).

I hope there will be not huge drawbacks when the time will come to 
complete them like they should behave.
I'm a little disapointed about how Carl deals with the design of 
vectors.
BrianH
28-May-2009
[14553x3]
Vectors are serializable in the only way that REBOL datatypes can 
be inherently serializable: through MOLD. This is a basic limitation 
of how datatypes are implemented in REBOL. All other forms of serialization 
*have to* be implemented with other functions.
The actions are the only functions that can be implemented *by* a 
datatype. All other functions are addons.
R3 is being incrementally designed. Incremental design is by far 
the best design approach for programming langages.
Steeve
28-May-2009
[14556x2]
Serialization is a general concept here.

I'm talking about convertions of vectors into another formats (like 
blocks or binaries).
molding a vector is of no use in real applications.
BrianH
28-May-2009
[14558x2]
Well, that has to be done by functions that are not inherent to the 
datatype, addon functions. Those addon functions can be built in 
or put into plugins, or both.
Except for the conversion to blocks, which is supported as of alpha 
55.
Steeve
28-May-2009
[14560x3]
are you serious ?
to block! and to binary! should be provided
especially to binary!
aswell as-binary
BrianH
28-May-2009
[14563x2]
Yes they should. And they will, along with better binary conversion 
methods than to-binary.
AS-BINARY and AS-STRING will not exist in R3 - no type aliasing allowed.
Steeve
28-May-2009
[14565]
Wtf, i want the reference of the hardstored binary data of the vector.
What the prob ? it's stored as a binary stream
BrianH
28-May-2009
[14566]
It's a safety issue. That kind of access will be done through accessor 
functions.
Steeve
28-May-2009
[14567]
you mean the data will be copied ?
BrianH
28-May-2009
[14568]
I mean the access will be through functions which will hide the internal 
implementation. That doesn't mean the data will be copied.
Steeve
28-May-2009
[14569]
there is nothing to hide, a vectors is a binary serie
BrianH
28-May-2009
[14570]
That's the plugin model, in theory (we'll see in practice). R2-style 
structs and routines are insecure.
Steeve
28-May-2009
[14571x2]
so to secure it, there will be a copy. If not it can be secured
*can't be