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

World: r3wp

[!REBOL3]

Steeve
21-Apr-2010
[2286]
what do you mean by no fast way to pad binaries ?
Pekr
21-Apr-2010
[2287]
I mean - #{FFFFFFFF} being treated as #{00000000FFFFFFFF} for OR 
and AND operations ....
Steeve
21-Apr-2010
[2288]
i don't understand why you don't chose the opposite way (dealing 
with integers) it's simpler and faster
Pekr
21-Apr-2010
[2289x2]
well, why not scrap binary altogether, no? What is binary for, if 
I should use integers? All docs describing some interface, mostly 
talk hexa. I know that hexa is not binary, but I want to see, what 
is happening with my bytes. Something like  4294967295 is telling 
me nothing. And putting binary/hexa helpers in comments is strange 
way of doing things. I want to see bytes, and bits ....
I can understand, that if you are really experienced, you might prefer 
integers, and shifting, etc.
Steeve
21-Apr-2010
[2291x2]
hum ok, you want pad-bin as fast as possible...
R3 ?
Pekr
21-Apr-2010
[2293]
yes, R3 .... I posted one func, did you see it?
Steeve
21-Apr-2010
[2294]
yup
Pekr
21-Apr-2010
[2295]
well, it's crap :-) The computation of existing int-size each time 
is not probably necessary. Maybe if we have it as a constant somewhere 
in system structure, it might be faster ... it is just for my testing 
purposes, not really a show stopper. I might in the end use integers 
as well, it is just that I was never good in binary handling, and 
it helps me to see, what is happening with bytes and bits ...
Maxim
21-Apr-2010
[2296]
pekr, you can easily build an extension which handles your specific 
binarie wishes and it will be VERY fast.
Pekr
21-Apr-2010
[2297]
I am not saying I can't .... I can as well start with mezzanines 
... good enough for my testing purposes, or even for target purpose 
= send few bytes of control commands to router :-)
Steeve
21-Apr-2010
[2298]
>> pad-bin: func [bin][to-binary to-integer bin]
>> pad-bin #{8000}
== #{0000000000008000}

That's all ?
Pekr
21-Apr-2010
[2299x2]
haha, clever :-) today I just tried with to-binary bin, I thought 
it will re-convert it :-) But this to-integer trick did it :-)
maybe no reason create a function for it, just state it in comments:

to-binary to-integer #{8000} ;--- make it 64 bit
Steeve
21-Apr-2010
[2301x2]
Usually I make shortcuts for to-binary and to-integer in my scripts 
(which have insanly long names in the rebol world)
I used to use: toi, tob, or int and bin
bin int #{8000}
BrianH
21-Apr-2010
[2303]
Sounds good. But it is still better to do the conversions to the 
most efficient method ahead of time if you can. REBOL is hand-optimized.
Steeve
21-Apr-2010
[2304x2]
As far I can remember our community is not very good with graphic 
designs, but hey we are coder !
wrong thread...
AdrianS
21-Apr-2010
[2306]
Brian - I seem to recall that the JVM as a target paltform for REBOL 
was discounted (because of performance and not having tail-call optimization, 
I think) - have you any opinion on targetting the Microsoft DLR? 
This would be a good way to get traction by being able to run in 
browsers (not just IE) without a REBOL plugin (well, assuming that 
Silverlight was already installed).

Some browser samples in Ruby and Python:

http://www.visitmix.com/labs/gestalt/samples/

This page walks thrugh running Ruby in the browser:


http://www.rubyinside.com/ironruby-silverlight-ruby-in-browser-3192.html
BrianH
21-Apr-2010
[2307]
I have been giving the subject some thought, and even more so since 
Silverlight came out. It would be the best way to get REBOL into 
Windows Phone 7, for instance. I don't see how the tail-call thing 
would affect REBOL on Java though: REBOL doesn't do tail-call optimization 
anyways. But we might want to wait for Java 7 and its dynamic types 
(Java's cheap knock-off of the DLR).
Graham
21-Apr-2010
[2308]
R3 question?  http://synapse-ehr.com/forums/showthread.php?53-Error-Illegal-entry-in-bfchar-block-in-ToUnicode-CMap
BrianH
21-Apr-2010
[2309]
No, it's not an R3 question, those functions don't exist in R3.
Graham
21-Apr-2010
[2310]
Must be some library he is using
Steeve
21-Apr-2010
[2311x2]
trying to do scheme above tcp to aid with async protos
but each time i stick my nose in R3's network stuffs, I encounter 
limits which annoys me
Pekr
21-Apr-2010
[2313]
what limits, for e.g.?
Steeve
21-Apr-2010
[2314x7]
First, we can't add our own parameters to actors or change their 
type
e.g

I wanted to user the refinement read/part to allow custom breaking 
rules
>> read/part port 100  ; to read only 100 bytes
Fine it wors
*works
but then i wanted to allow any type of breaking rule, like
>> read/part port crlf ; to break into lines
And event more powerfull:
>> read/part  port [thru #"^@]
To allow any parsing rule as breaking point
but then i wanted to allow any type of breaking rule, like
>> read/part port crlf ; to break into lines
And event more powerfull:
>> read/part  port [thru #"^@]
To allow any parsing rule as breaking point
but then i wanted to allow any type of breaking rule, like
>> read/part port crlf ; to break into lines
And event more powerfull:
>> read/part  port [thru #"^@]
To allow any parsing rule as breaking point
Pekr
21-Apr-2010
[2321]
'read would have to be extended, to allow that, no?
Steeve
21-Apr-2010
[2322]
It's the purpose of scheme's actors
BrianH
21-Apr-2010
[2323]
READ/custom perhaps.
Pekr
21-Apr-2010
[2324x2]
well, read/write became low-level, and Carl still did not decide, 
how to replace missing R2's functionality ....
read/lines is missing most ...
Steeve
21-Apr-2010
[2326x2]
read/write, read/custom don't exist in R3
That's the point you can rewrite the functions as actors of your 
scheme but your not allowed to add/change the parameters
Maxim
21-Apr-2010
[2328]
IMHO: after the host, I think the whole device model will be last 
thing to get itself fixed, finalized and done.  when that occurs, 
we'll have a beta.
Pekr
21-Apr-2010
[2329]
http://www.rebol.net/r3blogs/0294.html
http://www.rebol.net/r3blogs/0127.html
BrianH
21-Apr-2010
[2330x2]
Thank, I was about to look for those.
I've been waiting for READ/as and WRITE/as for a while now, to apply 
to the clipboard:// scheme.
Steeve
21-Apr-2010
[2332]
what i got currently, is this:

p: open etcp://my-ip:my-port   ;immediate, does not connect

write p [verbose debug timeout 20]   ; pass a block of commands to 
change the config of the port

write p "echo toto"     ; the connection is established then data 
are sent
read p 		; one packet is waited and a binary is returned.
read/string p  ; one packet is waited and a string is returned

read/part p crlf    ; one or more packets are waited until the breaking 
rule is matched
Pekr
21-Apr-2010
[2333]
read/write/as solve just encoding, no? Still not abstracted encoder/decoder 
solution anyway .... old discussion :-)
BrianH
21-Apr-2010
[2334]
READ or WRITE /as just solves the encoding problem. Which for the 
clipboard:// scheme means chosing which one of several encodings 
is already strored in the clipboard, at least for most modern OSes.
Pekr
21-Apr-2010
[2335]
ah, what? /string and /lines were added? Well, we can't keep to original 
ideas, probably ...