World: r3wp
[rebcode] Rebcode discussion
older newer | first last |
BrianH 20-Feb-2007 [1628x2] | That was part of the planned upcoming features, and then they stopped updating it. I recall creating a comprehensive proposal... |
You can still APPLY IN and then GETW or SETW. | |
Maxim 20-Feb-2007 [1630] | rebcode really has to be part of 2.7... if we could just have object lookup, that would allow me try to make a few tests with liquid and mayb optimise so its about 10-30 times faster at managing the dataflow :-) |
BrianH 20-Feb-2007 [1631] | Have you tried it with APPLY IN and such? How is the speed compared to REBOL? |
Maxim 20-Feb-2007 [1632x4] | I have not yet done any rebcode tests with liquid, as so far, its always interactive enough, so as to not require it... but I am going nuts with the engine ;-) liquidator is a testament to its stability and another user here is helping me push the enveloppe to :-) but obviously, It will come to a point where pure processing will be needed and in such a case, speed will always be a factor. |
going nuts as in "I'm having a lot of fun with it" :-D the apis is pretty complete for most gui and procedural | |
(needs) | |
I didn't know about APPLY IN ... I might just do a quick try in a little while... does 'APPLY support refinements? | |
BrianH 20-Feb-2007 [1636] | Yes, as positional true/false arguments. IN doesn't have any refinements. |
Maxim 20-Feb-2007 [1637] | ok ... yes... I remember that part about the ordering of apply... |
BrianH 20-Feb-2007 [1638x2] | If you change the order that the refinements are declared in the function, you will need to change all calls by APPLY to match. |
I think true/false will work - it might need true/none. | |
Maxim 20-Feb-2007 [1640] | its probably true/none |
BrianH 20-Feb-2007 [1641] | It's probably both. |
Maxim 20-Feb-2007 [1642] | hum... in any case, thanks for remining me about APPLY IN :-) you've revived my interest in rebcode (even if I might now rely on some features of 2.7) |
Steeve 20-Feb-2007 [1643] | here am i ^^^ |
BrianH 20-Feb-2007 [1644x2] | It is really the best way to work with objects in efficient code, so much so that I requested an IN opcode. |
Hi Steeve! | |
Maxim 20-Feb-2007 [1646] | glad you did :-) |
BrianH 20-Feb-2007 [1647] | IN doesn't work with structs though, so I requested a set of struct opcodes to work with them (SET.S, GET.S, ...). |
Maxim 20-Feb-2007 [1648x3] | that would probably be even faster. |
since its a simple shift | |
I meant offset | |
BrianH 20-Feb-2007 [1651x4] | For structs, yes. For objects, IN and GETW/SETW would be faster since you can cache the looked-up word. |
It's not that bad a technique in REBOL code either. | |
Path evaluation has a lot of overhead. | |
Any questions, Steeve? | |
Steeve 20-Feb-2007 [1655] | BrianH, what is the most rapid, to use a do [my-func var] or an apply ? |
BrianH 20-Feb-2007 [1656] | Apply. |
Steeve 20-Feb-2007 [1657] | hum, and if i have severall apply to do (in sequence) ? |
BrianH 20-Feb-2007 [1658] | APPLY in a LOOP block or something. Even then, it is much more efficient to translate to rebcode and inline when you can - APPLY overhead is significant, and DO overhead much more so. |
Steeve 20-Feb-2007 [1659x8] | ok |
have another question on system/internal/assembly* | |
can i disactivate the label parsing/replacecing to gain speed when i build rebcode functions | |
? | |
i d'ont use labels | |
but i build many many rebcode functions in real time, i need speed | |
i use a parser to convert Z80 opcodes into rebol opcodes | |
i attempt to do a Z80 emulator | |
BrianH 20-Feb-2007 [1667x2] | It really doesn't gain you much speed. The label fixups are done once, at rebcode function creation time. After that it just calls the offsets - the label statement is a noop. I only do straight offsets when generating code (like you are). Be careful though, as the offsets are calculated from the end of the branch statement, not the beginning. |
This only matters when writing your own offsets. I only noticed when I started using the BRAB opcode, and its predecessor BRAW. | |
Steeve 20-Feb-2007 [1669] | anyway, can i replace assembly* by a dummy function ? |
BrianH 20-Feb-2007 [1670] | You can replace assembly* with a Z80 assembler even. |
Steeve 20-Feb-2007 [1671x2] | ok |
i noticed that i can join the code of 2 rebcode function without re-assemble them | |
BrianH 20-Feb-2007 [1673x2] | Remember that the current assembler* doesn't do much, and even that is done at rebcode function creation time. It has no effect on execution time. |
If you join these function blocks after the rebcode function is created, you may have context issues. It is better to join them before assembly. | |
Steeve 20-Feb-2007 [1675x3] | yes but i try to do emulation + a debugger , so Z80 opcodes are converts step by step |
i have no context issues, cause all words i use have the same context | |
there is no local words in my rebcode functions | |
older newer | first last |