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

World: r3wp

[Red] Red language group

Kaj
28-Jun-2011
[2586]
Andreas' fixes to callbacks on Linux work now. I've enabled them 
in the 0MQ binding and with that, the binding is now pretty much 
production ready
Dockimbel
28-Jun-2011
[2587]
Andreas did a great debugging work on that.
Kaj
28-Jun-2011
[2588]
Yep
Andreas
28-Jun-2011
[2589]
Thanks. Good to hear that it's now working for you as well, Kaj.
Gregg
28-Jun-2011
[2590]
Very cool. Thanks to all of you for coordinating on this.
Robert
29-Jun-2011
[2591]
Is it possible to compile R3 extensions right out-of-the-box? That 
would be pretty cool.
Dockimbel
29-Jun-2011
[2592]
Robert: yes, as soon as we add DLL generation support in Red/System.
Oldes
29-Jun-2011
[2593]
it will not be much useful without floats ;-)
Dockimbel
29-Jun-2011
[2594]
Nice try :-)
Kaj
29-Jun-2011
[2595]
You'll still have to implement the R3 extensions interface
Dockimbel
29-Jun-2011
[2596]
The 64-bit integer support might also be required in Red/System for 
that.
Kaj
29-Jun-2011
[2597x2]
Indeed, it doesn't seem to be possible to get away without that
Once there are 64 bits values, it may be possible to shuffle them 
as floating point values between libraries, without Red being aware 
what they're used for
Dockimbel
29-Jun-2011
[2599]
Good point.
Kaj
29-Jun-2011
[2600]
When floats are passed to C functions, can they be in normal registers 
or must they be in FPU registers?
Dockimbel
29-Jun-2011
[2601]
If the calling convention is cdecl, they are just pushed on stack.
Kaj
29-Jun-2011
[2602]
That seems like a nice shortcut, then
Dockimbel
29-Jun-2011
[2603x2]
That would only work for literal float values.
If you use a variable, you need to pass thru the registers.
Kaj
29-Jun-2011
[2605]
The FPU registers?
Dockimbel
29-Jun-2011
[2606x2]
In the float case, yes FPU registers.
IA32 32-bit registers can't hold C double floats (64-bit).
Kaj
29-Jun-2011
[2608x3]
I've started working on a cURL binding. It can print the cURL version 
now :-)
I could call it a port from the R3 binding, but it will be more like 
a rewrite
The dynamics in Red are quite different
Dockimbel
29-Jun-2011
[2611x4]
You mean in Red/System. Red does not exist yet.
I will improve the web site that make that difference more clear.
Red/System can hardly be compared to REBOL, they don't live at the 
same level of abstraction.
Great to know you are working on a new binding. Let me know when 
you will put it online, so I can add a link from red-lang.org.
Kaj
29-Jun-2011
[2615x2]
As long as Red proper doesn't exist, I use Red to refer to Red/System 
:-)
I'm careful not to do that in publications, though
Andreas
29-Jun-2011
[2617]
http://rebol.esperconsultancy.nl/Red-ZeroMQ-binding/doc/trunk/COPYRIGHT.txt
refers to Red :)
Kaj
29-Jun-2011
[2618]
Ah, yes, because it will be a binding for Red, even though the binding 
is written in Red/System
Andreas
29-Jun-2011
[2619]
Hmm, form me the AltME large font swallowed the "refers to Red :)" 
remark.
Kaj
29-Jun-2011
[2620x2]
Not on my screen size
Since R3 bindings are written in C, their level is comparable to 
a binding in Red/System. But the dynamics are quite different, that's 
what I meant
Andreas
29-Jun-2011
[2622]
looking forward to more weird bugs discovered by the curl binding 
:)
Kaj
29-Jun-2011
[2623x2]
I hope they were all shaken out with the other bindings :-)
Hm, a cURL progress callback needs floats. It's pretty limiting if 
you can't get progress feedback
Dockimbel
29-Jun-2011
[2625]
You should be able to pass 2 integers (if it's a 'double or just 
one if it's a 'single), then do the float->integer (by doing a * 
100 e.g.). Probably fun to code. :-)
Kaj
29-Jun-2011
[2626]
But you said they must be passed via the FPU?
Dockimbel
29-Jun-2011
[2627]
Right, if you want them in a variable. What I was proposing here 
is to split them from the stack by declaring 2 integers, so that 
the float gets stored in 2 arguments (supposing it is a double).
Kaj
29-Jun-2011
[2628]
If cdecl functions pass them on the stack, they may be shuffled between 
them
Dockimbel
29-Jun-2011
[2629]
The stack order for cdecl and stdcall (used by Red/System) is the 
same.
Oldes
29-Jun-2011
[2630]
Almost everything needs floats... better to wait for proper implementation.
Dockimbel
29-Jun-2011
[2631]
Well, it depends what are the boundaries of your "everything". From 
my own experience, except for 2D/3D and scientific calculations, 
they are rarely needed.
Oldes
29-Jun-2011
[2632x2]
Well, you need it for music and graphics. That's almost everything 
for me. I was checking the FMOD binding, and it's not so bad... at 
least if you don't need to change volume or some more advanced effects:)
Is this useful? http://en.wikibooks.org/wiki/X86_Disassembly/Floating_Point_Numbers
Andreas
29-Jun-2011
[2634]
It is another source to confirm that cdecl/stdcall both pass floating 
point arguments via the normal stack :)
Kaj
29-Jun-2011
[2635]
Got cURL to read a website and print it: