• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r4wp

[#Red] Red language group

Endo
21-Jun-2012
[570]
we can copy/paste "about" section from http://www.red-lang.org/p/about.html
as well.
Kaj
21-Jun-2012
[571]
Be careful with that. The Red site is speaking in the future. Wikipedia 
will not regard that as encyclopedic information
Endo
21-Jun-2012
[572]
I see. So we will put those information after Red is completed.
Evgeniy Philippov
22-Jun-2012
[573x2]
It would be interesting for RED to be a strict superset of REBOL...
It is interesting what does DocKimbel think about such possibility...
Kaj
22-Jun-2012
[575]
You're right: as a compiler, it can't be
DocKimbel
27-Jun-2012
[576x2]
Bas: great work, thank you!
Evgeniy: I am not sure if a strict superset of REBOL is doable in 
Red without introducing some important runtime overhead, making the 
compilation approach much less efficient, so less useful. I'll try 
to push it as far as possible and will stop when we loose too much 
performances.
Pekr
27-Jun-2012
[578]
Hello Doc - how are you doing, lately? Still busy with the non-red 
related contract? :-)
DocKimbel
27-Jun-2012
[579]
Unfortunately yes, but it should end in about ten days, so I could 
finally get back to the interesting stuff. I'm becoming an MQL4 language 
expert now, and I really don't like that (even if it can make me 
see some interesting niche opportunities for a Red dialect). ;-)
Pekr
27-Jun-2012
[580]
Well, as for dialects, I still can see PARSE as a secret weapon. 
Hopefully Red gets to R3 or Topaz level, as far as parsing goes. 
We could create some dialects for niches, I think ppl would see the 
advantage ...
Rebolek
28-Jun-2012
[581x2]
It's possible to do something like [s: make c-string! 1000] in Red? 
So I would reserve 1000 bytes long c-string?
I tried declare but that leaves me with empty c-string!
PeterWood
28-Jun-2012
[583]
I haven't found away to pre-allocate memory for a c-string! in Red/System 
except by initialising a string.
Rebolek
28-Jun-2012
[584]
ah, that's unfortunate. thanks
DocKimbel
29-Jun-2012
[585]
Red/System has no memory manager. You need to use the allocate/free 
wrappers provided by the runtime (see %Red/red-system/runtime/libc.reds). 


Once Red's memory manager will be stable, we could easily add some 
simple functions to make it available from Red/System too, so you'll 
be able to either manually manage memory or rely on Red's memory 
manager (including being able to call the GC).
Rebolek
29-Jun-2012
[586x2]
Ah, great! Thanks.
How can I get address of c-string! variable?
DocKimbel
29-Jun-2012
[588]
c-string! variables are memory pointers, so you're already manipulating 
the address. ;-)
Rebolek
29-Jun-2012
[589]
yes, but if I want that adress for another purpose like copy-memory 
function?
DocKimbel
29-Jun-2012
[590]
Just pass the variable name.
Rebolek
29-Jun-2012
[591]
I tried but ended with:

*** Compilation Error: argument type mismatch on calling: copy-memory
*** expected: [pointer! [byte!]], found: [c-string!]
DocKimbel
29-Jun-2012
[592]
You need to make a type casting: as byte-ptr! <variable>
Rebolek
29-Jun-2012
[593]
ah, thanks!
DocKimbel
29-Jun-2012
[594]
byte-ptr! is just a macro for [pointer! [byte!]] which is a bit more 
generic type than c-string!
Rebolek
29-Jun-2012
[595x2]
yes, that works. Thanks very much!
another question :) how to get pointer to integer! ? as byte-ptr! 
converts the value and doesn't return address.
DocKimbel
29-Jun-2012
[597x3]
just use: as-integer <byte-ptr! variable>
Ah sorry, not what you asked for...
The get-word! syntax for integer! variables hasn't been implemented 
yet. So currently, the only way (AFAIR) is to wrap your integer! 
in a struct! (as you would do in REBOL).
Rebolek
29-Jun-2012
[600]
I see, thanks.
Kaj
29-Jun-2012
[601x2]
There are several *-reference! types defined in my C library binding 
that do that:
integer-reference!:				alias struct! [value [integer!]]
GiuseppeC
5-Jul-2012
[603]
Hi Doc,

   I have found the time to view the documentation of RED/System on 
   your site.

   Red/system brings the expressiveness of REBOL in a low level language.

   I see there is no object orientation capabilities into this language. 
   Is it planned ? Otherwise, as a programmer, why you dont find it 
   usefull ?
Endo
5-Jul-2012
[604]
I think it is planned for Red as Red/System is a low level system 
language.
GiuseppeC
5-Jul-2012
[605]
Endo, I know it will be available in Red as it will inherit many 
REBOL features.

My question is for curiosity. Why a programmer chose to not put into 
his low level language OOP features like in C++ (I am not talink 
about full OOP but a basic subset)
Is this OOP really crap ?
Endo
5-Jul-2012
[606x2]
OS APIs and systems don't need that feature. And C++ is not that 
low-level, as you need to use C if you want to use WinAPIs or kernel 
functions.
OOP is a high level feature and no use in low level APIs.
Is this OOP really crap?
 I don't Doc thinks like that, but let him answer.
Pekr
5-Jul-2012
[608]
What I would welcome though is some series capabilities, even blocks, 
traversal, etc. Doc says, it will come via Red. The question is, 
for low level wrappers, if such concept would be usefull or not?
PeterWood
5-Jul-2012
[609]
I believe that it will be possible to access all Red datatypes from 
Red/System via the Red Memory Manager (which is being built in Red/System). 
I doubt that Red/System will have any built-in functions to traverse 
and manipulate series though.
Endo
5-Jul-2012
[610]
I don't think it is useful for Red/System, look at Kaj's bindings, 
its all system structures, API calls, enumerations and a few functions.

When we have Red we (or someone) can write wrappers in Red, so "normal" 
users will not need to use Red/System.

And there is no use series etc. kind of high level features in bindings/API/kernel 
calls.
DocKimbel
5-Jul-2012
[611]
No object! nor series! support planned for Red/System, remember that's 
supposed to be just a low-level dialect callable from Red meant for 
system programming. However, as Peter mentioned, it will be possible 
to access Red values and actions (mainly series and I/O actions) 
from Red/System when deeper interfacing with Red is needed.


OOP is just not necessary to Red/System, only code and data encapsulation 
is IMO worth adding in the form of a module system. I'm not a big 
fan of intensive use of OOP, as done in C++ or Java (or I'm probably 
just repelled by class-based OOP). I find prototype-based OOP (REBOL, 
Javascript,...) much more appealing and will support it in Red.
Henrik
5-Jul-2012
[612]
As far as I observe, many people are not keen on the C++ implementation 
of OOP, anyway.
GiuseppeC
5-Jul-2012
[613]
Hi Doc,
   I have started the topic just to read your opinion.

   I also have a question. Rebol has manual delegation. Some find useful 
   to have automatic delegation. Which is your opinion about this for 
   RED  ?
DocKimbel
5-Jul-2012
[614]
By "automatic delegation" do you mean implementing a class-based 
object system? I thought about adding a class! datatype to Red at 
the beginning, but I'm really not convince that would be a wise move.
GiuseppeC
5-Jul-2012
[615]
Doc, I mean calling a method when a value inside an object is set 
or read.
DocKimbel
5-Jul-2012
[616]
Right, yes, that's a feature I was planning to have in Red (didn't 
know that it was called formally "automatic delegation").
GiuseppeC
5-Jul-2012
[617]
Doc, someone else told me (as far I remember BrianH). I could be 
wrong !
DocKimbel
5-Jul-2012
[618]
A good and non-ambiguous syntax would be needed for that though.
Kaj
5-Jul-2012
[619]
I thought about implementing some basic series functions in Red/System, 
but they would be primitive and hardly used once the Red memory manager 
is available. There could still be a place for them in low level 
coding, but right now it doesn't justify the effort for me