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

World: r4wp

[#Red] Red language group

DocKimbel
16-Aug-2012
[1014]
It does abstract everything that can be abstracted, currently, IIRC, 
only FPU options (system/fpu/* properties) are platform-specific.
ACook
16-Aug-2012
[1015]
One thing I'm torn on when it comes to VMs is if I need to write 
my own at all. I know I will have to write a Bootstrapping language 
as an intermediary, but I'm thinking it might be a waste of time 
when LLVM has such aggressive optimization for compilation and also 
supports JIT - both of which I'd have to write myself otherwise.
DocKimbel
16-Aug-2012
[1016]
LLVM is a good choice if you really want a VM (Red/System is more 
a standalone language than a VM).
ACook
16-Aug-2012
[1017]
Of course.
Jerry
16-Aug-2012
[1018x2]
Yes Jerry wants that.
for making Chinese Alias
BrianH
16-Aug-2012
[1020]
Doc, aliases are used in R3 internally to implement case-insensitive 
words. Explicit use of the ALIAS function is rare and unsafe though, 
so it's been recommended that the function be removed.
PeterWood
16-Aug-2012
[1021]
How much of an overhead is there from using this mechanism over alias:

  my-alias-of-print: :print
DocKimbel
16-Aug-2012
[1022x2]
No overhead, but it's not equivalent to an alias.
Brian: I think that was the case for R2 too? I used the same trick 
in r-sharp, so ALIAS was coming almost for free.
Robert
17-Aug-2012
[1024]
Isn't Red/System more the runtime environtment for Red? Like for 
Smalltalk or Oberon systems?
PeterWood
17-Aug-2012
[1025x2]
No, I don't think so. The Red runtime is written in Red/System. Red/System 
compiles to machine code.
I suspect that the Red runtime will be linked into Red executables 
rather than exist as a separate file.
BrianH
17-Aug-2012
[1027]
Doc, aliases weren't used that way in R2. R2 stores the word strings 
using the case that the word was first loaded in. When you load subsequent 
words of the same name, they display with the case that the first 
one had. In R3 words are case-preserving, displaying with the case 
they had when they were loaded, even if other words with the same 
name have different cases. I prefer the R3 method, it's a good system, 
though it does lead to some confusion from people used to R2. For 
instance, they compare like strings:
>> 'a = 'A
== true
>> 'a == 'A
== false
>> 'a =? 'A
== false
DocKimbel
17-Aug-2012
[1028]
Peter: exactly.
Gabriele
18-Aug-2012
[1029]
Brian, that was REBOL 1. REBOL 2 is case preserving.

>> [a A ab Ab aB AB]
== [a A ab Ab aB AB]
Robert
18-Aug-2012
[1030x3]
Well, IMO than it's not really so clearly stated. Taking a look at 
chart 10, confuses me.  Maybe it's the wording. Doc, I would simplify 
all this to more commone terms to make it as simple as possible for 
new users.
So, Red Compiler is like the first C++ compilers that emitted C code, 
but emits Red System language?
A reduced dialect?
Kaj
18-Aug-2012
[1033]
Yes, except that Red/System is designed to fit Red, and Red will 
pass code to Red/System efficiently in loaded block form, instead 
of text form that the C compilers had to parse again
PeterWood
18-Aug-2012
[1034]
Robert, Nenad's intial plan was for the Red compiler to directly 
generate machine code. So his first presentation reflects that. It 
was a few months after the launch that he decided to generate Red/System 
code from the Red compiler.
Robert
19-Aug-2012
[1035]
Ok, IMO it just needs to be made more clear. I'm confusig it after 
not tracking this here for a time. Just make things as simple as 
possible.
DocKimbel
19-Aug-2012
[1036x3]
Robert: C++ is a superset of C. Red is not a superset of Red/System, 
they are two different languages that share the same syntax and superficially, 
some semantic rules. Red/System is a low-level dialect of Red than 
enables system & hardware programming with C-level performances. 
Additionally, Red/System is used to build Red runtime (memory manager, 
lexer, natives,...).
Merged namespaces branch with master branch.
Kaj: I'll give tonight a quick try to add namespaces support to aliases, 
then I'll make the 0.2.6 release.
Kaj
19-Aug-2012
[1039]
Cool :-)
DocKimbel
19-Aug-2012
[1040x3]
Kaj: aliases are now namespace-aware! ;-)
But I'm not 100% confident that my changes cover all possible use-cases, 
so I'll delay the 0.2.6 release until tomorrow night to give us time 
to test it better.
In the meantime, I'll also have a look at the compilation target 
folder issue you've raised.
Kaj
19-Aug-2012
[1043]
By the way, it's also about compilation source. If your source is 
in your working directory, you still have to provide the full path
Andreas
19-Aug-2012
[1044x2]
Kaj, for compilation or for including?
I think rsc.r should work fine with relative paths.
Kaj
19-Aug-2012
[1046x2]
Compiling; relative paths do work for including
The GTK binding doesn't work anymore
Andreas
19-Aug-2012
[1048]
Compiling with rsc.r works fine with relative paths; where do you 
encounter problems?
Kaj
19-Aug-2012
[1049]
It doesn't work for me, on Linux
PeterWood
19-Aug-2012
[1050x3]
Or for me on OS X :

Schulz:Red peter$ rebol -qs red-system/rsc.r red-system/tests/hello.reds

Cannot access source file: red-system/tests/hello.reds
If you login to red-system dir compiling tests/hello.reds will work.
I presume Kaj's issue is having to cd to the red-system dir before 
compiling (it is a bit of a pain).
DocKimbel
20-Aug-2012
[1053]
The GTK binding doesn't work anymore
 Was it working before my changes on aliases?
Kaj
20-Aug-2012
[1054x3]
Yes, I reported it in the tracker
Peter, I had automated switching directories in a wrapper script, 
but I don't seem to have to do that anymore in the current version
I can start rsc.r from any directory, but then it fails to find the 
source file in that directory
DocKimbel
20-Aug-2012
[1057]
Kaj: the issue has been fixed.
Kaj
20-Aug-2012
[1058x2]
For some odd reason, it does indeed work if I switch manually to 
the directory holding rsc.r
Thanks!
DocKimbel
20-Aug-2012
[1060]
Kaj: I've tried compiling from different folders (out of Red/ tree), 
with both absolute and relative paths to %rsc.r, the compilation 
goes well. The only issue I see is that the final binary is in Red's 
%builds/ instead of local folder. I guess I should change that to, 
by default, output the binary to same folder as program source code.
Kaj
20-Aug-2012
[1061x2]
Why not simply the working directory? That's the common way compilers 
work
That also means you don't want to change into the Red tree to start 
the compiler
DocKimbel
20-Aug-2012
[1063]
Working directory: sure we can do that.


DO is automatically doing a CD to the argument script's folder, it's 
not the %rsc.r script.