World: r3wp
[Red] Red language group
older newer | first last |
Kaj 10-Jun-2011 [1959] | The problem with that is that you have to do it for every function. It's more work, in a different place than the #import. It feels like a hack, whereas return: [logic!] lets the compiler know the exact type |
Dockimbel 10-Jun-2011 [1960] | Well, that is the default behaviour already. You just have to be sure that the imported function is respecting that convention strictly. |
Kaj 10-Jun-2011 [1961] | Besides, the #define would still generate the extra code, wouldn't it? There's currently no way to specify that no conversion is necessary for a return value |
Dockimbel 10-Jun-2011 [1962] | Just don't use any type casting and no conversion code will be added. |
Kaj 10-Jun-2011 [1963] | But will integer! than be handled as logic! in expressions? |
Dockimbel 10-Jun-2011 [1964] | Certainly not, but we were talking about an imported function with a return: [logic!] declaration? |
Kaj 10-Jun-2011 [1965x2] | Well, that was my original question, whether that already works as I would like :-) |
So it can only be used when strictly 0 and 1 are returned in integer! format? | |
Dockimbel 10-Jun-2011 [1967] | Exactly. |
Kaj 10-Jun-2011 [1968] | OK, thanks |
Dockimbel 10-Jun-2011 [1969] | If you function return 0 for false and a positive number for true, it needs a runtime conversion. |
Kaj 10-Jun-2011 [1970x2] | Fair enough |
Any plans to implement automatic inlining in the future? | |
Dockimbel 10-Jun-2011 [1972x3] | Yes, but probably as part of a future optimizing compiler version. |
So, probably when Red/System will be rewritten in Red. | |
I would also adopt a fastcall convention as default for Red/System function calls. | |
Kaj 10-Jun-2011 [1975] | Awaiting that, I'll refrain from the #define solution, then |
Dockimbel 11-Jun-2011 [1976] | Andreas, Kaj: what were the changes required on ELF emitter to make it work on Syllable? Just entry point address? |
Kaj 11-Jun-2011 [1977] | Base address, really, and address alignment |
Dockimbel 11-Jun-2011 [1978] | Ah, yes, base address, not entry point. Thanks. |
Kaj 11-Jun-2011 [1979x2] | Base address for Syllable Desktop is 80000000h which currently needs to be coded as -2147483648 |
The same change would be necessary for BeOS, by the way | |
Andreas 14-Jun-2011 [1981x3] | Red/System can now generate dynamically linked ELF binaries. |
Along with some additional pre-processor directives added (#if, #either, #switch), this now enables the Red/System runtime being fully writen in Red/System itself. | |
If someone wants to test the generated ELF binaries on Syllable, I have a pre-built "hello.reds" available at http://bolka.at/2011/tmp/hello-syllable.bin | |
Steeve 14-Jun-2011 [1984] | btw, I tried to install syllabe within VirtualBox some weeks ago, And It failed/ |
Dockimbel 14-Jun-2011 [1985] | Andreas: tested on Syllable, works flawlessly! |
Andreas 14-Jun-2011 [1986x2] | Oh, great to hear :) |
Wouldn't have expected that, actually. | |
Dockimbel 14-Jun-2011 [1988] | Is it compiled with C bindings? (length? == strlen( ))? |
Andreas 14-Jun-2011 [1989x4] | Compiled with the current default settings. |
So yes, with C bindings. | |
readelf says that alloc, free, memset, memmove, strlen are imported in the binary. | |
malloc* | |
Dockimbel 14-Jun-2011 [1993x2] | Steeve: which system image file have you used? |
Great! :) | |
Steeve 14-Jun-2011 [1995x2] | I check it |
SyllableDesktop-0.6.6.i586.iso | |
Dockimbel 14-Jun-2011 [1997x3] | I am currently working on runtime error catching. I have successfully redirected default handlers for SIGILL, SIGSEGV, SIGFPE on Linux, but on Windows, the systems seems to ignore my handlers (using signal( ) function). So I am currently testing with SetUnhandledExceptionFilter() (http://msdn.microsoft.com/en-us/library/ms680634%28VS.85%29.aspx) |
If anyone has experience with that API on Windows, advices and tips are welcome. :-) | |
Steeve: I failed to install that version too, but here are special install images for Vmware and VirtualBox under "Emulate Syllable" bar here: http://web.syllable.org/pages/get-Syllable.html#installation-CD | |
Steeve 14-Jun-2011 [2000] | Thanks, I'll try it |
Dockimbel 14-Jun-2011 [2001] | My Syllable image on Vmware works well (as long as I keep the mouse in the VM during the boot sequence, else it fails to be detected). |
Steeve 14-Jun-2011 [2002] | Btw, How do you use a Vmware image instead of an iso one. I don't see any option to do so with VirtualBox |
Dockimbel 14-Jun-2011 [2003x2] | You just do from menu: File->Open. |
(on Vmware) | |
Steeve 14-Jun-2011 [2005] | Hmm... |
Gregg 14-Jun-2011 [2006] | Great to see continued progress on Red! |
Dockimbel 14-Jun-2011 [2007] | Thanks Gregg, we are currently reaching the first milestone of the project with a fully capable Red/System language, just a few more implementation fixes, the specification draft to complete, and I will declare it beta (means "usable" for real work). |
Kaj 14-Jun-2011 [2008] | Cool news :-) |
older newer | first last |