World: r4wp
[#Red] Red language group
older newer | first last |
Andreas 27-Feb-2012 [95] | (2/3 inline binding code and the rest is very plain OpenGL and, yuck, GLUT.) |
PeterWood 27-Feb-2012 [96] | Looks good and the code looks some much easier on the eye than C to me. |
GrahamC 27-Feb-2012 [97x2] | so what to add to be able to click on something and get a calback working? |
a few 1000s of LOC :) | |
DocKimbel 27-Feb-2012 [99] | That's where dialects can shine: abstract low-level APIs. |
TomBon 27-Feb-2012 [100] | andreas, cool! perhaps time to add GLFW? ;-) |
Andreas 27-Feb-2012 [101] | tombon: would most likely be better than glut :) |
TomBon 27-Feb-2012 [102] | events for free :)) |
Andreas 27-Feb-2012 [103] | ah, events are "for free" in glut as well :) |
TomBon 27-Feb-2012 [104] | as clean as in GLFW? argh.... ;-) |
Andreas 28-Feb-2012 [105x3] | didn't say anything about clean :) |
Just updated the Gist, you can now rotate using the arrow keys: https://gist.github.com/d3b0e5c6fdbc4f19ff7a | |
(Graham: +10 lines binding, +12 lines reds code) | |
GrahamC 28-Feb-2012 [108] | 2 factors overestimate by me :) |
Andreas 28-Feb-2012 [109x2] | 2 orders of magnitude! :) |
But then, you asked for clicking, and I only gave you typing :) | |
GrahamC 28-Feb-2012 [111x2] | yes what I meant ... |
10 x 10 x is two factors? | |
Andreas 28-Feb-2012 [113] | Had to enable double buffering to stop the flickering. Another 4 lines. |
TomBon 28-Feb-2012 [114] | harr..harr. andreas the human coding machine :)) |
Pekr 29-Feb-2012 [115] | Doc, do I understand it correctly, that lists/arrays are now supported via 'typed funcitonality, hence structs? How much would it complicate red/system to have a native block implementation? :-) |
Endo 29-Feb-2012 [116] | I'm sure Doc will answer this question as: "Red/System is for low level system programming, no need to implement blocks unless we need it while writting Red". :) I think blocks etc. is for Red not for Red/System. |
Pekr 29-Feb-2012 [117] | I know. OK, maybe I need an advice. I was looking into some C code educatory example, which contained something like: char multi[5][10]; decomposed to: multi[0] = {'0','1','2','3','4','5','6','7','8','9'} multi[1] = {'a','b','c','d','e','f','g','h','i','j'} multi[2] = {'A','B','C','D','E','F','G','H','I','J'} multi[3] = {'9','8','7','6','5','4','3','2','1','0'} multi[4] = {'J','I','H','G','F','E','D','C','B','A'} which gets stored in a memory block of a "0123456789abcdefghijABCDEFGHIJ9876543210JIHGFEDCBA" value. If I would be supposed (for any reason :-), to interface to such a construct, I would simply use a pointer in Red, and would be responsible to manually decompose/treat the value of arrays, not to break it for the C level code? |
Andreas 29-Feb-2012 [118x3] | Yes. (And there's hardly a breakage you could incur.) |
Note that in C, multidimensional arrays are really just a convenience. So a `char[5][10]` is actually identical in memory to a `char[50]`. | |
And, as you know, an array type and a pointer type are (for most things) interchangeable, a `char[50]` is the same as a `char*`, therefore a `char[5][10]` is also the same as a `char*`. | |
Pekr 29-Feb-2012 [121] | OK, thanks. So btw - how are REBOL blocks (most probably), implemented in the C level? As structs of "arrays", chars? |
Endo 29-Feb-2012 [122] | Andreas: No possibility to be multi[0] and multi[1] are not interleaved? I mean, couldn't be 2 different memory blocks instead of continues one? Normally it will char[50] but same for all compilers? all memory models? small hardwares etc.? |
Kaj 29-Feb-2012 [123x2] | Petr, it is true that typed function arguments can be used to implement blocks to some extent |
REBOL blocks have larger cells | |
Andreas 29-Feb-2012 [125] | Endo: it's guaranteed to be a single, contiguous area of memory. So yes, that behaviour is the case for all compilers and all memory models and all hardware (if they claim compliance with the C standard). |
DocKimbel 29-Feb-2012 [126] | Endo: thanks for avoiding me to repeat myself over and over. :-) |
Pekr 29-Feb-2012 [127] | When I will write app in Red, it will compile to Red/System in the first pass, and then to the native code from R/S? So that it means, that you write Red in R/S? Hmm, if Carl would release R3 sources, it would not help you much, as you plan to write Red in R/S, not C? |
DocKimbel 29-Feb-2012 [128x2] | Pekr: "Doc, do I understand it correctly, that lists/arrays are now supported via 'typed funcitonality" No, it can look like "lists", but there are only function calls with arguments. |
Arrays might be supported in future though, if we really need them for implementing Red. | |
Kaj 29-Feb-2012 [130] | If you make an array of typed structs, you effectively have a block |
GrahamC 29-Feb-2012 [131] | from the mailing list http://www.arnoldvanhofwegen.com/pics/banners/redlang.png |
Pekr 29-Feb-2012 [132] | What is that? :-) |
GrahamC 29-Feb-2012 [133] | someone's idea of a banner for red supporters |
Steeve 29-Feb-2012 [134] | uglyyyyyyyyyyyyyyyyy :-) |
GrahamC 29-Feb-2012 [135] | do better |
Pekr 29-Feb-2012 [136] | I do like work of one Agency here - http://loganamiru.cz/, they did my 2zone media :-) |
Steeve 29-Feb-2012 [137] | C'mon Graham, I'm not a graphic designer but people still have some common artistry. :-) |
Pekr 29-Feb-2012 [138] | I like e.g. part of this one -if you would turn the arrows 90 grades, it could imitate REBOL prompt sign >> RED - http://www.logofactory.cz/msys/uploads/logos/48.jpg |
GrahamC 29-Feb-2012 [139] | we could ask Fork ... if he's still around |
Gregg 29-Feb-2012 [140] | A simple vector style of Red Riding Hood's hood, maybe with one twinkling eye peeking out, and the tag line "Don't be afraid". :-) |
GrahamC 29-Feb-2012 [141x2] | or ...Judy Garland's slippers ... make a wish :) |
( Dorothy in Wizard of Oz and sorry they were ruby red slippers ) | |
Pekr 29-Feb-2012 [143] | We can't work like that imo :-) I went thru the process several times. We have to define qualities we want to reflect, etc. But RED, red is "just" a color. What can represent that? Something red, perhaps :-) |
GrahamC 29-Feb-2012 [144] | symbolism is that your wishes will be granted if you try hard enough, and the impossible is possible. We don't need the wizard of oz to help us. |
older newer | first last |