World: r3wp
[!REBOL3]
older newer | first last |
Paul 7-Feb-2010 [522] | What kinda value do you pass to to-utype? |
BrianH 7-Feb-2010 [523] | None. User-defined datatypes don't work yet. The datatype is a placeholder for now. |
Paul 7-Feb-2010 [524x2] | ok, got ya. |
how about to-typeset? | |
BrianH 7-Feb-2010 [526] | And before you ask, I don't know what EVAL is used for either, just what it does: It does a DO on block! arguments, but returns the argument unevaluated otherwise. I've asked Carl what it's used for and haven't gotten an answer yet. |
Paul 7-Feb-2010 [527] | yeah ask about dump also. |
BrianH 7-Feb-2010 [528x2] | TO-TYPESET creates typeset! values. We don't have R2's pseudo-datatypes like series! anymore, we now have typeset!, sort-of an immediate bitset for datatypes. It speeds up function calling and allows all sorts of other things. I backported a fake version of typesets to R2 as well in the 2.7.7 release. |
TYPES-OF function! returns a block of argument words and typesets. | |
Paul 7-Feb-2010 [530] | Docs need more examples. If someone just went thought the R3 Functions page and separted it into a seciton that says NEW in R3 and explained those and gave an example for each we would have awesome docs. |
BrianH 7-Feb-2010 [531x3] | There's already been a blog about that recently: http://www.rebol.com/article/0456.html |
Check the comments - it talks about reorganizing the docs. | |
TYPES-OF works on other function types as well - we have a lot of them. | |
Robert 7-Feb-2010 [534] | Brian, please add that .r3 scripts are searched for as well. And that .r3 takes priority over .r if filenames are the same. |
BrianH 7-Feb-2010 [535x4] | The strategy that seems to work best is to have platform-specific scripts in different directories and set system/options/module-paths to pick the sets of files that are appropriate. |
Since this isn't just a R2 vs. R3 problem, it's also a Mac vs. Linux problem, etc. | |
File associations only affect the main script though, not the modules it uses. You can't use an Explorer to load a module. | |
And since the module lookup process doesn't apply to scripts, this is a bit of a non-issue. | |
Ashley 8-Feb-2010 [539] | >> system/version == 2.100.96.2.5 >> to decimal! 1% == 0.01 >> to binary! 0.01 == #{3F847AE147AE147B} >> to binary! 1% ** Script error: invalid argument: 1% ** Where: to ** Near: to binary! 1% >> to binary! %a ** Script error: invalid argument: %a ** Where: to ** Near: to binary! %a >> to binary! 0x0 ** Script error: invalid argument: 0x0 ** Where: to ** Near: to binary! 0x0 I think pair! should be binary! encoded/decoded something like this (in R2 it was to-binary formed): to-raw-pair!: make function! [[ pair [pair!] /local x y ][ x: to binary! pair/x y: to binary! pair/y while [all [zero? first x zero? first y]][remove x remove y] append x y ]] to-rebol-pair!: make function! [[ pair [binary!] /local length ][ to pair! reduce [to integer! copy/part pair length: (length? pair) / 2 to integer! skip pair length] ]] >> to-raw-pair! 0x255 == #{00FF} >> to-raw-pair! 0x256 == #{00000100} |
Graham 8-Feb-2010 [540] | >> system/version == 2.100.97.3.1 |
sqlab 8-Feb-2010 [541] | Recently I made some tests comparing the speed of R3 to R2. After getting results of R3 up to 100 times slowlier than R2 and more, I found that parse is now almost unusable for simple parsing under some circumstances. I will later add a Curecode ticket. |
Pekr 8-Feb-2010 [542] | sqlab. Post your tests ... I can't believe you :-) |
Graham 8-Feb-2010 [543] | not optimized ... |
sqlab 8-Feb-2010 [544] | There is nothing to optimize in simple parse data "^/" .( |
Pekr 8-Feb-2010 [545] | Ah, special mode parsing ... you try to get block of lines, correct? I wonder if using some parse rules instead would show so much of a difference between R2 and R3? |
sqlab 8-Feb-2010 [546x2] | split produces the expected behaviour bit , but is still 10x slowlier. |
c: "" for i 0 255 1 [ append c to-char i ] data: to-string array/initial 255 * 255 random c m: parse data "^/" l: length? m I get always diferent values for l. | |
Ashley 8-Feb-2010 [548] | >> trim/with #{001100} #{00} == #{11} >> trim/head/with #{001100} #{00} ** Script error: incompatible or invalid refinements ** Where: trim ** Near: trim/head/with #{001100} #{00} |
Pekr 8-Feb-2010 [549] | sqlab - 'split is a mezzanine, hence slower imo ... |
sqlab 8-Feb-2010 [550] | Is that behaviour somewhere documented, that this "special mode parsing" does not work anymore? |
Graham 8-Feb-2010 [551] | >> dt [ loop 1000000 [ parse "abc def" none ]] == 0:00:01.842453 >> t1: now/precise loop 1000000 [ parse "abc def" none ] t2: now/precise == 8-Feb-2010/23:00:21.43+13:00 >> difference t1 t2 == -0:00:01.004 >> |
Pekr 8-Feb-2010 [552] | sqlab - I did not say it should not work, it should work. But there might be some bug or something like that, because parse was highly modified ... |
sqlab 8-Feb-2010 [553] | G: Dont parse some chars many times, parse many chars a few times. |
Graham 8-Feb-2010 [554] | 0 < 2 < 100 ... so still in the range |
sqlab 8-Feb-2010 [555] | Especially look at the outcome of the parsing, even with the same data I get alyways different results |
Pekr 8-Feb-2010 [556] | Graham - I don't understand your test at all :-) |
sqlab 8-Feb-2010 [557] | just try my example |
Graham 8-Feb-2010 [558] | different results .. you're using 'random |
Pekr 8-Feb-2010 [559x2] | let's try to compare following for R2 vs R3: parse "abc^/def^/ghi^/" [start: any [end: newline (print copy/part start end) start: | skip]] |
well, just remove (print ...) ... I just want to find out the traversal time .... | |
Graham 8-Feb-2010 [561] | I normally just parse short bits of text .. so R2 looks to be 2x faster than R3 |
Pekr 8-Feb-2010 [562x3] | s: now/time/precise loop 1000000 [parse "abc^/def^/ghi^/" [start: any [end: newline start: | skip]]] now/time/precise - s Three consecutive runs: R2: 0:00:03.11 0:00:02.941 0:00:03.089 R3: 0:00:01.732 0:00:01.679 0:00:01.724 |
the above code does not run in R3. Dunno if "end" is forbidden or became a keyword, but I get following error, if I don't change end: to en: >> s: now/time/precise loop 1000000 [parse "abc^/def^/ghi^/" [start: any [end: n ewline start: | skip]]] now/time/precise - s ** Script error: PARSE - command cannot be used as variable: end: ** Where: parse loop ** Near: parse {abc def ghi } [start: any [end: newline start: | skip... | |
So - for basic traversal, R3 is faster .... for my example .... | |
sqlab 8-Feb-2010 [565] | even with my random generated data, the number of parts should be always the same. But you can also parse the same data a few times. Every times it will be parsed in a different number of parts |
Graham 8-Feb-2010 [566] | end is a keyword! |
sqlab 8-Feb-2010 [567] | The data I parse, are oftly in the 10s of MB and more. With R2 I had no problems |
Pekr 8-Feb-2010 [568] | >> start: now/time/precise loop 1000000 [parse "abc^/def^/ghi^/" [s: any [e: newline (append blk copy/part s e) s: | skip]]] now/time/precise - start == 0:00:05.359 |
Graham 8-Feb-2010 [569] | Hmm... tried to parse 4M chars a few times and r2 ran out of memory ... r3 worked fine |
Pekr 8-Feb-2010 [570x2] | There really is some problem: R2: >> start: now/time/precise loop 1000000 [parse "abc^/def^/ghi^/" "^/"] now/time/precise - start == 0:00:00.933 R3: == 0:00:04.259 |
I would curecode it, along with my example, and ask Carl about the possible cause ... | |
older newer | first last |