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

World: r3wp

[rebcode] Rebcode discussion

Maxim
21-Oct-2006
[1487]
oh, the 30 minutes you write above... , was that using REBOL?
Jerry
21-Oct-2006
[1488]
Yes, the 30-minntes version is in REBOL
Gregg
21-Oct-2006
[1489]
Do you need to conver the data when using rebcode? In REBOL you would, 
but I think you can poke it in rebcode. e.g. 


mem-move: rebcode [bin [binary!] src dst /local v] [pick v bin src 
 poke bin dst v]
Jerry
22-Oct-2006
[1490x3]
Gregg, Thank you.

I've just found out that "to-char" is not necessary in Rebcode, the 
value picked from a binary! can be poked into a binary! without using 
"to-char" first. This is different from the regular REBOL code.
I would like to have an interactive console for REBCODE. That would 
be greate for learning the REBCODE dialect.

>> iRebcode       ; switch to REBCODE console
:> set.i a 10     
:> add.i a 20      
:> print a        
== 30             
:> exit           ; back to REBOL console
>> print a
== 30
It is possible, I mean, the interactive REBCODE console idea.
Geomol
23-Oct-2006
[1493x5]
Something like:

iRebcode: has [b] [while [(b: ask ":> ") <> "exit"] [do do append/only 
[rebcode []] load b]]
Guess it needs some binding.
Better version:

iRebcode: has [b] [while [(b: ask ":> ") <> "exit"] [if error? try 
[do do append/only copy [rebcode []] load b] [print "Syntax error!"]]]
That must be an one-liner rebcode prompt.
Good idea, Jerry! Thanks! :-)
Jerry
23-Oct-2006
[1498x3]
>> iRebcode: has [b] [while [(b: ask ":> ") <> "exit"] [if error? 
try [do  do append/only copy [rebcode []] load b] [print "Syntax 
error!"]]]
>> iRebcode
:> set.i a 10
:> print a
?unset?
:>
Binding seems to be needed ... I don't know how to do that.
Geomol, Thank you for your iRebcode function. Your inspire me to 
rewrite it into an "interactive draw" function:

>> iDraw: has [b canvas draw-blk temp-draw-blk] [
[        draw-blk: copy []

[        canvas: view/new layout [box 400x400 black effect [draw 
draw-blk]]
[        while [ (b: ask "iDraw >> ") <> "exit"] [
[                temp-draw-blk: copy draw-blk
[                if error? try [
[                        append draw-blk load b
[                        show canvas
[                    ] [
[                        print "Syntax error!"
[                        draw-blk: temp-draw-blk
[                    ]
[            ]
[        draw-blk ; return value
[    ]
>>
>> iDraw
iDraw >> fill-pen red circle 100x100 100
iDraw >> fill-pen 20 blue box 50x50 100x100
iDraw >> text "Fun"
iDraw >> exit
>>
Anton
24-Oct-2006
[1501]
That looks quite handy actually.
BrianH
24-Oct-2006
[1502x2]
Simpler version:

iRebcode: has [b] [while [(b: ask ":> ") <> "exit"] [if error? try 
[do rebcode [] load b] [print "Syntax error!"]]]
No need for the do append copy - the rebcode function is a function, 
not syntax.
Geomol
24-Oct-2006
[1504]
Jerry, iRebcode works ok for me under OSX.
BrianH, cool! :-)
Gabriele
25-Oct-2006
[1505]
Jerry, about the above, remember that A must already refer to a integer 
value before you can use set.i.
Jerry
25-Oct-2006
[1506]
I see. Thank you, Gabriele.
Jean-François
7-Dec-2006
[1507]
Have a look

The Synthesis kernel written by Dr. Henry Massalin as his PhD. thesis 
is commonly viewed to be the 
mother of all self-modifying code."
via SteDekorte et al :
http://www.dekorte.com/blog/blog.cgi?do=item&id=2336
Geomol
8-Dec-2006
[1508]
Interesting! And it's made for the Motorola 68030 CPU.
[unknown: 5]
9-Dec-2006
[1509]
I thought rebcode was a function built into all new builds of REBOL 
- is it?  if not why not?
Henrik
9-Dec-2006
[1510]
it's not finished yet.
Maxim
9-Dec-2006
[1511]
only a few beta versions had rebcode in them
[unknown: 5]
9-Dec-2006
[1512]
grrr.  Seems they should put it in anyway to others for at least 
access to the support that it may provide.
Maxim
9-Dec-2006
[1513]
and a (shrinking) number of ops are buggy.... but a bug in rebcode 
is much more dramatic than in normal REBOL
[unknown: 5]
9-Dec-2006
[1514]
Just seems like what it may provide might still be better than nothing.
Maxim
9-Dec-2006
[1515]
it can crash the interpreter and even make your OS buggy... so I 
think Carl is a bit wary of the bad publicity this might give REBOL.
[unknown: 5]
9-Dec-2006
[1516]
yeah that is probably it.  Shame I hope it continues to develop
Maxim
9-Dec-2006
[1517]
Although I do agree... in the least, it would allow a select few 
the opportunity to develop fast code other can just use...
Henrik
9-Dec-2006
[1518]
there are no test suites made yet, AFAIK so there is no proper testing 
done yet. only (very promising) concept programs have been done.
Maxim
9-Dec-2006
[1519x2]
yes speed did often seem to be in the 30-100 times faster!
(IIRC)
Henrik
9-Dec-2006
[1521x2]
I coded a gauss blur test program and recreated it in rebcode and 
it was approximately 18 times faster. it could probably be 30-40 
times faster if there are going to be color conversion and pixel 
read/write routines built in. Right now that needs to be done manually. 
It will be fast enough for anyone to build a software rendering texture 
mapping 3D engine.
rebcode is really amazing. it reminds me of the demoscene in the 
early Amiga days :-)
Maxim
9-Dec-2006
[1523x2]
and many image processing funcs could at least be coded in a fast 
pre-process mode (not interactive, but fast enough that rendering 
them isn't too slow as to be annoying
(by interactive I mean 30+ f/sec)
Henrik
9-Dec-2006
[1525]
if we also could have direct access to the buffer that is used for 
outputs so we can skip the View engine, but throw pixels directly 
on screen, even more speed can be gained.
Maxim
9-Dec-2006
[1526x4]
this would be very cool.
I'd also like a way to copy to/from an external image source... to 
allow easier access to DLL rendered gfx.  (opengl and others)
and things like capture cards or output framebuffers...
it would just allow us to stay within REBOL platform instead of having 
to resort to lib useage....
Henrik
9-Dec-2006
[1530]
this could also be useful in situations where you don't need anything 
but rebcode. what if it were possible to build a rebol core that 
only consist of rebcode? that would be pretty small, wouldn't it?
Maxim
9-Dec-2006
[1531x2]
imagine being able to call rebcode directly within AGG draw loop 
 :-)
we could probably define our own primitives.
Henrik
9-Dec-2006
[1533]
possibilities, possibilities... :-)
Gregg
11-Dec-2006
[1534]
I think a big issue was security. Because of the same issues that 
let you crash the system, bad things could be done by talented people. 
I'd love to see it included though, even if they had to take out 
the buggy and unsafe bits for the time being.
Oldes
18-Jan-2007
[1535]
Opcodes of the new AVM+ runtime system: http://lxr.mozilla.org/mozilla/source/js/tamarin/core/opcodes.tbl?raw=1
Oldes
23-Jan-2007
[1536]
maybe someone may find it useful: cvs -d :pserver:anonymous:[anonymous-:-cvs-mirror-:-mozilla-:-org]:/cvsroot 
co mozilla/js/tamarin