World: r3wp
[Red] Red language group
older newer | first last |
BrianH 2-May-2011 [1355] | Shad, typed variables with type inference handles the readability/maintenance problem pretty well, which is why several statically typed languages have been retrofiting type inference into them recently. Fortunately, Red is planned around that from the start. Your "predictable type variable" proposal (I don't know the standard term either) sounds useful. Many languages do this through reflection facilities, but that kind of thing requires dynamically typed variables at least as an option if you are going to use the reflection facilities of the language you are interfacing with - this is necessary for C++ at least because there isn't a shared standard for encoding that information in a static way. It would be more useful for integrating with .NET or CORBA objects, since direct field access is prohibited anyways for those so there's no extra overhead in the field access itself, just in the runtime discovery, and ahead-of-time static compilation has shared rules that work on a binary standard. |
Awi 2-May-2011 [1356] | Somebody created an open source .NET Micro Framework port to Arduino http://netduino.com/netduino/specs.htm. It's an ARM7 based microcontroller. Is it possible that someday Red would be available on this platform (Reduino sounds really good)? Just dreaming... How would I start, if I could help? |
Dockimbel 3-May-2011 [1357] | Awi, that would be great, I would love to see Red run on such platform but I'm afraid Red's memory footprint would be a bit too high for a 60KB of RAM (but this might be specific to the netduino platform?). OTOH, Red/System compiler should work nicely there. If you want to help for such port, we need two things: - a target file format emitter (I guess it would be the firmware file format) - a native ARM7 code emitter as Red/System back-end. Let me know if you want to start working on these parts, I would provide additional documentations. |
Awi 3-May-2011 [1358] | I think Red/System is already much better than .Net or C. I will look into both things you mentioned, but to be honest I have zero experience on porting. But let me see what I can do. |
Dockimbel 8-May-2011 [1359] | I think I am going to port Red to this USB key size platform, once available: http://www.raspberrypi.org |
onetom 8-May-2011 [1360] | nice machine... i would love to try |
Kaj 8-May-2011 [1361] | Neat gadget, but Ubuntu is going to bog it down |
Dockimbel 8-May-2011 [1362] | I would install a Damn Small distro instead. |
onetom 8-May-2011 [1363] | doc: khm, u wanted to say syllable, right? ;) |
Dockimbel 8-May-2011 [1364] | Sure! =) |
Kaj 8-May-2011 [1365] | We'd have to port to ARM first |
onetom 8-May-2011 [1366x2] | i was thinking about syllable server. what has to be ported on it to arm? if u ubuntu runs on this thing, then the kernel and c compiler shouldnt be an issue |
no altme though... i can't use it as my development machine then ;D | |
Kaj 8-May-2011 [1368x3] | We've had a pattern of people who came to our mailing list shouting enthusiastically that they had found out that the "GNU C compiler" would compile to PowerPC or something, that they would compile Syllable to it over the weekend and report afterwards |
We never heard from such people again | |
Sure most parts of Syllable Server have been ported to ARM in other projects, but porting the system will be many man months of work at best | |
onetom 8-May-2011 [1371] | thats why i was asking which parts are the problematic. i was just wondering if there is already an ubuntu running on that thing, then probably most of the build tools for syllable server are ready |
Kaj 8-May-2011 [1372x2] | It's not that any of the parts is particularly problematic, it's that it's an awful lot of work with today's software bloat |
And if you don't know all the parts intimately, they can easily pose a big problem to a particular developer | |
onetom 8-May-2011 [1374] | ok, got it. i was building lfs back then , so i know what u r talking about |
Kaj 8-May-2011 [1375] | Then you know that the ports of LFS to various architectures are separate projects, that are partly rearchitected |
onetom 8-May-2011 [1376] | i was just trying the x86 version, but i can imagine |
Kaj 8-May-2011 [1377] | It can easily take me half a year to create a next version of Syllable Server, and that's on the same architecture |
Pekr 9-May-2011 [1378] | Doc - there is many such small platforms, even x86 based IIRC. Gumstix is e.g. for real, a bit pricey, but definitely not vapor - http://www.gumstix.com/store/catalog/product_info.php?products_id=256 |
Dockimbel 9-May-2011 [1379] | Right, but not at $25 (the one you posted is sold $229). |
Pekr 9-May-2011 [1380x3] | Right, but is sold right now, without the "we plan to develop" attitude :-) |
I personally bought Beagleboard. Pandora Board might be even better .... | |
Small enough for us. | |
Kaj 9-May-2011 [1383] | I think we can have faith in David Braben |
Kaj 10-May-2011 [1384x2] | I have updated the 0MQ binding to the latest Red version, and moved it to a Fossil repository: |
http://rebol.esperconsultancy.nl/Red-ZeroMQ-binding | |
Dockimbel 10-May-2011 [1386x3] | Thanks, will test is tomorrow. |
From sources: "libzmq.dll" cdecl [ ; stdcall for Windows? => should be cdecl, stdcall is used in Windows DLL (and rarely by C libs). | |
vsm-data1 [integer!] ; unsigned char [ZMQ_MAX_VSM_SIZE] (default 30) => we will need a better way to handle such arrays when interfacing with third-party libs... | |
Kaj 10-May-2011 [1389x2] | Yes |
I found the same info that Windows system libraries use stdcall, but that MSVC defaults to cdecl. I had been compiling the binding with stdcall, and both work. I standardised on cdecl and retained the comment for the moment being | |
Kaj 19-May-2011 [1391x3] | I'm getting this: |
Compiling /users/administrator/Red/Red-ZeroMQ-binding/examples/reply-server.reds ... *** Compilation Error: invalid struct syntax: [pointer!] *** in: %/users/administrator/Red/Red-ZeroMQ-binding/examples/../ZeroMQ-binding.reds *** at: [struct [ content [pointer!] flags [byte!] | |
What's the new syntax for a pointer field in a struct? | |
Dockimbel 19-May-2011 [1394x2] | pointer! [integer!] |
Actually it isn't a new syntax, it's just that the compiler wasn't checking it deep enough until now. | |
Kaj 19-May-2011 [1396x2] | Shouldn't an actual pointer! type be possible? |
What you're saying, that's a pointer to an integer, right? But I need a pointer to a bigger memory area here | |
Dockimbel 19-May-2011 [1398x2] | Pointer! alone is equivalent to an integer, it just represent an address, but can't be dereferenced. |
If you are just passing the pointer! reference but never dereferencing it, you could just use integer! instead (or c-string!). | |
Kaj 19-May-2011 [1400x2] | Yes, it's just to reserve the space for a pointer that's used by 0MQ, but not by Red |
I'm trying to use pointer! as much as possible instead of integer! because it makes clear that we're talking about an address size, not what happens to be the compiler's integer size | |
Dockimbel 19-May-2011 [1402x2] | Agreed. You could also use aliased types for that: handle!: alias integer! or void-ptr!: alias integer! Aliased typed are not yet fully supported nor tested, but it should work fine in your case. |
Sorry, I meant: handle!: alias pointer! [integer!] or void-ptr!: alias pointer! [integer!] | |
BrianH 19-May-2011 [1404] | You might want to avoid using handle! for these, as it is the best candidate for the opaque-pointer-sized-value type in Red proper, that all of Red/System's pointer! types would appear to be when they leak into Red code. |
older newer | first last |