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

World: r3wp

[!REBOL3]

BrianH
20-Dec-2010
[6722]
I expect that Carl added it to be able to write more concise code. 
I prefer COMMENT too though.
Gregg
20-Dec-2010
[6723]
I tend to just write code in micro-optimized form in the first place

And do you consider that premature optimization, or not?
BrianH
20-Dec-2010
[6724]
It is just as easy in theory to write the code in micro-optimized 
form as it is to not, so why not? In practice though, in R2 it is 
harder to write micro-optimized code (for various reasons). In R3 
it is *easier* to write micro-optimized code than it is to not, because 
we have been deliberately been optimizing the language for just that 
effect for a couple years now.
Maxim
20-Dec-2010
[6725]
in R2 I use none of the mezz loops(they really slow down code), now 
that they're all native, I have much more options in R3.
BrianH
20-Dec-2010
[6726]
What's more, we have been working to make the behavior of the language 
much more consistent between datatypes, so it is now easier to make 
macro-optimizations like changing datatypes without needing to change 
the code that uses them. This is why the SELECT trick for objects 
works the same as it does for blocks, for instance.
Kaj
20-Dec-2010
[6727]
Pity I can't use any of it, because I still need to run on Cheyenne
BrianH
20-Dec-2010
[6728]
I ran into the same problem, which is why I made R2/Forward.
Kaj
20-Dec-2010
[6729]
Yes, that helps
BrianH
20-Dec-2010
[6730]
One side effect of "premature optimization" is that micro-optimized 
code patterns in the R3 mezzanines that looked bad or required explanation 
to Carl often led to improvements in the language to make those micro-optimizations 
unnecessary. Lots of ease-of-use improvements in R3 came about because 
of this.
Kaj
20-Dec-2010
[6731]
I don't know if you can call that premature, after thirteen years 
:-)
BrianH
20-Dec-2010
[6732]
In this case, I wrote most of those micro-optimizations in the last 
three years :)
Kaj
20-Dec-2010
[6733]
I understand, but at the start of that, REBOL was a ten years old 
project, and a thirty years old design
BrianH
20-Dec-2010
[6734x2]
Yes indeed. A lot of the improvements in R3 came from insight gained 
from many years of REBOL use.
By many people in the community, not just the R3 team.
Gregg
21-Dec-2010
[6736]
It is just as easy in theory to write the code in micro-optimized 
form as it is to not, so why not?

So that's a "Yes" to my question then? ;-)
Steeve
21-Dec-2010
[6737x3]
>> a: [a 1]
== [a 1]
>> a/:b
** Script error: :b has no value
>> select a 'b
== none

Brian, Are you kidding ? Could you avoid stupid code ? :-)

>> a: [a 1]
== [a 1]

>> b: 'c
== c

>> a/c
== none

>> a/:b
== none

Exactly the same behavior than SELECT, not more not less.
But I prefer the compact form, more readable IMHO.
Another old Idioms.
first serie
vs 
serie/1

I see that everywhere (even Ladislav use it too much ;-))
serie/1 is a lot faster though
Kaj
21-Dec-2010
[6740]
Carl used to advise it was slower. Was that so in R2?
Steeve
21-Dec-2010
[6741x3]
It's true, path notation slower with R2, not anymore with R3
A/1 is 2 time faster than FIRST A, on my config.
Actually, first calls pick
Kaj
21-Dec-2010
[6744x2]
That's nice, I like that much better, and certainly more robust path 
evaluation
It's highly annoying to have paths bomb out instead of return NONE
Steeve
21-Dec-2010
[6746]
We don't have that anymore since a while, both in R2 and R3.
Kaj
21-Dec-2010
[6747]
>> b: []
== []
>> b/1
== none
>> b/a
** Script Error: Invalid path value: a
** Near: b/a
Steeve
21-Dec-2010
[6748x3]
Was talking about the first form only (with the index)
but yeah
R3 is more lenient
Kaj
21-Dec-2010
[6751]
Hasn't the first form always been like that?
Steeve
21-Dec-2010
[6752x3]
Don't think so, but my memory is not that good :-)
Don't think so, but my memory is not that good :-)
I Remember something like: 
Hey ! You past the end !
Izkata
21-Dec-2010
[6755x2]
At one point in R2, it was something like this:
>> X: [1 2]
== [1 2]
>> X/2
== 2
>> X/3
== none
>> X/4
!Error
(...well, for some reason I remember it that way, at least.  There's 
a chance I have it confused with something else...)
BrianH
21-Dec-2010
[6757x2]
Steeve, you are right, I missed that :(
Gregg, my answer to your question is that writing micro-optimal code 
in the first place is usually not premature optimization; it is instead 
just avoiding having to rewrite as much of the code later. So it's 
still optimization, just not premature. Making macro-optimizations 
before you have the overall design done is usually premature optimization, 
but if your code style is consistent then you can make them later 
without having to rewrite too much, in my experience :)
Ladislav
21-Dec-2010
[6759]
Re "premature optimization" - I do not think I ever did have any 
feeling I used that. For example, I would never want to write O(n 
*n) code when O(n) is available, no matter how would anybody want 
to call my approach.
RobertS
21-Dec-2010
[6760]
I posted a note on Geany as a possible linux rebol tool in IDE as 
Carl's Rebol Blog is no place for running notes - but altme cannot 
tag a topic ?  And trying to select a group here on linux as ALTme 
1.2.25 is loading is just a crap shoot - highlight and click and 
close yore eyes or is it the reverse?
Henrik
21-Dec-2010
[6761]
Probably because AltME resorts the groups as you are trying to click 
the one you want, thus getting the wrong one.
Gregg
21-Dec-2010
[6762]
We might want to change groups on the opimization topic. How about 
Performance?
Jerry
27-Dec-2010
[6763]
Do we have NaN (Not A Number) defined in R3?
Henrik
27-Dec-2010
[6764]
I don't think so. Is it needed?
PeterWood
27-Dec-2010
[6765]
This page suggests that the "internals" of R3 does have NaN defined 
http://www.rebol.net/wiki/Decimals-64but it doesn't appear to be 
accessible.
Sunanda
27-Dec-2010
[6766]
Related topic, Jerry: INFs (see comment from Carl, which perhaps 
offers some hope that the situation will be normalised one day):
    http://www.curecode.org/rebol3/ticket.rsp?id=1717
Ladislav
27-Dec-2010
[6767x3]
This page suggests that the 

internals" of R3 does have NaN defined" - how does the text suggest 
it? I, as a coauthor will try to correct the text, if it does.
Certainly, IEEE754 defines NaN, but Rebol does not need to use/define 
it in any way.
So, for Rebol decimals, NaN is not defined/supported at present, 
nor are there any plans to use it in the future.
Jerry
27-Dec-2010
[6770]
Thanks for the answer, Ladislave.
Ladislav
27-Dec-2010
[6771]
(but, of course, if such a wish exists, there is always the possibility 
to put it as a wish to CureCode)