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

World: r3wp

[!REBOL3-OLD1]

Pekr
28-May-2009
[14546]
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
BrianH
28-May-2009
[14573x2]
It can be secured if access is through bounds-checked accessors.
By "we'll see in practice", I mean that the current model is not 
yet documented, and has gone through design changes this month.
Steeve
28-May-2009
[14575x2]
i don't see your point, if i want a binary serie of the internal 
data of a vector, it's to do all sort of operations we can do on 
binaries
accessor will not protect anything
BrianH
28-May-2009
[14577]
Except inserting, or changing the length, or changing the data to 
something the vector type doesn't support, or...
Steeve
28-May-2009
[14578x2]
Oh Geez, you want protect the vector from modifications ?
So forget my request, vectors will be of no use
i will continue to manage my indexes with plain binaries
BrianH
28-May-2009
[14580]
No, I want to protect the vector from *bad* modifications. That's 
easy to do, as long as you *don't* do type aliasing.
Steeve
28-May-2009
[14581x3]
what kind of bad modification could exist with a binary serie ? there 
is noone.
To my mind a vector should be just a wrapper on a binary serie.
just a new handy way, to modify or get values from a binary
BrianH
28-May-2009
[14584x2]
That's my point. There are no bad modifications to binaries, but 
there *are* bad modifications to vectors, depending on the type.
There are unsupported floating point numbers (inf, nan), and vectors 
must be a multiple of their component parts' size.
Steeve
28-May-2009
[14586x2]
The types are limited to integers so there are no *bad* modifications.
Oh yes, i forgot about floats
BrianH
28-May-2009
[14588]
No, decimals are supported too.
Steeve
28-May-2009
[14589]
yeah yeah ,my bad...
BrianH
28-May-2009
[14590]
(slow altme)
Steeve
28-May-2009
[14591x2]
i vote to discard decimals, if it can be of any help :)
they can use fixed point decimals instead, so users will not complain
BrianH
28-May-2009
[14593]
Ladislav will complain :(
Steeve
28-May-2009
[14594]
who's that ? :-)
BrianH
29-May-2009
[14595]
Quick discussion needed, and here because more people need to chime 
in:


There is a proposal to change the name of the MAP function to MAP-EACH. 
Here's why:

- There's a map! type, and this function is unrelated - except in 
CS theoretical terms, which is why we suggest the name MAP-EACH.

- The other functions that have the name of a type without the ! 
are constructors for that type. The map! type could use one.
- This function is behaviorily one of the *EACH family already.

- This is *not* the functional language map function, and it might 
be good to emphasize that...


In functional languages, functions like map take functions as parameters. 
However, such languages tend to be compiled and the function values 
they take are constructed ahead of time. Since REBOL is interpreted 
and functions are created at runtime, that kind of code pattern tends 
to be inefficient. That is why REBOL control and loop functions tend 
to take blocks instead, and have any argument words to those blocks 
as a separate parameter: It's much more efficient that way.


There is precedent: The REBOL function that corresponds to the functional-langage 
filter function is REMOVE-EACH.


We ask this question now because now is the time to make the change, 
if ever. Not many functions in R3 use MAP yet (the only one I can 
think of off the top of my head is LOAD). This will change when we 
do a hand-optimization pass of the mezzanines, and it will definitely 
be too late once we hit beta.


What do you all think? Please chime in in the next couple days if 
you can (and have an opinion).