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

World: r3wp

[!REBOL3-OLD1]

BrianH
20-Apr-2009
[13368]
Dialecting isn't any slower, it's just that everything else has gotten 
quicker in R3, and dialect processing just seems slower in comparison. 
Dialecting just has to catch up with the rest.
Pekr
20-Apr-2009
[13369x2]
BrainH: what is your take on security? I mean - with R2 web plugin, 
we could not allow DLL interface. We are now restructuring R3 security 
model, but I still wonder - what about R3 plug-ins? Those will contain 
native code, no? Will R3 be "internet secure"? Or we will have to 
release special version of R3 for browser, hence making it non-extensible? 
Or it can be secured somehow?
BrainH: well, for me dialects should not be introduced just for the 
sake of using dialects, but for kind of API environments, where they 
make sense. And - you "compile" them to REBOL code in the end, I 
think that the cost is not very high ...
BrianH
20-Apr-2009
[13371]
I expect that the browser plugin won't be able to load REBOL plugins 
that have native code in them - they will need to be compiled in.
Pekr
20-Apr-2009
[13372]
OK, moving home. I am curious what Carl comes up with. His host isolation 
plan via 'cmd actions looks interesting, although I do not understand 
it fully yet :-)
BrianH
20-Apr-2009
[13373x2]
Some dialects are compiled into REBOL code (I do it often), but most 
people's dialects are either interpreted or handled by natives.
The security model is a work in process - if you don't understand 
it fully yet, that just means you get it :)
Janko
20-Apr-2009
[13375]
BrianH, that libjit thing is very interesting
Gabriele
21-Apr-2009
[13376x4]
Geomol, the difference I'm pointing out is the following: suppose 
you have an array of unicode code points. each element in the array 
is an integer that represents a character. you can "encode" it to 
UTF-8. there is no magic, for each integer you have a corresponding 
sequence of bytes.
Now, if your array was representing a url, you could encode it to 
UTF-8 using the % encoding as well to stay in the ascii subset. This 
is encoding, but still, it will not solve your @ problem. each @ 
in the array of integers will become an @ (which is an ascii char) 
in the final string.
it is in your *source array* (re: shouting, i just want to give emphasis 
but we don't have rich text, and the * thing does not work very well 
for long text) that you must distinguish between @ (the field separator) 
and % 4 0 (an escaped @, part of the url field text). There is no 
encoding process that can *automatically* go from your array of integers 
to the correct url string.
You can do it automatically only if you keep your fields separate, 
like in an object. so if you have [user: "[user-:-domain]" host: "somehost" 
...] you can have a function that automatically turns that into the 
correct url string.
Geomol
21-Apr-2009
[13380x2]
Maybe we got unicode encoding end escape encoding confused.


As I see it, given correct rules, auto converting of user input to 
correct url can be achieved. I made this function to illustrate, 
what I mean (it's not optimized, but should be easy to read):

encode-url: func [input /local url components host] [
	components: parse input "@"
	host: back tail components

	url: clear ""
	append url components/1
	components: next components

	forall components [
		either components = host [
			append url "@"
			append url components/1
		][
			append url "%40"
			append url components/1
		]
	]
	url
]


I can use it both with and without specifying %40 for the first @ 
in the url:

>> encode-url "ftp://[name-:-home-:-net]:[pass-:-server-:-net]"
== "ftp://name%40home.net:[pass-:-server-:-net]"
>> encode-url "ftp://name%40home.net:[pass-:-server-:-net]"
== "ftp://name%40home.net:[pass-:-server-:-net]"


It will give correct result in both cases (I use strings, but of 
course it should be url! datatype in REBOL). Now comes unicode. Given 
precise rules, how that should happen, I see no problem with encoding 
this in e.g. UTF-8.


So I think, it's possible to do this correctly. But maybe it's better 
to keep it simple and not do such auto convertions. In any case, 
the behaviour needs to be well documented, so users can figure out, 
how to create a valid url. I had same problem as Pekr years ago, 
and I missed documentation of that.
unicode encoding *and* escape encoding
sqlab
21-Apr-2009
[13382]
I think it is good to have a flexible encoding method, but it should 
not be invoked automatically.
Geomol
21-Apr-2009
[13383]
Yeah, maybe give functions like mine above, that users can call and 
get their input encoded, instead of having to know all the escaping 
rules themselves.


If that solution is choosed, then this input should give an error, 
as it is an invalid url:

ftp://[user-:-net-:-net]:[pass-:-server-:-net]

Today R3 just accepts it.
Pekr
21-Apr-2009
[13384x2]
Great!, Ladislav Mecir just registered to R3 chat! Hopefully he will 
be back and is OK!
New short doc to comment on: http://rebol.com/r3/docs/concepts/gui-layout.html
Henrik
21-Apr-2009
[13386]
Ladislav is back. I guess we can get more focus on those scanner 
problems now. :-)
Pekr
21-Apr-2009
[13387x2]
:-)
BrianH has finally some companion to talk to, instead of listening 
to my lame questions :-)
BrianH
21-Apr-2009
[13389]
But I like your lame questions :)
Janko
21-Apr-2009
[13390x2]
wow, that is great.. I remember his rebol website showed me that 
rebol is very deep language , I still have plan to read his documents 
more
yes :)
Henrik
21-Apr-2009
[13392]
is Chat down again?
Graham
21-Apr-2009
[13393]
Ladislav also seen on skype today :)
Will
21-Apr-2009
[13394]
yuppy-yay-yea 8-) Ladislav back 8-)
[unknown: 5]
21-Apr-2009
[13395]
Someone hit him up and tell him to jump in here.
Henrik
22-Apr-2009
[13396]
The O3D plugin from google takes up about 15 MB of disk space. I 
wonder how many kb it would take to do the same thing in R3 using 
ReBrowse.
Gabriele
22-Apr-2009
[13397]
Geomol, so that will give you the correct result for *two* cases. 
Cool. What about the other billion cases? :-) I'd like to understand 
if you have ever worked with this stuff in real life, and to what 
extent, because in my experience what you did above makes no sense 
at all...
Henrik
22-Apr-2009
[13398]
On the new R3 GUI document: I think the new guides and layers concept 
will work much better, but of course it depends on the implementation. 
I've asked a range of questions in Chat to get some more information.
Pekr
22-Apr-2009
[13399]
Doesn't guides concept reminds 'AT concept in R2, and hence absolute 
positioning, which we were against?
Henrik
22-Apr-2009
[13400]
No. AT would be overridden as soon as RETURN was used, so AT was 
only useful per face. Guides are generally a great idea if used correctly.
Pekr
22-Apr-2009
[13401]
So in what regard it differs to current 3.4 VID?
Henrik
22-Apr-2009
[13402x2]
They can be set manually, which solves a problem that was present 
since the old VID3, namely to have proper reference positions in 
the layout, usable by multiple panels. Even if it's not possible 
to share guides between panels, we can get good use of this.

Generally they provide much more control over the layout. Whether 
guides are implemented correctly is a different issue.
Not having proper reference positions is one of the reasons VID3.4 
is very hard to produce good layouts with. Faces are just sailing 
around in the window.
Pekr
22-Apr-2009
[13404x2]
Yes, so finaly my "anchoring" model? So that I can e.g. position 
two buttons relative to some text area corner?
(that could be achieved by normal layout model with alignment of 
butons to the right even today otoh)
Henrik
22-Apr-2009
[13406]
I'm not sure, but it could be. The anchoring model I was advocating 
was from OSX, which Carl does not like. That reminds me that I didn't 
ask whether guides could be hinged to other guides.
Pekr
22-Apr-2009
[13407]
Why Carl proposes different model suddenly? I thought he was OK with 
what he has created?
Henrik
22-Apr-2009
[13408x3]
I just hope he saw that the model wasn't good enough.
(also he apparently listened to my comments :-))
anyhow, with guides we are also no longer depending on MAX-SIZE.
Ladislav
23-Apr-2009
[13411x2]
Hello, jumping in
re the %rebol.r and %user.r files:
* I do not use %rebol.r for anything

* I use %user.r to set up my personal preferences on every machine 
so, that it looks like I expect it to: defining my personal "absolutely 
necessary" functions
BrianH
23-Apr-2009
[13413]
Ladislav (continued from Rebol vs. Scheme), FUNCTOR currently isn't 
being used by any mezzanine code, so if we want to change it now 
is the time. If we go with your initialization block idea:

- The initialization would have to be performed at function creation 
time, not first call.

- The init block would be only the starting spec for the static object, 
not  the final spec. We'd need to still do the search-for-setwords 
that FUNCT does, or there'd be no point to including FUNCTOR.
- I'd suggest that the parameters be in spec, init, body order.
Ladislav
23-Apr-2009
[13414]
I essentially support Pekr's opinion about %user.r with the following 
exception:

* REBOL should be unable to overwrite %user.r when started in the 
default security mode (security reasons)
BrianH
23-Apr-2009
[13415]
functor: func [

   "Defines a user function with all set-words collected into a persistent 
   object (self)."

    spec [block!] "Help string (opt) followed by arg words (and opt type 
    and string)"
    init [block!] "Initialization block of the persistent object"
    body [block!] "The body block of the function"
][

    make function! reduce [copy/deep spec bind/set/copy body make object! 
    init]
]


We decided to not use the term "static locals" since it would be 
confusing to people not familiar with C languages.
Ladislav
23-Apr-2009
[13416x2]
re Functor:

* in my opinion it does not make sense to initialize static local 
variables during function call, since they are static and therefore 
supposed to persist, so the only time suitable for the initialization 
seems to be the function creation time

* the initialization (IMO) can perfectly serve another purpose: all 
initialized (during function creation) variables shall be static, 
while the other variables shall be dynamic IMO
If the terminology does not look good, then we may probably say "persistent" 
instead of "static" meaning that the values persist during calls 
unless explicitely changed