« first day (1207 days earlier)      last day (2573 days later) » 

12:02 AM
begin works, but might use done as it doesn't occur anywhere else that I know of.
Or contain
Crude example would be:
either (true) contain print "True!" done contain print "False :(" false done
either (true) [print "True!"][print "False :(" false]
(this is just thinking out loud, not sure I'll go anywhere with this...)
Within a template:
<[ either (true) contain ]>
True
<[ done contain ]>
False
<[ done ]>
Not really very likeable.
 
12:27 AM
@rgchris That looks to be going deeper to the "structure in tags" that dialects with a Rebol backbone avoid. I would like to see more attempts to get what's desired as html output with a dialect somehow...
 
@HostileFork I still feel it needs to be somewhat inside-out. Shouldn't hesitate in dumping, for example Google Analytics code verbatim into such a template.
 
@BrianH the issue with copy on write isn't with multithreading, but I did find a hitch; if you COPY/DEEP a block then you can't stub out the series except if it has no series in it (unless you're willing to do copy-on-read for non-leaf series)
 
@rgchris you might look into the Razor engine in ASP.NET MVC. It has a good balance between code and markup. Notably, the embedding goes the other way around; your suggestion seems more like ASP-style page languages.
 
@BrianH The intent is to move away from RSP-style.
Which can get fairly symbol-heavy.
<% if true [ %>True<% ] %> -- Ugh.
 
@rgchris well, that sounds like RSP-style with a different syntax. That is why I mentioned Razor, it doesn't require most of that stuff. It's good to look at it for ideas.
 
12:36 AM
@rgchris I use [HTML {<whatever "whatever"...>] for such cases, and if we get the none improvements on rejoin and go with parens for code, [HTML (code)] could be quite legible when you need it.
Also in Dream I'm thinking you can choose default markup for string on at least a per file basis in the header. I like Markdown but being able to choose could be useful.
 
@BrianH Hm, it's interesting, but I don't know that I like code intermingled either. Will look at it some more...
 
@HostileFork multithreading isn't the issue with copy-on-write, it's a reason to do it at all. Most Rebol code has benefited from non-copied, modified series. This hasn't been an issue until multitasking was proposed, since it's mostly concurrent code that benefits from not modifying structures. The reason I mentioned PROTECT is because it would theoretically be a way of indicating that you don't want series to change.
 
@rgchris Note that the "code" run in Draem could be a subset of full Rebol, the way Django works. It need not be (and probably should not be) full DO. Alternative default processors for parents code, like markup processors for raw strings, could be indicated in the header.
@BrianH protect would thus be CONST, not static...
But the protect name seems fine to me, even on declarations initialized with literals. x: protect "foo"
Although this makes me wonder. What if literals were protected by default, and static was UNPROTECT?
 
@HostileFork right, because normally we would want to not copy. But concurrency might turn that on its head, as would Ladislav's points about builders being better than modifiers when not in low-memory situations.
@HostileFork the protect and unprotect model for this turned out to be a usability nightmare. Once all of the missing features needed to do what was required were proposed, it became clear that the whole model needed a bit of a rethink. A lot of the underlying code is great, but the API stinks.
I can find and link the tickets if you like. It really seems like we need to separate concerns, at least from the outside. There may be a lot of shared or related code in the inside, but we need to make things appear separate on the outside.
 
12:58 AM
Wait, I think I just figured out why copy on write with a copy on read fallback for nested blocks is okay. Just make the copied version own the data. If the copy was done by an assign instead of by copy itself (or even if it was copy) odds are no one ever descends down into the original. It probably only existed to make a copy of.
 
Let's take strings. For Ruby they copy string literals by default, and then were able to freeze them afterwards (freeze is their equivalent of protect). They started doing copy-on-write at some point for explicitly dup'd strings, which is nice, but it doesn't deal with that first copy, so they still had a lot of overhead.
With Ruby 2.1 they added syntax to make pre-frozen string literals, which cut down on the copies and (for 2.1+ code) increase their performance dramatically by treating frozen strings a lot like symbols.
Now, we don't have their situation, quite the opposite, and we won't get quite the same benefits because Rebol isn't compiled, but some of their internal changes might be worth looking at for something more Rebol-like. We just need to figure out the best Rebol-like semantics to have on the outside.
 
Pre-frozen series literals sounds like it could be helpful. I think having to say x: mutable "foo" isn't so bad. Confusing though that non-series can't be immutable. :-/ You have to put non-series values into one-element blocks and protect them!
 
For instance, most of our literals that we want to copy-on-write are in code blocks. One interesting part of Rebol is that most code blocks are passed as parameters to function builders that call make, or to binding loops. We could have the function/closure make and binding loops protect/deep their resulting code blocks, and then you can declare stuff as mutable when you need to.
 
That sounds quite good, actually.
 
@HostileFork the non-structure "immediate" types are all immutable already.
 
1:12 AM
Ok, food for thought, now I want another test which is to try your immutable function builder and see what kinds of things break.
 
Keep in mind that when you assign a value to a word, you are really changing an object value slot, not the word. Even binding creates new words of the same symbol bound to a new object, it doesn't change the original words.
 
It really sort of is the function bodies we want to protect, not data outside of them
Now I like the awkwardness of x: unprotect "foo" because you get the feeling you're doing something odd. Rather than copying a variable once outside the loop, you're undermining security by making the code in the function itself mutable. People should think twice...
 
@HostileFork one thing that breaks is functions that contain what in other languages might be called "static local variables". That is one of the uses of function/with, btw, but that kind of thing doesn't survive mezzanine-style code generation flows. And the ability to unprotect at all makes protect style freezing a poor security method, its original rationale, so we'd better rethink what we're trying to do here.
 
This is better than the copy on set-word because its more uniform, cuts to the problem, would be easier to patch code affected by the change. I bet it will catch some bugs too.
@BrianH function/unprotected and func/unprotected for mezz-style code if you're sure you know what you're doing?
 
As long as it doesn't break functions like reword or R2's map-each, which use compiled dialects, it might be an interesting approach.
@HostileFork would you please encourage some people to look at github.com/rebol/rebol/pull/82 and issue.cc/r3/1952 and comment? It is important that these be looked at.
@HostileFork I don't think these will be necessary, since it's exceedingly rare that you'd want to unprotect everything - normally you only want to unprotect specific things. Nonetheless, we should consider whether we want to explicitly protect code blocks in the function builders, or whether we should do it in make. If we do it in make then certain whole classes of function builders will become impossible.
 
1:30 AM
@BrianH I don't know if I understand the efficiency argument. What implementation change of DO that is likely to happen would make DO some-bin faster than DO TO STRING! some-bin
@BrianH It seems like it should be in the function builders, not make
 
@HostileFork do to string! some-bin has to convert the string back to UTF-8 binary before it can be parsed, because Rebol's source parser can only handle UTF-8 binary. We don't have a string parser for Rebol source. So, this could be a major speedup for a wide variety of situations.
 
The thing about having the function/unprotect would mean you could write function/unprotect [] [x: "something" y: "something" z: "something" ...] instead of function [] [x: unprotect "something" y: unprotect "something" z: unprotect "something" ...] because it's function doing the copy+protect you can't do function [] unprotect [...] so it gives you access to something impossible to do otherwise.
Well, without using the underlying make yourself. I just didn't want to cut off the ability to have those semantics if you wanted them.
@BrianH Oh. Well, then yes. It seems it should certainly accept binaries. Is this uncontroversial?
 
@HostileFork but then if that function has something like if condition [some code] then the code block will be unprotected as well, which cuts out on a lot of the (security) benefits of doing this in the first place. Remember, it's not just strings that are literal.
 
@BrianH I didn't say it was for everyone, just that people who liked the old semantics might want it. I wouldn't use it, myself. But if you don't unprotect at the outer level outside of the function, then any unprotects will have to run every time you call the function.
 
@HostileFork it wasn't merged when Carl merged all of the things. I don't know why, but the fact that noone else made any comments on either the PR or the ticket seems like a good guess.
 
1:37 AM
It could be important in optimization. You like optimization. :-)
@BrianH commented Be right back in a moment, but could you dig up anything pertinent to this protect/unprotect idea where issues have been seen prior?
 
@HostileFork make unprotect of something unprotected have a fast code path. Or better yet, put the unprotected stuff in a function/with block. Or use make function!, or your own function builder if you have a common use case that needs this feature. You don't want to miss out on the optimization possibilities that come with unchanging code blocks - you can only hand-optimize things without them.
@HostileFork issue.cc/r3/1014 issue.cc/r3/1015 issue.cc/r3/1141 issue.cc/r3/1142 issue.cc/r3/1143 and those are just the API/functionality issues, that doesn't count the bugs in existing functionality. After those, it became clear that we need to rethink the API model because this one isn't simple to use in complex situations.
And that doesn't even count combining protect and protect/hide into the same function.
Also, there is no protected? function, so the only way you can tell if something is modifiable is to try to modify it and see if that triggers an error.
@HostileFork protected? function issue.cc/r3/1788
 
2:07 AM
@BrianH Yes, it seems like HIDE should be separate. HIDE / UNHIDE / HIDDEN?
 
@HostileFork I think the reason it's not called that is because hide is a common operation in GUIs.
 
@BrianH cloak/uncloak/cloaked? The only use I know of for the existing CLOAK I removed from boot startup. It isn't any kind of useful security.
It's a pretty funky word.
Unlikely to be used elsewhere.
 
@HostileFork because of the "hide" issue I had to name the corresponding module keyword hidden.
 
2:22 AM
Full stack - and according to your diagram, down to the hardware level. So, will I eventually be able to recompile both for an OS and directly for hardware like Verilog? — Michael 12 hours ago
@Michael Red is a language like Rebol except its IL is a syntax-compatible "dialect" of itself called Red/System. Red/System is lower-level and is C-like (does not have Lisp-style metaprogramming like Red & Rebol), with some ability to do things like inline assembly. It seamlessly embeds in Red. So "hardware" here means "talking to the hardware", e.g. at the level of being an operating system...but since C to HDL exists, Red could do similar. Come chat about it! — HostileFork 40 secs ago
@BrianH what is FUNCO supposed to be? :-/
Oh. Hmm. "FUNC" "O"ptimized. Hmm.
Why don't the boot functions explicitly use FUNCO instead of having a period where FUNC is defined to FUNCO?
You mentioned that this affects recursion and other matters, so it seems that if you're changing the semantics of function its good to see that explicitly in the source code.
 
2:40 AM
The O is for Original, at least I thought. It is basically the FUNC that is used to load the mezzanines. It improves startup time by not copying the code body, but isn't recursion safe for the same reason.
There's really no practical reason to leave it defined once startup is finished.
 
@BrianH so mezzanines can't recurse (safely, in a general sense)?
If function bodies were protected, how would this affect that issue?
Perhaps you can explain the recursion safety issue to me.
The comment on FUNCO reads "funco: :func ; save it for expert usage"... it seems experts could use make function! themselves, couldn't they?
 
Functions which are run while the Mezzanines are being loaded can't call functions which call FUNC internally, like COLLECT. Once the mezz is finished loading FUNC is replaced by the recursion-safe version. Then you can use COLLECT.
FUNCO doesn't need to be exported, it's a development artifact, like T. We can get rid of that line.
 
@BrianH That sounds fine to me, but what are the ramifications of defining FUNCO as minimal FUNC and then whenever you need FUNCO you use it explicitly? So FUNC is never defined until it is full FUNC? Where would that mess things up? How many FUNCOs would there wind up being?
 
2:58 AM
During startup FUNC is defined as that minimal FUNC. After startup FUNC is redefined as the recursion safe FUNC we know and love. Right now FUNCO is set to that minimal FUNC before FUNC is redefined, but it doesn't have to be. Outside of R2/Forward I've never seen FUNCO used at all.
 
@BrianH So what if during startup there was no FUNC, only FUNCO, and then after startup FUNCO was undefined and FUNC defined?
This seems like it would "tag" any recursion unsafe functions at the source level, rather than switching what FUNC meant for the convenience of moving functions into and out of startup. You'd catch the mistake because there'd be no FUNC early on, and no FUNCO later, so if you ever moved you'd have to fix it up.
Basically do the FUNC define and FUNCO undefine at the same moment. Is that possible?
 
There is no reason not to redefine FUNC after startup. By setting the word FUNC early we speed up Rebol by giving it an earlier slot in lib. There is no reason to define FUNCO at all, and no reason to have any runtime function not be recursion safe at all.
 
Couldn't you get the word definition just by saying FUNC: none ?
It's like you get into this "When is a FUNC not a FUNC? When it's a FUNCO." situation that seems avoidable. I might even call it FUNC-BOOT or something like that.
It would be a nice reminder that you're dealing with a special function generator for that function, not the normal FUNC. I realize that when one does all the bookkeeping in one's head one might find that "unnecessary" but on an open source project where many eyes need to be able to read it, there are new concerns of understandability.
"Oh, I know this file contains functions that run before the boot is finished, so the FUNC generator is different at this point." You may know, but it's not as easy for other people to know this, or to keep any ramifications in the forefront of your mind.
 
Yes, but then if you call the function FUNCO the word has to be added to lib or sys, wasting space. Better to not define it at all. It doesn't matter that startup FUNC isn't recursion safe, it doesn't need to be and we don't want to call affected functions anyway due to their overhead.
 
Does UNSET allow a word to be reclaimed?
 
3:10 AM
No, it stays in the object.
Otherwise bindings fail
 
But back to this issue of recursion safety. If the FUNC and FUNCTION generators did a PROTECT of the body, what would the recursion issue be? I'm still trying to understand that bit. And if you do a body that copies just one time... how does that make recursion any safer? You mean a recursive function that defines a function inside its body? What is the failure case?
 
Protect would need to be replaced by some copy-on-write thing, not the don't-write thing it is now.
 
@BrianH I'm still having trouble understanding the issue, walk me through it.
@RebolBot
body: [foo: "" append foo "bar" return foo]
x: func [] body
y: func [] body
print x
print y
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> body: [foo: "" append foo "bar" return foo] x: func [] body y: func [] body print x print y
bar
bar
 
Without a copy, you would get "bar" then "barbar". Right?
I think I get that bit. But I'm not sure what you mean about recursion safety.
If you don't make a copy, and unprotect something in the copy for modification, you wind up in the same situation as the above. But if you make a copy, and protect, then unprotect when you want to do the above... it seems the same. I'm not seeing where recursion gets in the mix.
 
3:18 AM
Protect of a series/object/map marks the thingy as nonmodifiable. We would need to instead mark the thingy as make-a-copy-when-modifying.
 
I'm trying to get to the fundamentals of why, see repeated question.
Show me a recursion case where making a copy of the function at time of generation plays into it, that is demonstrably different in character than the short example above.
The foundational issue is that you preserve the series literals that are "static" in a function by a pointer living in a value that is in the block of the function body itself. Because blocks count as "series literals" this is slippery. x: next [foo bar] shows why you can't just copy series that follow set-words... you have to copy all the series.
And as with the example above, what if you said:
@RebolBot
body: [foo: "" append foo "bar" return foo]
x: func [] body
insert body [print "starting y function"]
y: func [] body
print x
print y
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> body: [foo: "" append foo "bar" return foo] x: func [] body insert body [print "starting y function"] y: func [] body print x print y
bar
starting y function
bar
 
I didn't call x again, but... if you didn't copy the body then calling x again would print "starting y function".
As well as "barbarbar"
 
Calling startup FUNC doesn't copy the spec or code block arguments, it modifies the original. That means that calling FUNC in COLLECT with startup FUNC reuses the code block of the argument, rather than copying it. So calling COLLECT more than once will corrupt that data.
But not at runtime, COLLECT is fine then.
 
So "calling the function builder FUNC inside the body of a call to COLLECT would be a problem".
"if done before the FUNC redefinition" :-/ ?
These are some fairly subtle things, regardless, I do want to get to this recursion answer because I've yet to see it.
 
3:29 AM
Right. But COLLECT has too much overhead to run during startup, so it's an OK restriction. Same goes for other functions that call FUNC internally.
I'll explain when I get home. I'm on my phone at a grocery store.
 
Ah, no rush. I'm poking and learning.
 
@RebolBot do protect a: [] b: copy a append b 1
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> protect a: [] b: copy a append b 1
== [1]
 
3:47 AM
OK, so being protected doesn't extend to the copy, barring bugs. This means that with some fixes to protect we would have copy on write already just by prohibiting writes to noncopied stuff.
But since we can't detect whether things are protected we'll have to unprotect the stuff we don't want to copy, preemptively. And the API sucks.
Still using chat from the phone :-)
 
@BrianH I've never really gotten into this stuff as of yet. But now that I am, I believe I'm getting it.
Definitely, definitely have to look over Rubol again.
I do think that it can be an evangelism tool if done right, to say "can your language do THIS?"
I did get a little ways into it, I did sort of grumble about my block dialect for the yield being based on a block of code with a block at the beginning. [ [var1 var2] ... code ...] ; but I wanted to package up the parameters and the code somehow into a single "value".
Anyway I bet I could do all the under-the-hood stuff far more efficiently with my current knowledge. It was all totally confusing to me then; kept poking at it until it worked.
 
4:10 AM
@BrianH looks like your DO binary! is merged...
 
posted on February 18, 2014 by carls

Make DO binary treat the binary as source

posted on February 18, 2014 by carls

Correct multiple inheritance, CC#1863 (please verify the result as it relates to #143 - thanks.)

 
Yay!
 
I'm still very pleased about the ability to pass non-blocks to IF. I want us to get enough experience with this to make sure all the good outweighs the bad, so that there's enough evidence of that fact that it gets into Red also. I'd like to see PICK no longer use booleans; that's one of those "this doesn't feel right" situations.
Similarly nice is acceptance of the logic conversions being consistent with the conditional interpretations of truth/falsehood.
TRUE = TO LOGIC! 0 is simply more consistent with if 0 [print "true"] printing true.
And I do like that 0 isn't false. I've always hated that idea.
 
posted on February 18, 2014 by carls

Fix unwind passing (CureCode issues 1509, 1515, 1519, 1760)

 
That was just the most important PR of the bunch!
I have several sets of tickets that I want to make PRs for, now that I have more time. Should be fun.
 
4:26 AM
@BrianH Well it's more fun when everyone's around and things are happening. Has been a long period of thumb-twiddling on the Rebol side; I still feel that we should be able to think collectively and switch over to where Rebol is Red's research lab for foundational ideas of language, not vice-versa.
If Red went out the door with TO LOGIC! 0 being FALSE just for the sake of doing what Rebol did, that's the kind of thing that is not good. It seems we can scan ahead and keep that kind of thing from happening, or take care of this join thing with NONE.
 
Keep in mind that join and rejoin are just thin wrappers around append, so it may be better to rethink append and insert.
 
I guess if it turns out that at the end of the day, the argument is "none is a valid value in blocks so compose has to use (EITHER condition [code] [[]]) or (EITHER condition [[]] [code]) instead of IF condition [code] or (UNLESS condition [code])... I wouldn't call it the end of the world, and now there's (EITHER/ONLY condition [unevaluated block] []) as an alternative, if the condition was the only thing you really needed to eval.
Still I think all these should have reasoning. "The Design and Evolution of the Rebol language" should have a page you can point the people asking "Why?" to and have an argument that makes sense.
if/only + either/only + unless/only are rather useful. I've gotten on board with /only, under a certain strict definition.
Having more of them destigmatizes them and makes the pattern of what they mean more apparent.
You could get by with if/only, but it would wind up verbose as do-if-block if/only condition arg. And getting back to PRINT and PRINT/ONLY, you could get by with PRINT/ONLY... but usually you want that newline and the spaces injected between pieces.
 
Weirdly enough my strict definition of /only is a little different than yours, requiring that /only only be allowed when it takes an argument, so you can have an answer for "only what?". But I'm a little flexible if you are.
So resolve/only makes sense, as far as I am concerned.
 
4:43 AM
Welcome to the Rebol and Red room. See our FAQ. Cool, you have a reputation score of 640 so chat away!
 
5:02 AM
@rebol Hello!
 
@rebol Hello!
 
@CrazyProggrammer Hello!
I see you enjoy Android. I do some Android development and hacking.
 
@rebol always great to see more merges!
 
@BrianH I saw Carl at my store on Friday and he mentioned he was starting to feel bitten by the Rebol bug again. I was happy to hear that!
 
@CrazyProggrammer You've come to the right place. We're craaaaazy! Like Crazy Dave
 
5:15 AM
nice one... I am also crazy so we all are at same place...
hey I also want to join Red desigining how can I?
 
@CrazyProggrammer The GitHub sources are at github.com/red/red
On a related but different note:
I'm working with GregP on an intro article for Red for ODROID Magazine. So, I cross-compiled the Red Console for Linux-ARM and tried to run it on the ODROID. It gives me the error "error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory".
So I ran:

apt-get install libreadline-dev

This put libreadline.so.6 in a subdirectory of /lib. Same error. I moved libreadline.so.6 to the root of /lib. Same error.

What am I doing wrong?
@CrazyProggrammer Speaking of crazy, look at my avatar. My cartoonish bald head is sticking out of a monitor.
@ShixinZeng Thanks for letting me know that you tried to compile Rebol/View for Linux/ARM and had bugs. I hope you find time to fix them. If so, it will be great for promotional purposes. I'll show it off in ODROID Magazine to 8000+ monthly readers.
 
@CrazyProggrammer There's a lot to understand to start with, but I promise you it's fun to start with. You only lose your hair like @Respectech and I after you get deeper into it. (Don't know @BrianH's secret, it's probably a wig)
@RebolBot
print [{Do you know any Lisp,} (reverse {remmarggorPyzarC@})]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> print ["Do you know any Lisp," (reverse "remmarggorPyzarC@")]
Do you know any Lisp, @CrazyProggrammer
Welcome to the Rebol and Red room. See our FAQ. Cool, you have a reputation score of 3676 so chat away!
 
Greetings @tangentstorm. I am formerly of Texas. Your homepage links your GitHub to your gists, BTW
 
hello. why, so it does. thanks! :)
 
5:27 AM
@tangentstorm Another Android guy. Cool!
I mess a bit with Android. ;-)
@tangentstorm My mom lives in Texas. I've never visited her there. Maybe this summer....
 
@tangentstorm Red is trying to build programs for android, fully packaged .APK, with only a < 1MB executable. Zero install. Following in the steps of Rebol, except it's a compiler... and you can use the same executable to build binaries for Windows, OS/X, Linux... "cross-compilation done right"
 
I am really sorry but I dont know any of Lisp.
 
@CrazyProggrammer You don't have to be sorry, it's an exciting day for you! :-) Like XKCD says...
 
thats cool...
 
So red is a rebol compiler? Or just a rebol-like language?
 
5:32 AM
typo.
@RebolBot
code: [print 1 + 2]
print [{The length of code is:} length? code]
foreach symbol code [
    print [{The type of symbol} mold symbol {is} mold type? symbol]
]
print {About to run the code...!}
do code
append code [+ 3]
print [{The new length of code is:} length? code]
print {About to do the new code...}
do code
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> code: [print 1 + 2] print ["The length of code is:" length? code] foreach symbol code [print ["The type of symbol" mold symbol "is" mold type? symbol]] print "About to run the code...!" do code append code [+ 3] print ["The new length of code is:" length? code] print "About to do the new code..." do code
The length of code is: 4
The type of symbol print is word!
The type of symbol 1 is integer!
The type of symbol + is word!
The type of symbol 2 is integer!
 
@johnk Can RebolBot please notice fixed font code? So if the first line is @RebolBot, even if the @ is not the first character, it will still eval? I'm tired of having to modify after the fact.
@CrazyProgrammer That's sort of the essence of homoiconic languages like Lisp, code is data. But Rebol is deeper than Lisp, significantly.
 
@tangentstorm Red is the world's first full-stack programming language. It uses Rebol-like ideas and structure, but adds in a bunch of epic to the mix.
 
@tangentstorm It'll never be fully Rebol compatible in a runtime sense, they're different. But we're trying to make sure the syntax is compatible; so you can exchange data between them. Sort of like having an XML or JSON-like standard for the messaging medium that is both code and data... except, much better.
And, for the basics, we want the runtime to be close too.
 
I'm working with GregP on an article on Red for ODROID Magazine's March 2014 issue (of which I'm an editor - check it out at magazine.odroid.com).
 
5:37 AM
ok thats sounds interesting.
 
@CrazyProggrammer Rebol also has a lot of data types and an interesting way of thinking about the symbols, it's nuanced... so for instance...
@RebolBot
copy/part (to string! read tangentstorm.com) 80
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> copy/part (to string! read tangentstorm.com) 80
== {<!doctype html>
<html>
<head>
  <title>tangentstorm.com</title>
</head>
<body>
 }
 
There's the first 80 characters of @tangentstorm's website. (had we left off the TO STRING! that would be the first 80 bytes) But notice how http://tangenstorm.com isn't in quotes. Hm... what does that mean?
 
awasome...
 
@RebolBot
type? tangentstorm.com
 
5:40 AM
; Brought to you by: tryrebol.esperconsultancy.nl
>> type? tangentstorm.com
== url!
 
similer to perl.. right???
 
@CrazyProggrammer I don't know perl well enough to know anything than that I don't really like it very much. :-) But it is a chain of processing, I think. The deal here is that Rebol hasn't gone around and said "/ always means DIVIDE!" We separate tokens by spaces and when we see something like "foo://" we say "hey, that's a string of subclass URL!". And you can write code that acts differently if it gets a URL or other string subclass. We have others...
@RebolBot
type? <div>
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> type? <div>
== tag!
 
wowwww.
 
@RebolBot delete
@RebolBot
foo: func [value [url! string!]] [
    either url? value [
        print ["Doing URL thing with:" to string! value]
    ] [
        print ["Doing string thing with:" value]
    ]
]

foo example.com
foo "some example string"
 
5:44 AM
; Brought to you by: tryrebol.esperconsultancy.nl
>> foo: func [value [url! string!]] [either url? value [print ["Doing URL thing with:" to string! value]] [print ["Doing string thing with:" value]]] foo "http://example.com" foo "some example string"
Doing string thing with: example.com
Doing string thing with: some example string
; Brought to you by: tryrebol.esperconsultancy.nl
>> foo: func [value [url! string!]] [either url? value [print ["Doing URL thing with:" to string! value]] [print ["Doing string thing with:" value]]] foo example.com foo "some example string"
Doing URL thing with: example.com
Doing string thing with: some example string
 
@CrazyProgrammer Typing code into chat boxes is not the best way of doing things. :-) But the second answer shows the right thing... foo can tell which you passed it. The first time I passed "http://example.com" which is a STRING!, while http://example.com without quotes is a URL!
Anyway, when you pass READ a URL! it dispatches to a scheme handler. So if it's http:// it runs whatever you have registered for that, and you can use all other kinds of schemes. ("scheme" is not our word, that's what the W3C calls that part of a URL)
@CrazyProgrammer but the real cool bit of Rebol/Red (and @tangentstorm take note too) is that it's a "language construction set". All these little parts fit into the code-as-data paradigm for building your own languages that embed into it. Like PARSE...
@RebolBot
parse "parse in [Rebol] takes two parameters, the data to parse and a block of rules" [
    thru "["
    copy bracketed to "]"
]
print bracketed
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> parse {parse in [Rebol] takes two parameters, the data to parse and a block of rules} [thru "[" copy bracketed to "]"] print bracketed
Rebol
 
@CrazyProggrammer Make any sense how that worked? It had a matching position like in RegEx, except when it saw THRU "[" it moved the match to right after the open bracket and before the R. Then it did a COPY into the variable bracketed of all the data up TO (but not including) the close bracket. Then it printed the bracketed variable. Clear?
 
last execituation is little bit confusing...
 
@RebolBot
parse "parse in [Rebol] takes two parameters, the data to parse and a block of rules" [
    to "["
    copy bracketed thru "]"
]
print bracketed
 
5:50 AM
; Brought to you by: tryrebol.esperconsultancy.nl
>> parse {parse in [Rebol] takes two parameters, the data to parse and a block of rules} [to "[" copy bracketed thru "]"] print bracketed
[Rebol]
 
@CrazyProggrammer That's almost the same, except the first match went up TO (but not including) the open bracket. So the copy picked up the bracket, and then it copied THRU (so including) the close bracket. It's rather clear if you get it...
 
no result is as same as input..
nothing new..
 
@CrazyProggrammer Hm? I don't understand that statement.
 
confuse
RebolBot reply with same statement what you have give..
 
@CrazyProggrammer I don't like that RebolBot repeats the input, myself. I've asked that to change.
But you'll notice the result in the first case is "Rebol" and in the second case it's "[Rebol]". Ignore it repeating me.
@johnk @GrahamChiu See, another vote for don't repeat the input.
The >> line is the interpreter input, then what comes after is what it spat out.
@RebolBot
print "Hello"
 
5:54 AM
ya got it..
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> print "Hello"
Hello
 
@CrazyProggrammer Okay, with that, you can see that when I said to "[" and then copy bracketed thru "]" I got it to print bracketed as "Rebol". Then when I said thru "[" and then copy bracketed to "]" I got it to print bracketed as "[Rebol]". How would you do this in JavaScript?
If I gave you a string and said it had a string in it that was in brackets, and wanted you to give me the string in brackets?
 
may be using regex
 
@CrazyProggrammer Fair enough, okay, what would it look like?
 
6:01 AM
I think you always have to escape brackets in RegEx
 
its confusing here to write... this is my first time to chat here..
\\\[
\\[
 
@CrazyProggrammer No problem, and welcome. We like it here. :-) If you want to set your avatar to something other than the default gravatar: setting your avatar
@CrazyProggrammer There are online RegEx testers like RegEx Pal to help you figure some things out, capture groups are just done with parentheses.
 
pretty good... thanks a lot...
i like this..
I have a question ...
 
@RebolBot
parse "It gets even better, [Red] and [Rebol] have significant [Power]" [
    some [
        thru "["
        copy bracketed to "]"
        (print bracketed)
    ]
    to end
]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> parse {It gets even better, [Red] and [Rebol] have significant [Power]} [some [thru "[" copy bracketed to "]" (print bracketed)] to end]
Red
Rebol
Power
== true
 
6:09 AM
What would you say is the main advantage (or even difference) between rebol and lisp? (Aside from the syntax?)
 
It can do things that no mere Turing Complete language can do! Hm, wait. No, it can't. Sorry, apparently I'm wrong about that. :-)
@RebolBot
12-Dec-2012 + 60
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> 12-Dec-2012 + 60
== 10-Feb-2013
 
@RebolBot
$3.00 + $0.25
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> $3.00 + $0.25
== $3.25
 
so it has a rich selection of data types, with nice literal syntax.
 
6:12 AM
Because braces are used for the string types, you have {"It's cool", said {HostileFork}, "that you can put quotes and apostrophes inside your strings and only worry about escaping when you have mismatched pairs of curly braces... matched pairs nest fine in strings..."}
You don't have to hit SHIFT to get a bracket on most keyboards, and that's the foundational block creator, so it's easy to type.
Note that:
@RebolBot
x: y: z: 10 + 20
print x
print y
print z
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> x: y: z: 10 + 20 print x print y print z
30
30
30
 
Is the result of having a different symbol type, a "set-word", which is just the same as a symbol except the evaluator has a different rule. So it's not that "colon is the assignment operator". The shape of the evaluator is to use that type. But that's yet another "flavor" of symbol that--if you don't pass it to the default evaluator... goes into your toolbox.
I use it for writing scripts. [Hamlet: {My kingdom for a horse!}] Oh. Hm, I guess that was someone else. But you get my point. :-)
@RebolBot
code: [x: y: z: 10 + 20]
foreach symbol code [
    print [{The type of} mold symbol {is} mold type? symbol]
]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> code: [x: y: z: 10 + 20] foreach symbol code [print ["The type of" mold symbol "is" mold type? symbol]]
The type of x: is set-word!
The type of y: is set-word!
The type of z: is set-word!
The type of 10 is integer!
The type of + is word!
The type of 20 is integer!
 
@tangentstorm I didn't really answer your "aside from syntax" point but you did get to one angle of it with "so it has a rich selection of data types, with nice literal syntax.". Yes, but that really is just the starting point. The rest of it is about implementation, philosophy, and design.
We call it "the war against complexity", and it's precisely why if you look at the downloads you have a zero-install cross platform half-megabyte interpreter. One exe. rebolsource.net
Red is taking this into an even deeper direction, and throwing out the ANSI C toolchain, and turning it into a compiler with an embedded interpreter that also does JIT compilation. It compiles what it can, JIT compiles what it can't, and uses the embedded interpreter linked into your executable do deal with whatever is left.
Putting our foot down. No LLVM, no OpenJDK, no nothing. < 1MB tool, zero install, all platforms.
 
like java
 
6:19 AM
I use a lot of non-mainstream languages (like J and forth and oberon) so I'm used to seeing very small systems with a lot of power.
 
Red is taking this into an even deeper direction, and throwing out the ANSI C toolchain, and turning it into a compiler with an embedded interpreter that also does JIT compilation. It compiles what it can, JIT compiles what it can't, and uses the embedded interpreter linked into your executable do deal with whatever is left.

is copy of java (according to me)
 
@tangentstorm Then you'll fit right in. :-) Rebol took inspiration from Forth and Lisp, people also say Logo. Red is swiping a lot of ideas from Rebol but also borrowing from Lua and Scala. What we welcome here are challenges: show us code you think is elegant in your world, we'll show you how we do it. "Take the Rebol/Red challenge" as they would say. :-)
@CrazyProggrammer Java can't do basic homoiconic evaluation. Show me Java doing the code: [print 1 + 2] and then append code [+ 3] and then do code and print out 6. Just for starters. It's rather different.
 
@RebolBot
 
My main interest areas are C++11 and Rebol/Red. So these are extremes, and different ways of looking at things. I haven't spent as much time with Haskell or functional languages as I might, but I prefer working with paradigm-neutral tools. Sometimes I want to do something functional-style but I don't want to have to throw out my whole toolset the moment I want to do something more expedient.
 
code: [print 1 + 2]
 
6:24 AM
@CrazyProggrammer In chat, SHIFT ENTER is what you need to make a newline without ending the message. Awkward, but, that's what you do. In that case, you're not running the code so all you did was store a 4-element block into a variable named *code. You have to invoke the evaluator to run it.
@RebolBot
code: [print 1 + 2]
do code
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> code: [print 1 + 2] do code
3
 
@RebolBot
code: [print 1 + 2]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> code: [print 1 + 2]
== [print 1 + 2]
 
RebolBot by default speaks in the "rebolbot dialect" so you can ask it to do various things, or just say hi. :-) But it's an example of using Rebol syntax and interpreting it in interesting ways, whatever your purpose is. The SHIFT-ENTER says "no, don't use RebolBot dialect, run as code."
@RebolBot good evening
 
6:26 AM
@HostileFork good evening to you too
 
The basic idea is that I'm defining 5 arrays: p,q,r,s,t , which together represent every possible combination of values for 5 boolean inputs. And then by applying any of the 16 boolean operations, I can show that something is always true or sometimes true or whatever.
 
@RebolBot hi
 
@CrazyProggrammer hi to you too
 
@RedBot
print "Don't forget about me, although I'm new..."
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> print "Don't forget about me, although I'm new..."
Don't forget about me, although I'm new...
 
6:28 AM
so like at the very bottom it says: (p,q) given p, p imp q ... if i type that into the j console, it responds with 1 1
 
@redbot hi
 
Can you elaborate on that?
 
@CrazyProggrammer RedBot doesn't speak a lot right now besides evaluation...
 
ok..
@redbot
code: [print 1 + 2]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> code: [print 1 + 2]
== [print 1 + 2]
 
6:31 AM
@RebolBot
code: [print 1 + 2]
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> code: [print 1 + 2]
== [print 1 + 2]
 
@tangentstorm I don't know J. But certainly, syntactically Rebol can represent something like [a 1 1 = (p q) [given p] p imp q] There aren't commas (excluded from the language, in part because at a distance they are indistinguishable from periods, so they only appear in numbers like 1,20 as the French use it as a decimal point). This was a purposeful decision. Like many of the purposeful choices it has a point.
 
as a very simple example: ` 1 1 0 0 *. 0 1 0 1 ` would be a truth table for 'and'.
How would i express something like that in rebol?
( the output would be ` 0 1 0 0 `)
 
@RebolBot
truth-table: [1 1 0 0 *. 0 1 0 1]
print [{Length of truth table is:} length? truth-table]
foreach symbol truth-table [
    print [{The type of symbol} mold symbol {is} mold type? symbol]
]
 
1 2 3 4 + 5 6 7 8 would be 6 8 10 12 because 1+5=6 etc.
 
6:34 AM
; Brought to you by: tryrebol.esperconsultancy.nl
>> truth-table: [1 1 0 0 *. 0 1 0 1] print ["Length of truth table is:" length? truth-table] foreach symbol truth-table [print ["The type of symbol" mold symbol "is" mold type? symbol]]
Length of truth table is: 9
The type of symbol 1 is integer!
The type of symbol 1 is integer!
The type of symbol 0 is integer!
The type of symbol 0 is integer!
The type of symbol *. is word!
The type of symbol 0 is integer!
The type of symbol 1 is integer!
 
@tangentstorm If that's how you want to represent yourself, okay. You have the tools. If it's in an unevaluated block sky's the limit. It's not written. As far as I can tell you made it up. :-)
 
the syntax doesn't have to be exact. ` [ 0 0 1 1 ] and [ 0 1 0 1 ] ` would be fine
 
@tangentstorm You can do that too. But if you understand Lisp then you understand the "sky's the limit" notion. Rebol's new magic brought to the table is some new types... for instance, did you catch the existence of multiple series blocks?
 
no i don't know what that means
You said " What we welcome here are challenges: show us code you think is elegant in your world, we'll show you how we do it." So I was giving you an example. :)
 
@RebolBot
code: [(1 + 2) [3 + 4] x/+/y]
print [{Length of code is:} length? code]
foreach element code [
    print [{Type of element} mold element {is} mold type? element {with length} length? element]
]
 
6:38 AM
; Brought to you by: tryrebol.esperconsultancy.nl
>> code: [(1 + 2) [3 + 4] x/+/y] print ["Length of code is:" length? code] foreach element code [print ["Type of element" mold element "is" mold type? element "with length" length? element]]
Length of code is: 3
Type of element (1 + 2) is paren! with length 3
Type of element [3 + 4] is block! with length 3
Type of element x/+/y is path! with length 3
 
@tangentstorm And I appreciate you answering. We can try and use it as a focus point for understanding... I learn things too, sometimes. :-)
@tangentstorm You have several different kinds of series "tinkertoys" in Rebol, just as you have several string subclass "tinkertoys". This gives you the option of giving them different behavior. All the validation is done for you, so you don't worry by the time you're at the metaprogramming phase about "unmatched brackets and parentheses"
It so happens that these tinkertoys are used for specific purposes in the default evaluator, but you can use them for others...
 
like in python i might express it as: zip((lambda a,b: a +b), [0,0,1,1],[0,1,01,])
 
@RebolBot
code: compose [print (reverse "olleH")]
probe code
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> code: compose [print (reverse "olleH")] probe code
[print "Hello"]
== [print "Hello"]
 
In that case, you see a templating tool. Compose scans the block for parentheses expressions, runs the evaluator on them and does a substitution, leaves the rest alone.
@RebolBot
code: compose/deep [print [(reverse "olleH") "World"]]
probe code
 
6:41 AM
; Brought to you by: tryrebol.esperconsultancy.nl
>> code: compose/deep [print [(reverse "olleH") "World"]] probe code
[print ["Hello" "World"]]
== [print ["Hello" "World"]]
 
There you see that /deep instructs it to dig into subseries looking for paren blocks. It leaves non-paren blocks alone. Cool huh?
 
@RebolBot print 1 * 0
 
@tangentstorm What?
 
SHIFT-ENTER for newline.
 
@RebolBot
@RebolBot
print 1 and 0
 
6:42 AM
; Brought to you by: tryrebol.esperconsultancy.nl
>> print 1 and 0
0
 
But back to the point, you gave me something that could be legally cast into Rebol (in its non-comma bias) as [a 1 1 = (p q) [given p] p imp q], and you could have that structure if it's what you wanted. I'd imagine you could come up with a nicer "dialect" than that. What's an "a"? Is this the best parse syntax you can use?
 
a means assert
 
0
Q: How to associate file extensions with MIME type with Cheyenne?

rgchrisI'm trying to use Cheyenne to serve a news feed and would like to ensure that files with the .feed extension are served as application/atom+xml. How do I configure Cheyenne to do this?

 
Oh. Well, you either embrace the Rebol evaluator or you don't. If you don't then your block is being symbolically evaluated in your sublanguage all the way, and then you're the designer... though you can call back out to the evaluator when you need it. Again, Lispy.
 
the lines that start with 'a' in that J code are just asserting something is always true. The results of the expressions like 'p or not p' would be an array of 32 values (either 1 for true or 0 for false) and a just checks that they're all true.
 
6:48 AM
If you do want to run within the evaluator as "holding the reigns" then you start creeping backwards into something like assert my-evaluator [1 1 = (p q) [given p] p imp q], which if you really want your evaluator to be in control of "assert is a" then it shifts to my-evaluator [a 1 1 = (p q) [given p] p imp q]. It's just about where you've put the locus of control.
 
so what it's saying in english is: given that that P is true and P implies Q, what are the values of P and Q ? (and the answer is they're both true)
but surely you can define a new top-level words in rebol, right?
 
Well why isn't it more like what you said in English?
rule: [(P true) and (P implies Q)]
assert logix rule [
    p: true
    q: true
]
@tangentstorm Yes, and there are no keywords. Words are merely bound to things, some start bound to natives but you may rebind them.
@RebolBot
old-print: :print ;-- save print

print: func [value] [
old-print reverse value
]
print "Hello World"

print: :old-print ;--put it back
 
; Brought to you by: tryrebol.esperconsultancy.nl
>> old-print: :print
== make native! [[
    "Outputs a value followed by a line break."
    value [any-type!] "The value to print"
]]
 
Hrm, why didn't that work. I recall having a problem with RebolBot over this before.
 
Oh i see why you were confused. J evaluates right-to-left.
 
6:55 AM
@tangentstorm Okay, that example works in the console, but anyway, the point is Rebol does let you redefine things, you can also PROTECT things against change...
@RebolBot
data: [a b c]
protect data
append data 'd
 
; Brought to you by: tryrebol.esperconsultancy.nl
; rebol.com/r3/docs/errors/script-protected.html
>> data: [a b c] protect data append data 'd
*** ERROR
** Script error: protected value or series - cannot modify
** Where: append
** Near: append data 'd
 
@tangentstorm If you're used to Forth and J and cool things, I think the end result of looking into what's going on here would be "hey, Rebol + Red are taking these ideas and really nailing it" vs. "why would you be making yet another spinoff of things that already exist". It's not without its design challenges, but especially if you look at what Red is doing it's going into the crazy-zone of cool.
@RebolBot delete
RebolBot has some sass, sometimes.
 

« first day (1207 days earlier)      last day (2573 days later) »