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

World: r3wp

[Core] Discuss core issues

Izkata
18-May-2009
[13786x2]
Sorting seems to be the big bottleneck:


arraycount with sorted data (using maximum-of, same results as sorted):
>> time [arraycount copy SDat] 50
== 0:00:00.172956
fast-tally with unsorted data:
>> time [fast-tally copy Data] 50
== 0:00:00.357852
fast-tally with the sort step removed, with pre-sorted data:
>> time [fast-tally copy SDat] 50 
== 0:00:00.103735
So which is best depends on what Tom is using it for, I guess
TomBon
19-May-2009
[13788]
this is great, very fast code. thanks a lot for this.
the code is used for generating dynamic parsing rules 
for financial market data. soon I will release a free
software based on this data.
Steeve
19-May-2009
[13789x2]
Seems that Tally is faster with R3.
2 reasons:
SORT is faster
MAXIMUM-OF is not anymore native 

(btw some of us claimed that it was a bad idea to have maximum-of 
 not anymore native in R3, But will claimed in the desert, so now 
we can see the drawback)
(Tally faster than radix, i meant)
BrianH
19-May-2009
[13791]
MAXIMUM-OF was rarely used, and is now mostly native rather than 
fully native. The majority of its processing is the loop, which is 
now native. MAXIMUM-OF and MINIMUM-OF are so rarely used that they 
might not make the mezzanine cut; they might be moved to R3/Plus.
Izkata
19-May-2009
[13792x2]
I would definitely prefer a native fold-type function over maximum-of 
and minimum-of
which I think was mentioned under the name accumulate?
BrianH
19-May-2009
[13794]
We tried, but that has definitely been declared an R3/Plus function, 
not native. Making ACCUMLATE? native wouldn't help much - the mezzanine 
version is really fast already. You won't be able to get functional 
language speed even from a native because that requires compiler 
support, and REBOL doesn't have a compiler at all.
Izkata
19-May-2009
[13795]
Okay, good to know.  Glad it's in, at least
BrianH
19-May-2009
[13796x2]
R3/Plus has a low barrier to entry, because it will be modular. People 
can just not include the modules they don't need.


Conversely, there will be a high standard for inclusion as mezzanine 
or built-in native code because you won't as easily be able to remove 
it if you don't need it. Many R2 mezzanines, and even some natives 
won't make the cut.
The plugin architecture will make it less necessary to include native 
code you don't need. R3/Plus lets us say yes without bloating the 
core. R3 is going to be much tighter than R2.
Graham
19-May-2009
[13798]
Such as ?  I'd had to have an cgi script running and find that functions 
I need aren't included.
BrianH
19-May-2009
[13799]
Use the needs header to load the modules you need and you can be 
sure they'll be included. As for which functions will be mezzanine, 
that is still in question for many functions. If you want to make 
sure that your favorites are there, oparticipate in the discussion.
Graham
19-May-2009
[13800x2]
page: read/custom [ scheme: 'http host: "twitter.com" target: "direct_messages/new.xml" 
user: "my-twitter-id" pass: "mypassword" ]  [ POST "text=This was 
also sent from a Rebol&user=synapse_emr" ]


This sends a private tweet to a user ... not clear from the API docs 
what the call is to just tweet ... anyone know?
ooops ... wrong group.
Maxim
19-May-2009
[13802]
this is easy to figure out using firebug  ;-)


redirect the html page to a server you have cheyenne running and 
save out the whole http request, you will have url and post data 
:-)
Graham
19-May-2009
[13803x2]
just reinstall wireshark
But there is a  twitter restful api ... just can't find it there. 
  Must be blind.
Janko
19-May-2009
[13805]
too bad accumulate is not in the core, I totally ditched python for 
any further work because guido v.r. removed the basic (quite poor) 
functional constructs it had
Steeve
19-May-2009
[13806]
If that so, most of existing mezzanines should be fired into external 
modules.
Because i use mezzanines only to test some ideas.

But if have to do the "real work", then i use only natives. Don't 
ask why, it's obvious.
Graham
19-May-2009
[13807]
Don''t you end up then writing your own mezzanines?
Janko
19-May-2009
[13808]
to me one of great beauties of rebol is that all stuff are expressions 
like "either" and by so composable ..  and that you don't need explicit 
return statements.. two of big features that I think aid more functional 
(not imperative) design of programs...
Steeve
19-May-2009
[13809x2]
but they they have to be strictly adapted for their purposes, so 
i remove code related to needless use cases.
speed is a priority especially with Rebol which can be really slow 
if you don't take care
Janko
19-May-2009
[13811x4]
functional:

reduce [ "hi " (either is-male? gender [ "boy" ] [ "girl" ]) , "how 
are you?" ]

vs imperativeish:
a: "hi "
either is-male? gender [ append a "boy" ] [ append a "girl" ]
append a " How are you?"
a
so although I got impression from Carl's blogposts that he thinks 
rebol should be practical vs. functional , I think a lot of it's 
power and elegance and practicality come from functional aspects 
of it (just expressing my opinion)
( ok, my memory was bad, Carl only said rebol is not Pure Functional 
PL , which is totally different thing and I don't want it to be pure 
functional :) )
http://www.rebol.com/article/0206.html
Steeve
19-May-2009
[13815x2]
i think the power of rebol comes from the big amount of small code 
schemes so that by combining only some of them you can do all you 
want.
It's the main difference with other functional languages.
The amount of natives schemes and data types.
Adding more and more natives schemes (like matrix operations on series) 
is the way to get Rebol more and more powerful
Maxim
19-May-2009
[13817x3]
the unification of series management is one of the major sources 
of code reduction in rebol.
the other is the fact that series are mutable, and many functions 
edit the input series directly.
even more so in R3  :-)
Graham
19-May-2009
[13820]
This works ... posting a message is actually called updating your 
status!


 page: read/custom [ scheme: 'http host: "twitter.com" target: "statuses/update.xml" 
 user: "my-twitter-id" pass: "mypassword" ]  [ POST "status=Playing 
 with REBOL and the Twitter API" ]
Steeve
19-May-2009
[13821x2]
interesting, can you post other messages than "status=" ?
(never used twitter)
Graham
19-May-2009
[13823]
http://apiwiki.twitter.com/Twitter-API-Documentation
Henrik
22-May-2009
[13824]
is there a quick way to tell if an integer overflows?

I'm missing an overflow? function:

overflow? 632479375863785946758934675892
== true
BrianH
22-May-2009
[13825]
int-overflow?: func [n [number!]] [error? try [to-integer n]]
Henrik
22-May-2009
[13826]
hmm.. yes, thanks.
Maxim
22-May-2009
[13827]
unfortunately this might not work... to-integer sometimes returns 
a decimal... unlesss its been fixed for 2.7.6
BrianH
22-May-2009
[13828]
It should work - always return integer! or error! - if the input 
is a number! (as specified in the type test of the argument. TO-INTEGER 
would  only have that problem with string input.
Maxim
22-May-2009
[13829]
aaah yes... missed the input type ... sorry.
Graham
26-May-2009
[13830x2]
any good reason apart from the fact that data is a block that this 
is not allowed?

forskip data: [ 1 2 3 4 ] 2 [ ]
but you have to do:

data: [ 1 2 3 4 ]
forskip data 2 [ ... ]
Maxim
26-May-2009
[13832x2]
cause the word is being used as the index.
probably cause in the time frame of evaluation the set word happens 
after the forskip hits it.
Graham
26-May-2009
[13834]
Is that a good reason?  :)
Maxim
26-May-2009
[13835]
the assignment I mean.