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

World: r3wp

[rebcode] Rebcode discussion

Pekr
11-Oct-2005
[51]
wasn't it planned for so called language plug-ins some time ago?
Carl
11-Oct-2005
[52]
Yes, in fact it was the plugin design that made the problem clear.
Pekr
11-Oct-2005
[53]
So that ppl could write own components? Either in external language/libraries, 
or using VM?
Carl
11-Oct-2005
[54x3]
The more I worked on it, the more problems that came up.
A better approach is to use VM, and eventually JIT to native.
Then, if we come up with a datatype definition method, it may be 
possible to allow user created datatypes.
Pekr
11-Oct-2005
[57]
Yes, VM sounds good, but without internal access to datatypes? Dunno, 
will have to look into examples. Can't imagine manipulating block 
datatype for e.g. using VM :-)
Carl
11-Oct-2005
[58]
But, there would be many rules, because the user must be aware of 
GC and such.
Pekr
11-Oct-2005
[59]
Gabriele did something like that iirc ...
Carl
11-Oct-2005
[60]
Blocks are not very useful at VM level. Mostly strings, and the new 
Vector datatype.
Pekr
11-Oct-2005
[61]
Vector? AGG related?
Gabriele
11-Oct-2005
[62x5]
note about the new ASM: it has an iterative rewriting engine, so 
you can define rewriting rules and basically create your own assembler/compiler.
with it, i can write things like this:
f: rebcode [x y /local res] [
    res: x * x + (y * y)
    sqrt res
    return res
]
the x * x + (y * y) line is compiled to rebcode by the assembler, 
provided you give it the rules to do so :)
think of it as the macro expander in LISP, but more powerful (based 
on parse rules, so you can "expand" any dialect)
Carl
11-Oct-2005
[67x7]
New REBCODE release: www.rebol.net/builds/031/rebcode2.zip
Contains low level fixes and Gabriele's new assembler.
Both CORE and VIEW versions included.
Pekr: vector as a word for 1D array.
For example, vectors will let you create an optimal array of integers 
(unlike blocks).
Mostly useful for specific algorithms and use in rebcode VM.
But, note, not currently functional.
Henrik
11-Oct-2005
[74]
link is broken
Gabriele
11-Oct-2005
[75]
rebcode8.zip (there's a typo above)... but, wait, we found a couple 
bugs ;)
Carl
11-Oct-2005
[76]
New REBCODE release: www.rebol.net/builds/031/rebcode9.zip
Gabriele
11-Oct-2005
[77]
;you can try:
do http://www.colellachiara.com/soft/Misc/julia.r
Alan
11-Oct-2005
[78]
Carl:for some reason IE can not open/save rebcode9.zip-the page just 
gives me a blank icon ? But Firefox does work ! :)
Anton
12-Oct-2005
[79]
Very nice Gabriele :)
BrianH
12-Oct-2005
[80x6]
Thanks for the answers to some of my questions! In summary:

- The set-word notation for setting variables doesn't seem to work 
any more, and the reason for the change to the set* opcodes is increased 
speed.

- BRAW is computed goto, but it is yet unclear what the value of 
the word is supposed to be. I'll test.
After testing and some guesses I figured out that the rebcode dialect 
is statement-based, although it can be converted from expression-based 
by the aforementioned rewrite rules. Also, the | in the declaration 
of opcode syntax refers to alternate data types, so that:
    skip: [word! integer! | word!]

means that skip takes a word! as its first argument and an integer! 
or a word! in its second argument.
After some digging, it seems that the inner block goto label problem 
has been solved. I'm not sure where Gabriele's user defined rewrite 
rules are to be set, but I'm still looking.
The syntax check in Gabriele's assembler seems solid at first glance 
- it seems to be automatically generated from the system/internal/rebcodes 
object, or both generated from the same source data.
There may still be ways to crash the VM using semantic errors (type 
mismatch and such). Testing...
So far, argument words with the wrong type of values assigned to 
them just seem to cause the opcodes to be skipped without complaint. 
Certainly better than crashing, but it could lead to the kind of 
errors that would be difficult to find without extensive unit testing 
or a type inferencer. Still, I'm pleased.
Henrik
12-Oct-2005
[86]
gabriele, the gradient is a little boring, but still a good demo. 
:-)
Cyphre
12-Oct-2005
[87]
do http://www.rebol.cz/~cyphre/dotflowers.r
Henrik
12-Oct-2005
[88]
cyphre: great stuff
BrianH
12-Oct-2005
[89x2]
Glad to hear about the vectors!
Any chance of struct! support in /Core? It would seem that it could 
be even more useful in rebcode than in library access...
Benjamin
12-Oct-2005
[91]
WOW Cyphre o_0 cool stuff
BrianH
12-Oct-2005
[92x2]
It seems to me that vectors would be useful to use when implementing 
Unicode support.
Nice, Cyphre :)
Henrik
12-Oct-2005
[94]
try adding a blur or other effect to the image in dotflowers. looks 
really cool :-)
Benjamin
12-Oct-2005
[95]
only 20% of CPU on my 2.6 !
Henrik
12-Oct-2005
[96x2]
eats 45% here... show eats a lot on my machine for some reason
I'm wondering a bit if it's possible to do anything more direct than 
show. simply have a pixel buffer directly to put pixels in without 
the need for show
Cyphre
12-Oct-2005
[98]
thanks guys...I agree Rebol should be able to use 'direct blitting' 
mode(bypass the compositing engine)
Henrik
12-Oct-2005
[99]
benjamin is it a celeron or pentium 4?
Benjamin
12-Oct-2005
[100]
amd