• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

AltME groups: search

Help · search scripts · search articles · search mailing list

results summary

worldhits
r4wp5907
r3wp58701
total:64608

results window for this page: [start: 3201 end: 3300]

world-name: r4wp

Group: #Red ... Red language group [web-public]
Kaj:
8-Mar-2013
In my older benchmarks with Carl's R3 build, R3 was a quarter faster 
than R2 (3 : 4). But I was computing Fibonacci 35 then, and now Fibonacci 
40 to have a better comparison with fast languages on fast machines
DocKimbel:
8-Mar-2013
Better specify it clearly each time you announce comparative performances, 
else people will generalize it and get a wrong picture of the real 
performance ratios. 


Fibonacci basically tests the efficiency of the function calls. A 
test with a bigger loop could be interesting. For example, you can 
take the %demo.red script and strip all screen outputs, add a LOOP 
around the main code and  you'll should see much bigger differences.
Kaj:
8-Mar-2013
I don't know what "real" performance ratios are, but I think that 
computing Fibonacci numbers is a more real task than running the 
text console demo in a loop
DocKimbel:
8-Mar-2013
Kaj, what matters in such benchmark is not the usefulness of the 
resulting data, it is how the test stresses the language implementation. 
From that perspective, Fibonacci just tests the efficiency of nested 
calls, nothing else, no series manipulation, no memory allocation, 
very limited math, very limited control flow, ... The demo code will 
stress more parts of the implementation, hence giving you a more 
accurate picture (closer to what user will experience with their 
own scripts).


If you take the language Shootout tests, each test is meant to stress 
a specific part of each language, giving a good (and quite fair) 
comparison for each category.


I think we should implement them in order to get a good picture of 
Red performances and how they evolve. Anyone interested in implementing 
them? http://dada.perl.it/shootout/
Kaj:
8-Mar-2013
Yes, so Fibonacci is a good such test, isn't it?
Kaj:
8-Mar-2013
The Red interpreter can now actually load and run REBOL scripts, 
as long as they're compatible and they don't have a Unix shebang 
line
DocKimbel:
8-Mar-2013
Fibonacci is a good such test, isn't it?
 It is a very good test for nested calls. :-)
DocKimbel:
8-Mar-2013
PRINT: yes we could enhance it, but it would need to be promoted 
as a "keyword" in the compiler (not a big deal though).
DocKimbel:
8-Mar-2013
There are also some refinements for some natives that are implemented 
in the compiler and not in the interpreter (/any for SET and GET 
from top of my head, but there are probably more). I need to do a 
review to collect them and implement them before the release (probably 
on Sunday).
Kaj:
8-Mar-2013
Are you sure PRINT can't just be a function?
DocKimbel:
8-Mar-2013
Yes, it is a function, but the reduction (on literal blocks only) 
could be handled by the compiler if it's also declared as a keyword 
(in the compiler).
DocKimbel:
8-Mar-2013
So `print [1 + 2]` could be compiled efficiently by the compiler 
(calling the native with a reduced block), while `print a` will directly 
call the native version.
DocKimbel:
8-Mar-2013
They have a native common part anyway, as some parts cannot be statically 
compiled.
DocKimbel:
8-Mar-2013
It would be good to have some benchmarks on these to see the gains 
the compiler brings (it will be vary a lot I guess).
DocKimbel:
8-Mar-2013
Also, later, I realized that if I make DO an intrinsic, expressions 
in functions like: `do [foo: :bar]` (where `bar` is a function) would 
be more complicated to write for the user, as the literal block would 
be compiled, loosing the advantage of interpreter here. So it would 
have required user to write instead: `code: [foo: :bar] do code`.
Kaj:
8-Mar-2013
Andreas' R3 build is a bit slower even than mine, so nothing wrong 
with mine it seems. Apparently R3 is 10% slower than R2 on Fibonacci 
40
DocKimbel:
8-Mar-2013
Right, REDUCE on a literal block should be the fastest way to evaluate 
code dynamically, for now.
Kaj:
8-Mar-2013
Do you know of any other language that intertwines an interpreter 
and a compiler so intimately?
DocKimbel:
8-Mar-2013
No, not the way Red does it (static AOT compiler + interpreter), 
but as there are thousands of languages out there, I guess that there 
are probably others that use the same technique.


Thinking about that, there's a more classical approach used by some 
JIT compilers like LuaJIT, that by default runs under an interpreter, 
gather runtime stats, then starts replacing some nested loops with 
JIT-compiled code (principle of a tracing JIT). So, such architecture 
implies an interwined interpreter and JIT-compiler.
Kaj:
8-Mar-2013
Could both these situations issue a warning and not an error for 
now?
DocKimbel:
9-Mar-2013
Received it, thanks a lot Endo!
DocKimbel:
9-Mar-2013
red>> a: %dev
== %dev
red>> type? a
== file!
red>> length? a
== 3
red>> append a %/red/hello.red
== %dev/red/hello.red
red>> length? a
== 17
red>> find a slash
== %/red/hello.red
red>> index? find a slash
== 4
red>> form a
== "dev/red/hello.red"
red>> mold a
== "%dev/red/hello.red"
red>> a/1
== #"d"
red>> last a
== #"d"
red>> a/5: #"R"
== #"R"
red>> a
== %dev/Red/hello.red
DocKimbel:
9-Mar-2013
I'm counting 27 datatypes implemented so far in Red. The next on 
the list will be: typeset!, errror!, object!, port!, binary!. Although, 
I'm not sure in which precise order they will be added (especially 
for error! and object!, not sure which one I'll do first).


For other datatypes, like float!, date! and time!, which are not 
a requirement for building Red core itself, I would like them to 
be contributed if possible. I could provide a sample empty datatype 
file and instructions on how to use Red's current internal API to 
anyone willing to work on them.
DocKimbel:
9-Mar-2013
Vector! is a bit tricky and I might use it for parallel processing, 
so I will probably implement it myself.
Pekr:
9-Mar-2013
Well - IDE is IDE, I mean - the runtime stuff. Simply put (and most 
probably worrying unnecessarily and sounding like a broken machine), 
let's make R3/Red another Amiga like OS :)
BrianH:
9-Mar-2013
There are some things in R3, particularly some of the things that 
the module system can do, that probably won't make sense to do in 
Red because it's compiled. Delay-loading modules won't be as important 
for Red because most of the overhead of creating a module can be 
done ahead of time when it's compiled. It would make sense to support 
the delaying feature because you might want to have a module's side 
effects happen at a particular time, but the delay can happen a lot 
later in the process than it would in R3. Red might benefit from 
the options specification method and some other aspects of its surface 
API and behavioral model, but the implementation would be completely 
different. The restrictions we made to make the module system statically 
resolvable (in R3's case by a preprocessor like prebol or Ladislav's 
include) would be a lot more important for Red than they have been 
so far for R3, because compilation makes static resolution more important.
BrianH:
9-Mar-2013
In many ways, R3's module system design is even more beneficial for 
a language like Red than it is for R3 itself. Actually, that was 
one of the things I was taking into account when we were thinking 
it through. Back before Red was announced I was thinking about putting 
a JIT compiler into R3, and R3's extensions are similar in some ways 
to what modules would be in a Red-like language. So R3's module system 
was basically designed with Red in mind.
DocKimbel:
9-Mar-2013
About the path composition for files, I might give it a try tomorrow.
BrianH:
9-Mar-2013
It's on my todo list to do more LOAD tests for R3. You can use those 
then, at least as a start.
BrianH:
9-Mar-2013
Those tests manage to be unified between R2 and R3 by tagging the 
ones that aren't. A #red tag could be added...
DocKimbel:
9-Mar-2013
Let me stash my changes to see if there's a side-effect.
Kaj:
9-Mar-2013
{} is OK now that I've forced a build
DocKimbel:
9-Mar-2013
2.7.7 is definitely a no-go.
DocKimbel:
9-Mar-2013
I will give it a look tomorrow testing with 2.7.8.
DocKimbel:
9-Mar-2013
In case, some of you are interested in a more detailled view of Red's 
roadmap, I've started using Trello for keeping track of current and 
future tasks. I've just started adding stuff, I have many more things 
to put there. Here's the URL:


https://trello.com/board/red-programming-language/51387ada4e1ba9b86b001141
Kaj:
9-Mar-2013
I'm getting a blank page with just a header bar
DocKimbel:
9-Mar-2013
It's a web proxy, you can surf the site from there.
DocKimbel:
9-Mar-2013
Hmm, so not a web proxy...
Kaj:
9-Mar-2013
You mean the SDL program? Yes, the window is already hidden, but 
if I try it on Linux I do get a task bar icon
Endo:
10-Mar-2013
Trello is a very good choice, so anyone can see what is on the list 
easily. I use it for my work and personal lists. There is Android 
app too.
Marco:
10-Mar-2013
I suggest to change the relaive part of "Readme.md" to:

Running the Red/System hello script
------------------------

1. From the REBOL console type:

    `call/show ""` ; (type this only once to fix Rebol 2 bug)

    `change-dir %red-system/`

2. Type: 

    `do/args %rsc.r "%tests/hello.reds"`
	

    the compilation process should finish with a `...output file size` 
    message.


3. The resulting binary is in `red-system/builds/`, go try it! type 
(on Windows):

    `call/wait/shell/console %builds/hello.exe`
Arnold:
10-Mar-2013
Tell the Red interpreter "find a slash" and it finds one, Now that's 
programming computers! 
Hurray for file! support!
DocKimbel:
10-Mar-2013
Right, it could teach Rebolbot a few tricks. ;-)
DocKimbel:
10-Mar-2013
Marco: thanks for the proposition. Exposing Rebol bug in the first 
commands that a new user has to type to run Red compiler, is really 
not appealing.
DocKimbel:
10-Mar-2013
Fortunately, these steps are temporary, once we get the compiler 
encapped, it should be a one-liner.
DocKimbel:
11-Mar-2013
Can't you just return unset! from an undefined path, like for an 
undefined word?

I will give it a try.
Gregg:
11-Mar-2013
If it's Doc's birthday, we should give him a present and donate to 
his child's future. 

Happy Birthday Doc.
NickA:
11-Mar-2013
Made a little donation - happy birthday!
DocKimbel:
11-Mar-2013
I can have a quick look at it though, if it's just a few lines of 
code, I'll add it.
DocKimbel:
11-Mar-2013
Is there a CC ticket about that?
DocKimbel:
11-Mar-2013
At first look, I'd say nothing done as it can be useful to disable 
a code block in a loop passing 0 as looping number (or empty block 
in case of FOREACH).
BrianH:
11-Mar-2013
That method of disabling a loop block would be in addition to passing 
none as the data (for foreach)?
Kaj:
11-Mar-2013
In that case, it seems obvious to me to do nothing. That's a regular 
construct in programs
DocKimbel:
12-Mar-2013
The changes I made in the interpreter for not exiting the console 
on errors have a very bad side-effect: some errors are passing silently 
through the unit tests and are not reported! :-/
DocKimbel:
12-Mar-2013
Kaj, I'm really don't see this approach working. The HALTs in the 
runtime code *do* have a purpose, they protect the user from running 
its code after an error that sets the stack in an undetermined state. 
It's a (temporary) protection barrier until we have proper error 
handling. Removing them will just make me chase false errors.  I 
can't patch the whole runtime code to make it look like it has error 
recovering while it has not...
DocKimbel:
12-Mar-2013
I told you that the cleaner option would be: write a input data validation 
routine to, at least, catch those undefined words.
Group: Rebol School ... REBOL School [web-public]
DocKimbel:
10-Oct-2012
Hi Sujoy, glad you're using Uniserve. You should use the latest version 
from Cheyenne. Some services or client protocols might be dependent 
on Cheyenne, so the best thing to do is move them out of %services/ 
and %protocols/ folder and leave only your own ones. Also by default, 
the task hander module should go in a %UniServe/handlers/ folder.
Sujoy:
10-Oct-2012
Thanks for getting back to me on this Doc...
So if i have this correct, I should:
1. Use the latest version from Cheyenne (have made a copy)

2. Remove all services and protocols from the %services/ and %protocols/ 
folders, except for task-master.r (which i need!)

3. Now hopelessly confused - the UniServe directory tree of the latest 
Cheyenne version I have is as follows:
     Uniserve
     ---clients
     ---libs
     ---protocols
     ---services
         ---task-master.r
         ---task-master
             ---task-handler.r
     I don't see a %UniServe/handlers folder...
Sujoy:
10-Oct-2012
ah - ok. i was trying to create a %MODULES folder
give me a minute...
DocKimbel:
10-Oct-2012
Can you send me a zip of your Uniserve folder so I can test that 
locally?
Sujoy:
10-Oct-2012
have sent you a mail at nr at red-lang dot org
Sujoy:
10-Oct-2012
:)
is this because pool-list is empty?

i put in a debug "print" cmd in the on-new-client function of task-master.r, 
which is the only place i could see pool-list being appended to...but 
it seems the function is not called
DocKimbel:
10-Oct-2012
No the issue is with 'shared being reset to 'none in %task-master...looks 
like a regression in Uniserve when working on standalone...I'm looking 
into it.
DocKimbel:
10-Oct-2012
I've just pushed a fix for that to Cheyenne SVN repo on Google code.
Sujoy:
10-Oct-2012
:(
i'm actually trying to do something really simple
i have a bunch of feeds i want to download

i can do that sequentially (foreach feed feeds [...]), but thought 
it best to us background worker processes via task-master to download 
instead
is there an alternative?
Sujoy:
10-Oct-2012
or a better way of writing this using uniserve?
DocKimbel:
10-Oct-2012
Uniserve task-master is mainly meant for server-side parallel request 
processing. For your need, you should use an async HTTP client rather, 
which would be a much simpler solution.
DocKimbel:
10-Oct-2012
Are you running from SVN repo, or a copy of Uniserve folder?
Sujoy:
10-Oct-2012
a copy of the Uniserve folder...
DocKimbel:
10-Oct-2012
But, you should *really* use a async HTTP client, that's the best 
solution for your need (multiple HTTP downloads at the same time).
DocKimbel:
10-Oct-2012
Sujoy: have a look at this description of  one of async HTTP clients 
available: http://stackoverflow.com/questions/1653969/rebol-multitasking-with-async-why-do-i-get-invalid-port-spec
Sujoy:
10-Oct-2012
i have another issue - and need help from a parse guru
Sujoy:
10-Oct-2012
i'm trying to extract article text from an awfully written series 
of html pages - one sample:


http://www.business-standard.com/india/news/vadra-/a-little-helpmy-friends//489109/
Sujoy:
10-Oct-2012
using beautifulsoup in python however, i can do the following:

from bs4 import  BeautifulSoup as bs
import urllib2


uri = "http://www.business-standard.com/india/news/vadra-/a-little-helpmy-friends//489109/"
soup = bs(urllib2.urlopen(uri).read())

p = soup.find_all('p')
[s.extract() for s in soup.p.find_all('table')]
[s.extract() for s in soup.p.find_all('script')]
[s.extract() for s in soup.p.find_all('tstyle')]

text = bs(''.join(str(p))).get_text()

...and this gives me exactly what is required...

just want to do this in Rebol! ;)
Endo:
10-Oct-2012
just a quick answer, to give you an idea, I've used following to 
extract something from a web page:
b: [] parse/all mypage [
        any [

            thru {<span class="dblClickSpan"} thru ">" copy t to </span>
            (append b trim/lines t) 7 skip
        ]
 ]
Sujoy:
10-Oct-2012
never used the niwashi - Kaj, do you have a quick example for me 
to use?

i've got the docs open, but am maybe being obtuse - it is 230am here!
Kaj:
10-Oct-2012
It's a bit confusing to set up. I'll have a look
Kaj:
10-Oct-2012
#! /usr/bin/env r2
REBOL []

here: what-dir

program: dirize clean-path here/../../../cms/files/program/PowerMezz

do program/mezz/module.r

load-module/from program

module [
	imports: [
		%mezz/trees.r
		%mezz/load-html.r
		%mezz/html-to-text.r
	]
][
;	print mold-tree load-html read http://osslo.nl/leveranciers

	make-dir %data

	for id 1 169 1 [
		print id

  page: load-html read join http://osslo.nl/leveranciers?mod=organization&id=
  id


  content: get-node page/childs/html/childs/body/childs/div/childs/3/childs/2

		body: get-node content/childs/table/childs/tbody
;		print form-html/with body [pretty?: yes]
;		print mold-tree body

;		item: get-node body/childs/10/childs/2
;		print form-html/with item [pretty?: yes]
;		print mold-tree item
;		print mold item

		record: copy ""
		short-name: name: none

		unless get-node body/childs/tr/childs/th [  ; Missing record
			foreach item get-node body/childs [

    switch/default type: trim get-node item/childs/td/childs/text/prop/value 
    [
					"Logo:" [

;						if all [get-node item/childs/2/childs/1  get-node item/childs/2/childs/1/childs/1] 
[
;							repend record

;								['icon tab tab tab tab		get-node item/childs/2/childs/a/childs/img/prop/src 
 newline]
;						]
					]
					"Naam:" [
						if get-node item/childs/2/childs/1 [
							repend record

        ['name tab tab tab tab		name: trim/lines html-to-text get-node item/childs/2/childs/text/prop/value 
         newline]
						]
					]
...					"Adres:" [

      unless empty? trim/lines html-to-text form-html/with get-node item/childs/2 
      [pretty?: yes] [
							street: get-node item/childs/2/childs/1/prop/value
							place: get-node item/childs/2/childs/3/prop/value

							number: next find/last street #" "
							street: trim/lines html-to-text copy/part street number

							unless empty? street [
								repend record ['street tab tab tab tab	street newline]
							]
							unless empty? number [
								repend record ['number tab tab tab tab	number newline]
							]
							unless place/1 = #" " [
								where: find  skip place 5  #" "

        repend record ['postal-code tab tab tab	copy/part place where  newline]

								place: where
							]
							unless empty? place: trim/lines html-to-text place [
								repend record ['place tab tab tab tab 	place newline]
							]
						]
					]
					"Telefoon:" [

      unless #{C2} = to-binary trim/lines html-to-text form-html/with get-node 
      item/childs/2 [pretty?: yes] [
							repend record

        ['phones tab tab tab tab	trim get-node item/childs/2/childs/text/prop/value 
         newline]
						]
					]
					"Website:" [

      if all [get-node item/childs/2/childs/1  get-node item/childs/2/childs/1/childs/1] 
      [
							repend record

        ['websites tab tab tab		trim get-node item/childs/2/childs/a/childs/text/prop/value 
         newline]
						]
					]
					"E-mail:" [

      if all [get-node item/childs/2/childs/1  get-node item/childs/2/childs/1/childs/1] 
      [
							repend record

        ['mail-addresses tab tab	trim/all get-node item/childs/2/childs/a/childs/text/prop/value 
         newline]
						]
					]
					"Profiel:" [

      unless #{C2} = to-binary trim/lines html-to-text form-html/with get-node 
      item/childs/2 [pretty?: yes] [
							repend record [
								'description newline
									tab replace/all

          trim html-to-text form-html/with get-node item/childs/2 [pretty?: 
          yes]
										"^/" "^/^-"
									newline
							]
						]
					]
				][
					print ["Onbekend veld: " type]
				]
			]
			write rejoin [%data/
				replace/all replace/all replace/all any [short-name name]
					#" " #"-"
					#"/" #"-"
					#"." ""
				%.txt
			] record
		]
	]
]
Kaj:
10-Oct-2012
That came out bigger than planned. I was trying to cut out some repetitive 
fields. It scrapes addresses from a web page and converts them to 
text format
Sujoy:
10-Oct-2012
and python is ~30MB
but yeah - its a lovely piece of work
Kaj:
10-Oct-2012
Still looks like it would be nice to have a REBOL implementation 
:-)
Kaj:
11-Oct-2012
Sujoy, I only did a request/reply example so far, so I'll have to 
look into it
Kaj:
11-Oct-2012
You could also run R2 code on Cheyenne, and use Mongrel as a proxy
Sujoy:
11-Oct-2012
yes - mongrel as a proxy is great, but i was thinking more in terms 
of zed's idea of a language agnostic web server
Kaj:
11-Oct-2012
Only as a proxy so far, I'm planning towards running Red and R3 0MQ 
servers as Mongrel apps
Sujoy:
11-Oct-2012
good to know!

i haven't seen janko around in a long time - i've been interested 
in using his distributed actors library, but cant find it online 
anywhere
Kaj:
11-Oct-2012
I'd say with the latest news, there's a future for R3 again
Sujoy:
11-Oct-2012
his blog - janko-in-a-jar seems offline
any ideas if he's shifted to some other domain?
Sujoy:
11-Oct-2012
well - am super excited that r3 is in what looks like the final stages 
of being open sourced
i'm not a licensing guru, but LGPL and MIT looks good to me
or Apache
Sujoy:
11-Oct-2012
or a custom REBOL license - based on Carl's latest blog post
Kaj:
11-Oct-2012
Had to make a Red bug report, but I'm looking into your ventilator 
now
Sujoy:
11-Oct-2012
havent been looking at changes to zmq for a while now
Gregg:
11-Oct-2012
SUjoy, send me a reminder next week. I'm very busy the next few days, 
but have ported many of the 0mq guide examples. Mine use Andreas's 
binding, but it might still help.
Sujoy:
11-Oct-2012
very similar from what little i've seen
they even have a libzmq compatability layer built in
MarcS:
12-Oct-2012
I see that some folks use 'copy' on top-level bindings (i.e., foo: 
copy [], bar: copy "", bas: copy #{}). Is this simply stylistic (for 
consistency with initialisation inside of blocks) or am I overlooking 
a potential pitfall?
MarcS:
12-Oct-2012
sure, but that example is inside a block
MarcS:
12-Oct-2012
i guess a related question is whether i'll run into difficulties 
with 'context [ foo: [] ]' versus 'context [ foo: copy [] ]'
Henrik:
12-Oct-2012
that again depends on how the word is meant to be used. if you use 
the context as a copyable prototype, then the original 'foo block 
will be re-used, if you don't copy it on creation of the context.
Henrik:
12-Oct-2012
at the top level, there may not be a reason, but through various 
tricks, it's still possible that it may be relevant to copy it, such 
as if the code itself is later used in a context, which means the 
code is no longer top level.
Ladislav:
12-Oct-2012
so is there any reason for using copy at the top level (global assignments) 
with binding to literals?
 - certainly, there are reasons. See these two examples:

; example #1
repeat i 2 [
    a: []
    append a i
    print mold a
]

and

; example #2
repeat i 2 [
    a: copy []
    append a i
    print mold a
]
3201 / 6460812345...3132[33] 3435...643644645646647