« first day (847 days earlier)      last day (2933 days later) » 
00:00 - 10:0010:00 - 00:00

12:00 AM
It runs in R3 but gives a different result - 34 instead of 52.
 
>> parse/all to-string read rebol.com [(n: 0) any ["rebol" (++ n) | skip]]
== true
>> n
== 52
 
@HostileFork What fixed font button ?
 
(Works fine in R3, you just have to take care of encoding.)
 
@PeterWAWood It's orange and to the right of where you are typing in your chat text,where the send and upload buttons are. It only appears in multi-line messages (try typing some stuff and then shift enter).
 
Note that encoding works if the website sends an appropriate header:
 
12:02 AM
@earl I forgot the improvement in R3 that everything is read as a binary value.
 
>> read rebolsource.net
== {<!doctype html>
...
}
 
Is there a concept of evented IO in Rebol?
 
@HostileFork I only see two orange buttons "send" and "upload.."
 
@BenjaminGruenbaum Yes, that's one area R3 originally aimed to exploit more.
 
@PeterWAWood Even after typing "foo" and pushing SHIFT-ENTER?
 
12:03 AM
@earl How would I do that? (Download a web page and then get called back when I get a result)
 
>> parse/all read `http://rebol.com` [(count: 0) any ["rebol" (count: count + 1) | skip]]
== true

>> count
== 34

>> parse/all to-string read `http://rebol.com` [(count: 0) any ["rebol" (count: co== true) | skip]]

>> count
== 52
Wrong back tick?
 
@PeterWAWood The caveat is that markup doesn't apply to multi-line messages, so you do either back ticks in single line messages or nothing in multi-line ones.
The easiest thing to do is probably to always post your code as a multi line message, just push shift enter if it's only one line to get an empty extra line.
I put in a little more effort to put code inline as bold, and backtick as necessary, but I may cut that out soon. :-)
 
@HostileFork I see the fixed font button after I push SHITF-ENTER
 
@PeterWAWood You can go back and edit to fix any errors, there's an orange triangle that hovers on the message, you can click it to get things like a permalink or edit if it's been under 2 minutes. Up arrow lets you edit the last message you posted if you're in the 2m window.
 
@HostileFork Thanks.
 :7893415

>> type? read rebol.com
== binary!
 
12:13 AM
You need to do the fixed font bit.
rebol.com
 
@BenjaminGruenbaum Basics would look like:
c: open http://...
c/awake: func [eventt] [switch event/type [read [print eventt/port/data]]]
wait c
Unfortunately, there is currently some breakage surrounding the http impl.
 
I guess you can't combine it with a reply eh.
 
@HostileFork I'll get the hang of it soon.
 
Oh that's cool, I love async/await notation, what does wait do? does it wait until execution finishes and contains the value?
 
@HostileFork Appears that way.
 
12:15 AM
Yes, wait executes an event loop.
It blocks until the waited-upon "things" signal that they are finished :)
(Excuse the wishy-washy terminology. I don't want to use too many Rebolisms, but I don't want to do half-assed comparisons either :)
 
12:28 AM
>> parse/all read/lines rebol.com [ (cnt: 0 ) any [ "rebol" ( ++ cnt) | skip ]]
>> ?? cnt
cnt: 34
 
    >> parse/all to-string read/lines rebol.com [(count: 0) any ["rebol" (count: count + 1) | skip]]
== true

>> count                                                                        == 52
>> type? read/lines rebol.com
== binary!
 I guess there must be a bug:
     >> type? read/string rebol.com
    == binary!
 
No, that's a side-effect of parsing thru binary data.
You can parse thru binary, and you can even use strings to match, but it's always case-sensitive.
>> parse/case to-string read rebol.com [(n: 0) any ["rebol" (++ n) | skip]] n
== 34
@GrahamChiu READ/string, and READ/lines are ignored when reading from URLs. I think that's a bug (and I think one already reported), but I'm not absolutely sure (and too lazy to look it up now). Maybe @BrianH knows when he checks back.
 
@earl well, that is an actor so it should be in the http protocol
looks like all refinements are ignored
 
@GrahamChiu Yes.
@Jina Thanks for looking that up, @Jina. Seems I commented on it just a month ago :)
 
12:43 AM
well, we should FIX it
zero? countdown
>> true
but in rebol 0, and 1 are both true
 
Are you sure ?
 
@GrahamChiu True :)
 
>> 0 = true
== false
 
>> true? 0
== true
 
if 0 [print 'true]
 
12:48 AM
>> 0 = not not 0
== false
 
I don't think @BrianH wants us to discuss introducing C concepts into Rebol
 
My proposal that primes be true and non-primes be false was rejected without, I think, proper consideration.
 
@HostileFork 0 a non-prime so that suits me
BTW, that we have a 'found? suggests that at one point in Rebol's history, a series was not considered true
 
@GrahamChiu Hm. Seems kind of unnecessary. Any proposals to get rid of it, and stick it into R3/backward?
 
>> found? false
== true
Not sure about the reasons it was added originally, but found? is shorthand for not none? and often used in places where the former just reads better than the latter.
 
12:59 AM
@earl something? might be more sensible
 
@HostileFork that's what I use in my code
 
@HostileFork found? select foo bar or found? find foo bar read pretty well ...
 
@earl What about any [(something? select foo bar) (find foo bar)]?
 
The "or" wasn't code in the above :)
But I'd still prefer found? position: find foo bar over the same code with something?.
 
@HostileFork but the any is in the latter post. :)
 
1:06 AM
So, what's the diff between 'true? and 'found?
 
>> true? false
== false
>> found? false
== true
 
With code like this around, I think that who ever suggested renaming REBOL as Zen had a good point :)
 
so 'true? is a subset of 'found?
 
 
1 hour later…
2:18 AM
should be

digit5: union digit4 charset "5"
 
2:36 AM
So the Red/System tests, being smaller and not as dependent on hash!, seem to run more snappily in R3.
Obviously the penalty of not having hash lookups hurts you more with bigger symbol tables and such. But good to know that the R3 version with map would likely be faster.
Also, most of the time the error location finding in R3 is better than R2's...that's a benefit.
 
Hello all. Teach me the basics of parse
@HostileFork has made me insanely curious.
 
@SomeKittens Well, for starters it's a dialect. It's something that someone could have created themselves if they'd wanted to. But it's implemented natively in the interpreter in C for performance, and because it's so useful.
 
@PeterWAWood you can practice all kinds of markup in the sandbox room, if you want
 
Parse takes a series type as input. That can be a string or a block or a URL or whatever. At each moment in the parse there is a "parse position". This is where in that series the matching is being applied at the moment. It starts (perhaps obviously) at the beginning, and moves along. When a rule matches it moves past the content that matched the rule. If a combination of rules fails and it has no alternative patterns it can try, it will stop parsing.
You will get one of two results back out of the call to parse: true or false. It will be true if at the end of the matching the parse position is at the end of the input.
Pretty basic so far. But some of the killer tricks in parse are the following:
 
So Rebol is inferring that the type is URL?
 
2:52 AM
A url! is really just a string! under the hood, but it carries a special "subtype" notion that lets you do different things with if you want to. But the string functions work. This leads to some surprising things, not all of which are necessarily behaviors that will stay in for the long run:
>> weird: reverse google.com
== moc.elgoog//:ptth

>> type? weird
== url!
 
Yeah, that does seem counter-intuitive.
 
Because at the time it was tokenized it fit the pattern of a URL!, the type was permanently branded onto that token. This can get a little confusing if you want to round trip your code to a string and back, because it won't come back as a URL! again if you've done something like this.
But it's one of those "flexibility vs safety" issues, you might want to temporarily do some restructuring to a URL and be mad that at runtime it doesn't let you peel parts off and put them back on.
 
It might be prudent to create an optional "strict mode" where those things are frowned upon
 
@SomeKittens Maybe. But bear in mind, the DO dialect is sort of the "dangerous" core-level dialect...you usually implement safety by making something more declarative.
Anyway, that's just to demonstrate what's going on here is that there are subtypes of string for these little different ideas like email addresses or URLs or HTML-style tags. And you can write a function to do a different things based on what it gets. That's why for instance the read http://hostilefork.com goes and talks to a website and the read %c:/directory/foo.txt opens a file on the filesystem. They can "sniff" the type? and behave accordingly.
And we're not living in "everything is the same type of string" kind of environment that's so stifling elsewhere. It's more fun.
Okay back to the killer tricks.
 
I like it. It's a step back to me coding into the language, instead of around it
 
3:00 AM
* Like much of the rest of what is encouraged in Rebol, parse is very "literate". It doesn't use weird symbols and stuff when a nice well written sentence will do. As @Jina said "I'd rather write a Parse than a RegEx. RSI better than brainstrain." I personally type english faster than I type compressed symbols just because I practice typing English in email and whatever all the time and I can keep my hands closer on the home keys.
Remember all those micro decisions like square brackets for the main block of the language. You can write Rebol pretty fast and then actually read it afterward.
So in parse if I want to say "Match me any number of a's followed by exactly 3 b's" you can write parse "aaaaaaabbb" [any "a" 3 "b"] and there you have it. Simple. Works on "bbb" but not "bbbb", etc.
* I mentioned it works equally well on symbolic structure as it does on things like strings or URLs. This saves re-learning and is quite elegant.
So parse [apple apple banana banana banana] [any 'apple 3 'banana] fits the same pattern and works just as well. Also, interestingly, it's fast. Because it's doing symbolic comparison--each symbol is numbered under the hood, so those aren't string compares.
* You might have noticed that I had to "quote" the words when I used them. There's a reason for that, because if you just use a non-keyword from parse when you're writing your code in the dialect, it assumes you want to substitute a rule held by that variable.
rule: ['apple | 'banana]

parse [apple apple banana apple pear] [some rule 1 'pear]
Having this ability allows you to break up your problem nicely into subproblems, and keep things orderly. You can also (eerily) dynamically modify the rules as you go if you need to.
 
@HostileFork Yeah, just like lisp
 
* So speaking of dynamically modifying things, it gets fairly interesting when you realize that unlike LISP we have more than one kind of series type. So the clever use of parentheses in Parse is to inject code that runs... in the DO dialect... at the point in time of the rule before it matching.
parse "aaaaabb" [any "a" (print "We matched some number of a's") 3 "b" (print "We matched precisely 3 b's")] therefore returns false, and it only prints "We matched some number of a's". You can use any DO dialect code in those parentheses, and it only runs in the case where the prior match rule has been successful.
 
Now I'm starting to see where this gets all mind-blowy
 
Remember that parentheses were used in the DO dialect to signal precedence, and that still will happen for any inner parentheses you have. But you can also break into another parse call inside that code if you need to. :-)
It's only the outer parentheses, the ones in the parse dialect level, that receive this treatment.
Similarly, you know how things like do [x: 10] is having a certain interpretation of what to do with the x symbol if it's subtyped by having a colon after it. (The subtyping of symbols with x:, :x, 'x, vs just x etc. etc. is very similar to how under the hood URL! and TAG! and STRING! all work the same, but you have access to being able to "sniff the type" and use it for some purpose).
When the do dialect sniffs the type and sees it's one of these SET-WORD! subtypes, it has a particular interpretation of treating it as something akin to a variable assignment.
 
so x: means that x is assigned to whatever comes next. 'x is like a raw type? What's :x
 
3:16 AM
You wouldn't have to do that in your dialects. In fact, I keep a journal of my lucid dreams, and in my dialect that powers it behind the scenes I have things like [weird-alien: ("laughing heartily") {You're certainly interesting for a human...}] When my dialect churns that to HTML I take the hyphens out and do the processing.
@SomeKittens 'x is a "lit-word". A literal or quoted word. If you say x: 'print then it doesn't try and call print the function, it stores the literal symbol for print into x. This is a Lispism, but the others aren't.
You can incidentally achieve that also by saying x: quote print, if you prefer.
 
nah, I'm lazy
 
It's a more general mechanism, for instance you can say x: quote (1 + 2) and you get the symbolic parenthesized series (1 + 2) stored in x. Not evaluated and flattened to 3. There isn't a parallel for x: '(1 + 2).
 
What command finds the type of a variable?
 
@SomeKittens In the do dialect, type?. You can look at things using probe (print has behavior... it will flatten blocks and such so x: ["Hello" world: (1 + 2)] followed by print x gets you "Hello 3" and stores 3 in world. :-) But probe will just give you your original block of symbols to look at, unmodified.
@SomeKittens Regarding what :x is, it is a "get-word". Again, these are all abstract and you can use them in your own dialects how you want. But the DO dialect uses it to get the thing something points at instead of evaluating it. foo: :print and then foo "Hello Rebol" will print out Hello Rebol.
You can achieve the equivalent thing with foo: get 'print or foo: get quote print if you want. Rebol just throws another symbol type into the box of legos for you.
So interestingly, what set-word and get-word are used for in the parse dialect is to capture the parse position and to set the parse position, respectively.
 
that...makes an incredible amount of sense
 
3:27 AM
parse "aaaabbbbcccc" [some "a" b-pos: (result1: copy/part b-pos 4) some "c" :b-pos copy result2 thru "c" to end]
 
== false
 
There's currently a thru bug, I'm not testing this, I'm just writing it. :-)
Oh, I see.
parse "aaaabbbbcccc" [some "a" b-pos: (result1: copy/part b-pos 4) some ["b" | "c"] :b-pos copy result2 to "c" to end]
Okay, there's what I wanted to demo. :-)
This matches some number of a's, then it captures the parse position in b-pos. Parentheses are used to switch over to the DO dialect, and you see one way of capturing input... by processing that captured position. In this case copying 4 characters out, just keeping it simple.
 
How many dialects are there, just DO and parse?
 
Then you're still sitting with your parse position in front of the four b's. So we go ahead and skip the parse position to the end of the series by matching some b and c. Then we use an alternative method of capture... copy, which is part of the parse dialect and doesn't require any DO dialect code. It "copies the contents of the series from the current position up TO a match of "c" (but not including it) into something called result2.
Then we just skip the parse head up to the end so it returns true. But it's interesting to note the properties this has. For instance, you only get result2 if there are some "b"s or "c"s after the "a"s... otherwise you don't.
 
@HostileFork I believe the longer compilation times of Red tests in comparison to Res/System tests is simply that with the current bootstrap version of the compiler the whole Red runtime is complied from source for each Red program compilation.
 
3:37 AM
@SomeKittens The definition of what constitutes a dialect is a little slippery. Is any function that interprets its input by value as symbols instead of accepting the results of the evaluator a "dialect"? Compose lets you use parentheses to say what parts of a symbolic block you want evaluated and leaves the rest alone. It's a slippery slope to call it a dialect, though.
@SomeKittens There are cool dialects. This game was made using a dialect that compiled to Flash, it was for making adventure games. It doesn't run in Rebol, but the source was expressed as Rebol.
Fun game, I bought it and played through it. :-)
 
@HostileFork I've found that R3 Map! lookups are faster than R2 Hash! lookups from a few tests.
 
@PeterWAWood I'd expect so...
@SomeKittens and bear in mind, in case you've forgotten, you get all this functionality in a single uncompressed executable, that requires no installation, and the latest core R3 builds are under half a megabyte. :-P rebolsource.net
So welcome to the Rebolution, feel free to join us. :-)
 
I'm trying. I just don't have as much time for fun things like this as I want.
 
@SomeKittens In some ways, anyone who deals with code can't afford not to look at it. Applied pragmatically, it saves time. The problem, or potential mistake, is not being able to be totally practical with it--stay as a user, for what it's good for--and keep out of the dev discussions, or going down "hmm...what if" tinkering project rabbit-holes.
It's too tempting to do wild things with it, because you can.
The limitations of other languages are their horse-blinders, and that's the blue pill. Who to serve, The Matrix or your mind...? :-/
But yeah, I still like C++11 for lots of what I am really interested in about software, at least historically. High performance type-checked computation with SFINAE. But there's just so much stuff I see on the web with people making disasters every day, and C++ is not appropriate for what they're doing, so I have to worry about the stuff they make that I want to use too because I'm affected by it.
@SomeKittens But yeah, when you've got a task and it's a sort of simple "something in, something out" kind of thing where you're not forced to run it in a language by constraints put on from the outer environment, feel free to ask us how we might do the same thing. You might get code and have time saved because we'll go "oh, that's easy" or even "oh, that's hard...hmmm...how would you do that?" and write it to make sure we understand an important design issue.
 
3:59 AM
Will do.
 
Also good word of mouth to smart people is useful, trying to build up a presence on the "real Internet"
 
I can write a blog article (like that'll help)
 
Sure, that helps. It's a start. The language hasn't had any new users for years, really. Development had stopped, no bugfixes, the head developer just kind of went on to other things.
 
4:31 AM
So... length? mold "^~" is 3 in R3, whereas the mold produces "^^~" in R2. to integer! second mold "^~" gives 127, but unlike other characters it doesn't bother to caret escape that one. Should it?
Seems to me that if a native Rebol caret escape is available, it should use it in mold. Not that it's illegal if you have UTF-8 strings, but it's not a printable character...and every difference from R2 is just one more thing...
Hello @PhilipK, just chatting on Rebol. Came out in '98, recently open sourced (December). What's up?
The issue I just specifically is about one of the interesting things Rebol can do. It has a symbolic structure for its source that can be manipulated in the language itself, as variables and then evaluated (like in Lisp). It also can send these symbolic structures to strings, and load them back up from strings again. (Making it into a string is called "molding", while getting the structure back from a string is called "loading").
So you can say things like code: load "x: foo + 1" and then do length? code and get 4 because there are 4 symbols (x:, foo, +, and 1). Then you could do something like append code [+ 2] and say codestring: mold code. And your string would be "x: foo + 1 + 2".
length? codestring would then be 14, because that's how many characters are in the string representation of the code.
 
4:50 AM
Updated the ftp protocol to use integer codes, instead of text, and added a dehex when fetching the username to allow %40 ( @ )
Note I said the because I'm not aware of any others. If there are, I'll reword it to say a
 
Meanwhile, I found another darn emitter bug where it's behind the emission and somewhere invisible in the guts, and only happens in R3.
Fun times.
lius3 [global 1164 [5804 5810 5835 5864 5893 5922] -] vs lius3 [global 1168 [5804 5810 5835 5864 5893 5922] -] Who wants to bet this is another one of those to binary! getting 8 bytes instead of 4 things? I'm going to rewrite my predictable to binary! conversion from integer! regardless of platform width proposal up. This is not futureproof.
By "fixing" it I'm just keeping the same old problem going.
This can be solved with a different pattern.
 
Hi @HostileFork was just curious about Rebol haven't heard of it before.
 
@PhilipK It's off to work we are going. :-) You can edit your chat messages for two minutes, if you didn't know. The up arrow is a convenient way of doing it for your last posted one assuming the two minutes aren't up, or you can hover and you get a little orange drop down with permalinks and such.
@PhilipK You came to the right place. :-) Do you know Lisp?
 
5:06 AM
No mainly use Javascript and PHP.
A bit of Ruby
 
@PhilipK Ah. Well, if someone knows Lisp it's usually best to explain Rebol by the ways in which it differs from Lisp, rather than repeating parts they probably already know.
 
What is Rebol used for?
 
Rebol was first released in 1998. It's been around. But it was only open sourced in December, after a few years of low-to-non-existent development. The company behind it had kind of fizzled.
@PhilipK It's an interpreted language. So it's not used for writing device drivers or things like that. Think more Ruby/JavaScript/PHP-ish range of tasks. Red is a project that's got some ambitious ideas to let you use the "Rebol magic" to get performance as good as C by being a compiled language. We're interested in both here, but Rebol is the older and more mature project.
@PhilipK You're probably aware that, because of the rules of universal computation or whatever... pretty much any language can be used to solve any problem. It's just a question of "fit" and suitability to the task.
 
Interesting so it has really good performance and can be used on web?
 
Depending on what you're doing, Rebol's performance can be pretty impressive for what you'd think the kinds of "abstraction" it allows would be costing. But yes, there are many people making websites in Rebol. Unfortunately, they're not always that great of designers and can lack some common sense...lots of old people. :-)
Open sourcing should hopefully change it so it doesn't appear that the language is from a dinosaur era of buying programming tools in boxes at the store on 3.5 floppies :-)
 
5:14 AM
haha way before my time
 
However, being from the dinosaur era the interpreter is very small. It doesn't require installation either. You just run it. Take a look at the sizes on some of the platforms: rebolsource.net
What it does in under half a megabyte is freak-ay.
@PhilipK Here is a little script done by one of our folks here which aggregates the answers into an RSS feed for us, if the question is tagged Rebol. StackOverflow doesn't offer that by default, they only let you do recent question queries so you have to mash it up: StackOverflow answer aggregator
 
So you would compile that script?
 
It's interpreted, in Rebol. It would be compiled in Red.
 
Will keep an eye on this. Gotta get back to a project I'm working on. TTYL
 
Syntactically it's very rich. You can just say: website: http://google.com and it goes happily along, no quotes or anything. And the website is of type url.
@PhilipK Okdokie, we'll be around.
 
 
1 hour later…
6:41 AM
do pick [
    reb4.me/r/altxml
    reb4.me/r3/altxml
] system/version < 2.99.0
@rgchris .. saves a few characters
 
6:58 AM
Good idea!
 
@rgchris Is the make block! optimization worth it for the clarity vs just copy []? I think that for StackOverflow purposes that RSS script is great.
So it's worth kind of taking things that people react to and go "what?" and make it prettier.
I even feel like hiding that do pick and weird version number would be worth it, just go with whatever version of Rebol you're running and is most convenient for you since I assume it's your "actual" script. do http://reb4.me/r/altxml is even less head-scratching
And in the red port, another bug bites the dust.
 
make block! probably saves picoseconds in execution
Carl uses this a lot in his code ... I guess he just likes to optimize everything
How exactly do these feeds end up here?
 
7:14 AM
@GrahamChiu There's a place in the room menu for managing feeds. You just paste the URL there. Room owners can add and remove them.
 
@HostileFork ah .. ok, cute
 
I'm sure no one is surprised, but many R2/R3 porting bugs come from the assumption that char! is byte. Appending chars to binary and such.
Morning/evening @graph. Bunch of Rebol explaining if you scroll up a bit, or further...
Hello @DavidLin...apologies for the reputation requirement of 20 to speak. It's not difficult to get, though! We've got some advice on the FAQ
 
mornin'
 
7:29 AM
@HostileFork Went with R2. R3 version here: reb4.me/r3/so-answers
 
@rgchris Cleaner!
@PeterWAWood R3-built unicode-test.reds now identical executable to R2 and passes all tests.
 
@HostileFork That's great progress. I don't think REBOL could handle that test itself.
 
quite some information from you @HostileFork, interesting
 
@PeterWAWood I wonder if it would be possible to unify the Rebol and Red tests structure so that at least some commonality could be checked. Even if it's just one test for starters, the spirit of unifying it would be good. Even no shared tests, using the same framework would seem to make sense.
@graph At some point, I'm going to get the automated tutorial going. But until then, good to try out what people from different backgrounds seem to understand.
 
Quick-test all ready includes quick-unit-test for testing Rebol code and there are a handful of such tests in the Red test suite. I guess it would be quite easy to generate equivalent REBOL tests to the Red tests.
I'll add it to my to-do list though it will be after I've improved the simple dynamic link library tests.
 
7:46 AM
earl suggested I check things in on a branch somewhere and get help rather than getting all burnt out on this, but I think I'm going for the full test suite passing. I have a hazy feeling that I can do it soon. But that's how I felt after hello.reds built to binary equality, so... it may be hazy again. :-)
Are there any examples of functions that demand you use a refinement? Like if there are /a and /b options that are mutually exclusive and a default does not make sense or could be dangerous? I feel that shift was a dangerous thing, to have it reverse the bitshifting sign without warning.
Aesthetically it's like I want people to always say shift/left or shift/right to disambiguate. But I've not seen any functions that demand a refinement, so I wonder if demanding an argument is "the rule". So you could do shift 'left value amount or shift 'right value amount.
 
Why would a function demand a refinement?
trim = trim/head/tail
 
Well, Rebol seems to not think that defaulting is dangerous, but to someone coming from a background where they've found lots of bugs based on lack of forcing people to be explicit it starts to make one wonder if that defaulting is smart. In shift case, the only reason that I'm complaining about it is because it reversed the direction of the shift between R2 and R3.
 
eek!
 
8:01 AM
Shameless request for a retweet:
A little Reb-Fu: http://reb4.me/r3/so-answers — create a feed of answers to active Rebol questions on StackOverflow.
 
r3 says it uses the sign of the bits value to decide shift direction
 
@rgchris That's a Sweeeet Tweeeeet! (You can't beat the Tweet!)
@GrahamChiu Yup, but the default assumption for positive numbers changed.
 
8:21 AM
I guess compatibility wasn't a big thing on Carl's mind .. time to make a break
 
8:32 AM
@SebastianGodelet welcome to our place on SO chat .. see our faq
 
@GrahamChiu, just looking thru, never heard of Rebol before.
 
( JS could do with a better parser here .. )
 
@SebastianGodelet Hey Sebastian. Well, what languages do you like and know, for context? Have you ever used something like Lisp?
 
I did encounter Lisp in University, but actually i'm more of a Prolog fan. In highschool and University i did mostly Java, but at work it's C#, and recently Javascript/Typescript
On the Rebol Website the documentation just states the Basic types. But i miss an example of a more complete program.
 
@SebastianGodelet Okay well if you've got some background that works. Well Rebol is a code-as-data language, like Lisp. But it's better at "bending to your will" in terms of expressing code in a pretty way. There's a lot of Rebol code out there doing a lot of things, but it has historically been a lot of "one man show" projects...with libraries and routines shared, but not as often full turnkey programs that were made to be truly illustrative.
 
8:43 AM
the premise of rebol is that the language matters most. I like that Point of view, but in my professional career I found that libraries and documentation matter most. Thats what i like about node.js for example. Ist so super easy to share code and use libraries, is is baked into the language
 
@SebastianGodelet the script library has hundreds of more complete examples
 
@SebastianGodelet Yes, it does depend... it's kind of a philosophy thing really. I believe that Rebol and Red are about to have their time where people see how much the long, careful design process has created a uniquely sustainable artifact for managing complexity. I don't know how often in the "Tortoise and the Hare" type situations the Tortoise with being slow and steady wins the race...it seems that right now, the sprinting ahead has given people "more bang for their buck".
Or at least, people seem to enjoy programming in things that are quite a mess, if they work. But the brittleness and the inability to truly tune and re-mold the language itself to match the domain of your problem is annoying to me. I think the day is coming, now that Rebol is open source (as of December).
 
@HostileFork, well its all about return on investment, using a too small time window to calculate it. The force of business dictates the programming environment. As seen with Lisp machines, much superior but anyone is now on IBM style machines.
 
@SebastianGodelet Yes, if you follow history Rebol is from one of the main guys of AmigaOS design.
 
@GrahamChiu, thanks for that link, pretty impressive!
Oh how I love AmigaOS. Not this silly 8.3 file name silliness of Dos. A desktop environment still using less memory, and and and :(
 
8:50 AM
@SebastianGodelet We are having some more talent with people getting prettier about things. :-) I drew a new logo. If you saw Chris's tweet up above you can see that we've got some great new syntax highlighting server side to use.
 
@HostileFork, I do have to say. Rebol does have a beauty in it!
 
@SebastianGodelet If you liked the Amiga you will probably love Rebol, many people in the community were carryovers from users of that OS. I actually have to get to sleep (3am here) but if you scroll up a bit you can see explanations of features I've laid out for other people in chat.
We're doing some teaching and outreach in this room, because really Rebol has been an insular world...and a proprietary language...I think a lot of people didn't want to share it because it was their secret weapon. :-) The open sourcing brought me back after a couple of years of ignoring it and so I'm trying to open other things about the culture.
But we've got some unifying to do and yes, to make more bindings and libraries that you don't have to go hunting for.
 
I guess the best is just I download the binaries from there: rebolsource.net and try to execute your script
 
@SebastianGodelet rebol3 is a little feature incomplete at present ... but since the open sourcing in December, a lot of progress is being made
 
@SebastianGodelet It can run scripts from the net. You can include by URL or by file. Rebol is smart. But sometimes you might need a little help especially with the alpha version (rebol 3).
 
9:00 AM
yes, I figured that out myself: do reb4.me/r3/so-answers
 
But we're here to give that help, and hopefully (soon) on StackOverflow answering a greater amount of Q&A
 
its just so awesome!
 
@SebastianGodelet It is...but there are many surprises and it takes patience sometimes. But if you go "why does it do this!?" someone here will probably show you a reason and you'll go "ohhhhh."
 
If you're french .. many of the programmers including @dockimbel hail from that region
 
Of course sometimes it's just broken and we go "yeah, look in the bug database".
 
9:02 AM
well my father is from Belgium, but we do live in Germany
 
Pretty close !
 
is rebol using type inference or is it all dynamically typed?
 
@SebastianGodelet No type inference in Rebol, but Red is a compiler vs. an interpreter and has some.
 
so lets say I have a function:
encode: func [text][
parse/all text: copy text [
some [
change #"<" "&lt;"
| change #"^"" "&quot;"
| change #"&" "&amp;"
| skip
]
]

head text
]
and I call it using a number, what will happen?
 
9:06 AM
Hey @user2098587 ... sorry about the 20 rep to chat situation, we don't make that rule, that's StackExchange. But see our FAQ, if you ask some questions or give some answers we're happy to follow it and upvote them... if they're good. Or at least respectable. I mean, any sincere attempt deserves at least 20 points. :-)
 
you'll throw an error
parse/all expects a series and not an integer!
 
@GrahamChiu, well that is good enough! That's what I really dislike about javascript. It will happily ignore a programmer mistake and calculate whatever it seems fit...
 
@SebastianGodelet Or you could say encode: func [text [url! string!]] and it will only take urls or ordinary strings.
Or you could say spec: [text [url! string!]] and then say encode: func spec (...) and encode2: func spec (...) and reuse your prototypes.
 
So it is actually a pretty strongly-typed language, but interpreted. So it's like python, dynamic and strong less the implicit type conversions (which I dislike)
 
You have great freedom to take slots in other languages that would require you to fit into a certain form and morph things around, and process things before you run them. As with Lisp, the central idea is there of code as data, but it has been evolved radically... and it's not ugly.
(to us, and most who learn to use it) :-)
And people go "well I could do that with a lambda function" or make an argument about how they could do something computationally equivalent. Well, you can do anything with a Turing Machine too. I don't want to bend how I express myself to the language's rules. I want the language to bend to how I want to write things.
 
9:13 AM
in Lisp, I can quote code with ', but can I do that in rebol too?
 
@SebastianGodelet You can generate symbols that are quoted tokens with an apostrophe, but the more general mechanism in Rebol is to use quote. x: quote (1 + 2) then probe x vs y: (1 + 2) and probe y
 
yes, either ' or quote
 
Another good tool you need quickly is type? so try that code above and then type? x
The availability of more than one series type gives Rebol a rich set of power. Lisp sort of shoehorns everything into this parenthesized series, and that winds up getting kind of ugly when you want to do what we call "dialecting"
 
type? <a href="test" />
== tag!
:) like in VB.NET with XML literals
 
It's really just a string, but it's a string that has been subtyped.
 
9:17 AM
So surely someone must have written a rebol to Lisp compiler?
 
scheme
 
The angle brackets aren't "in the string", they're notational. So try reverse <a href="test" />. It's not an object based DOM element, it's merely a token in your toybox that you can use.
 
this is Joe Marshall's rebol 1.0 to scheme compiler
 
So its just "syntactic sugar" but with the consequence that rebol is pretty much like literal programming
 
By holding onto the type, you can make myroutine [<p> 13-Dec-2013 http://hostilefork.com] go to my website on that date, look for all the instances of the <p> tag on my page, and return a count of them.
Literate programming, yes. But very many deep and carefully chosen decisions. The square brackets chosen as the main block type so you don't have to push the shift key on most keyboards while you are typing to get them.
 
9:21 AM
actually, I'm really interested in compiler construction on the scientific side of view, now that rebol 3 is open source as you said, how much effort is it to understand the architecture of a (small) language like rebol? I mean the interpreter is really lightweight. Quite fascinating
 
@SebastianGodelet If you know C and have ever looked at an interpreter's source before, not too hard. The code isn't magic, the design is the magic. Refusing to let complexity worm its way in and instead stepping back and honing the machine.
 
well, the [] are still terrible on a german keyboard. But hey i'm used to it. But that's a reason why many german programmers use Pascal.
 
@HostileFork You wrote: "It's a slippery slope to call it a dialect, though. " - to the contrary, I do not see anything "slippery" in calling COMPOSE a dialect.
 
for []{} you need to press "Alt-Gr", for ()=*' its shift
 
But also, think about string delimiters. Instead of "double quotes" and 'single quotes' which are pretty useless as alternatives, it has asymmetric ones. So you can write things like print {"It's cool because if the braces line up, no problem!!" said {Fork}, "while the tap-dance of apostrophes and quotes for escaping annoys me to no end. Multi-line strings, no escaping!"}
As long as you've got matched pairs of braces, you're home free, and it's much more readable.
 
9:25 AM
Like in Perl basically (I'm thinking of regular expression delimiters)
 
It's a wonderful and labyrinthine world of "better". Of course, it's not perfect for every problem, but that's where DocKimbel is trying to attack things with Red...and write device-drivers in a Rebol-like syntax.
All the way up to abstract stuff.
@Ladislav Well, then I guess we'll have to do a dialect re-count in Rebol and see how many it does ship with by default. :-)
 
Has anyone counted the number of dialects that ship with rebol out of the box?
 
im a little bit sad: type? 2013-02-21T15:18Z
does not recognize ISO 8601 Times
 
@SebastianGodelet There are routines to convert in the script library. I don't know if there's a good reason not to support it other than maybe Carl looked at it and felt it wasn't very "literate-looking" and thus said if you wanted to ignore Rebol's format you'd have to use a library. Try probe now
 
I hope there will be more support for standard date schemes in the future.
 
9:39 AM
Then now/date ... now/time ... now/date + 1
 
@HostileFork Why re-count? I am not sure anybody did it yet. But, there should be at least two people doing it to compare their results.
 
@Ladislav I counted two. :-) But with a looser definition, I'm sure there are many.
 
@SebastianGodelet An iso-8601! datatype could be interesting, but of course not easily user readable.
 
Two? That is too little!
 
The function specification dialect, etc.
 
9:40 AM
@HostileFork, you see that's a problem with lots of programming languages. See in .NET DateTime.ToString , string.ToUpperCase is locale dependent by default. Which makes a portability nightmare...
Like when you open an English .csv file in a German Excel version, it fails!
probe now + 1, well how did it (guess) that I mean + 1 day?
 
@SebastianGodelet The gist of Rebol is to not try and be all things to all people in the DO dialect. It looks to get certain things organized so they are consistent and workable to be used to get all the other dialects going. If you start thinking in a dialect point of view, you begin to worry less about getting things "right for everyone" so much as making a nice malleable pleasing substrate that makes some people happy.
 
@SebastianGodelet because you added a 1, and not an hour or a minute
 
@GrahamChiu, probe now + 00:10, now I see !
 
>> now
== 24-Feb-2013/22:43:33+13:00
>> now + 1:00
== 24-Feb-2013/23:43:40+13:00
 
The DO dialect really isn't some great thing for scientific computation, it's the tinkertoys you could build such a thing with if you wanted, and not lose the literacy of the parts. You have the DO dialect to lean on, and the PARSE dialect to lean on, but you're the designer. It really is a lot like my discovering LEGOs after action figures and Matchbox cars and going "Hey, I build what I want."
 
9:46 AM
@Henrik I think we should support ISO-8601 format
 
Then they screwed it up with things like the LEGO alligator that was three plastic parts stuck together with six bumps on its back.
That isn't a LEGO alligator. THIS is a LEGO alligator:
 
@GrahamChiu I think we should actually support a number of common formats. If they each have their own datatype with the REBOL default being date!, then working between different date formats will be ridiculously simple.
 
@HostileFork, Hehe yes, Lego is very popular here. And I agree they messed it up.
But then, rebol has a type like email! ...
 
to-iso-8601 now
 
@Henrik some of the date formats have spaces ...
 
9:48 AM
@HostileFork, I am not sure I understand that Dialect part. Now what is the language, what is a dialect
 
>> to-idate now
== "Sun, 24 Feb 2013 22:48:08 +1300"
 
Some people might think the first alligator looks cool. I think it's kind of stupid. When you use Rebol for a while you start to see these finite non-reconfigurable non-well-designed molded plastic hunks of junk that you can't pull apart and use for anything. What would I do with the upper jaw if I unhinged it? Doesn't fit to anything. Pull the tail out? Useless.
 
>> load to-idate now
** Syntax Error: Invalid word -- Sun,
** Near: (line 1) Sun, 24 Feb 2013 22:48:29 +1300
 
@GrahamChiu We may simply leave those out that are meant to be human readable.
 
The bottom one I can break down fractally and sort into the parts box and feel like I can still have fun with it.
 
9:49 AM
@GrahamChiu So, human readable is a one-way operation.
 
@Henrik well, the current http protocol has a bug with not recognising the internet date format
 
@HostileFork well I can do now/time, but then now/hour or now/time/hour both fail :(
 
@SebastianGodelet now is a function with a time refinement
 
@GrahamChiu I don't know how deeply it would affect the lexical scanner to make idate a real datatype.
@SebastianGodelet hour = 1, minute = 2, second = 3
 
@GrahamChiu, yes I see. Just seems to be a little bit inconsistent from the readability point of view.
 
9:52 AM
>> a: now
== 24-Feb-2013/22:52:13+13:00
>> a/time/hour
== 22
 
>> now/time/hour
** Script error: now has no refinement called hour

>> a: now
== 24-Feb-2013/10:53:05+1:00

>> a/time/hour
== 10
 
@SebastianGodelet so you can see a date value supports this, but not 'now which is a function .. I guess it could be added easily enough
 
I don't understand that ...
 
@SebastianGodelet that's because NOW is a function and there is no /HOUR refinement in it.
 
So the "/" operator is not right associative?
 
9:54 AM
@SebastianGodelet Well you know foo [a b c] is different from foo [a b] [c]. What you're not seeing is that it's not an operator.
 
@SebastianGodelet Not sure what that means, but refinements are part of the function call itself.
 
HostileFork, well I guess my mental model is too much into the "other" programming languages. That's a steep learning curve then.
 
It's an alternative series type. So a/b/c is a series it just uses a different method of delimiting. It's called a "path". And [a b c] is a series too, called a block, it just uses another method. And (a b c) is a paren!
 
right associative: 2^2^3 is 2 by the power of 8
and not 4 by the power of 3 ...
or in object oriented languages the "dot" operator [C#] DateTime.Now.Hour is right associative
 
The same methods work on them. So second quote a/b/c is going to be b. And second quote (a b c) is going to be b. And second quote [a b c] is going to be b. (The quote on the block isn't necessary for technical reasons).
But you're missing the central idea, it's not about association at all.
 
9:57 AM
@SebastianGodelet it's not the same thing. the refinement depends on the type that you are applying the refinement on.
 
@HostileFork. Yes I see that now. I just thought its an operator. As in other languages these / * ' almost always are operators. But rebol works differently here it seems.
 
Yup, just giving you more series types to be creative with. You can do differently with it than what the DO dialect does in your own ideas.
 
@SebastianGodelet in cases like a/b/c there is no "/" operator at all, as @HostileFork already mentioned
 
But in the DO dialect, when it meets a symbolic lexical element formed like that and the first element happens to be a function, it then kicks off and interprets the rest as specification of optional "refinements". If it were an object, it would pick fields out of it, etc.
 
00:00 - 10:0010:00 - 00:00

« first day (847 days earlier)      last day (2933 days later) »