r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Red] Red language group

Kaj
26-Jan-2012
[4500]
I still have that feeling every time I see it
Pekr
26-Jan-2012
[4501x2]
I don't remember anymore. Not liking the word much, as well as another 
funct, func, etc.
I am just sure, if there is going to be so much of a distinction 
between the Red/System and Red itself. I think I am well aware of 
the difference. But - why would anyone use Red/System, without wanting 
 to use Red, which will have some compatibility level?
Dockimbel
26-Jan-2012
[4503x2]
To a lesser extent, I had also a weird feeling with FUNC word, but 
it vanished rapidly, I'm very used to it since years now.
The distinction between Red and Red/System is almost as big as between 
REBOL and C.
Henrik
26-Jan-2012
[4505]
I accepted PRIN the first time I saw it, just going "oh" and memorized 
it for what it did. I don't agree that Red being a fundamentally 
different language means that you must rename trivial functions. 
That just means there are more differences to learn.
Pekr
26-Jan-2012
[4506]
that's it - you just get used to it. Now imagine your source code 
- if Oldes is right, then 99% of time you are going to see print-line, 
instead of print, in your source code. Well, it depends how often 
do you actually print :-)
Kaj
26-Jan-2012
[4507]
It's a more common way of abbreviating than leaving off one letter. 
Still, I changed all my FUNCs to FUNCTIONs in Red/System
Dockimbel
26-Jan-2012
[4508]
Red/System is aiming at being a dialect living inside Red, for system 
and bare-metal programming.
Oldes
26-Jan-2012
[4509]
I accepted PRIN as well... and as I said, it's usage is really rare. 
I would prefere PRINT to do line break.
Pekr
26-Jan-2012
[4510]
Doc - yes, but as I said - will there be many users, using just Red/System, 
not using Red, and vice versa?
Dockimbel
26-Jan-2012
[4511]
Everyone will use Red, some library developers or system programmers 
will also use Red/System.
Pekr
26-Jan-2012
[4512]
If not, the mindset is closer than you might think. If someone is 
going to use only Red/System, which you claim being closer to C than 
Red, than such person can just use - a C :-)
Oldes
26-Jan-2012
[4513]
I will not use print-line for sure:)
Dockimbel
26-Jan-2012
[4514]
You have ?? instead. ;-)
Pekr
26-Jan-2012
[4515]
But - as Red/System is mostly out of my scope, I will acept any decision 
...
Dockimbel
26-Jan-2012
[4516]
Also, it's too early in the project to be nitpicking, you'll have 
plenty of time for that when Red will be out. ;-)
Pekr
26-Jan-2012
[4517x2]
Will some alpha Red come in 2012?
That's what I said -not an important issue, I just wanted to state 
my opinion, that 'print, if used in 80+ cases with new line, should 
do so :-)
Oldes
26-Jan-2012
[4519]
Do you want to use ?? in RED as well? Because as Pekr said, it will 
just cause confusion... I have enough problems not to write TRACE 
instead of PRINT :)
Kaj
26-Jan-2012
[4520x2]
There are other ways of looking at it. For example, code is read 
most of the time rather than written. PRINT-LINE is very clear for 
reading
Another view is that a very small audience of REBOL programmers is 
used to PRIN. The big audience for Red is people that don't know 
or even dislike REBOL
Pekr
26-Jan-2012
[4522]
Kaj - yes, most of ppl are used to print, which will almost not be 
used, as it does not print a newline - that is also another point 
of view at it :-)
Kaj
26-Jan-2012
[4523]
By most of people, you mean REBOL people
Pekr
26-Jan-2012
[4524]
yes, because most Red/System users, are going to be also a Red users. 
Red/System is not for C ppl, that is an illusion imo. Why would anyone 
C oriented would like to use Red/System, if he/she would not also 
want to use Red later? :-)
Ladislav
26-Jan-2012
[4525]
REBOL itself is incompatible between R2 and R3
 - counterexamples:


- my INCLUDE is a complicated script that is working in both environments, 
i.e., the compatibility surely isn't "incidental" in your own words

- the core-tests suite is working in both environments as well, containing 
more than 3000 interpreter tests
Kaj
26-Jan-2012
[4526]
Do you mean that's proof that R2 and R3 are compatible?
Ladislav
26-Jan-2012
[4527]
What else should be?
Pekr
26-Jan-2012
[4528]
Well, now I restrain ... I am most probably not going to be a fluent 
Red/System user, so I don't want to influence such a decision, if 
other ppl feel differently about the topic ...
Kaj
26-Jan-2012
[4529x2]
I'll have to refer you to Boolean algebra
Also, I didn't say "incidental" about R2 and R3, I said it about 
Red and REBOL
Ladislav
26-Jan-2012
[4531]
Well, I can describe more compatibility examples like Brian's backward 
compatibility library, but I think it is absolutely unnecessary having 
mentioned the common interpreter core tests. However, I am curious 
how is that related to Boolean algebra?
Kaj
26-Jan-2012
[4532x2]
Your statement seems to be that R2 and R3 are compatible. Examples 
cannot prove that. Counterexample falsifying that: for my CMS of 
towards 4000 lines, although I wrote it in basic R2 to avoid porting 
issues, I had to make extensive changes throughout and a number of 
alternative functions and wrappers to get it to work on R3
The other way around, there are web sites I can build correctly on 
R3 but not correctly on R2
Andreas
26-Jan-2012
[4534x2]
To put my two cents in: I disliked PRIN the first time I saw it, 
and I still dislike it everytime I have to use it, 10+ years later.
I also find myself using PRIN regularly (i.e. much more than 1% of 
the time I _don't_ want to print a newline right away).
Dockimbel
26-Jan-2012
[4536]
Pekr: I fully agree with the 80% (or 99%) usage argument, the issue 
is not there, it is in finding a suitable name for "print-without-LF" 
if PRINT is used for printing with LF. Last time we tried that, we 
didn't find any good solution, so we ended up with a single PRINT 
command to cover all use cases.
GrahamC
26-Jan-2012
[4537x3]
the name has to be similar but suggest it is somewhat less .. so 
how about -print ?
or, print-
I suspect that is why the t is missing for 'prin ... but then you 
have to know what it stands for
Kaj
26-Jan-2012
[4540x2]
I've renamed the print-string in the C library binding to make way 
for the Red/System one
Sorry, print-line
Dockimbel
27-Jan-2012
[4542]
Thanks Kaj, I forgot it was defined also in C binding.
Oldes
27-Jan-2012
[4543]
Is there any doc how to write a test case? Or should I just hack 
it somehow?
Dockimbel
27-Jan-2012
[4544x2]
The testing framework done by Peter WA Wood is documented here: http://static.red-lang.org/red-system-quick-test.html
You can also browse inside %red/red-system/tests/source/ to see how 
tests are done. Basically:

- language unit tests go in %tests/source/units/<feature_name>-test.reds

- compilation passing tests and compilation error tests go in %tests/source/compiler/<feature_name>-test.reds
PeterWood
27-Jan-2012
[4546x2]
There are two additional assertions in the float-partial branch that 
you might find useful Oldes. They aren't in the documentation yet. 
They are:


--assertF~= which takes three float!s, it compares the first two 
to be equal within a tolerance supplied as a third argument. The 
tolerance is both an absolute and relative tolerance. So, a tolerance 
of 0.01 would return true if the two floats were equal + or - minus 
0.01 or within 1 percent.

I have used a tolerance of 1e-12 in testing.
The other one is --assertF32~= which is the equivalent for float32! 
datatypes. I have used a tolerance of 1E-6 with this assertion.
Oldes
27-Jan-2012
[4548x2]
I would like to write tests for enumerations: https://github.com/dockimbel/Red/pull/201
(still not finished - I must add detection if values does not exists 
already)