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

World: r3wp

[rebcode] Rebcode discussion

Pekr
15-Oct-2005
[428]
BrianH - where're you from?
BrianH
15-Oct-2005
[429]
Chicago, Illinois, USA
Volker
15-Oct-2005
[430]
Spaggethi not from italy? MAybe this helps arguing? http://science.slashdot.org/article.pl?sid=05/10/15/022201&tid=14
:)
Pekr
15-Oct-2005
[431]
that's quite far away from here :-) But isn't it close to Sassneranch? 
Maybe you could visit Carl to talk to him personally :-)
BrianH
15-Oct-2005
[432]
Ah, but proper pizza is from Chicago :)
Pekr
15-Oct-2005
[433]
:-)
BrianH
15-Oct-2005
[434x2]
That's more than a thousand miles away. Not a quick jaunt.
Mapquest say that just to get to their zip code, it would take 31 
hours 55 minutes in time, 2194 miles in distance.
Gabriele
15-Oct-2005
[436]
i already asked Carl about HERE. he hasn't aswered yet, but that 
does not mean he won't.
BrianH
15-Oct-2005
[437x3]
In rebcode, testing not x, before ==> after:
true  ==> false
false  ==> true
none  ==> none  (three-valued logic, SQL here we come)
1  ==> 0  (bitwise)
1.0  ==> 1.0  (unchanged)
a

  ==> REBOL goes away without warning (where's that type inferencer?)
Thanks Gabriele! I wasn't meaning to be a jerk - I meant it about 
Carl being busy :(
Now you have a nice RAMBO entry to work with.
Gabriele
15-Oct-2005
[440]
indeed, i was referring to Petr's message, rather than yours. :-)
BrianH
15-Oct-2005
[441x4]
Well, I think putting an entry in the Rebol Enhancements group or 
in RAMBO beats drivinf 2194 miles :)
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.