REBOL Technologies

Comments on: Try REBOL 3... (server needed)

Carl Sassenrath, CTO
REBOL Technologies
9-Sep-2009 5:50 GMT

Article #0427
Main page || Index || Prior Article [0426] || Next Article [0428] || 117 Comments || Send feedback

Some of you have mentioned the "Try Ruby (in your browser)" page that lets you try Ruby from your browser. It's basically an HTML text-area that uses a browser script to send what you type to a server that runs Ruby and returns the result.

When I first saw this page several years ago, I found it a bit amusing. After all, users can download and install REBOL in about the same amount of time as bringing up that web page and typing a few lines, so why not just do that?

However, I will admit that the world sets it's own expectations. Despite the fact that you can download and install REBOL in just a few seconds, that does not mean that the world really believes that statement... and is willing to give it a try.

Of course, you could also ask what benefit there is in typing lines into a browser text-area when you're a new user and don't really know what to type. The Try Ruby demo helps a bit by suggesting some basic lines.

But, you know me, sure... I decided to give it a try. I typed:

>> print ["hi" 1 2 3]

and Ruby returned:

"(eval):17:in `run_line': compile error\n(eval):17: syntax error,
unexpected tINTEGER, expecting ']'\nprint [\"hi\" 1 2 3]\n ^"     
SyntaxError: (eval):17:in `run_line': compile error                     
(eval):17: syntax error, unexpected tINTEGER, expecting ']'             
print ["hi" 1 2 3]

Hmmm. I figured I'd give it something more fun and evaluative to "think about"...

>> print [1 + 2 "is" 3]

The response printed was:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">                      
<html><head>                                                            
<title>500 Internal Server Error</title>                                
</head><body>                                                           
<h1>Internal Server Error</h1>                                          
<p>The server encountered an internal error or                          
misconfiguration and was unable to complete                             
your request.</p>                                                       
<p>Please contact the server administrator,                             
...

Sure, these things happen. We don't throw stones from glass houses.

But, it got me thinking... would our errors be any more friendly? So, to be fair, I decided to try some Ruby in REBOL. I found this in the tutorial:

def initialize(names = "World")
  @names = names
end

and, I typed it into REBOL:

>> def initialize(names = "World")
** Script error: def has no value
>> @names = names
** Syntax error: invalid "email" -- "@names"
** Near: (line 1) @names = names
>> end
** Script error: end has no value

So, REBOL wasn't too harsh. In fact, if we had the WHY? feature better documented, users could quickly open to the online doc pages that describe what the errors actually mean. For example, these pages explain our famous has no value error message.

So, maybe it would be an interesting experiment to build a "Try REBOL" page now that 3.0 is almost beta. (In fact, maybe it already exists out there... and I've simply "lost my links" again.)

Is there a REBOLer out there interested in coding up the browser script and/or putting the backend on a server? I can provide the REBOL 3.0 executable and link to the page. (Sorry I can't do more... I'm a little short on time right now with development tasks.)

117 Comments

Comments:

henrik
9-Sep-2009 23:54:26
I'll need help, but I have a Linode server just waiting for such tasks. :-) It runs Debian Lenny.
Carl Sassenrath
10-Sep-2009 0:01:39
Great! That was quick.
Kaj
10-Sep-2009 8:37:52
That's a very cool experiment. :-) I'll also see what I can do.
Henrik
10-Sep-2009 10:23
We're discussing how to do this right now, and I'm busy tearing my hair out building a javascript console. It's great fun.
Carl Sassenrath
10-Sep-2009 10:26:01
Henrik... hopefully the REBOL part of it will be easy.
Oldes
10-Sep-2009 14:57:37
Carl, so R3 is enough mature to handle codes like:
b: [] forever [append b now]
without eating all memory on the server very quickly?
-pekr-
10-Sep-2009 19:23:03
Oldes,

there was added one security setting, where you set number of CPU cycles. We asked to extend the setting by adding memory and/or time of running script option, but not success. If not time, then at least memory option is really important, and unless it is implemented, I regard it like not having security option for server area at all. It also has to be settable as a command line option imo, so that you can control it externally.

elvis
10-Sep-2009 19:28:08
Ruby is a great language, they do everything to make your life easy, even setting a page to try Ruby, that's something I haven't seen in any other language.

the other thing with Ruby, is that they provide you with everything you need to write a full blown application. It's really free 100%. Not like Rebol where only a subset of the package is available, and that's not much.

there are other nice 100% free languages like PHP which just made it to top 3 languages at the TIOBE Ranking.

They are more mature as well than Rebol.

20 years ago maybe Rebol would have made it, with its partially free language package, unforunately in today's world, there are so many other really free languages available, that Rebol will not draw a huge following.

If the goal of the Rebol community is not to have a huge following, then that's ok. however if the goal is to have it used by a larger % of the market, then they will have to change their licensing model.

good day !

Kaj
10-Sep-2009 21:15:09
I've got a very simple one running on Syllable Server, Cheyenne and QuarterMaster, but now I have to make it robust.
Carl S (remote)
10-Sep-2009 22:48:56
Elvis, that comment is off topic...

But, to reply: Ruby is a nice traditional language structure and implementation. Yes, it may be friendly, but it's not unique or modern in its programming model. It's 1980's OOL technology.

REBOL is about a lot more than that.

It's a different way of programming and solving computing-related problems for people who want to push the envelope and jump forward to the next generation of software technology.

REBOL blows away most other languages when it comes to built-in datatypes, consistent polymorphic functions, reflection, data and code representation via symbolics and dialecting, lexical formats, embedded documentation, and a lot more.

In addition, we believe that languages and systems should be small, clean, and fast -- not large, bloated, and complicated. That's the main reason why the core of REBOL is not open. However, you can download REBOL freely, and the new R3 version will freely let you write interfaces to anything you want, as well as embed REBOL within other software.

With regard to the size of our community, we prefer quality of programmers over shear numbers. REBOL is not for everyone. It's really for those who seek greater leverage and productivity in their applications and data management. Definitely not for traditional C-style coders.

Anyway, in the end, you code in what you want to code in. For you, it may be Ruby, BASIC, Perl, or C#. That's fine. We encourage you to stick with what works for you. But, don't go around posting negative comments to communities of people who want a lot more than what Ruby has to offer. There's nothing to win in that game.

Carl Sassenrath
10-Sep-2009 23:18:07
Pekr, as I noted before, generally, counting cycles is more useful than elapsed time because it's CPU-speed independent (however, that said, time can be added, for those who might want it.) And yes, a memory limit is useful, and should not be difficult to add. Perhaps by the time the script is ready, we can have the memory limit added.

Also, a command line support is not required... I think we can use rebol.r for now. It can setup the SECURE settings, then unset SECURE.

-pekr-
11-Sep-2009 0:20:05
Elvis, by many forum standards, your post would be marked as simple trolling. You only agenda is - 100% succesfull = 100% open-sourced. We are REBOLs on purpose, we like REBOL and we do what we think is best. R3 changes many things in REBOL ecosphere and you can bet, that we will actually get some following, and you know why? Because some ppl might finally get it! You don't need tens of megabytes of garbage to do some usefull stuff ...

Enjoy tools you use, and we'll continue working hard, so that more ppl can enjoy REBOL :-) Also don't forget about world actually not being black & white. Even REBOLlers do use some other languages here or there ...

Henrik
11-Sep-2009 0:26:21
It turns out there is absolutely no formal standardization in how different browsers handle keyboard input. As such, most browsers deliver different keycodes ranging between the ASCII area and up to around 60000. This even varies between browser versions and identical browsers on different platforms, due to Mac vs. PC keyboard layouts. Even language setup might affect it.

We will need to test in a wide range of browsers.

Not all browsers will accept things like Escape or F-keys. Sometimes the browser interferes, because the key is used for a specific browser command. I looked through the Ruby console keyboard code and there is a bunch of dirty stuff to handle different browsers correctly. I don't think we can avoid that. There will be some chars we simply can't type.

Silly things like this is slowing this down, where in REBOL, keyboard detection fortunately is trivial and cross platform. Bring on ReBrowser!

The console itself still needs a few things, like proper scrolling, but I think it could be used in a few hours. Still no server side stuff, though.

-pekr-
11-Sep-2009 0:33:11
Carl, thanks for your input. I think that time limit goes in hands with CPU cycles, and hence is not that much needed as memory limit (although ppl thinking in time units might find it easier to set and use than CPU cycles, maybe we should really add both).

As for rebol.r. I know there were some things planned to chnage in regards to either rebol.r or user.r, so I completly forgot about rebol.r option. Command line came to my mind, as I know we have -s option, so I thought we could just add --secure [your settings here] one. But the truth is, that command line might not be enough for server environment, becaue user puts it into shebang line of CGI script, so he could override it :-) ...

Ingo
11-Sep-2009 0:49:03
Two more things secure might be missing for server side

limited file writes

  • its possible to write, but not fill up the whole disk
limited network send / receive
  • it's possible to send / receive, but not possible to start an attack
-pekr-
11-Sep-2009 2:43:44
Anothe note to security. So far, it mostly allows to allow/disallow certain area of usage. Do you think it would be usefull to eventually add limits? You already started with CPU cycles.

I mean - when discussing on-line console demo, I asked simple question - do we allow simple and nice examples as?:

>> print read http://www.rebol.com

... but I got interesting reply - what if user tries to download some blue-ray ISO? Hence my question towards things like:

  • limiting number of data downloaded/sent (per connection?)
  • limiting number of connections? (tricky, it would have to happen on low-level, not at scheme level)
  • limiting number of tasks/threads (once those are implemented) - imagine someone spawning 10K of tasks? I wonder, if "launch" can be missused that way, launching tonnes of interpreters, which are ordered to wait few days? :-)

    ... just throwing some ideas around ...

  • johnson
    11-Sep-2009 5:36:02
    I'm new to rebol but so far have found it to be really good. The main reason I tried Rebol was because of the number of things it could do with its amazingly small size. What a difference from the dozen or so 500mb ide's and languages i've used!

    It reminds me a lot of lua, but with better functional programming support, better gui creation, deployment... and much more

    Just wanted to drop by and say thanks to Carl and all the developers for actively maintaining Rebol.

    In a few months time, i'm going to be completely using rebol for my development.

    Maxim Olivier-Adlhoch
    11-Sep-2009 10:31:24
    pekr, the limit is a great idea. It should include throttling. Having a way to slow down the interpretter if the CPU, memory, or something else is getting bottle-necked, the same for TCP xfer.

    Also some pre-determined conditions should allow us to control the resetting or changing of limits and security.

    (reset cpu throttle if its inactive for a few seconds, increase memory limit if thread count increases, etc).

    some kind of Rebol management console could allow us to check-on interpreter activity and control it in real-time ... resetting some stuff when specific errors or events occur, adding interpreter delays & port re-connections on tcp time-outs for example, when you must not kill the server because its state is as important as the data it manages.

    Karl
    11-Sep-2009 12:27:36
    The comment by elvis is tangentially related to the subject of 'giving Rebol a try'. Not buying that? Then consider me off topic too, if you want.

    > the world sets it's own expectations

    For some people those expectations include respecting a user's rights to study, fix, and customize their software.

    > REBOL blows away most other languages when it comes to built-in datatypes

    That's nice Carl. What about when I need to add my own datatypes?

    I used Rebol for a bit but it was just not flexible enough to meet my needs. I wanted to use it, but in the end and had to respect the lesson I had learned from the demise of the Amiga: Do not let your information technology be controlled by others.

    Kaj
    11-Sep-2009 13:23:27
    There's more work to do, but here's my version:

    http://tryrebol.esperconsultancy.nl

    -pekr-
    11-Sep-2009 13:43:32
    Karl, in order to comment, you should know what you are talking about - user-types are planned for R3, so before you show more of your ignorance,you should go and study what is planned, which you only can do, if you precisely follow the project, not just by occassionally lurking in blogs ...

    Once and once again raised topics of open-source REBOL as a measure of system quality shows just you are not ready for REBOL ....

    Kaj
    11-Sep-2009 14:10:58
    Let's not be snobbish or xenophobic. Ruby fans will stay with Ruby, REBOL fans will stay with REBOL and open source zealots will not be convinced to use anything else. I can only say that I produce two open source operating systems to not fall into the Atari/Amiga/Be demises pitfall again, I use Ruby everywhere that I cannot use REBOL yet, but I still prefer REBOL for its qualities in both system and language design.
    -pekr-
    11-Sep-2009 22:21:09
    I think I understand English properly to clearly identify your original post as being clearly fanboyish. It had nothing in common with the topic given! There is no single relation to R3-in-browser demo in any sense in your original post, just plain bashing that REBOL should be here 20 years ago or it has no chance to succeed. Now how is that related to R3-in-browser demo?

    You can't defend your original post with some additional explanations, just to make your points look better.

    Your last sentence shows exactly who you are. Gee, Xenophoby and snobism in computer languages? Stating that, you clearly show disrespect and ignorance to all the hard work which goes into R3.

    What snobism? Our community is highly respectfull. Carl listens to all our wishes most of the time. We have two blog channels, R3 Chat system, dedicated AltME Channels, ML, forum. We have luxury to talk to language author on a daily basis - ALL of us, interested to cooperate. So, - please don't try to compare us with some eventually snobbish communities, which don't allow different opinions - this is not clearly our case. OTOH we try to stay highly focused to bring R3 to life, so posts like your original one don't really help the topic in any way.

    Please go to following link ( http://en.wikipedia.org/wiki/List_of_programming_languages ) to realise that the computer language world is not black & white and measured by some obscure TIOBE ranking. By your measure new technologies should not be brought to life, because others are here already, and even highly ranked :-)

    It is not enough having head on ones shoulder, it is also important to actually have some brain inside it and use it from time to time :-) (... a joke of course, but I could not resist :-)

    Maxim Olivier-Adlhoch
    11-Sep-2009 22:32:19
    kaj, your "try rebol" page is really cool. :-)
    Kaj
    12-Sep-2009 17:35:34
    Thanks! :-) I've been improving it over the past day. There's still an issue with it in that you can't use double quotes for strings yet, but {} work.
    Carl Sassenrath
    12-Sep-2009 17:40:58
    Kaj... sounds like good progress. I gave it a try, but the site name is not resolving in DNS for some reason. Will try again soon.
    Carl Sassenrath
    12-Sep-2009 17:43:31
    The blog went offline today for a few hours... someone cracking around in the code. Tightened it up a bit to make it less likely.

    Contact me via feedback if you see anything else odd. Thanks.

    Kaj
    12-Sep-2009 17:56:01
    Petr, what are you going on about? Instead of wildly taking swipes around you, I think you should take note of the names of who wrote what.
    Kaj
    13-Sep-2009 0:06:29
    I solved the problem with the double quotes: they can now be used.
    Jerry Tsai
    13-Sep-2009 1:30:39
    Kaj, In your "try rebol" web page, I tried this:

    >> print to-string read http://www.rebol.com

    I got a real web page, not a string.

    -pekr-
    13-Sep-2009 1:34:18
    Kaj - there is Elvis reply definitely missing in this blog, and maybe not only his one, but maybe few other posts. It seems like I am replying to noone. Anyway - it does not matter anyway - we can't convince those, who are convinced there are much better alternatives than REBOL is ...
    -pekr-
    13-Sep-2009 1:37:54
    As for console - if Ruby one works, isn't that java-script code available, so that we don't have to reimplement it from scratch?
    Kaj
    13-Sep-2009 2:08:33
    Petr, you are referring to one of my posts mixed together with posts from Elvis and Karl, so you are creating your own ghosts.
    Kaj
    13-Sep-2009 2:10:42
    Jerry, right, that's the main thing I still need to fix. :-) It will take some more work.
    Henrik
    13-Sep-2009 4:26
    Pekr, and others: I've refined the console now, and works much better. It should work in IE, Firefox, Opera, Chrome and Safari. Still needing to scroll the console buffer properly.

    Note this is still only the front end. Returned values are simply local echo, but implementing that final part to connect to R3 on a server is probably trivial, a few lines of code. The hard part will be R3 processes as sessions connected to the console in the browser. If someone wants to go ahead and try, I can move on to some docs I have to finish for another project.

    It is located here:

    http://97.107.135.89/projects/rebol/r3shell/

    If you want to study the code:

    http://97.107.135.89/projects/rebol/r3shell/console.js

    Areas marked with *** are the ones that need to change.

    Henrik
    13-Sep-2009 4:28:16
    Oops, the last URL is:

    http://97.107.135.89/projects/rebol/r3shell/js/console.js

    -pekr-
    13-Sep-2009 4:43:27
    Kaj, this is not really constructive, and it does not even matter, but please don't try to make fool of me. There is one post from Elvis clearly missing, it was titled Emperror's new clothes, the title was in bold letters, it replied to me, Carl, and you, stating e.g. that I can't interpret english, that his post was related to browser-plugin, that you are at least the one having head on its shoulders, and that Elvis is out of this place. The post got somehow to be - deleted/lost.

    In such a perspective, my post was direct reply to Elvis, and it might look as I am replying to some ghost, but I was not :-)

    I would like to be back to console topic now, so this was my last reply to off-topic rants Elvis started and I mistakenly feeded ...

    -pekr-
    13-Sep-2009 4:50:31
    Carl - any reply to possible additional security dialect enhancements, like being able to set amount of data downloaded, etc.? Today I logget to my account at one hosting site, and there was a message, that they raised amount of memory being able to use for PHP and CPU utilisation for .aspx.

    It then immeditelly came to my mind, that in order to ask such hosting site to add REBOL for CGI purposes, they really might ask for the interpreter to be able to set its CPU, memory, time utilisation, and maybe even limit number of tasks/threads, and ability to download some amount of data. It can be probably tricky (e.g. I can't imagine e.g. limiting speed of networking - that one belongs to router setting), but I propose 'limit directive for 'secure dialect ...

    It does not have to come in next version, but if Henrik is about to show some interesting demos, e.g. parsing links of website in few lines of code, we have to allow networking. And in such a case, we need the ability to set limit for amount of data being downloaded?

    Henrik
    13-Sep-2009 5:03:50
    Pekr, I'm not sure that will help. You can probably set up a limit of, say 1 MB data download.

    But you could loop that in multiple sessions to reset the limit. If you want to, you can reset the session, setup a new download and quietly overrun my monthly download quota. The connection is pretty fast and the limit could be overrun in a few days and the account would be shut down.

    I'm still against the idea of allowing networking or anything that can abuse the server in some way.

    Kaj
    13-Sep-2009 5:18:13
    Henrik, looks nice, but it acts weird in Konqueror.

    I think I'll leave mine as a stateless form, to avoid the complexities, and so we'll have two different ones to choose from.

    -pekr-
    13-Sep-2009 5:21:19
    Henrik,

    really nice progress. I wonder if we can get multiline/wordwrapping mode working, or if it will be problem to achieve?

    As for FF, it would be nice if secondary cursor/pointer ("I") would not appear, but that is cosmetic problem.

    It also does not seem to scroll the area, if you fill-up the screen. Other than that, it looks really nice - a good work :-)

    Henrik
    13-Sep-2009 5:25:17
    Kaj, sorry. I have no way to test in Konqueror.

    Also I don't have IE8 installed, only IE7, so if anyone wants to test it there, go ahead.

    Henrik
    13-Sep-2009 5:40:17
    Pekr, I don't know if there are issues with multiple lines. I've tested without problems so far, as the console now consists of a bunch of inline DIVs instead of a hardcoded char-based terminal. They wrap automatically.

    As an unintended side effect, you can't paste in the console. Maybe that's a good idea.

    BTW, this is a bad place to chat. I get abuse errors all the time, because I can't post two messages in a row. Can we move to R3 chat? It's not down right now.

    Kaj
    13-Sep-2009 5:53:34
    Petr, an effect of this blog being cracked, then, but it looked weird to me. It would be nice if we could be friendlier to outsiders and lurkers. For human considerations, it leaves less room for misunderstandings, but also because after all, we're working on marketing here.
    onetom
    13-Sep-2009 17:03:49
    on linux u can control some resource usage (file, mem and cpu too) via the /etc/security/limits.conf file on a per-user/per-group basis.

    (this problem set reminds me those times when i was experimenting with a gforth irc bot ;)

    Kaj
    14-Sep-2009 11:33:58
    I'm looking into that, thanks. I don't have PAM yet on Syllable Server, but the Shadow package is integrated, which can do similar things in /etc/limits
    Shadwolf
    14-Sep-2009 19:49:36
    Even more passionated debate...

    Rebol needs show rooms to be compared to the other "I make software" products available on the market.

    I liked the idea of the plugin but it seems a pain to maintain it and work on the rebol/core/view enhancement at same time.

    So the minimal demonstration simulating a rebol console in a html page in a web site the "try rebol" would be a way to show how rebol is powerfull.

    But then we will lack the most attractive part of rebol and what made rebol webbrowser plugin a very interresting product in my opinion. The VID embeded layer.

    Kaj
    14-Sep-2009 23:03:12
    I fixed the encoding when HTML is generated, for example when reading a web page.
    James_Nak
    15-Sep-2009 16:20:24
    Thanks Kaj and Henrik. Great stuff.
    Carl Read
    17-Sep-2009 1:31:11
    This works...

    foreach value [ a b c d e ] [ print value ]

    in Kaj's Try REBOL, but doesn't in Henrik's REBOL 3 Console. (Using FireFox 3.5.3.) This is what happens in the Console...

    >> foreach value [ a b c d e ] [ print value ] == foreach value [ a b c d e ] [ print value ]

    (Note that from a tester's POV, Kaj's approach is the better, since cut & paste works.)

    Carl Read
    17-Sep-2009 1:39:01
    Gah - there should've been a newline before the "==". ie, like this but without the empty line in the middle...

    >> foreach value [ a b c d e ] [ print value ]

    == foreach value [ a b c d e ] [ print value ]

    (Carl - your blog code has a problem with "^/==")

    Nick
    17-Sep-2009 6:45:34
    Henrik, your shell looks great, but I can't get it working in IE6, Opera 9.63, or Firefox 3.0.14. I get the same problem as Carl Read :(
    Oldes
    17-Sep-2009 7:40:38
    Henrik's shell is not complete, it's just the browser part, now there must be the server part to be done. Kaj's script is just a cgi with no persistent state. Henrik needs server with persistent states so it behaves as a real console.
    Kaj
    17-Sep-2009 11:08:59
    To be exact, mine is not implemented with CGI but with QuarterMaster - although that's currently much the same. But indeed, I'm communicating with the server per REBOL script, not per line or even trying to have the server maintain the state of a REBOL environment. That would be much more complicated and would make it very hard to keep checks on security.
    Henrik
    17-Sep-2009 11:26:18
    Indeed, Kaj's is ahead of mine, in the "it's working!" department. :-) The results are simply echoed back locally. The server part has proven more difficult to solve than I thought, because it needs a process manager the ability for a specific R3 process to communicate with a specific console. I'm not sure how to do that.
    Ratio
    17-Sep-2009 20:41:44
    Hi all !

    I like REBOL, but I'm not fiddling in the skys

    so long own homewórk is not done.

    A few examples:

  • What about basic functions like CHAR(numASCI)??

  • What about the contrary? - ASCI(char)??

  • What about READLINE functions? - Very important. We cannot use blocks in VID, RebGUI etc.

  • What about KEYBOARD handling? - Very important!

  • What about DOCUMENTATION ? - Scattered all over the world, but NEVER exhaustive ?

  • What about DOZENS of superfluous functions in REBOL? - Could be just options.

  • What about abolishing illogical things like #"char" and OOP?

    Ratio

  • Ashley
    17-Sep-2009 21:58:21
    What about basic functions like CHAR(numASCI)??

    to char! 97

    What about the contrary? - ASCI(char)??

    to integer! #"a"

    What about READLINE functions?

    answer: ask "Prompt: "

    What about DOZENS of superfluous functions in REBOL?

    Please list them for discussion.

    What about abolishing illogical things like #"char" and OOP?

    These things are logical to others, bit like saying "I don't think red is logical, lets remove it".

    Henrik
    18-Sep-2009 0:38:48
    What about DOZENS of superfluous functions in REBOL? - Could be just options.

    If you are referring to functions that could be refinements, it's likely they are not, because their scope is broader than you think. Furthermore, adding refinements to a function slows it down. That is why most functions have at tops 1 or 2 refinments.

    Kaj
    18-Sep-2009 4:17:52
    I added asynchronous server communication to make it a little more like a console, and for that advanced REBOL/responsive Syllable feeling. :-)

    http://tryrebol.esperconsultancy.nl

    sleepnova
    18-Sep-2009 10:52:40
    It would be fun if there is a pure javascript REBOL3 interpreter. If there is any plan to do something like that, I'd love to be part of the contributors to implement it.
    Leafy
    18-Sep-2009 11:50:58
    I was thinking of this for quite a while; REBOL and JS are similar in design (at a basic level) which is quite helpful too. Instead of relying on REBOL plugin we might create a "REBOL-to-JS translator" which would be really nice. (at)Kaj: Sweet stuff!
    Kaj
    18-Sep-2009 13:44:34
    Thanks!

    Gabriele has an incomplete implementation of REBOL 2 in JavaScript, so it's certainly possible, to an extent. It's very slow, of course, and quite limited.

    Nick
    19-Sep-2009 16:51:16
    Much nicer Kaj!
    Steeve
    20-Sep-2009 8:19:39
    Kaj, you should perform the 'help function on the result, if it's an object to reduce it's size. (Tried it with 'system --> slow and huge result without it)
    Ratio
    20-Sep-2009 15:48:33
    Hi! Thanks for your answers. Yes, I'm happy with REBOL and RebGUI.

    We could now manage about 30% of our hundreds of GUI dialogs via REBOL and RebGUI.

    Though we still have a large overhead ( since we don't know how to call REBOL directly - not using the Windoze shell and files ) it's really surprising how fast and perfectly positionings and all the other things are managed with REBOL VID and RebGUI.

    We save a lot of our own code. But we also had and have ernormous problems! :-(

    Functions doing (always or almost) the same are very confusing for beginners. Previously I mentioned half a dozen ways to create user functions. ONE should be enough.

    Another "big" example are all the "to-" functions and "to" itself.

    make datatype! X seems to be more than enough.

    We always build our own function "shortcuts" if needed.

    Except keyboard - OOP and the by REBOL often returned datatype #"char" also produce basic problems.

    For example we had to write this extremely complicated code to overcome the #"char" (and other) issues with REBOL's empty? function:

    xEmpty?: make function! [
    	{Needed, since REBOL's empty? not really useable: 
    	NONE or 'word or #"char" are "errors"! 
    	"   " or [none] not empty!  
    	empty? just working with: "" or []}
    

    xText /local x p result][ print "" print ["Xempty:" type? xText] probe xText if char? xtext ; real problem if we get a #"" ! [x: join xtext " " ; result a string! doesn't change xtext like form, make string! etc., alas! :-) x: pick x 1 if either any [#" " = x #"^(at)" = x] ; last case we got #"". Its converted to ^(at) [return true] [return false] ]

    if any [none? xText word? xText set-word? xText empty? xText ] [print [type? xText " xEmpty returning TRUE"] return true ]

    print ["xEmpty checks " type? xText ]

    result: true

    either block? xText ; check each entry, none appears as 'WORD in a block! [foreach p xText [unless xEmpty? p [ result: false break]]] ; recursive

    [result: empty? trim/all copy xText] ;copy else xtext changed! print ["XEMPTY returns: " result]

    result ]

    Works, but there should be a much better way! We couldn't find it.

    Anyway: Each part of a string is a string even if its a binary string!

    Its a logical failure to treat single elements of a string NOT as strings.

    The problems arising are quite a lot. The xEmpty? function above is just an example.

    Cheers, Ratio

    Ratio
    20-Sep-2009 16:19:52
    I just see it but can't help it:

    the - #"^(at)" - in above code is (wrongly) translated though it should not be translated at all (I used pre).

    Use form #"" to see what we get by REBOL and what is meant.

    Empty - functions are btw the most used basic functions in any application.

    Ratio

    Ashley
    20-Sep-2009 17:53:32
    OT
    xempty?: make function! [v] [attempt [empty? v]]
    
    does most of what you want. Expecting empty? to work on a scalar value does not make sense.

    Could I suggest you discuss these issues in AltME before assuming they are fundamental language problems that no-one else has noticed over the last 10 years! ;)

    Henrik
    21-Sep-2009 0:42:38
    I like coding my things so I don't get into datatype issues. Feed the right types to the functions. This way I avoid using ATTEMPT, as it can cause other problems of potentially ignored or hidden errors.

    Have a look at what types are accepted by EMPTY?:

    empty?: native [
        "Returns TRUE if a series is at its tail." 
        series [series! port! bitset!]
    ]

    So you would work out something like:

    if all [series? value empty? value] [...do something...]

    Then make sure that your value is a series beforehand.

    In a way, Ratio has a point, but the solution is wrong. The right solution would be to add a neutrality point for each datatype. An empty string, object or block would be neutral. The integer zero is neutral. TRUE would be neutral. Then all Ratio would need to do, would be:

    neutral? value

    Although some values can't be neutral, like words, this would still be a great deal easier than using EMPTY? REBOL would by default specify a neutral value as:

    make  []
    Maxim Olivier-Adlhoch
    21-Sep-2009 11:50:25
    I agree the neutral? func is useful and the default compare method in other languages, python being one of them.

    I've juggled with many names for this func in the past, but 'NEUTRAL? hits the nail right on. :-)

    Kaj
    21-Sep-2009 12:33:50
    Steeve, that's a good idea, thanks. I see that the R3 console does that on objects, although not on ports, and the R2 console stays silent on both objects and ports. I'm now executing HELP on both objects and ports.
    Ratio
    21-Sep-2009 17:14:14
    I think these are fundámental issues, Ashley.

    Henrik, agree. EMPTY does the same thing as TAIL. So EMPTY? is another function which in its current form is superfluous and (very!) misleading, too. REBOL should provide a useable EMPTY? function.

    In C and other languages, checks of empty values are always needed to check parameters and user inputs INDEPENDENT of datatypes: e.g. to use defaults, avoid runtime errors, avoid further checks and so on. Carl earlier suggested a DEFAULT function which points into the same direction.

    Even in our tiny bits of REBOL our xEMPTY is used about a dozen times. Though it's just a workaround checking just a few of the 54 datatypes available in REBOL.

    Generally: In these lower levels we cannot be sure what we get from the main applications. We have to handle everything we get - user-friendly.

    EMPTY checks therefore are a very important critirion.

    But the real reason why I cited empty/xEmpty is the CHAR problem in REBOL and the fundamental problems it produces mainly, but not only for newcomers.

    A CHAR! (a single part of a string) is in REBOL not treated as STRING!. Seems to be something linke a 'WORD, i.e. a datatype without any value. There might be reasons for that, but there are many disadvantages. Illogical things.

    PICK - applied on STRINGS! - always returns a !CHAR, not - as expected - a STRING!.

    COPY/PART on the other hand returns (applied on STRINGS) a string, fine! BUT if the string is in a block it returns a block! - Contrary to PICK.

    PICK - applied on a block! - returns exactly what is expected. One element only, but fine!

    In C it's quite normal to handle strings as arrays (which indeed they are). Each assembler programmer knows that. All values of any type used by any program have a location in memory callable by its address + offset in memory.

    A "block" is an array of strings (and possibly other values). So if we address a block value by its index, we want exactly that element as it is. If we similarly address a string we want exactly that element as it is - not quite different datatypes!

    Though code is not data and data not code.... ;-)

    ... A string is a string - each part of it also.

    Wouldn't it be a good idea to improve PICK or COPY and removing the other function? Adding to one of them a third parameter determining how many elements we want to extract from the starting point?

    Of course we can do it ourselfs. We implemented already SUBSTR, LEFTSTR and RIGHTSTR functions. But as application programmers we really have other problems than building the basic tools we need. ;-)

    Cheers, Ratio

    Anon
    21-Sep-2009 19:43:52
    Ratio,

    a REBOL string! is simply a series of char!s. As PICK simply returns the value at a specified position in a series, PICK on a string! returns a char!:

    >> str: "foobar"
    == "foobar"
    >> pick str 4
    == #"b"

    If you want to get a string! of length 1 starting at a specified position in a string!, well:

    >> copy/part at str 4 1
    == "b"
    Anon
    21-Sep-2009 19:48:13
    Ratio, please also note, that the above is completely consistent with the behaviour of those functions on blocks (which are series of values of possibly heterogenous types):

    >> pick [1 2 2 4 5 6] 4          
    == 4
    >> copy/part at [1 2 2 4 5 6] 4 1
    == [4]
    Brian Hawley
    21-Sep-2009 20:36:58
    Ratio, EMPTY? and TAIL? are not superfluous, they are two words that refer to the same function. Plus, you need to realize that something can't be considered empty unless it can contain something. Every container type in R3 is supported by EMPTY?, so there is no reason to fret.

    By the way, char! is not a container type, nor is none!, so there is no sensible reason to consider them empty.

    "A string is a string - each part of it also."

    Your preconceptions from other programming languages are showing - and you're picking the wrong ones. No more Basic, Python and C stuff. If you want something more comparable, try Lisp, Scheme or Forth.

    Henrik
    22-Sep-2009 0:56:31
    EMPTY does the same thing as TAIL. So EMPTY? is another function which in its current form is superfluous and (very!) misleading, too. REBOL should provide a useable EMPTY? function.

    Many functions are offered for readability and take up only a few bytes in the REBOL executable. EMPTY? is not misleading.

    About string! vs. char!, this is a strange issue. I have never encountered this as a design problem in my 8 years of REBOL coding. The reason is this:

    REBOL does a lot to help you shape your input using the TO functions as well as FORM, MOLD, JOIN, etc.

    It's like creating a key to a keyhole from a silly putty mold, and that's what you need to take advantage of: You change the key to fit the keyhole (easy), rather than change the keyhole to fit the key (hard).

    What I see above, is a huuuge chunk of code meant for retrofitting the keyhole and give it a new "feature" for it to fit more keys. That is a good way to complicate things very quickly.

    Another advantage is the ease with which you can discard data, before it reaches your EMPTY? function, as I already demonstrated in an earlier post. This makes the code easier to debug and runs faster.

    Why is char! not a problem?

    Because of this:

    form #"a"

    I still hold onto NEUTRAL?, but only for reducing the size of an often used scenario, where a value can potentially be a series.

    About those extra functions you built:

    We implemented already SUBSTR, LEFTSTR and RIGHTSTR functions. But as application programmers we really have other problems than building the basic tools we need. ;-)

    I don't understand why you need to build functions like these. You are handicapping REBOL:

    1. You are limiting yourself (name-wise at least) to strings.

    2. They are not necessarily COPY consistent. Only RIGHTSTR could work without COPY, but did you actually make it like that?

    3. You should take a look at the existing series navigation functions:

    - AT (largely equivalent to the simplest RIGHTSTR)

    - SKIP (similar to AT, but relative instead of absolute)

    - COPY or COPY/PART (similar to LEFTSTR or SUBSTR, only you don't need to feed the starting index)

    - FIND (similar to AT, except the input is a series element)

    - TAIL

    - HEAD

    - BACK

    - NEXT

    This is quite elegantly done, because of all these functions, only COPY performs a copy. None of the others manipulate or damage the series.

    4. You potentially lose the INDEX? for a series, where you might need it later, because of an unintentional COPY.

    These functions fit well into the above scheme of shaping your input. The ability to combine them in many different ways make then way more powerful than *STR functions.

    Kaj
    22-Sep-2009 10:40:24
    By the way, the Try Ruby console doesn't work for me at all - which probably explains why it's still marked beta. Half of the keyboard doesn't work, in Firefox 3, and in Konqueror the tutorial is unusable, too, due to almost invisible contrast.

    Henrik, if you're trying to use their code, I don't think it's going to work.

    Henrik
    23-Sep-2009 0:18:43
    Nope, I'm not using their code. I think I have the client side of things in order now, as it seems that all keyboard and console code is working.

    Right now I'm re-ordering things on the webserver to get a more presentable website for my other projects, and then I want to figure the rest out. I still haven't done that. :-/

    Gerard Cote
    23-Sep-2009 18:34:56
    Nice work Kaj. My trial worked well using Firefox 3.5.3.

    And thanks to all for the discussion about what really seemed off-topic here. It just sent some light over common misconceptions. Should be kept aside for newbies or programmers coming from other programming worlds and be put into some tutorial or summary about the way Rebol treats its series! Had some hard way to get it right too in the past ...

    Ratio
    24-Sep-2009 20:01:25
    Thanks again for your answers.

    After having considered them carefully I suppose, that nobody has an answer to the main question:

    Why do we need the often returned datatype CHAR!?

    Earnest developers have extremly often and very much todo with strings and blocks. These are the most flexible and most powerful datatypes.

    Except beeing confronted with lots of errors or conversion issues - what can we do with a datatype CHAR!?

    I tell you:

    We can do NOTHING with a datatype CHAR!

    Objections? :-)

    So why do we have it and get it though we do not want and can't make any senseful use of it?

    Yes, there indeed exists a function integer! Integer! indeed works only with #"A" but not with "A" - why not? Integer! should also work with "ABC.." just using the first char: "A".

    Yes, we indeed had to write a workaround also for all that to be able to always get the ASC value of ANY string - how long it ever might be.

    Henrik, thank you. That's all quite fine. But does it resolve the basic problems with the strange return values when extracting just ONE element of strings or blocks?

    AT doesn't it better, skip as we know indeed returns a string in these cases, fine! But applied on one block element it also returns a block (while the value is expected!!).

    To avoid the nasty CHAR! problem we couldn't help but write a function "char!-to-string!" in short "c2s") which is needed two times - at the very begin and the very end - of EACH basic series function!!

    Furthermore we had to write a function which converts a single block returned:

    ["A"] to "A"

    ["ABC"] to "ABC" etc.pp. - INDEPENDENT of all 54 datatypes available in REBOL.

    Cheers, Ratio

    Ratio
    24-Sep-2009 20:08:11
    ... Much overhead and deterring trouble for beginners who normally wouldn't believe it and try as ourselfs and many others (see the library) many different ways before.

    Always needed and expected things cannot be done without large problems on higher levels.

    They have to be solved at the root - in REBOL itself!!!

    Our block-to-value conversion might be questionable since it is somewhere an exception for cases where only ONE element is questioned. But it's normally used expecting normal results.

    The CHAR! problem in REBOL is always a problem.

    The datatype CHAR! should disappear - unless anybody tells us why we need it and why we must have so much unexpected trouble with it.

    So far nobody could tell us, WHY we need a datatype CHAR!. -- NOBODY. --

    Do so IF YOU CAN, Gerard Cote !!!

    Those who regard fundamental, basic issues "OT" in REBOL are bad for REBOL having those "geniusses" on board.

    Good string management is a very basic issue. So I could not comment other important issues: keyboard in general, console in R3 etc. Mentioned it earlier.

    -----------

    Next we have to check the date! datatype. Our first impression is that we cannot easily extract DAY, MONTH, YEAR. But hopefully we find a way.

    If this should be as complicated like string extract, this should be done in REBOL itself.

    Strings, dates and numerics are mainly used in all real applications. These datatypes must be handled in many, many different ways. REBOL cannot do that. But REBOL has to provide an easy way to access (get) them. If this is "too trivial" for experts: I'm sorry for REBOL.

    ----------

    I'm very, very happy that keybord ESC works in REBOL everywhere.

    Another issue is the ENTER key. Works not even in RebGUI.

    Navigation keys (all the arrow keys) do not work at all (except TAB in RebGUI).

    I programmed keyboard and mouse myself. So I know, that keyboard is a bit more complicated than MOUSE.

    Actions on MOUSE always work correctly. But that's no enough in a good GUI. The keyboard should always be useable as users expect.

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

    If REBOL wants to deter earnest users - users not just playing a little around - you are on the right way with comments like yours, Gerard Cote ;-(

    As expierenced developer and CTO I wouldn't write here so long comments if I were not earnestly interested in a well functioning REBOL system.

    All my comments are meant constructive, not destructive.

    Cheers, Ratio

    Ratio
    24-Sep-2009 20:22:07
    If you look into the library of user contributions, string management in REBOL is a problem for many.

    We see e.g. different proposals to solve the SUBSTR problem which cannot be done with REBOL functions alone. SKIP, AT, FIND etc are not sufficient.

    Why isn't SUBSTR (call it as you like) implemented in REBOL itself?!

    SUBSTR really IS a very basic string function - always urgently needed !!

    Until new users find complex solutions like this:

    	result: copy/part (skip Series start - 1) count 
    

    ...they have spent plenty of time - hours or days - on it.

    ----------

    But even this doesn't work correctly due to earlier mentioned problems.

    So most newcomers might give up. :-(

    If this is in the interest of REBOL developers, ok.

    If not:

    For REBOL developers it certainly is easy to implement those basic functions.

    Too trivial for geniusses? ;-)

    For newcomers it's almost impossible.

    Instead of fiddling in the skies and instead of installing dozens obviously superfluous and misleading things.

    I beg your pardon!

    First please provide basic functions ALL potential users normally need and can hardly built by themselfs!!

    Ratio

    Ratio
    24-Sep-2009 21:01:02
    Hi folks!

    After checking about 20-30 GUI-Systems including dozens of LINUX flavors based on X (Gnome, KDE etc.pp.) we found REBOL/VID/RebGUI as probably the best for our large commercial application.

    But as the main developer (CTO) I'm really tired to struggle with GUI problems. They are only a small part of our application.

    If any of the real REBOL experts wants to earn some thousand bucks by applying his "hobby" in practice -

    please write me a mail to "ratio (AT) kabelmail.de"

    Would very much appreciate your expert help and will (so or so) all keep SECRET.

    What from your side is expected:

    GUI displays and useable answers, based - of course - on a mutually agreed protocol.

    We on our side are flexible in this respect.

    Certainly we could do all GUIs ourselfs. As we already did with about 30% of our dialogs.

    But your expert help would be worth for us some thousand bucks. ;-)

    We really have enough todo maintaining and improving our main application.

    Expert help in the GUI sphere would be very welcome and you must not do it for nothing !!

    So please write me if you are an expert and like doing practical things with REBOL.

    I am sure you can. ;-)

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

    If you still do not believe it:

    Ratio - the CTO - really wants your help and it's him really worth some thousand USD!!

    If you are interested, please write me a mail to "ratio (AT) kabelmail.de"

    Again: All will be kept secret. I'm a scientist and a man of honesty, but tired to struggle with GUIs.

    REBOL/VID/RebGUI is in my opinion the best basis to solve all our GUI problems. We already solved about 30% of them.

    Perhaps we can get help from China?! I like this efficient chinese people!

    A good chinese programmer, if expert in REBOL, is very welcome - and would be a relative millionaire with small efforts.

    Cheers, Ratio

    Ashley
    24-Sep-2009 22:41:36
    All my comments are meant constructive, not destructive.
    They're all good questions ... it's just that asking them in a blog topic headed "Try REBOL 3... (server needed)" is kind of high-jacking the thread, and by responding to your questions I and others are further encouraging that. There are other forums for general REBOL-related discussion such as the mail list, AltME, REBOL Talk forum, etc where these free ranging discussions are more appropriate.

    Having said that, I can't resist answering this one:

    we cannot easily extract DAY, MONTH, YEAR
    >> help now
    USAGE:
        NOW /year /month /day /time /zone /date /weekday /yearday /precise 
    

    DESCRIPTION: Returns the current local date and time. NOW is a native value.

    REFINEMENTS: /year -- Returns the year only. /month -- Returns the month only. /day -- Returns the day of the month only. /time -- Returns the time only. /zone -- Returns the time zone offset from GMT only. /date -- Returns date only. /weekday -- Returns day of the week as integer (Monday is day 1). /yearday -- Returns day of the year (Julian) /precise -- Use nanosecond precision

    >> d: now/date == 25-Sep-2009 >> d/day == 25 >> d/month == 9 >> d/year == 2009

    Henrik
    25-Sep-2009 0:41:18
    We can do NOTHING with a datatype CHAR!

    Objections? :-)

    Yes.

    1. A string! is a lot heavier to represent in memory than a char!. A char in R2 is basically just 1 byte in memory. I'm not sure the garbage collection aspect is different, but if you have hundreds of strings scattered over a single script, it starts to add up. If you are passing a string, you may have to create one first and destroy it afterwards. You may also need to worry about whether it's being copied. Carl likes efficiency and char! provides a nice shortcut to avoid many worries.

    2. Why do you need the integer! or money! datatypes? You can strictly just use a decimal! to use numbers. But by using this mindset, you could remove half the datatypes in REBOL. Many datatypes are one of the huge points of REBOL, for example through the PARSE function (which you don't seem to want to use). It's about expressability. In fact, REBOL 3 has many more "useless" datatypes. Over 50.

    3. The ability to recognize a string of exactly one char in length using the PARSE function, (which you don't seem to want to use). We can't tighten the parse specs to a single char without complicating it with a silly error handler.:

    parse ["a" "b" "c"] [
      any [
        set shortcut string! (
          either 1 = length? shortcut [
            append shortcuts shortcut
          ] [
            make error! "You didn't follow specs, silly."
          ]
        )
      ]
    ]
    

    vs.

    parse [#"a" #"b" #"c"] [
      any [set shortcut char! (append shortcuts shortcut)]
    ]

    Yes, there indeed exists a function integer! Integer! indeed works only with #"A" but not with "A" - why not? Integer! should also work with "ABC.." just using the first char: "A".

    Because to integer! "1" does not mean the same as to integer! #"1". Try it. Using LOAD or DO for that is a big efficiency hog:

    >> then: now/precise loop 1000000 [do "1"] difference now/precise then
    == 0:00:00.489432 ; BTW: DO is not secure for this kind of thing.
    >> then: now/precise loop 1000000 [load "1"] difference now/precise then
    == 0:00:00.473504
    >> then: now/precise loop 1000000 [to integer! "1"] difference now/precise then
    == 0:00:00.267836

    Furthermore we had to write a function which converts a single block returned:

    ["A"] to "A"

    ["ABC"] to "ABC" etc.pp. - INDEPENDENT of all 54 datatypes available in REBOL.

    Sorry, that's nonsensical. FIRST will help you there, just fine. FIRST is also very fast and efficient.

    Why isn't SUBSTR (call it as you like) implemented in REBOL itself?!

    Because it doesn't take many hours or days to write (as you claim and deliberately overcomplicate):

    result: copy/part Series count

    A SUBSTR might look like this:

    result: substr Series start count

    But where does Series start? What if you don't want it to start at head? Does it start at the head? I can't see that. Because you are not leveraging the power of REBOL to handle series indexes for you...:

    result: copy/part at head Series start count
    result: copy/part at skip head Series preamble start count
    result: copy/part at find head Series "Dear sir," start count

    ...it's required that you calculate them separately, making SUBSTR increasingly silly and slower:

    result: substr head series (index? find head Series "Dear sir,") count

    The problem is that you have not learned the underlying model of series, indexes and series copying in REBOL and are not using them in a larger context, but instead hobbling them together in functions that will only slow REBOL down, eat more memory and give you much less control in the end.

    If you understood the model, you would not be asking for functions from BASIC to solve "problems" that don't exist.

    Nick
    25-Sep-2009 20:26:59
    Kaj, is there any chance that you'll be releasing the source for http://tryrebol.esperconsultancy.nl/ ?
    Kaj
    25-Sep-2009 22:00:42
    That depends. The app doesn't have much source, because it's written on top of QuarterMaster. It's really a collection of small tweaks to QM and Syllable Server to get everything right. The UI part of the code is already visible in the HTML. However, I'm in the process of replacing large parts of QM with my own web platform, so eventually Try-REBOL will also run on that. I haven't drawn a line yet which will be open source, and in any case it's still in heavy development, not suitable for publication yet.
    Nick
    26-Sep-2009 9:18:16
    Has anyone done something like this for R2?
    Kaj
    26-Sep-2009 10:41:18
    Eh, yes. Just wait until I bring it online. :-)
    Nick
    26-Sep-2009 12:13:32
    I just created a super simple CGI script for REBOL2 (must be a version with "call" support - I'm using 2.76):

    http://musiclessonz.com/rebol_tutorial/console.r

    I don't want to publish the link to a running version. If you want to try it, just upload it to your web server, rename it console.cgi, and change the path to your REBOL interpreter (2 places in the script). Try running something like:

    ? system/locale/months call "ls"

    So far, it's doing everything I wanted :)

    Kaj
    26-Sep-2009 14:37:05
    I'm not sure what the meaning of that proxy link is, but thanks anyway; I've had an R2 version of my site almost since the beginning, and I'm not using CGI.
    Nick
    27-Sep-2009 4:27:31
    For some reason, the blog continually rejected my submissions, so I used a proxy browser to put in the comment. I didn't realize that they would change my link (unbelievable!) - the text of the URL above is correct. Let me try again:

    http://musiclessonz.com/rebol_tutorial/console.r

    Kaj
    27-Sep-2009 12:09:19
    Now I've set up resource limits in Syllable Server at the operating system level, so the demo site is no longer dependent on R3's security features (although they're still in place).
    Kaj
    27-Sep-2009 15:31:36
    Now that the server is secured, I could also bring REBOL 2 online, without being bothered by its lesser security compared to REBOL 3. And there's a bonus surprise.
    Kaj
    28-Sep-2009 20:17:04
    I added a compare function where you get expressions computed in several REBOL versions at the same time.
    Carl Sassenrath
    29-Sep-2009 13:22:44
    Nick, so that web proxy changed your URL? Interesting. Must be how they stay in business. Anyway, I'll fix the link.

    Also, thank you all for participating in this project! If you are ready, I'd like to get the final URLs for the web pages, and post them. Send them to me on R3 Chat. Thanks.

    Henrik
    29-Sep-2009 14:03:50
    I'm bowing out of the web console project. Too much work and backend will be complicated and there are still security issues. I'll hand the source to anyone who wants to continue. Sorry.
    Hostile Fork
    30-Sep-2009 7:58:16
    I'm glad to see you're making this a priority. BUT the key value here is not to have an online expression evaluator. It's to simulate an enthusiast of the language, watching over your shoulder and prodding you through some simple problems to learn the overall spirit of the system.

    And c'mon, that part is done and they made it free to adapt for any purpose. It's JavaScript, HTML, and RegEx—don't reinvent this. Just use it and give them a nice thank-you, ok?

    http://github.com/Sophrinix/TryRuby

    The hardest part here is coming up with a canned tutorial that "sells" instead of "scares". What features consistently excite new users? In what order should you honestly reveal Rebol's quirks, so that people leave the room rationalizing them as appropriate decisions for the value gained?

    As a learning experience, try porting their tutorial to Rebol verbatim. Pick some non-Rebol programmer friends and see where in the tutorial they go "WTF?!?" Adapt until you achieve a good "WTF/OMG" ratio. :P

    Getting the server to run persistent Rebol processes... clean them up after timeouts... and maintain state is a whole separate issue and probably a different skill set to implement.

    Kaj
    30-Sep-2009 9:39:34
    Sorry, but we tried the TryRuby site and I reported on it above. It doesn't work. This is exemplary of the state of IT and REBOL's goal is to change this status quo. I don't find it odd to create our own solutions, because this is the great thing that REBOL affords you. My site is built on a full REBOL stack of several projects by several REBOL enthusiasts, so there is really no shortage of reuse here. It took very little code to integrate them into this application.

    The tutorial aspect of Try Ruby is nice, but it's also a lot more work. Maybe I'll get to that someday, but for now I have other things to do.

    Sunanda
    30-Sep-2009 12:48:35
    (at)Kaj -- there are some security issues you might want to tighten up.....Ask me on AltME REBOL3 for some details.
    Kaj
    30-Sep-2009 15:48:21
    Had a chat with Sunanda and didn't find any new problems.
    Ratio
    30-Sep-2009 17:13:44
    Hi Henrik,

    have no problems with you postings. I hope I'm not "harsher" sometimes. ;-) It's never meant personally.

    Since I saw you in Altme helping mhinson I even think you are a VERY nice guy indeed.

    Now see this small function resolving the problems we discussed:

    ;====================================
    

    SUBSTR: make function! [ {USAGE: substr "1234567890" 3 2 - Result "34" substr "1234567890" 8 20 (or -1) - Result "890" substr "1234567890" -1 -1 - Result "1234567890" substr "1234567890" 11 -1 - Result ""

    SUBSTR can be used on strings, blocks and chars. Used on blocks a block is returned; if count = 1 you get it's value at start position. Datatype char! is always returned as string! If out of bounds an empty string "" is always returned. }

    xSeries [series! char!] start [integer!] "If = 1: start from first" count [integer!] "If < 1: Rest" /local result ][

    xSeries: c2s :xSeries ; c2s converts to string if char! separate function since often used

    if count < 1 [ count: length? xSeries]

    result: copy/part (skip xSeries start - 1) count

    if none? result: c2s block2val :result [result: ""] ; none happens if empty block [] or out of bounds

    result ]

    ;===================================

    BLOCK2VAL: make function! [ "Returns if 1 block its value" result ] [

    if all [block? result 2 > length? result ] [result: pick result 1] ; pick returns NONE if [] or out of bounds, FIRST ends with RT errors in these cases. result ]

    ================================

    LEFT and RIGHT mentioned earlier are just for convenience, they use SUBSTR also.

    As you see in this example, likewise the CHAR behavior is always treated as a sort of bug. So CHAR! is no longer a real problem for us. But it might be bad for newcomers to have these illogical and therefore hardly to understand and not easily to solve problems.

    Would be interesting to see Carl's comment on the CHAR! issue. Carl certainly understands what I mean.

    Qui tacet consentire videtur. ;-)

    Ratio

    Ratio
    30-Sep-2009 18:32:13
    Nick,

    want to thank you for your guides to REBOL. They are a great help esp. for beginners.

    Ratio

    ratio
    30-Sep-2009 18:36:02
    Ashley,

    although registered I cannot write in Altme. Don't know why. There is displayed no button or other input device. Can't help it. Sorry for that.

    Date/time functions work perfectly in REBOL. Had just for a second forgotten NOW when I mentioned this as possible problem. It certainly is not.

    OT!!! RebGUI involved: :-)

    We tried to use RebGUI TABLE allowing col sorting and selecting rows by users.

    First we had a problem with the "options", a block like: ["Name" left .5 "Age" right .5 ... ].

    Really impossible to write those things (Colnames, positions, Sizes(!!) ) manually in advance FIX into a program handling thousands of different arrays !! Must automatically be done at runtime checking maxwidths of each col etc. Positions should be left if strings, right if numbers; center not needed except perhaps for colnames.

    So first we wrote a generic function PREPARE-TABLE to auto-create option blocks useable for all data arrays.

    Wasn't easy for beginners but works correctly. Might be a good idea to professionally implement something like that in table.r itself. But where can I post that function/proposal w/o beeing blamed?

    Happy being done and options set correctly we got another problem with TABLE:

    Error message: "table column widths are too large"

    ...if using a some more or a little broader cols. Even though the screen is large enough. There indeed seems to be a FIX width in table!

    We cannot find the bug in table.r. Experimenting with the size settings there (size: 50x25) makes no difference at all. size/x seems to be set FIX to 240!!

    Table seems to contain 2 or 3 other small bugs:

  • table - xList/selected - returns none if last(!) row chosen

  • table does not correctly return into console (ESC needed in console, results are lost)

  • table shortens arrays by exactly one row each time is it called twice or more often with the same array.

    Studied the source code (table.r) but could not find the reasons for that. Perhaps the last mentioned problem has todo with the first.

    We are using rebgui-58048.zip

    Sorry, this indeed mainly was OT. ;-) But where can we talk about it?

    Ratio

  • Nick
    1-Oct-2009 3:22:48
    Thank you Ratio - I actually just added a whole new section on strings, based on the conversation in this blog thread. This new version has gone through an enormous number of improvements and additions in the past few months (it's not the absolute beginner tutorial - this one is much more in depth, and a faster read). Hostile Fork, I wonder if this tutorial may satisfy your request:

    http://musiclessonz.com/rebol.html#section-6.4

    Kaj
    1-Oct-2009 23:26:42
    Another batch of enhancements:

    Added assorted documentation links, including your tutorial.

    When an error results from an R2 expression, a link is shown to the relevant documentation, replicating the WHY? feature. Due to a bug in R3, this doesn't work there yet.

    Intercepted the BROWSE function and rerouted it to the client browser, so that it now works.

    Ratio
    2-Oct-2009 19:22:58
    Nick,

    you seem to be highly qualified in REBOL usage.

    We on our side are not.

    We succeeded to do some basic things but we are tired of it.

    We need just the basics. No effects, games, music etc. We do not want any - in our view - "firlefanz". We are interested in good TEXT display and reliable user responses.

    All what I said earlier is valid. Your help is worth a few thousand bucks.

    If you are earnestly interested to do the REBOL part, please write a mail to

    Ratio (at) kabelmail.de

    with a valid address to response to.

    REBOL experts could learn a lot about all what is really needed in real commercial applications. ;-)

    It should be relatively easy for you to help us and earn btw some bucks.

    Please help us.

    Best regards

    Ratio

    Hostile Fork
    2-Oct-2009 21:25:49
    (Nick: that's a useful site. I think it doesn't have quite the "pitch" nature that an interactive marketing experience would need. It shouldn't be too dry and the steps need to be small and salient. If you're on R3 chat, check out my post...)

    Kaj--

    I'll reiterate that I'm glad you are trying to put energy into a new idea. But the interface you are building isn't heeding Carl's statement above: the world sets it's own expectations. Try Ruby! has set a bar for this kind of thing, and releasing an inferior experience will leave people with one conclusion: Ruby must be better than Rebol.

    I went ahead and did a quick tryruby port to start a tryrebol. Please see my post about it on R3 chat as it is not a public URL. If it really matters to you, I can patch the Konqueror keyboard thing... but it's not savvy to make decisions on a browser has only 0.1% market share, and arguably is being buggy in this case:

    JavaScript Madness: Keyboard Events

    Since you apparently don't have the time to work on the tutorial "experience", it would be much more useful to focus on some of the unsolved questions in the evaluator. Like how to maintain interpreter state between sessions! On your site (as on my quick hack) typing this:

    x: 1

    ..and then this:

    print x + 1

    ...causes an error. So if you want to steer clear of JavaScript and HTML and Ruby, then maybe you could focus on solving the server-side persistent interpreter (with timeouts, etc). You can keep your hands clean and do every last bit in Rebol if you like. It could be used with the tryrebol interface, or anything...

    (Email me or private message me in Rebol chat to continue this conversation.)

    Nick
    2-Oct-2009 23:55:20
    Kaj, I was very excited to see Orca support (never tried it) - will it be implemented? (...and thank you for the link :)
    Kaj
    3-Oct-2009 1:51:25
    I'm not sure what you mean: ORCA support is implemented. Unless you caught me just now, because I'm experimenting with that part of the site. Sometimes things will not work when I'm developing them, as long as the site is not officially published yet.
    Kaj
    3-Oct-2009 2:17:09
    Fork, we're talking volunteer work here, so if you're not satisfied with my site, you're free to build your own. As Henrik has also stated, maintaining state of the REBOL interpreter is not trivial. In itself it can be done, but it opens up another can of extra security complexities, so it is simply not a feature of my site, at least not for now. Instead, I'm supporting extra features that would be difficult to do in a stateful GUI, such as script cut and paste and editing, and the comparison feature of several REBOL versions.

    I don't see how steering clear of JavaScript and HTML is an issue here, as the GUI of my site is obviously implemented in it, and handwritten at that. Steering clear of Ruby isn't a fundamental issue, either, as I've been using that as my main language for the past seven years - but this is a REBOL demo site. Being compatible with browsers if at all possible is an issue to me, as I'm developing alternative operating systems with alternative browsers, and one of the things we're fed up with is the gratuitous negligence of all but the latest and greatest and most mainstream. I also think it would reflect badly on REBOL if its demo site had compatibility issues, especially since its philosophy is also against such self-made problems.

    You're free to disagree, but you'll have to do the work yourself, because I can not justify it.

    CS-0427
    3-Oct-2009 5:49:37
    Kaj--

    PLEASE pay attention to what I have said. I did do the work, and I did build my own site.

    Carl seems to favor chatting inside Rebol 3, and that is where I posted the URL of my project. If you are truly a Rebol fan log in there and talk to me, check out my site, etc. If you won't even use R3 chat then I call shenanigans on your insistence to ignore tryruby sources because "Rebol is the one true way"

    Thanks.

    Kaj
    3-Oct-2009 6:13:45
    Great, I look forward to seeing your site. :-)

    By the way, have another look in R3 chat. I'm user 15 there or so. But currently not logging in much due to busy work on Try REBOL site...

    Kaj
    8-Oct-2009 21:04:14
    Made it look less dull now. :-)
    Kaj
    18-Oct-2009 11:20:29
    The Try REBOL site is stable now. I announced it on the Syllable websites: http://development.syllable.org/pages/index.html
    Gerard Cote
    25-Oct-2009 20:27:11
    Kaj,

    I just tried this small experiment using R2, R3(A92) and TryRebol and I didn't get the same error msgs for both R3 and TryRebol ? Can you see why and where the diff comes from ?

    s1: [] for i 1 26 1 [append s1 to-word to-char i + 64] ; to-string is missing between to-word and to-char

    Thanks.

    Kaj
    26-Oct-2009 12:07:24
    I'm not sure what you're trying to do? In this form, the expression is invalid on all REBOL versions. With the to-string added, the result is the same with R3 and R2 on TryREBOL.

    If you just mean the error messages: I had to program those differently for R3 and R2. On R2, I'm generating them myself, because I wanted more information than the default printout. On R3, there's a bug, at least on Linux, that prevents me from catching an error, so you get the default output.

    If you saw a difference with error output on A92, the obvious explanation would be that Try REBOL is still using A82, because there are bugs in newer versions, and only A90 is available for Linux. The error output is the same between A82 and A90, so if it's different on A92, I don't know why.

    cherrin
    13-Jul-2012 23:20:18
    Existing in the world surrounded momo9 by expertise at complete four places, it could be a debacle not to permit expertise encircle you as it did to the entire world. When the notebooks came in the marketplace, it initiates all the whirl in skills dedicated individuals and their social congregations. The conventional PCs were run into background when the portable pcs were introduced, not earlier than the prices of notebooks chopped to a economical series did the portable PCs snatched the marketplace right from the grip of the conservative PCs.

    Since then, it has been a warfare territory amid the manufacturers to originate and introduce latest, newfound scientific features in equipments to gain the peak and most profitable market fraction. Still the notebooks sellers cannot fight with the degree of upheaval the handset devices shaped while they launched into shops; with the improved product elements including all the latest chosen strategies pregnated in their light and compact bodies. eken a90 is one of the rages in the existing world; attracting the consumers additionally with its slim body and ideal effortlessness of managing them for a long time without giving into any kind of problem or getting tired. The wholesalers do not deem it any hazard for them to buy the tablet PCs as they are extremely in demand and return them greater than their spent value. Wholesale tablet PC is specifically advantageous to the wholesalers who obtain them from the vendors at a rate that is lower than the market worth and with their contacts with the sellers, adding to the practicality that they buy them in large number; presenting them an advantageous earnings from their selling. The wholesalers needn’t fret concerning the fame of the wholesale tablet PCs that they are buying in great number; for the reason that the tablet PCs are extensively utilized by hospital staff, salesmen, store holders, door to door service deliverers and in industrial regions, even the post delivery service is recorded using tablet PCs and pocket frame computers.
    China store is a right place to purchase every one of conventional goods of China. A China shop menifests Chinese customs in its goods ranging from garments to food stuff, garnishes, ornamental goods, and furnisher and also the personalized Chinese items and traditional Chinese tea and tablets. Chinese pictures and paintings are also showed in Chinese shop; depicts it’s distinguished customs. The outlook of the China outlet is perfect illustration of joined to one’s family tree. China is expeditious growing country, and has accessed almost all main and minor domestic and global businesses; however yet the nation has not forgotten its family tree. China store anywhere in this planet potrays same Chinese traditions very noticeably. The Chinese have constantly been conspicuous about sustaining their morales and cultures with seriousness and a Ployer MOMO9 absolutely lives up to the reputation of a entirely Chinese convention.

    Post a Comment:

    You can post a comment here. Keep it on-topic.

    Name:

    Blog id:

    CS-0427


    Comment:


     Note: HTML tags allowed for: b i u li ol ul font p br pre tt blockquote
     
     

    This is a technical blog related to the above topic. We reserve the right to remove comments that are off-topic, irrelevant links, advertisements, spams, personal attacks, politics, religion, etc.

    Updated 2-Oct-2014   -   Copyright Carl Sassenrath   -   WWW.REBOL.COM   -   Edit   -   Blogger Source Code