World: r3wp
[Red] Red language group
older newer | first last |
Dockimbel 13-Aug-2011 [2962x2] | Kaj: it seems I have introduced a regression on logic! handling in last commits. I will fix that asap. |
Kaj: issue should be fixed now, I have added a couple new tests to avoid new regressions for such returned values. | |
Kaj 13-Aug-2011 [2964] | Thanks! Logic! returns work again, but now I have another problem |
Dockimbel 13-Aug-2011 [2965x2] | I'm on it. |
Issue fixed. | |
Kaj 13-Aug-2011 [2967] | Thanks. Everything is peaceful again in paradise |
Dockimbel 13-Aug-2011 [2968] | Good! :) I will finally have some time to spend on the AVR port. |
Kaj 13-Aug-2011 [2969x2] | I hope so. I see a cload coming, but maybe it will drift past :-) |
cloud | |
Kaj 14-Aug-2011 [2971] | I've updated my bindings to the new PRINT form and marked them as needing the latest Red/System |
Dockimbel 14-Aug-2011 [2972] | Makes me think that having the release version stored in compiler and enforcing a header NEED: field might help... |
Kaj 14-Aug-2011 [2973x2] | Probably. I was recently looking for the compiler version, but couldn't find it |
It would have to be quite precise, though. Currently, the first 0.2.1 release won't do due to the bugs | |
Kaj 16-Aug-2011 [2975] | Is there a limit to the number of arguments that can be passed to (variadic) functions? |
Dockimbel 17-Aug-2011 [2976] | In the current implementation for IA-32, arguments total size is limited to 255 bytes. No special limit is set on variadic functions other than that. |
Kaj 17-Aug-2011 [2977] | The number of arguments, or the combined size of the arguments? |
Dockimbel 17-Aug-2011 [2978x2] | Combined size on stack. |
Have you reached that limit? | |
Kaj 17-Aug-2011 [2980x2] | No, but I'm thinking about implementing dialects in typed function calls. :-) |
Would that work out to 30 arguments for a typed function? | |
Dockimbel 17-Aug-2011 [2982] | You should leave that to Red...I wonder if I didn't open a pandora box by allowing type to be passed with arguments...:-) |
Kaj 17-Aug-2011 [2983x2] | You're not going the Bjarne Stroustrup route where you declare RTTI evil, are you? ;-) |
I think typed data should be used everywhere. It's very useful in PRINT, isn't it? | |
Dockimbel 17-Aug-2011 [2985] | 30 arguments: that's 30 * 4 * 2 bytes = 240 bytes, so that should fit in. |
Kaj 17-Aug-2011 [2986] | Don't the count and the pointer count? |
Dockimbel 17-Aug-2011 [2987x3] | ah yes, you're right, there's more to add...let me see... |
hmm, I haven't looked correctly at the code, the stack limit is for local variables storage (255 bytes) not for function arguments. | |
Too many context switching today, I can't even properly read my own code comments. :-/ | |
Kaj 17-Aug-2011 [2990] | I once went on vacation for two weeks, and then stared at my code for a full day, fearing that I couldn't program anymore :-) |
Dockimbel 17-Aug-2011 [2991x4] | Unfortunately, my brain cells are too damaged by code to experiment such feeling. ;-) |
About RTTI: I don't know if there are good or evil, hard to say. Typed data could be generalized, opening a lot of new possibilities. I just haven't had the time to experiment it to see if it would bring more advantages than issues. Your (and others) feedback on that would be very useful to me. | |
Also for fixed arity functions, the function spec block might become quite verbose: foo: func [[typed] arg1 [...] type1 [integer!] arg2 [...] type2 [integer!]...] [ ... ] Maybe the type numbers could be packed in a byte array and passed as an array pointer to make it easier to declare and use...? | |
Something like: foo: func [ [typed] arg1 [...] arg2 [...] type [pointer! [byte!]] ][ ;-- type/1 => type of arg1 ;-- type/2 => type of arg2 ... ] | |
Kaj 17-Aug-2011 [2995] | I'm very pleased with the new typed functions, as they should enable small low-level dialects. What I've learned from REBOL is that typed data with a standardised type system is sufficient to implement simple dialects, and that these are very useful to keep interfaces compatible while evolving them, because it's much more flexible than a fixed number of arguments with fixed types |
Dockimbel 17-Aug-2011 [2996] | Don't you miss the word! datatype to implement dialects in Red/System? |
Kaj 17-Aug-2011 [2997x6] | I probably will, but you can always define a list of constants yourself |
I don't mean fullblown dynamic dialects, but a lightweight version for efficient low-level interfaces | |
I've implemented SDL events, including mouse input and key presses | |
Here's an SDL paint program: | |
#include %../SDL.reds log-error: does [ ; Log current SDL error. print [sdl-form-error newline] ] red: as-byte FFh green: as-byte FFh blue: as-byte FFh screen: as sdl-surface! 0 event: declare sdl-event! mouse-event: declare sdl-mouse-motion-event! either sdl-begin sdl-init-all [ screen: sdl-set-video-mode 640 480 32 sdl-software-surface either as-logic screen [ while [all [ sdl-await-event event event/type <> as-byte sdl-quit ]][ if event/type = as-byte sdl-mouse-moved [ mouse-event: as sdl-mouse-motion-event! event if as-logic (as-integer mouse-event/pressed?) and FFh [ unless plot screen mouse-event/x-y and FFFFh mouse-event/x-y >>> 16 red green blue [ log-error ] ] ] ] ][ log-error ] sdl-end ][ log-error ] | |
I hereby name it PeterPaint, after the friend whose birthday we're going to celebrate tomorrow :-) | |
GrahamC 17-Aug-2011 [3003] | should upload it to the red program repository |
jocko 18-Aug-2011 [3004] | +1 |
shadwolf 18-Aug-2011 [3005x4] | PeterPaint aaaaaaaaaaaaaaaaaaahahahaah ... PetPaint would have been out of limit ? |
hexadecimals used fort event trigger comparaison could be holded in a meaning word ? | |
Impresive Kaj can you do us a set of widgets in SDL or just the smallest possible VID and the widgets will be designed later | |
I really like the Idea of VID a single face that as all possibilities and you just activated /deactivate the parts you want or not this is for me the core meaning of VID. | |
Dockimbel 18-Aug-2011 [3009x2] | Looks very nice Kaj! Is your SDL binding available to download somewhere yet? |
Re RTTI: One drawback is that you loose arguments type-checking, so some errors won't be caught at compile-time. | |
Kaj 18-Aug-2011 [3011] | Yes, it makes things a step more dynamic, so you move some of the checking to runtime. But that's actually the point: you can then develop interfaces that can be loosely compatible with a time range of interface versions. It's the philosophy of static everything versus declarative everything in REBOL and XML. In the beginning of computing, static seemed more correct, but these days it has turned out that everything has to be able to withstand change as well as possible |
older newer | first last |