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

World: r3wp

[Red] Red language group

Pekr
22-Feb-2012
[5261]
OK, that's clear at least now ...
Kaj
22-Feb-2012
[5262]
It's very nice that Red/System has a first class logic! but external 
code doesn't know that
Pekr
22-Feb-2012
[5263]
would it be possible to cast import values directly in import clauses, 
to prevent the need to write another wrapping functions? call me 
lazy :-)
Dockimbel
22-Feb-2012
[5264]
Integer! _is_ signed in Red/System, byte! is not.
Pekr
22-Feb-2012
[5265x2]
I mean, so I could write:

return: as integer! [byte!]
or: return: as logic! as integer! [byte!], so that I would get true/false 
directly :-)
Dockimbel
22-Feb-2012
[5267]
No! But you can use a macro to avoid making a function wrapper.
Pekr
22-Feb-2012
[5268]
macro?
Dockimbel
22-Feb-2012
[5269]
#define
Kaj
22-Feb-2012
[5270]
Oh, right, the other way around. But how do you get a high integer 
from a library, then?
Pekr
22-Feb-2012
[5271x2]
aha ... I would probably use something like _func-name ... and func-name: 
[as logic! as byte! _func-name]
I will look into #define ...
Dockimbel
22-Feb-2012
[5273x2]
Pekr: yes, that's an option.
Kaj: the same way as you get a low integer. :) The signed representation 
is just a convention, the actual data remains the same, signed or 
unsigned.
Kaj
22-Feb-2012
[5275]
It seems that Petr's library puts garbage in the high bytes if it 
returns 1 or a high integer
Dockimbel
22-Feb-2012
[5276]
Pekr: it should be  [as logic! _func-name], while setting [return: 
[byte!]] in _func-name definition.
Pekr
22-Feb-2012
[5277x2]
yes, I confused it - ti came from R2, where I put char as a return 
value, and then to-integer ... I develop in in R2, Red/System, World, 
to see if eventual crashes are environment specific, or library specific
the library is clearly a junk imo ... e.g. two consecutive calls 
to the same function do crash the app, etc.
Kaj
22-Feb-2012
[5279x3]
I split the C library binding in two branches so that users of the 
Red release can keep using the main (trunk) branch:
http://red.esperconsultancy.nl/Red-C-library/timeline
The new "developing" branch is not compatible with Red/System 0.2.4 
but is needed to use WebKit
Dockimbel
22-Feb-2012
[5282]
Kaj: I've just pushed a fix for the floats exceptions and regressions. 
Mandelbrot is running fine again now. Let me know if the issues are 
fixed for you too.
Kaj
22-Feb-2012
[5283x3]
Fixed, thanks
; CLOCKS_PER_SEC value for Syllable, Linux (XSI-conformant systems)
; TODO: check for other systems
#define clocks-per-second		1000'000
Judging by your screenshot, it's different for Windows
Dockimbel
22-Feb-2012
[5286]
IIRC, it should be 60 for Windows, but I'm not certain this is valid 
for all Windows versions.
Kaj
22-Feb-2012
[5287]
Sounds like that could be 50 in the US
Dockimbel
22-Feb-2012
[5288]
Possible.
Kaj
22-Feb-2012
[5289x7]
Performancewise, 100 or 1000 seem most likely
1000 or 10'000 really
It's 1000:
http://en.allexperts.com/q/C-1040/time-milliseconds-Windows.htm
But stupid Windows measures wall-clock time instead of processor 
time
That explains why your measurement is pretty much the same as on 
my old CPU
I'm working on new benchmarks that you'll like :-)
PeterWood
22-Feb-2012
[5296]
Kaj - you should also be aware of this note iin the Libc docs:

— Macro: int CLOCKS_PER_SEC

The value of this macro is the number of clock ticks per second measured 
by the clock function. POSIX requires that this value be one million 
independent of the actual resolution.
Kaj
22-Feb-2012
[5297x2]
Yes, that's already in the notes in my binding. See above (XSI-conformant 
systems)
I've just fixed the clocks-per-second value on Windows
Dockimbel
22-Feb-2012
[5299]
New branch started: `libc-init`


First commit contains proper init code for libc on Linux. It works 
ok, but additional testing needs to be done. Also support for other 
platforms needs to be added.

https://github.com/dockimbel/Red/tree/libc-init
Pekr
22-Feb-2012
[5300]
Any few words about what libc-init branch is about?
Dockimbel
22-Feb-2012
[5301x2]
Trust me, you don't want to know. ;-)
The main point is being able to properly call this "beast" from Red/System: 
http://www.msbit.com:82/LSB/booksets/LSB-Core-generic/LSB-Core-generic/baselib---libc-start-main-.html
Kaj
23-Feb-2012
[5303x2]
My Fibonacci benchmark results have scrolled way out of sight in 
the Other Languages group, so I'll repeat them here:
Syllable Server, AMD Athlon XP 1800+ (256 KB L2 cache)
				CPU Time		Relative
C (GCC -O3)			.14			1
C (GCC 4.4.3 i686)		.24			2
Red/System			.26			2
Ruby 1.8.7.248 (i486)	29			200
Boron (i486)			31			200
REBOL 3 2.100.111.4.4	41			300
ORCA (i486)			50			350
REBOL 2 2.7.7		55			400
World				10:27:00 *		> 260,000
*: Aborted after this time.
Pekr
23-Feb-2012
[5305]
How is that R/S jumped so high? A different test this time?
Kaj
23-Feb-2012
[5306x2]
Yes, that's what we discussed there. This one doesn't test floating 
point, but integer performance and function calling
As Doc explained, floating point performance is currently a bit hampered
Dockimbel
23-Feb-2012
[5308]
Nice! :)
Pekr
23-Feb-2012
[5309]
Raspberry Pi got Fedora Remix yesterday. Can't wait for the release, 
and getting Red running there :-)
Gerard
24-Mar-2012
[5310]
Hi Doc, I know you'Re working on the lexer and I asked myself if 
you would use some toolset like the Coco/R compiler generator to 
help you for the next phase (parsing)? It seems it has already been 
converted for many other languages.  Here are the links for the user 
manual and the other resources for using it if necessary ... http://www.ssw.uni-linz.ac.at/Coco/Doc/UserManual.pdf
http://www.scifac.ru.ac.za/coco/