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

World: r3wp

[rebcode] Rebcode discussion

BrianH
15-Oct-2005
[442x3]
What did Carl mean about rebcode modifying memory? I'm a little worried 
about these use-an-opcode-wrong, REBOL-goes-away errors.
That  NOT x  crash can be worked around by doing a  SETT x GETT x 
 to make sure the value is compatible.
That or be extra careful with specifying those argument types to 
rebcode functions.
Gabriele
15-Oct-2005
[445x3]
you should always specify argument types for REBCODE functions...
and... use the TYPE? opcode when you cannot determine the type in 
advance.
anyway... i think there's still a lot to improve in this area...
BrianH
15-Oct-2005
[448x2]
I would prefer opcodes to just don't do anything when given bad arguments, 
instead of crash REBOL with a core dump, as a general rule.
You all have been improving rebcode greatly in that respect so far.
Volker
15-Oct-2005
[450x2]
Carl mentioned everything is traded for speed.
Btw speed, little benchmark rebol, rebcode, c: http://polly.rebol.it/test/test/rebcode/download.r
BrianH
15-Oct-2005
[452]
They'll never get REBOL secure if you can cause core dumps with rebcode.
Volker
15-Oct-2005
[453]
Maybe rebcode is not enabled then, or there are two different interpreters.
BrianH
15-Oct-2005
[454x2]
Core dumps on Windows are caused by unintentional buffer overflows 
and such. If you can cause them unintentionally, you can cause them 
intentionally.
There are some things you shouldn't trade for speed.
Volker
15-Oct-2005
[456x3]
Personally i agree. OTOH lots of other apps do that trade too.
If you want to do multimedia, either trade or have a very smart compiler.
and the rebcode-portions should be a small part of the programm. 
And i guess often generated by dialects. which will add checks on 
their own, which is why we have this range-checks now (IMO)
BrianH
15-Oct-2005
[459x3]
Well yes, I want to make a very smart compiler as much as the next 
guy, but still I like the invalid-as-noop behavior that many of these 
opcodes have, that all of them should have.
At least invalid-as-error would do, rather than invalid-as-crash.
Heck, in debug mode I would like all of the opcodes to act as invalid-as-error.
Henrik
15-Oct-2005
[462]
hmm.. does IF work?

r: rebcode [] [
  set a -1
  lt a 0
  either [return a][return 0]
] ; works

r: rebcode [] [
  set a -1
  lt a 0
  if [return a]
] ; syntax error
Volker
15-Oct-2005
[463x2]
ift, iff (it-true, if-false)
(why not if, unless?)
Henrik
15-Oct-2005
[465]
ah, silly me. knew I shouldn't have read the docs :-)
BrianH
15-Oct-2005
[466]
Maybe they use ift, iff to empharize that they don't work like REBOL 
if, unless, that they operate on condition codes?
Volker
15-Oct-2005
[467]
But that is true for pick and such true. i mean different args but 
same name. maybe saves typing?
BrianH
15-Oct-2005
[468x3]
Could be an assembly thing :)
brat and braf are like that
And they came first - the inner block thing came later.
Geomol
17-Oct-2005
[471]
How do I break out of a loop? This won't work:
until [
eq a 0
ift [break]
...
]
Sunanda
17-Oct-2005
[472]
Break will exit an 'until:
    until [ break 1 = 4]  ;; does not loop forever.
Have you redefined 'break somehow
Ladislav
17-Oct-2005
[473]
this looks like a special case
Geomol
17-Oct-2005
[474]
Sunanda, I'm talking rebcode! Isn't your example non-rebcode?
Ladislav
17-Oct-2005
[475]
G: try until [eq a 0 braf 1 break ...]
Sunanda
17-Oct-2005
[476]
Whoops!! Sorry!
Geomol
17-Oct-2005
[477]
Ladislav, thanks! That did the job.
Pekr
17-Oct-2005
[478]
rebcode now seems to be regarded an alpha version. Initial release 
contained some fine docs, not included with later experimental releases. 
Will new extended docs come?
shadwolf
17-Oct-2005
[479x2]
Personal tought on REBCODE: "sniiiiiiiiiiiiiiiiiiiiiiiiiiiif don't 
toutch my rebol it looks like ASM sniiiiiiiiiiiif my poor reeeeeeeeeeeeeeeeboooooooooooool 
is all broken  :
                           set i 1
		eq i 1
		braf fail
		brat continue
		print "Should not print!"
		label continue
Sniiiiiiiiiiiiiiiiif "

but performances are great ...
With rebcode we loose on of his key feature the simplicity ... But 
for some tasks really precise that needs high perfs it's great to 
have such a tool . I don't kno yet if i ill use it every day...
Ladislav
17-Oct-2005
[481]
you surely shouldn't
Kaj
17-Oct-2005
[482]
I like the brat and barf instructions :-)
shadwolf
17-Oct-2005
[483]
but it looks not like rebol anymore  ...
Ladislav
17-Oct-2005
[484]
the fun is, that it is REBOL. Have you seen the Alien Dialect?
BrianH
17-Oct-2005
[485]
I still think it's pretty simple, by assembler standards. Have you 
seen x86 assembler?
Kaj
17-Oct-2005
[486]
Urgh
BrianH
17-Oct-2005
[487]
In rebcode, every instruction has just one addressing mode, does 
just one thing. Count your blessings when you can.
shadwolf
17-Oct-2005
[488]
Yeah i do a lot of asmx86 but ... I don't like that even if you get 
a close controle on what you are doing
Pekr
17-Oct-2005
[489]
shadwolf - the nice thing is, that for specific domain, you can create 
your own sub-language using parse and let it generate rebcode for 
you :-)
BrianH
17-Oct-2005
[490]
For some kinds of coding I would actually find rebcode to be a more 
comfortable dialect. For instance, you don't have to worry about 
whether someone has redefined add.
Pekr
17-Oct-2005
[491]
shadwolf - really no reason to use it on a daily basis, but cool 
to have for fast tasks - without it real-time image manipulation 
in rebol was impossible for e.g.!