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

AltME groups: search

Help · search scripts · search articles · search mailing list

results summary

worldhits
r4wp5907
r3wp58701
total:64608

results window for this page: [start: 1301 end: 1400]

world-name: r4wp

Group: #Red ... Red language group [web-public]
Arnold:
17-Sep-2012
I'll finish my new CMS first, or I should say publishing system together 
with the scripts I put on rebol.org lately. Then I will be able to 
publish code and story easier within my pages. I don't want the massive 
make-doc-pro and makedoc2 isn't my flavor. The ancient version from 
Chris Ross-Gill looks good but has some choices I dislike. So I am 
struggling with it too make it easy to use and with it I want to 
be able to generate a pdf version using Gabriele's pdf-maker script.
Pekr:
17-Sep-2012
just one link - to the github red site ... then user should orientiate 
himself there ... nowadays visiting Red-lang.org does not suggest 
clearly, where one could get Red to give it a try ....
DocKimbel:
17-Sep-2012
I admit git is not an intuitive tool and it can be a PIA sometimes...but 
Github is the place to be and it's an invaluable tool for collaborative 
coding.
Kaj:
17-Sep-2012
In my Syllable build recipe you can see that you can download the 
current state of a branch the same way:
Kaj:
17-Sep-2012
I'm sure it's confusing by design, so that Doc can make a living 
selling single downloads ;-)
Kaj:
17-Sep-2012
Kaj: I might make macros context-sensitive, but I don't see what 
more I can do. The point of #system is to write Red/System code within 
the 'red context, so naming should be done carefully to avoid conflicts. 
But with a few context wrappers, you should be able to solve that, 
no?
Kaj:
17-Sep-2012
As I said, wrapping a binding in a context isn't enough, in the first 
place because #define's remain global. Making them context sensitive 
would help a lot, because they're currently the most primitive construct 
in Red/System
Kaj:
17-Sep-2012
The other big part of the problem is that we have two languages now, 
Red built on top of Red/System, while they're so similar that they 
will often use the same names for slightly different concepts. With 
the bindings, one builds a world on top of Red/System, but the biggest 
parts of them should also be usable in the world one builds on Red, 
without making them look butchered when programming in Red/System
DocKimbel:
17-Sep-2012
I should be able to find a solution for that need tonight.
Kaj:
17-Sep-2012
That would be great. Otherwise I don't have a presentation :-(
DocKimbel:
17-Sep-2012
Ok, I've added (not pushed yet) a new directive for including Red/System 
libs outside of 'red context. Example:

	#system-include [%tests/hello.reds]


will load and compile the hello.reds script. Notice that relative 
include paths are resolved from Red/System root folder (%Red/red-system/).

Does that cover your need Kaj?
Kaj:
17-Sep-2012
By the way, I think we should eventually have a search path for includes, 
but that's for the future
DocKimbel:
17-Sep-2012
context-sensitive #define: seems to be a complicated change as it 
is the heart of the preprocessor...but context are created only during 
compilation (so after preprocessing).
DocKimbel:
17-Sep-2012
No, trivial, I would then just remove #system-include and add an 
option to #system to have the code loaded outside of 'red context...but 
semantically, it will be a bit inconsistent with barebone #system, 
as it means "inline the Red/System code here"...Maybe I should just 
rename #system-include to solve that.
Kaj:
17-Sep-2012
Why does it require a block?
Kaj:
17-Sep-2012
There's an extra problem when I wrap the C binding in a context, 
but that seems unrelated
Kaj:
17-Sep-2012
It's worse than that. The first error I get is on one of my #define's 
that's a struct! later in Red
DocKimbel:
17-Sep-2012
Added new actions: AT, SKIP, BACK, NEXT, LENGTH-OF.

You can now do a bit more than just PRINT 1. ;-) See:

	a: 123
	a: a + 2
	print a * 6 - a

	b: [4 7 9 [11] test /ref 'red]

	print pick b 2
	print pick pick b 4 1
	print pick next b 1
	print pick next next b 1
	print pick back next b 1

	print length-of b
	print length-of next next b
	print length-of pick b 4
	print pick at b 2 1
	print pick skip b 2 1

	print pick at next b -1 1
	print pick skip next b -1 1
DocKimbel:
18-Sep-2012
About your proposition:


- #include is for including files, not for inlining literal code, 
which is precisely the purpose of #system* directives.


- you can't use #include to include directly two different languages, 
that would be confusing for everyone and it's a semantic mismatch 
(making users think Red/System code can be directly used in Red with 
no clear separation between the two).


- #include is a preprocessor directive, #system is a compiler directive 
(processed during compilation)


- #system* directive are not complicated nor confusing, they are 
pretty simple and should look intuitive to C users (having the habit 
to inline ASM code into C). Those users are the target users for 
Red/System (remember that most Red users will never program in Red/System).
Pekr:
18-Sep-2012
Well, not coming from C kind of languages, I actually used code inclusion 
rarely. The preprocessing stuff in any language looks arcane to me, 
but that's just my feeling, as it is REALLY a long time ago, since 
I used code -> compile -> link technique (CA-Clipper - 1998 :-)


So I better wait for more "clean" way - the other method you described 
- simply what I am expecting is kind of Rebcode - writing any function 
in Red, using Red/System or C or ASM, whatever :-) But most probably 
I am confusing and create a mishmatch even in such case :-)
DocKimbel:
18-Sep-2012
Inline ASM: we might add that at some point, but you can already 
access some low-level CPU/FPU features (like stack manipulation). 
I will extend that in the future to support CPU in/out commands and 
direct registers reading/writing, so ASM support will be less necessary. 
Also, there's a cheap way to support it, adding the option to inline 
machine code directly in Red/System code flow (you would have to 
use an external ASM for generating the machine code). Something like: 
inline #{....machine code...}
DocKimbel:
18-Sep-2012
Secret project: that's a secret! (there's actually two secret projects, 
one by Kaj, one by me ;-))
Kaj:
18-Sep-2012
I'm trying to wrap my GTK dialect in a context, but I'm hitting more 
context bugs
Kaj:
18-Sep-2012
So it's going to be a traditional Red/System presentation, with little 
Red and contexts
DocKimbel:
19-Sep-2012
I've been very busy since yesterday on a new tool for Red: I've built 
a proper REBOL code profiler! (I wonder why I haven't done that since 
a long time...). I went through the profiler scripts on rebol.org 
and couldn't one suitable for my needs or that works with complex 
code, so I wrote one. It is able to deal with complex code, all datatypes, 
recursive calls and it's very simple to use.


Here's a demo profiling Red compiler (output is properly aligned 
when monospace font is used):

-= Red Compiler =-
Compiling red/tests/test.red ...

...compilation time:     40 ms

Compiling to native code...

...compilation time:     10189 ms
...linking time:         60 ms
...output file size:     37888 bytes
>> profiler/report/time


Function                       Count      Elapsed Time         % 
of ET

------------------------------------------------------------------------

compile                        1          0:00:10.249          100.0

comp-dialect                   205        0:00:09.659          94.24

fetch-expression               7505       0:00:09.628          93.94

comp-word                      5668       0:00:08.209          80.09

fetch-into                     427        0:00:07.519          73.36

comp-assignment                597        0:00:07.049          68.77

run                            3          0:00:06.492          63.34

comp-context                   21         0:00:06.398          62.42

comp-with                      1          0:00:05.565          54.29

comp-expression                3172       0:00:04.479          43.70

ns-find-with                   24277      0:00:03.962          38.65

finalize                       1          0:00:03.327          32.46

comp-natives                   1          0:00:03.274          31.94

comp-func-body                 180        0:00:03.271          31.91

comp-call                      2775       0:00:02.732          26.65

comp-func-args                 2861       0:00:01.862          18.16

find-aliased                   9650       0:00:01.86           18.14

resolve-type                   8032       0:00:01.799          17.55

get-type                       10758      0:00:01.546          15.08

ns-prefix                      21765      0:00:01.518          14.81

check-enum-symbol              7509       0:00:01.241          12.10

comp-block                     283        0:00:01.05           10.24

comp-variable-assign           417        0:00:01.034          10.08
DocKimbel:
19-Sep-2012
The overhead of the current implementation is about 5-6 times the 
program execution time, so it's very usable. I will publish it today, 
and I hope someone will pick it up to improve it and add features 
(like a GUI front-end for the reports, with sortable columns).
DocKimbel:
19-Sep-2012
BTW, as I was thinking, the above compiler profiling confirms that 
aliases and namespaces support are quite costly currently (ns-* functions). 
So now I know where to improve the code for better performances (not 
that it matters for the users currently, but it matters to me as 
I need to run the whole test suite dozens of time each day, and with 
the addition of now Red compiler, it (and will) adds up to a lot 
of waiting time at the end of the day).
DocKimbel:
19-Sep-2012
REBOL code profiler released: https://github.com/dockimbel/Red/blob/v0.3.0/red-system/utils/profiler.r


Should work with any REBOL app. Documentation, comments and example 
included in file header.


Hope someone will pick it up and improve it (like adding functions 
sub-tree stats and a GUI). This is github, so feel free to fork then 
fix/improve.
Arnold:
19-Sep-2012
Can someone tell me why for example in https://github.com/dockimbel/Red/blob/v0.3.0/red-system/utils/profiler.r
to use 

set 'make-profitable func [][] instead of make-profitable: func [][] 

because the second kind of declaration is also use in this script 
and I do not see why both are being used; you have a preference for 
one over the other so you use one, not both?
Pekr:
19-Sep-2012
Arnold - that's the old altme url bug. In order to be able to read 
such lines, just change the size of text for a while (aA button above 
the text field)
Pekr:
19-Sep-2012
Arnold - 'set example is one trick you can use in REBOL. Normally, 
when you enclose the function in the object/context, it is accessible 
via a path notation, e.g. context/make-profitable. When you use 'set 
aproach, it lives inside the context, but is exposed to the global 
context, so you can call it directly, or something like that :-)
Arnold:
19-Sep-2012
Thank you Pekr. It is a little to subtile for my mind and current 
REBOL knowledge, I will have to live with this ;-)
Arnold:
21-Sep-2012
Well my patience is being tested. No red-lang mailing list for me 
for a week or more. Account disabled. (Red-terrorist :) )
DocKimbel:
22-Sep-2012
Error handling will come fast, probably next week, but in a basic 
version as we still don't have something like system/standard/*
Henrik:
22-Sep-2012
You can certainly carry this data in the arg1, arg2 and arg3 words, 
but it's a bit awkward.
Arnold:
22-Sep-2012
About error, maybe some indication of the line number. Not prominent 
but as a hint at least, however using find most of the time finds 
the right place where the error is, sometimes it is not so clear.
DocKimbel:
22-Sep-2012
Line numbers: there are complicated and costly to handle in a REBOL-like 
language at runtime. The experimentation I did in Red/System confirms 
it. I'm not sure I will add them to Red unless we can come up with 
an efficient solution.
Henrik:
22-Sep-2012
Dockimbel, well, maybe it's bad design, but what I do generally is 
make error! in the deepest part of the code. When such a user error 
happens (which is generated by a plain make error! "something failed"), 
I disarm it and display arg1 in a dialog in the higher level code, 
if that makes sense. This way, errors are easy to identify and I 
don't have to make up schemes for return values. When a REBOL error 
happens at the same level, I let the program crash.
Henrik:
22-Sep-2012
Arnold, in R3 there is a stack trace shown at the error message, 
which lets you find errors much quicker than in R2. Line numbers 
aren't really practical with REBOL.
Arnold:
22-Sep-2012
(I know it is the value of the last line if it is a condition in 
rebol but shouldn't it be specified?)
DocKimbel:
22-Sep-2012
Alternatively, you can try to find a good existing open-source SSH/SSL 
lib that is BSD-compatible, so far, I haven't found  any. All the 
robust open source ones that I could found are under GPL.
Arnold:
22-Sep-2012
ok, just like in REBOL of course. Still it looks strange because 
I expect it to be there because there always is in other languages 
and it is a loop until a condition is met. So somewhere that condition 
must be tested to be true or false but indeed this part is more the 
definition of how the statement as a whole should be formatted in 
a Red program. I'm back on track, thanks!
AdrianS:
22-Sep-2012
Marco, maybe you could do a syntax coloring scheme for one of the 
popular editors out there
AdrianS:
22-Sep-2012
I guess this would be more straighforward for Red/System as opposed 
to Red because of the more limited syntax. I would think a regex 
based approach would work for that
AdrianS:
22-Sep-2012
might be worth starting with a TextMate bundle for REBOL and simplifying 
that, for Red/System
Arnold:
22-Sep-2012
I can live without the line numbers, even in a R2 like error handling 
:) A lot of programming errors are development related and should 
never happen again once correct datatypes are passed on between functions 
so after this is done no further need for extra debugging statements 
here. User input is always wrong, they give wrong data and should 
be punished hard for that (Oh no that's Googles point of view) but 
the point is it should be tested to be what it should be and in that 
 way REBOL errors should rarely be reported by users. (just my 2cents)
Arnold:
22-Sep-2012
Red needs a "Red programming language Pocket Reference" (O'Reilly 
book) before the world dominance can set in.
Kaj:
22-Sep-2012
Running makes no difference, but if you really port the code, you're 
entering a gray area in which I would guess the copyright could still 
apply to some extent
Henrik:
22-Sep-2012
There would have to be a complete specification somewhere that could 
be used for implementation.
Kaj:
22-Sep-2012
Henrik, yes, Graham's link says that all the information is available. 
But then you're looking at complete reimplementations of a whole 
software suit that's extremely security critical
DocKimbel:
22-Sep-2012
I don't think that all future Red users will be pleased to have to 
provide a long list of advertisement with all their apps, just because 
Red uses 3rd-party libs underneath.
Kaj:
22-Sep-2012
Henrik: something that works. I don't know what you want to use SSL/SSH 
for, but Red/System has a cURL binding. cURL usually uses OpenSSL 
and does most things you would want to do with SSL and SSH
Pekr:
23-Sep-2012
I don't understand following syntax - is that just a word? 

s: GET_BUFFER(data)
Pekr:
23-Sep-2012
does not look like a rebol syntax :-)
Pekr:
23-Sep-2012
Well, Rebol/Red headers are extensible. Is that really a problem 
to have a 'credit or 'licence field, and mention authors of particular 
components?
Pekr:
23-Sep-2012
Then I am dumb - R2 does not allow being it a word, nor is it a function 
... so, what's that? Well, some tests, uh, surprised :-)

>> GET_BUFFER: [1 2 3 4 5]
== [1 2 3 4 5]
>> GET_BUFFER: [1 2 3 4 5](escape)
>> data: 4
== 4
>> GET_BUFFER(data)
== 4
>> GET_BUFFER/:data
== 4
DocKimbel:
23-Sep-2012
It can be a CREDITS file distributed with your app.
DocKimbel:
23-Sep-2012
I've chosen that syntax to visually distinguish simple defines from 
macro with parameters. But you can write it with a space in between 
if you want, no problem.
Arnold:
23-Sep-2012
Pekr maybe try this instead of with 1 2 3 4 5 
>> GET_BUFFER: [a b c d e]
== [a b c d e]
>> data: 4
== 4
>> GET_BUFFER(data)
== 4
>> GET_BUFFER/:data  
== d
>> GET_BUFFER/(data)
== d
DocKimbel:
23-Sep-2012
Ah, there's maybe something that you could do: I need to port my 
current Red test script in Quick-Test (QT) form. I can send you the 
script (very very simple) and the expected unit tests format used 
by QT, you would just have to convert it and check if all tests are 
reported as passing in QT...it's not a big task, but you will save 
me some time for advancing on the code. Interested?
DocKimbel:
23-Sep-2012
The ticket system in Github could be used for storing tasks too (we 
would just need a new tag).
GrahamC:
23-Sep-2012
You would qualify for a free license for http://www.atlassian.com/software/jira/overview
but the software is quite "big"
GrahamC:
23-Sep-2012
how to get a free license for any of their listed products http://www.atlassian.com/software/views/open-source-license-request
DocKimbel:
23-Sep-2012
The main feature that would be needed in such tool is close integration 
with a git repo or directly with github.
Henrik:
23-Sep-2012
ok, Trello is probably not useful, unless there is a plugin.
Kaj:
23-Sep-2012
Actually, the 0MQ docs there include a guide for Red/System, but 
the cURL docs include programming documentation
DocKimbel:
24-Sep-2012
We could even already use Topaz for building it (maybe just adding 
a thin Red dialect on top of it?).
DocKimbel:
24-Sep-2012
Graham: I was thinking it could be ready for end of year of beginning 
of next year. Currently Red is not for end users, and won't be for 
a while. Red/System could be used in production though, but I don't 
have time to write users docs or tutorials for it.
GrahamC:
24-Sep-2012
Don't we need to wait a bit for more functionality from red before 
writing user docs?
DocKimbel:
24-Sep-2012
No, you can take REBOL as a model, all basic features will be identical.
Arnold:
24-Sep-2012
This is to try more Red beyond the things that are save to allow 
on a webserver/browser.
Arnold:
24-Sep-2012
Is it necessary for a tryred to have Red be able to process cgi on 
the webserver.
DocKimbel:
24-Sep-2012
The easiest way would be to use Topaz and "just" add a Red-to-Topaz 
converter.
Kaj:
24-Sep-2012
That sounds like a lot of work. On TryREBOL, Red and Red/System will 
be used directly
Arnold:
24-Sep-2012
Agreed. Also a great introduction like http://learnyousomeerlang.com/
would help using the REPL and compiling Red.
BrianH:
24-Sep-2012
The symbol being the string part of a word.
DocKimbel:
24-Sep-2012
Right, it could be a good option.
BrianH:
24-Sep-2012
I think that R3 stores symbols in something like a BTree.
DocKimbel:
24-Sep-2012
Red stores them in a block! value currently, so probably the less 
efficient way...we'll see in the future how to optimize it the best 
way.
DocKimbel:
24-Sep-2012
Maybe a Trie would be the best data structure for symbols (I have 
used them in other projects for fast short strings lookups).
BrianH:
24-Sep-2012
One gotcha we ran into with R3: R3 uses aliases to handle case-insensitive 
word equality. We found that aliases were a good, safe use for that, 
but not safe or stable to use for anything else. Perhaps you might 
consider this for Red.
Arnold:
24-Sep-2012
I can think of using to-head and to-tail. My opinion is you should 
have a more descriptive name for your variable. So length-of-cityname 
instead of length. The length could be of anything and the variable 
could be reused. Besides native English speaking programmers have 
always faced the fact that their prime candidate for variable names 
were taken because they were a reserved word. Imho so is should stay 
length? and not be length-of though that last one saves me from pressing 
a shift-key.
DocKimbel:
25-Sep-2012
Optimizations are for Red/System v2 (the rewrite in Red). The compiler 
will have a different architecture much more suitable for optimizations 
(including function inlining).
DocKimbel:
25-Sep-2012
No changes for Red plans, I continue on the same path towards a complete 
v1.0.
DocKimbel:
25-Sep-2012
Will you be studying RT's code to see how everything was accomplished?


Certainly not!! The GPL precludes me from looking at the code, the 
risk is too high to unconsciously write similar code and infringe 
the license. It is even worse than that, all Red contributions implementing 
a feature that exists in R3, will need to pass through a peer-reviewing 
process to determine if it is a derivative work of R3 or not. The 
reviewing persons would be able to look at R3 sources, but doing 
so, would not be able to contribute code to Red. So I strongly advise 
current and future Red contributors that wants to add REBOL features 
to Red from looking at R3 sources.

so C to Red/System rewrite would have to happen anyway ....

 No!! Porting GPL code to another language falls under derivate work 
 clause too. If it wasn't the case, it would be too easy to workaround 
 GPL terms by porting it from language A to B, then from B to A.


There is a reason why most big software companies prohibit their 
developers from looking at GPL source code.

Yes, that's how GPL can be bad to non-GPL world.
DocKimbel:
25-Sep-2012
Besides that, GPL is great if you live in a GPL-only world.
Pekr:
25-Sep-2012
Your above post should be posted to the discussion forums ... the 
split of REBOL community might be apparent. As for me, I am staying 
with the active project, hence with Red ... Well, I am a coding lamer, 
so most probably I personally don't need to worry about eventually 
looking into R3 source code :-)
Pekr:
25-Sep-2012
Well, I think that I will be a nice guy for quite some time, not 
trying to steal the happiness of guys out there :-)
DocKimbel:
25-Sep-2012
Janko: it can be a good or bad motivation for newcomers. Some might 
find it great to have the choice, other might be afraid by the fragmentation.
Janko:
25-Sep-2012
Because rebol/red are so different than anything else it might at 
the end help people learn about this coding mindset / convention, 
and then they have more choices. Sometimes lang choice is highly 
determined by runtime also (by my own exp).. in this case having 
many runtime options (red red/system rebol topaz) is a good thing.
Kaj:
25-Sep-2012
It's ironic that we will have a GPL interpreter and a BSD compiler. 
It's much more logical to have a BSD interpreter and a GPL compiler...
DocKimbel:
26-Sep-2012
Ah, found an HowTo: http://stackoverflow.com/questions/3780378/how-to-display-japanese-kanji-inside-a-cmd-window-under-windows
DocKimbel:
26-Sep-2012
It reads it as a stream of bytes. As UTF-8 doesn't use null bytes 
in its encoding (except for codepoint 0), it can be fully loaded 
as string! or binary! in R2 (but you'll see garbage for non-ASCII 
characters).
PeterWood:
26-Sep-2012
If anybody can provide the UTF-8 chars (hex values)  for Hello World 
in Czech. I'll run a test.
DocKimbel:
26-Sep-2012
I haven't implemented full char! support yet, so I can't write a 
Red script to print me the right codepoint values...(char! will be 
implemented later today though).
DocKimbel:
26-Sep-2012
Pekr: it might be a BOM issue with Red loader, I don't remember testing 
it...
Ladislav:
26-Sep-2012
Doc, a minor nitpicking: it is a vocative and thus the correct spelling 
should be

Dobr^(FD) den sv^(011B)te
Pekr:
26-Sep-2012
... but - it is a long time I tried it, so not sure ...
DocKimbel:
26-Sep-2012
Might be a corruption bug.
DocKimbel:
26-Sep-2012
...or rather a null character termination bug.
1301 / 6460812345...1213[14] 1516...643644645646647