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

World: r3wp

[Script Library] REBOL.org: Script library and Mailing list archive

Dockimbel
1-May-2007
[507]
Can I upload a ZIP archive in the Library or does it require to upload 
only a single REBOL script ?
Sunanda
1-May-2007
[508]
You can upload *packages* -- assemblies of any type of file you like.
Some examples here:

http://www.rebol.org/cgi-bin/cgiwrap/rebol/search.r?filter=type-package
Maxim
1-May-2007
[509x3]
zip file upload would be cool and easier... (nudge nudge, wink, wink)
but we've had the discussion before... so many things... so little 
time.
(the zip would be opened and converted to a package btw) its just 
sooo easy to prepare a zip file.
Sunanda
1-May-2007
[512x2]
If there was a standard REBOL library that could open *any* common 
zip format, then yes: it'd be easy to accept a zip upload and turn 
it into a package.
Otherwise, it'd be a support headache.
***

The current method of uploading package files (via a browser interface) 
is itself a headache. But (this is where I toss the ball back to 
you Maxim), LDS (the Library's API) supports package file uploading. 
So *you* could write an easy package assembly routine to run on the 
contributor's computer. Problem solved!
It could even work from a zip file, so no server scripts need be 
harmed in the writing of it :-)
Maxim
1-May-2007
[514x2]
hehe.
another pet project in queue  ;-)
Sunanda
1-May-2007
[516]
There's a lot that can be done to make the Library easier to use 
without waking up the Librarians :-)
Maxim
1-May-2007
[517x2]
aren't I an honorary member  ;-)
aren't  = ain't
Sunanda
1-May-2007
[519]
yes you is!
Jean-François
1-May-2007
[520]
Thanks Sunanda. I wasn't aware one could define it's own CSS for 
library code display.


However Gabriele's emitter has very usefull tags that are missing 
in the current library emitter. In particular, it is posible to highligh 
differently standard Rebol words and new words. This is extremely 
usefull for a beginner like me who doesn't yet know all of Rebols 
vocabulary. There is also the TAB tag that helps a lot.


Unfortunately, writing a new emitter using Gabriele's code is beyond 
my ability.


And from the dreamer in me... here is a suggestion for this better 
emitter: 

When one clicks (or maybe hover) on one of the standard Rebol words, 
you are presented with it's definition.
Sunanda
1-May-2007
[521]
That's a nice idea for a sort of "REBOL explainer" application.
But it would be difficult to do in the Library.

The Library does attempt to load and parse scripts -- that's how 
we do the colorisation. But (as with Gabriele's code) we rely on 
REBOL's own reflective abilities to tell us what is a word, function, 
operator etc.

The Library runs an old version of Core (and even if we update that, 
we'd never run a version of View on a webserver) so it does not have 
access to all the information a proper explainer.highlighter would 
need.
Take this script for example:

http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?color=yes&script=reboldiff.r

'new-line is a valid REBOL word, but it is not colored: that's because 
it is not a word in the version we use.

So sadly, the colorisation at REBOL.or remains a nice bit of eye 
candy rather than a solidly dependable feature.
Maxim
1-May-2007
[522]
REBOL's scopeless binding makes it VERY hard to analyse code without 
actually evaluating it... which can be pretty dangerous.  :-(
Sunanda
1-May-2007
[523]
That's true -- not something we could do safely on a server.....Hence 
we are limited to load/header etc.

A desktop application may be able to be more daring -- provided you 
don't let arbitrary code out of the sandbox.
Jean-François
1-May-2007
[524]
I understand about the "Rebol Explainer" app. ... maybe someday in 
a Rebol IDE.


But are the enhancements "à la Gabriele" still possible (i.e. Keywords, 
Words, and Tabs tags ) ?
Gabriele
1-May-2007
[525x2]
Jean: did you try overing on a bold word in my output? :)
Sunanda: i keep the list of know words external to the script. there's 
a link to it from the html doc i posted (look for the #include directive 
and click on it). there's also a script that generates that file 
(apache directory index is enabled for that dir, so you'll be able 
to see it there)
Sunanda
1-May-2007
[527]
Gabriel -- Thanks....A word list sounds a good way to go.
***

Jean-Francois -- a hover-over on kewords is certainly do-able and 
could look fun for the first couple of minutes on colorised scripts. 
Though it has drawbacks:
** it'd just about double the size of the page

** I think I'd be serious annoyed by it after 30 seconds -- though 
that may just be me

** lots of hidden-by-css styles (that's the way I'd do it, usng some 
of Eric Meyer's clevernesses) could create confusion for anyone using 
an elderly web browser or screen reader.


A good step in the right direction would be better styles for the 
code as we display it now.....So anyone experimenting with that is 
doing us all a great service ... Amd it would pave the way by creating 
a better foundation for higher cleverness.
Jean-François
1-May-2007
[528]
Gabriele, That is great !

I hadn't noticed the extra info poping up. Just that simple extra 
info is very helpful when inspecting/reading code (well for me anyway). 
Thank you.

The fact I hadn't noticed it might be a counter argument to Sunanda's 
fear of being annoyed by it. You really have to leave your pointer 
on it.


Any new language (natural or artificial) feels like "Scriptio continua" 
( http://en.wikipedia.org/wiki/Scriptio_continua) 

at first and all these visual cues are very helpfull in building 
the program's tree in your mind.


Imagine yourself a beginner at german reading a text that would have 
been colorized to accentuate its different elements. Hovering over 
a colored word would give you a translation or even maybe just a 
picture to prevent you from thinking in your first language.
Geomol
29-May-2007
[529x2]
I got some time to look at the CSS style sheet for displaying script 
code, Jean-Franois asked for. Where is the CSS located?
Is it the look of the code in this document: http://www.colellachiara.com/soft/PDFM2/pdf-maker.html
that is asked for?
Sunanda
29-May-2007
[531]
The personalised CSS feature starts here:
http://www.rebol.org/cgi-bin/cgiwrap/rebol/css-available.r

Use the menu bar to explore the options [Preview page · Update · 
View system CSS · Switch to system CSS · CSS help]
Have fun!
Geomol
29-May-2007
[532x2]
Does anyone have an opinion on what colors to use in syntax highlighting? 
The color-code.r script by Carl produce these colors: http://home.tiscali.dk/john.niclasen/rebol/color-test.html
This is how vim color REBOL code: http://home.tiscali.dk/john.niclasen/rebol/color-test-vim.html
Gregg
29-May-2007
[534]
Can't seem to hit those John.
Jean-François
30-May-2007
[535]
That's great Geomol.
Yes the pdf-maker docs are a good example.
I would stick with gabriele's color for a start.
Geomol
30-May-2007
[536x2]
Gregg, the Tiscali server (or network) was a bit slow last night. 
Try the links again, if you had trouble.
You guys can also think about, how many different colors are needed 
(preferred), when displaying REBOL source. A color for comments, 
values, datatypes, words, etc. Should values be split into numeric 
values, series and others with each their color. Other things?
ICarii
30-May-2007
[538]
personally id go for minimalist hilighting with colouring only for 
comments and strings - any more than that and it starts to look like 
a fairground -)
Geomol
30-May-2007
[539]
I programmed in COBOL for many years without coloring. Then I started 
using vim, and I found, it looked weird with all those colors. After 
a while, I started to really like it, because it's so much easier 
to read the code. Colors make our brains look and distinguish components 
much better than words. I'm for colors. But they have to be balanced, 
so it doesn't hurt the eyes too much.
Sunanda
30-May-2007
[540]
So did !
The color styles used right now are here:
http://www.rebol.org/cgi-bin/cgiwrap/rebol/css-view-system.r
(search for colorizer)

We already (in effect) collapse some into the same color: like file! 
and email!  Perhaps url! should be the same color too.
btiffin
30-May-2007
[541]
One of my heroes, Chuck Moore found colour important enough to use 
it for

'meaning'.  He got rid of colons in ColorForth by using bluespace 
and redspace and
greenspace instead of just whitespace.
Sunanda
30-May-2007
[542]
Trouble with colour is that some people are colour blind.

For some of them (and therefore all of us) using [red/green] to mean 
[danger/safe] or [stop/go] is dangerous.

Which is why (at least where I live) green traffic lights have been 
slowly migrating towards bluey-green over the past couple of decades.
btiffin
30-May-2007
[543]
Good points.  And Charles had some trouble with 'printouts'.  :) 
 I stopped following
the progress quite a few years ago.
Volker
30-May-2007
[544]
can be diferent fonts too. IIRC he used 4 colors or so. or if nothing 
else helps some markup.
Gregg
30-May-2007
[545x2]
I prefer the color-code scheme over the VIM scheme (don't like the 
pink), but as long as it isn't too bright most anything should be 
OK. 


It would be interesting to do some research on using different rendering 
schemes for code, based on activity. For example, when writing and 
maintaining code, I like comments in gray, so they "fade out" a bit; 
but if you're reading code, in a Literate Programming sense, you 
probably want the prose to stand out and the code to be subordinate.
Or if you're looking for specific datatypes, have a hot-key that, 
when pressed, highlights them.
btiffin
30-May-2007
[547x5]
Weirdo
:)
I've thought that same thing a few times.  A "gork" button.
gork = grok
Sorry for clogging the channel...It must be the Hare Krishna rock 
band I've got playing

in the background while doing LibDesk2 design thinking...  I think 
LD2 might be
pretty cool.
Gregg
30-May-2007
[552]
Ooooh, a grok button. I like that.
Geomol
30-May-2007
[553x4]
Some syntax colors: http://www.fys.ku.dk/~niclasen/rebol/syntax-color.html

This is work in progress! First is colors for comments and values 
(as I suggest). Then colors from Carl's script color-code.r, then 
some named colors from REBOL, and last some JavaScript syntax colors, 
I found on the net.


Syntax colors for many languages seem to use green for comments. 
I prefer blue, so comments better stick out, also for people having 
trouble with red and green. Values being red seem to be widely used. 
I'll try to make an example of REBOL code with colors...
First example with test of colors: http://www.fys.ku.dk/~niclasen/rebol/example.html

My idea is to build an example, that satisfies the need. Then I look 
at implementation for the Library, so sources in the library can 
be viewed this way.


Maybe refinements shouldn't be that yellow!? Should background be 
a little gray like this? #f9f9f9 Or should it be white? The purple 
and blue might be a bit too bright compared to the red and green? 
Or should the red and green be brighter?
Also try select the text in the browser. What color does the different 
browsers and OSs use for highlighting text? Can the colored text 
still be seen, when it's selected?
OS X has a default palette of rather bright colors for highlighting 
to choose from, suggesting the text colors to be dark, so the text 
still can be read when selected.