R2-Beta - Help write the code

Return to Index Page
Most recent messages (500 max) are listed first.

#UserMessageDate
182RobertSI've moved to a linux box but cannnot get to www.rebol.net/builds which I have bookmarked for the 2.7.7 beta code22-May-09 15:21
181GrahamAdd http put ... can we have this added to prot-http as well?22-Sep-08 18:59
180GrahamThe prot-http does not support custom headers such as cookie: with read/custom except with 'post. It's a simple fix to add that to 'get as I posted on the Rebol3 world. I propose this be added to 2.7.720-Sep-08 23:30
179GabrieleLadislav's is probably better though.9-Mar-08 13:26
178Gabrielei should probably clean it up and post it somewhere...9-Mar-08 13:26
177Gabrielethe timing function i use compares the times of various versions of code. this way it can automatically decide how much to loop based on desired precision, and you just have to wait a fixed amount of time regardless of how slow your code is.9-Mar-08 13:26
176CarlAgreed.8-Mar-08 19:37
175BrianHWe need to look at the various timing or profiling tools and pick one, maybe even incorporate it as Carl joked.8-Mar-08 17:29
174CarlThat's correct.8-Mar-08 17:29
173BrianHAs long as the reg functions are available to encapped code, or even straight code on /Face, we should be fine. Just not /View.8-Mar-08 17:27
172CarlSDK tools are not end-user tools.8-Mar-08 17:26
171BrianHRobert, even the read-only registry functions are a security hole. View code, even sandboxed, is often untrusted code from 3rd parties.8-Mar-08 17:25
170CarlWe should add tm as a mezz ;)8-Mar-08 17:22
169PekrI want also easy conversion of integers .... hopefully R3 adresses it now ....8-Mar-08 16:27
168Henriknice8-Mar-08 16:20
167Oldesas it's much more better to write: shift/left #{FF} 4 than something like: to-binary to-char (( first #{FF}) * 16) and 2558-Mar-08 16:20
166Oldesbut for binary manipulation is much more better8-Mar-08 16:17
165Oldesjust it's faster to use multiplication and division in some cases: >> tm 1000000 [shift/left 100 4] 0:00:00.391 >> tm 1000000 [100 * 16] 0:00:00.2668-Mar-08 16:14
164MaartenPekr, see?8-Mar-08 13:38
163OldesShift is finally here.. thanks Maarten and Carl.. I almost forget this long time wish:)8-Mar-08 12:20
162PekrOK, then I expect shift as a native goes in R3 too?8-Mar-08 9:08
161Robertreg-f unctions: I think it makes a lot of sense to keep the read-only function available. 90% of the time one just needs to read something and not alter the registry.8-Mar-08 9:02
160MaartenIt is a way of showing Rebol 2 (and thus in general) is very much alive!8-Mar-08 7:47
159MaartenExactly, but for now, I'm very happy with this (as will others be)8-Mar-08 7:46
158BrianHIt would probably be a good idea to add a carry option later, once we nail down what the behavior should should be.8-Mar-08 7:46
157BrianHThere was some question about what you really wanted the carry behavior to be in binaries, so he did no carrying for now.8-Mar-08 7:44
156MaartenWith 'shift, 'or, ' xor, and 'and the binary basics are finally there :-)8-Mar-08 7:43
155BrianHSeperate operations make sense for rebcode, but a unified function makes more sense for REBOL code. Fewer natives added that way.8-Mar-08 7:42
154MaartenCarl: behaviour as expected (no rotate). It's easy to simulate roate with a bit mask and OR8-Mar-08 7:42
153MaartenPekr: R3 may break R2 (wil do that anyway for unicode), and this is (if I understood correctly) a port from rebcode. It is a big advancement and adds real value to 2.7.6. I have mezzanine stoo, but they are much slower. This opens up the possibility to do things REBOL van harldy do these days.8-Mar-08 7:41
152PekrIsn't shift preliminary and rushed way too fast into 2.7.6? General lack of binary supporting functions was expressed several times. There was even effort to write some of them, and IIRC Geomol put them into some library as mezzanines. IIRC R3 promissed to add some helpers for us. So I am afraind we introduce something not so complete here. If so, I will be first to dislike and vote it down ...8-Mar-08 3:20
151BrianHTAKE done.8-Mar-08 0:06
150BrianHAt least one that isn't /direct I mean, though I am wondering about that one too.7-Mar-08 23:27
149BrianHCan you take the index? of a port?7-Mar-08 23:26
148CarlNever an easy call, that one.7-Mar-08 23:23
147BrianHLooks good.7-Mar-08 23:23
146CarlIn other words, index out is index in.7-Mar-08 23:23
145CarlRight now it is: >> shift/part next #{01020408} 1 2 == #{010208}7-Mar-08 23:22
144BrianHPretend the starting position is the head.7-Mar-08 23:22
143CarlSo, as shown above?7-Mar-08 23:22
142BrianHReturn to the current position.7-Mar-08 23:21
141CarlI'm going to reset it to head for now.7-Mar-08 23:21
140CarlQuestion is that last one... should SHIFT return to HEAD by default?7-Mar-08 23:21
139Carl>> shift/part #{01020408} 1 2 == #{00010408} >> head shift/part next #{01020408} 1 2 == #{01010208}7-Mar-08 23:20
138BrianHI'm working on TAKE, but the screening code is interesting. What does take/part something some-pair do?7-Mar-08 23:19
137Carlyes7-Mar-08 23:17
136CarlBasic shift is in. That's all we have time for today, and it will be a few weeks before anyone really uses it.7-Mar-08 23:17
135BrianHLet's just no-carry for now and consider adding it as an option later when we can discuss the scope of the problem.7-Mar-08 23:17
134BrianHYeah, I wish he were awake so he could show us some code.7-Mar-08 23:15
133CarlFrom above: "Forget /carry; /rotate is nice, but even without it is a big step forward"7-Mar-08 23:14
132BrianHHe requested carry by default, then asked for rotate-no-carry as well (which I don't know what that is).7-Mar-08 23:13
131CarlIt is possible I missunderstood his comments.7-Mar-08 23:12
130BrianHSo you shift the bytes independently? I thought he wanted carry between the bytes.7-Mar-08 23:11
129CarlI think that's what Maarten requested.7-Mar-08 23:10
128CarlCorrect.7-Mar-08 23:10
127BrianHWhat do you mean by non-endian? No carry between bytes of a binary?7-Mar-08 23:10
126Carl(If you want to think of it as LE, it is ok. ;)7-Mar-08 23:10
125BrianHI'll ignore /last on ports then.7-Mar-08 23:09
124CarlNon endian.7-Mar-08 23:09
123CarlNot sure you can do that on ports.7-Mar-08 23:08
122BrianHLittleendian then?7-Mar-08 23:08
121CarlExample for binary: >> shift #{8421} 1 == #{4210} >> shift/left #{8421} 1 == #{0842} >> shift/logical #{8421} 1 == #{C210}7-Mar-08 23:07
120BrianHScratch bitsets. Is TAKE from a port affected by /last?7-Mar-08 22:59
119BrianHDo you want TAKE to work on bitsets? How does /last work with bitsets or ports?7-Mar-08 22:56
118Carl(And the first person who asks about shift/left/logical gets to work in my vineyard for a day. ;)7-Mar-08 22:55
117BrianHNice.7-Mar-08 22:54
116Carl>> shift/left -1 1 == -27-Mar-08 22:54
115Carl>> shift -1 1 == -1 >> shift/logical -1 1 == 21474836477-Mar-08 22:53
114CarlREBOL/View 2.7.6.3.1 7-Mar-2008

>> shift 100 1 == 50 >> shift/left 100 1 == 200

7-Mar-08 22:53
113CarlProbably.7-Mar-08 22:51
112BrianHShould I do TAKE as well?7-Mar-08 22:49
111BrianHALSO and FIRST+ cloned in mezzanines, tested and submitted.7-Mar-08 22:44
110BrianHYes.7-Mar-08 22:41
109CarlSo, its: shift: native [ {Perform a bit shift operation. Right shift (decreasing) by default.} data [integer! binary!] bits [integer!] /left "Shift bits to the left (increasing)" /logical "Use logical shift (unsigned, fill with zero)" /part {Shift only part of a series.} length [integer!] ]7-Mar-08 22:41
108CarlAh, we want to specify # bits, right?7-Mar-08 22:41
107BrianHCool.7-Mar-08 22:40
106CarlBrian, note he wants it for binary... that is, N bytes. So carry works from byte to byte.7-Mar-08 22:40
105MaartenGottago, bedtime...7-Mar-08 22:29
104BrianHIt makes sense in assembler where it would carry to a carry flag, but REBOL doesn't have that.7-Mar-08 22:27
103MaartenOk, then if it isn't asked too much..... (I feel like shift is already pushing you, but this is too handy!)7-Mar-08 22:26
102BrianHI can see shift or rotate of a binary automatically carry within the binary. I mean what would a integer shift carry to?7-Mar-08 22:26
101CarlM: no, ROT w/o carry is not hard.7-Mar-08 22:25
100MaartenYep7-Mar-08 22:25
99CarlIn other words, N-bit long shift.7-Mar-08 22:25
98Carlbinary bytes.7-Mar-08 22:25
97BrianHWhat is the difference between rotate-no-carry and shift? For that matter, what would you carry _to_ in REBOL?7-Mar-08 22:24
96MaartenIs rotate-no-carry hard?7-Mar-08 22:22
95MaartenYes, logical as default7-Mar-08 22:22
94CarlI would guess logical to be more common for binary series.7-Mar-08 22:21
93CarlMaarten... in your normal binary! shifts, are you sure you want arithmetic shift as default?7-Mar-08 22:20
92BrianHIf you don't port ALSO and FIRST+, I'll make mezzanines. Maybe even TAKE.7-Mar-08 22:18
91MaartenSince it hardly requires any thought or discussion ;-)7-Mar-08 22:17
90MaartenOK, I'll settle for the easy one (Unicode) for 2.7.67-Mar-08 22:17
89BrianHClosure is infeasable, but APPLY would be a god-send.7-Mar-08 22:16
88CarlROTFLOL, yeah sure. And Unicode, don't forget that!7-Mar-08 22:16
87BrianHI won't.7-Mar-08 22:16
86MaartenAnd closure ans apply while we're at it ;-)7-Mar-08 22:16
85CarlDo *not* let me forget to roll it forward into 3.0. ;)7-Mar-08 22:15
84BrianHSpeaking of simple, can you port ALSO, FIRST+ and TAKE natives?7-Mar-08 22:15
83MaartenMany thanks7-Mar-08 22:14
82CarlOk. Simple impl first. That way, it can be done for 2.7.67-Mar-08 22:14
81BrianHDo /carry by having it operate on binaries.7-Mar-08 22:14
80MaartenForget /carry; /rotate is nice, but even without it is a big step forward7-Mar-08 22:13
79MaartenAnd Gregg. Gabriele. Cyphre. ....7-Mar-08 22:13
78CarlHmm.... Well, no, was not going to do carry version of it.7-Mar-08 22:13
77MaartenYes, me :-)7-Mar-08 22:12
76BrianHBetter in than out. If it is there, someone will use it.7-Mar-08 22:12
75Maarten/rotare (or /carry) is useful.7-Mar-08 22:12
74CarlAh, nice!7-Mar-08 22:12
73Maarten(drinking another bottle of virtual REBOL wine!)7-Mar-08 22:12
72CarlOr is it not useful.7-Mar-08 22:12
71CarlSo, the only question now is...

/rotate ?

7-Mar-08 22:12
70Carlshift: native [ {Perform a bit shift operation. Right shift (decreasing) by default.} data [integer! binary!] /left "Shift bits to the left (increasing)" /logical "Use logical shift (unsigned)" /part {Shift only part of a series.} length [integer!] ]7-Mar-08 22:11
69CarlNo, binary is bytes. Non endian.7-Mar-08 22:11
68BrianHBut I will accept either way as long as it is the same on all platforms.7-Mar-08 22:11
67BrianHDo we treat a binary as bigendian or littleendian? I say bigendian.7-Mar-08 22:10
66MaartenI am just really happy if it will come!7-Mar-08 22:10
65MaartenBut really, as long as one is the default and the other one is there, it is clear if you do help 'shift7-Mar-08 22:09
64BrianHI think of shift as being like exponents - positive ones are up, negative are down.7-Mar-08 22:09
63MaartenOk, but then we want /carry ;-)7-Mar-08 22:08
62CarlFunny, I would make down the default. ;)7-Mar-08 22:08
61MaartenDepends on byte order?7-Mar-08 22:07
60BrianHx: x * 2 is up.7-Mar-08 22:07
59BrianHShould default be shift up or down? I forget which is left (up?) or right (down?). Up should be default, with negative numbers being down.7-Mar-08 22:07
58Carlwhich one should be the default?7-Mar-08 22:06
57CarlI was just thinking about that too...7-Mar-08 22:05
56BrianHWhat about the difference between arithmetic and logical shift? Do we just do logical and use the mod operator for arithmetic?7-Mar-08 22:04
55CarlYes, I agree.7-Mar-08 22:02
54MaartenIt removes one of the few limitations Rebol has7-Mar-08 22:02
53MaartenBut if it is easy to do, please add it. IMHO it is a major improvement, what does the rest think?7-Mar-08 22:02
52Carl;)7-Mar-08 22:01
51MaartenNo, we have to leave some things for R37-Mar-08 22:01
50Carlnext thing you'll ask for is... shift: func [data [integer! binary!] /left /rot /carry /part n]7-Mar-08 22:00
49MaartenIf you can do it with integer! , yes. Default would be left? Then /left should go?7-Mar-08 22:00
48Carlshift: func [data [integer! binary!] /left /rot /part n]7-Mar-08 22:00
47MaartenSeriously, these are one of the few (if not only area) where Rebol is lacking. With shift (and XOR already there) we can do most algortihmic stuff with binaries7-Mar-08 22:00
46BrianHrotfl?7-Mar-08 21:59
45CarlSo, Maarten, is full def this:7-Mar-08 21:59
44CarlThey must have come from some macros... due to their over-parenisizing. ;)7-Mar-08 21:58
43Maarten;-)7-Mar-08 21:58
42MaartenThanks :-)7-Mar-08 21:58
41CarlREBINT rotr(REBCNT n, REBINT b) { return (((n) >> (b)) | ((n) << (32 - (b)))); }

REBINT rotl(REBCNT n, REBINT b) { return (((n) << (b)) | ((n) >> (32 - (b)))); }

7-Mar-08 21:58
40Carlactually, those are local runtime defined, not stdlib7-Mar-08 21:57
39Carlrotl rotr7-Mar-08 21:57
38CarlFound it in my rebcode impl.7-Mar-08 21:57
37BrianHCarl, I'm not sure - it might be platform-specific intrinsics. Let me look.7-Mar-08 21:56
36BrianHEventually I'd like to do evaluation audits on the rest of the mezz code.7-Mar-08 21:55
35BrianHI've done an evaluation audit on mezz-series. I don't think I have the time to fix the /View bugs I found while rewriting dev-resize.7-Mar-08 21:54
34MaartenGab, it can be done in mezz, simply sloooooow7-Mar-08 21:54
33CarlBrianH: does C implement ROT??7-Mar-08 21:54
32Gabrielei said mezz :)7-Mar-08 21:53
31MaartenYeah, shift ;-)7-Mar-08 21:53
30Gabrieleis there any mezz code requiring my help?7-Mar-08 21:53
29BrianHIt is probably better to have separate rshift, logical left shift, arithmetic left shift and rotate functions, to simplify and cut down on path overhead.7-Mar-08 21:52
28MaartenWell.... I just implemented a binary search protocol in REBOL where I had to wrap 32 bit decimals as unsigned ints in binaries :-)7-Mar-08 21:52
27CarlAdd that to tracker. Thanks.7-Mar-08 21:52
26Maartenshift: func [ b [binary!] /left /part n]7-Mar-08 21:52
25CarlThat's an interesting statement. :-/7-Mar-08 21:51
24MaartenI can live without integer. Binary is where it is really missing.7-Mar-08 21:51
23CarlMaarten: So, you really mean shift on BINARY! -- what about INTEGER?7-Mar-08 21:50
22BrianHMaarten, re: Tracker #37, do you have proposed function specs?7-Mar-08 21:49
21BrianHI meant the SDK source then, the stuff outside of /Face and /Pro that you have to explicitly encap to get /View capabilities. Is that source included in the /Face and /Pro binaries?7-Mar-08 21:35
20CarlMaarten: you mentioned you want bit shift operators.7-Mar-08 21:31
19CarlThey are the same source.7-Mar-08 21:30
18BrianHSorry if I wasn't clear with my suggestion about the reg funcs. I meant _move_ the reg func cleanup code out of the source for /Face and /Pro, and put it into the mezzanine source for /View instead.7-Mar-08 21:04
17CarlChanged group name - to avoid assumption that this has to do with HELP function. ;)7-Mar-08 20:31
16CarlOn #22: Here's the fix, and it's been added to tracker for release docs:

Setting sound/volume to NONE or to < 0.0 will keep the master volume as it has been set by user.

7-Mar-08 20:30
15CarlThat's how it works already. The bug is with the non-encap forms of REBOL, like /face and /pro.7-Mar-08 20:29
14BrianHMake the cleanup something that you have to do intentionally as part of your encapped app, and document the means to do so.7-Mar-08 20:10
13BrianHOn the reg funcs, it's simple: Just move the call to unset-reg-funcs and its unsetting to some part of the source that is encapped to be part of View, rather than have it be in the Pro code. That way the security cleanup can be added at encap time, as needed.7-Mar-08 20:09
12Carl(add ] to first line)7-Mar-08 20:00
11CarlNo such flag. Resorting to:

unless find [face pro command] system/product unset-reg-funcs ]

7-Mar-08 19:59
10CarlWe need an 'sdk flag somewhere.7-Mar-08 19:47
9CarlSystem/product is one way. I was hoping for a general test.7-Mar-08 19:43
8CarlYes, cassette tape, Apple2 / C64 style.7-Mar-08 19:43
7Henriksystem/product?7-Mar-08 19:43
6Brentprobably more like backup to tape?? ;-)7-Mar-08 19:40
5CarlWe need to qualify the unset-reg-funcs entry. Since the bug request is to keep it enabled in /pro, /face, and /command, how best to detect those?

I must admit, 3 years ago, I would instantly know the answer, but these days R3 occupies my brain cells. R2 was swapped out of my brain "to disk".

7-Mar-08 19:39
4CarlThe boot in REBOL does this:

; Security cleanup - some functions must go: foreach word [ ctx-install set-browser-path netscan free-boot unset-reg-funcs ][unset word]

7-Mar-08 19:37
3CarlBut, more of you may be able to help too. For example, looking at the top tracker item regarding registry functions....7-Mar-08 19:37
2CarlNo, actually, several people here are helping.7-Mar-08 19:36
1CarlIn the spirit of greater community involvement, I should not be the one fixing all the bugs,right?7-Mar-08 19:36

Return to Index Page