« first day (830 days earlier)      last day (2950 days later) » 
00:00 - 18:0018:00 - 00:00

12:03 AM
@GrahamChiu Hmm? You could search for http when said by @rgchris sorted by newest
@GrahamChiu Composting is big in Austin, I run into people promoting it at things. There's a new pilot program for curbside collection
 
12:33 AM
Regarding GitHub issue #79...
 
@HostileFork Exactly. I've been composting for the last 40 years but sadly I've never got the techique right. And looks like what I've read about it in the past has been incorrect. So, I'd like to get this right. It cuts the amount of rubbish we put out on the curb by 90% if we can do this right.
@HostileFork Can use approx equals
REST when said by GrahamChiu sorted by newest
doesn't work
 
@GrahamChiu Have you found the unindexed item where you said it? Can file a bug. Information Retrieval on large sites isn't an exact science though. Try searching for "the". :-)
 
oh well, non deterministic search ... works now
 
12:56 AM
What's the best way to turn a string like "FFFF" into a binary #{FFFF} ?
Preferably something that works in R2 and R3
 
>> debase/base "FFFF" 16
== #{FFFF}
 
Oh. Right. That thing. :-)
 
1:08 AM
If you wanted to pad an input that's #{FF}, #{FFFF} or #{FFFFFFFF} => #{000000FF}, #{0000FFFF}, or #{FFFFFFFF} respectively, what's the best way?
 
so presumably you want a string since leading 0s are not the binary format
 
Anything better than head change skip #{00000000} (4 - length? bin) bin, offhand?
You can have zeroes in a binary. :-/
Binary format of what?
 
I have a neat way of padding 0s for decimal.
I've seen all sorts of contortions to get that .. mainly to get padding for dates.
so, how would you pad say 1 .. 999 to 0001 .. 0999 ?
 
Well, you'd need a copy on the binary as its a series type.
 
1:45 AM
Hey @Adrian
 
hey Brian
oh, BrianD :-)
gotta distinguish now
 
Fork is fine. :-)
 
Spoon
not as edgy?
been trying to stay caught up with the chatter here - you guys talk a lot and I don't want to miss anything interesting
 
@Adrian BrianH told me about Ladislav's build dialect, which I find an interesting thing that I had not known about.
 
I had a look, as well - seems interesting
also read your tag writeup on the wiki
 
1:59 AM
Hrrrm. I wonder if array and array/initial are actually that useful to have...what if there was just a pad that modified its series input.
So array becomes pad copy [] 10 none. But you could use it for much more.
 
@HostileFork modifying stinks :)
/me ducks
 
@earl Well if you're trying to pad something that's already been constructed, and is big...
 
yes, yes, a very unpopular opinion among performance micro-optimising rebol people.
just ignore me :)
 
Well, I mean, does that sound crazy? Why not make pad the native? It would be quite useful and I always thought "array" was weird.
A lot more general, a lot more useful, and to my eyes...less weird.
 
no, not crazy. it fits well with the other core crazyness :) and you basically have that pad native already.
 
2:09 AM
@earl I do? Why didn't you suggest I use it on the binary then?
 
>> head insert/dup copy [] none 10
== [none none none none none none none none none none]
@HostileFork head insert/dup bin #{00} (4 - length? bin) -- same ugly.
 
Andreas (@earl), not sure if you missed it, but I had asked you if you thought it was worth creating debug/release targets in the makefile
 
@Adrian Saw it, forgot about it, thanks for bringing it up again. Yes, it is.
The CMake build should already support that, btw. For mainline, we have: github.com/rebol/r3/issues/44
I lean towards making debug builds the default, with a RELEASE environment variable for triggering release builds (as well as a dist (or release) target for convenience).
 
should the symbols be external?
takes a while to generate them
 
sorry, i'm not sure i understand?
 
2:20 AM
not used to gnu and debug so maybe you can't have an external symbols file like with VS, a pdb
can you?
so that these don't always have to be regenerated - or at least not entirely
 
no, debug info is contained within the binary in ELF or Mach-O.
 
and can't be externalized? Thought I had read the other day that there is a way to do something similar
 
38
Q: How to generate gcc debug symbol outside the build target?

kcwuI know I can generate debug symbol using -g option. However the symbol is embeded in the target file. Could gcc generate debug symbol outside the result executable/library? Like .pdb file of windows VC++ compiler did.

 
yeah, think that's one of the things I remembered
 
you can do that with adding a debuglink, yes. but that's rather unusual.
main use is for distros to provide a smoother experience for selectively debug-enabling things.
 
2:26 AM
wouldn't it save some time when you're building the target?
 
debug builds show no significant difference in performance for me, no.
 
no, don't mean performance at runtime
 
i'm talking about build time as well, yes.
6.77s vs 6.80s for a full rebuild on the machine i'm working on at the moment.
 
hmm, I built a debug version with symbols the other day and it seemed to take some time vs not having them - this was with -g added and the strip removed
did you maybe only have some of the symbols created?
 
full rebuild, as mentioned above :)
 
2:30 AM
I'll time my build again, but I'm pretty sure with symbols it was over one minute for me
 
just relinking takes 0.51s with syms and 0.45s without syms for me.
 
pretty much 2 min for a full build with symbols
you're building from the command-line?
 
yes
 
with -g and no stripping?
 
yep
 
2:36 AM
Well, maybe CB is doing something to slow things down. For one, it's outputting quite a bit of crap in the build log for every symbol
not sure that can be muted
 
that's part of the plain makefile (nm)
~1800 symbols
 
what is part of the plain makefile?
 
the symbol dump
remove the NM right below the STRIP, and it should be gone
 
you mean nm running needlessly?
a lot faster (about 30s), but still not your speed
you must have a nice little system
 
i parallelise builds with make -j
 
2:42 AM
should try that too - have a quad core with hyperthreading
 
rebuild:
	make -C make/ clean
	make -C make/ prep
	make -C make/ -j r3
(that's my "rebuild" meta-target.)
 
 
1 hour later…
3:48 AM
@HostileFork array is more useful for quickly specifying multi-dimensional arrays as preallocated blocks of blocks; array/initial is most useful when you pass it a generator function, because it gets called every time.
 
@BrianH Some of these things get me curious about what the performance is, pad just seems like a more generally useful native that would do the same thing and not be difficult to write and optimize. The only weakness is that because it can assume you're creating a new block it might be micro-optimizingly faster than passing in a block made with copy []
Array just seems like one more thing to remember, and then people will go looking for an array! type or something, it's cognitive load.
And a fast modifying pad primitive that returned the head of the pad would be useful.
Strings, binaries, blocks, etc.
 
I make pad functions all the time, but they are extremely simple and have to be different almost every time. A flexible pad function pays for that flexibility in overhead, compared to the inlined code with the options processing taken out. For mezzanines especially (but natives too) you pay for flexibility.
 
Lengthwise: pad copy [] X none is 16 characters. array X is admittedly shorter if none is really what you wanted. But if you want anything other than none you have array/initial X Y vs pad copy [] X Y, and the array case is one character longer.
I think padding strings, binaries, paths parens...it could all be useful if it was there and if it were fast.
 
Longer code is less relevant than code complexity, especially internal complexity. The array function pays off when you need the complexity, since it's the most efficient mezz way to do what it does. Nonetheless, I use it rarely enough that I have to check its source every time to figure out what it does, exactly, and I wrote the function :(
 
Oh, it takes a block of sizes. Now I see what you're saying
 
4:02 AM
The array function is most useful for multi-dimension stuff though. There would be a real advantage to a single-dimension pad function, if it were designed right and implemented efficiently (likely native). I don't think that padding with generator functions would be that useful, so you could make native code to deal with the options rather quickly.
 
I didn't realize it was a mezzanine, I thought it existed as a native, and that its raison d'etre was some internal performance optimization on pre-allocating and pre-filling identical values.
 
Mezz functions aren't necessarily that slow. The array function wouldn't be that much faster in native form, and it would be much tougher to get right. It calls really fast natives internally.
A pad function would benefit from being native though, because a lot of its overhead would be options processing, which is faster in native code. That is the price of flexibility.
You likely wouldn't benefit from having pad call functions, and it wouldn't need to call itself recursively; those are the two things that are most awkward to do in native code. However, pad would benefit from having left, right and center options, a /copy option if it modifies by default, or an /into option if it builds by default - that is where native code would help.
 
Hmmm... well okay @earl, I guess pad/into sounds nice.
 
@HostileFork Remember, the /into option would need to be consistent, we made it that way for good reasons. That means returning the after-insert position like insert.
 
@HostileFork Mutating would be more in line with the rest of Rebol, so that should probably be the default.
 
4:17 AM
@BrianH Okay, then not.
 
No /copy necessary, though. I don't think any other mutator except BIND has it.
 
@earl We do both kinds. We have mutators and generators. Mutators without corresponding generators have /copy options, and generators without corresponding mutators have /into options. The /copy and /into options work consistently, with rare exceptions.
 
@KK. Hey. We are discussing whether there should be an operation built into Rebol that would let you "pad" series types. So if you said foo: {Some string} and then pad foo 3 #"A" and then print foo it would say AAASome string
 
@HostileFork btw:
 
@earl Most other mutators have corresponding generators, so they don't need a /copy option. That is why insert and append don't have /copy: we have join and rejoin instead.
 
4:22 AM
>> format/pad [-10] "FF" #"0"
== "00000000FF"
@BrianH Name one mutator but BIND with /copy :)
 
The format function is still waiting for consensus. Its specification dialect is poor.
 
@KK. However it would also be able to work with other series types, like block! or paren!, or binary!. So pad [] 3 [a + b] would get you [ [a + b] [a + b] [a + b] ]
 
KK.
@HostileFork Hello. This happens in python too, but with a multiplication sign.
>>> 3 * "HostileFork"
'HostileForkHostileForkHostileFork'
 
@KK. Well, what if you have a very long string that is 200,000 characters long. And you think it would be nice to put 3 "HostileFork" pads in the front. How much memory would this consume? How long would it take? using "plus" and "multiply"?
 
KK.
@HostileFork [POSSIBLE WRONG THOUGHT] In other languages, (I think) almost everything is possible with every data type because it is implemented as a special case, but here, it seems like the focus is getting everything possible because there are no special cases
 
4:29 AM
Most built-in mutators aren't complex enough to not have corresponding generators, which is why the only one complex enough to have a /copy option is bind. But we did have several generators without corresponding mutators, so we added the /into option. The return position is essential for efficient chaining, which is how you manage to be efficient when building with mutators. It wasn't arbitrary. That is why reduce, compose, collect, extract and reword have standard /into options.
 
KK.
@HostileFork I think I get your point, it will involve (willingly or unwillingly) some sort of Shlemiel the Painter's algorithm.
 
@KK. Well, every language has some things it does consistently and other things that it does in a "special case". For instance, C++ has a uniform way of specifying iterations and it can be applied across a whole lot of types of containers, whether they are linked lists or consecutive arrays in memory. Etc.
 
@HostileFork Depends on the Python implementation :)
 
@HostileFork In R2, you'd have to move the whole 200'000 chars over 3 times, and might have to do a realloc. Making mutators efficient takes care. Builders can be more efficient.
I would prefer to have pad be a generator with an /into option, because that would make chaining values into preallocated buffers easier.
 
@KK. But Rebol tries a certain kind of consistency, for instance look at this page on Why there is no substring in Rebol ... even when people ask for it a lot. And notice how the parts fit together, a lot like written language which can be thrown around easily.
 
4:38 AM
@HostileFork "So pad [] 3 [a + b] would get you [ [a + b] [a + b] [a + b] ]". Would you prefer that the [a + b] be copied or referenced?
 
@BrianH Referenced, but for KK's benefit I'm trying to reduce the word count. :-)
 
@HostileFork I don't know who these rebolers are, but I don't recall a vote!
 
@GrahamChiu People new to the language ask for it at first...I mean. I think only a couple actual Rebol users have ranted that adding it would be a good idea to keep people from running away because there's no substring.
 
KK.
@HostileFork thanks, I was feeling overwhelmed :-)
 
@HostileFork Better to point them to a set of string handling functions that they can import
 
4:41 AM
@GrahamChiu I'd argue things like that aren't bad ideas. People will grow out of it.
 
@HostileFork Are you doing references to reduce overhead, or do you expect to use the side effect of making multiple references to a modifiable structure, which would make any changes effectively propagate to all referenced structures (since they's be the same structure), and reduced task/recursion safety?
@GrahamChiu A standard module of handy series functions could be useful, as long as you don't have to include it by default. Maybe some of the existing mezz functions can be moved there.
 
after you've written copy/part skip string 5 2, you'd want to reduce that to something less noisy like

substring string [ 4 .. 2 ]
 
Without the brackets or .. either, of course.
 
the ".." is just eye candy and optional
So, after 15 years we still tell people .. just do copy/part skip is a bit silly I think.
 
It adds overhead to make it optional. Putting the range numbers in a block adds overhead too, especially since that block will more often look like this: reduce [b '.. e]
 
4:49 AM
the block is because it's dialected
If we were to worry about performance all the time, we'd use C
 
Dialects have processing overhead. You don't use them when the operation is so tiny that the dialect processing overhead dwarfs the real work.
 
@BrianH Well I figured you could always copy if you wanted but you couldn't get references if you wanted. I deal with situations all the time where copy-by-default would make things safer but having the option is interesting, and at least consistent.
 
And since putting those values in a block will more often than not mean generating an intermediate block, that makes for a bad dialect.
 
It's about noise reduction, readibility vs performance
 
If you want to make a substring dialect like that, it would have to be native. And I don't mean a command, I mean a real native. The only way you could make it not have to have an explicit reduce is to make it have an implicit one, like apply, and that can only be done with a real native. And checking the block for the right number of values, making the .. be optional, it wouldn't be a very fast native either.
 
4:57 AM
well, we can remove the optional ..
I think Python has a large number of string handling operations
 
Even making it be mandatory would be an improvement. Or making it be a keyword that we don't have to check is really .. would work too.
You have to remember, Python is compiled, so its dialect processing overhead is at compile time. We get nothing for free.
Would substring string 4 .. 2 work for you? It's much faster without the brackets, and you can even keep the .. keyword by making it a lit-word argument.
 
While we're at it .. what annoys me is that we have 'suffix? but we don't have a matching function to get filename
the brackets were to allow a dialect to process multiple parts of the string
 
@GrahamChiu Agreed. We have to do copy/part f suffix? f
Wait, that wouldn't even work.
 
clear find/last f "."
 
And maybe a copy in there too.
 
5:06 AM
If you do lots of file processing .. it's annoying
 
If you want substring dialected to handle multiple ranges or positions, it ends up being as complex as extract, and having comparable behavior but not periodic. It better support more than just strings (making the name not great).
 
well, it was for future proofing and I haven't needed it! :)
 
@BrianH Right, I think the deal is "oh you want substring? here it is." They go "okay, well whew, I'm glad your language isn't totally bonkers and you didn't try to talk me out of it. Let me see now if I can work through this test..." It gets them to the next question, and then you go "Hey, you want something even cooler? Extract. It's not as fast because it's a dialect, but it's much more awesome and can manipulate symbols too."
Then later they grow out of substring and when they need performance they use the standard parts box from the DO dialect. Or Red. :-)
 
string splicing is needed to convert strings in one date format to another ...
I don't know if this is likely, but perhaps locale could actually recognize USA date formats
 
@HostileFork extract is pretty fast because it is a limited dialect which is processed quickly, and most of the setup work is only done once before the repetitions start. It wouldn't be much faster to do with the regular do ops. The only way you could make it faster is to make it native.
With a non-repetitive series-rearrangement dialect you'd have to make it native right away to make the dialect processing overhead not take longer than the equivalent do code would take.
 
5:26 AM
I would like to get this Red R3 port thing in a checkinable state so I can look at some of these performance questions for myself and understand what's going on.
 
5:41 AM
@HostileFork have you made any progress on those 32 or was it 52 bytes?
 
@GrahamChiu Slow progress, basically lost a week to not feeling well so I chatted instead because that's sort of productive.
 
Back to Rebol for new users .. a file somewhere of common functions found in other languages should be easy to do ...
 
But then I felt better and finished up the Red talk edit and got back to programming.
 
@HostileFork so this was therapeutic chat?
 
@GrahamChiu I hope not because if so, it works very slowly. :-)
And is thusly not an effective method for dealing with problems.
 
5:45 AM
@HostileFork just as good as others
ahh.. you changed the sentence to which I was replying
need a way to quote
 
I copy and paste.
 
somewhere there is a mouseless command driven interface to this chat
 
You can also be fast on the edit, press the up arrow. If you're within two minutes you go into editing mode on your last msg.
 
that's what I miss about my old chat program ... had lots of command line functions
 
KK.
[changing topic] Are the parentheses in the first line only for readibility or is there a difference between the following two lines?
>> view layout [image (load http://rebol.com/view/bay.jpg)]
connecting to: rebol.com
>> view layout [image load http://rebol.com/view/bay.jpg]
connecting to: rebol.com
 
5:50 AM
@GrahamChiu, I wonder about your use of .. for ranges in the single-extract (substring) dialect. Everywhere else we do ranges in R3 we use - instead. Does consistency matter here?
 
could fetch the remote user's local time, translate their language to english or whatever
@BrianH It was a R2 function
@KK. VID is a DIALECT
 
Ah, ranges in R2 are also specified with - (mostly in charset).
 
you don't write Rebol code inside the block
 
I mean that when ranges are specified using a keyword elsewhere, the keyword used is - instead of .. in other dialects. Maybe the other dialects could be altered to also suport the .. keyword.
 
@KK. BTW: Refer to the updated chat room FAQ for a list of the relative priorities of topics (Rebol language usage questions come ahead of Rebol implementation discussion, and most certainly StackOverflow chat shortcuts.) So don't worry about topic changes upward on that list.
 
5:54 AM
@BrianH true. My first thought would be one might confuse a range with a negative number
 
That is a downside of using -. And the downside of using . (visibility) might be solved by using .. instead. And ... could be a rest keyword, though we'd have the visibility problem again.
 
this is what I have in my source

substring: func [
[catch]
source [string!]
spec [block!]
/local start stop rule
][
rule: [set start integer! '.. set stop integer!]
unless parse spec rule [
throw make error! "Invalid range spec."
]
copy/part skip source start stop
]
 
@KK. Not knowing vid I had to go look. But I believe the way it was chosen for the dialect to work is that the thing coming after image is one of those "alive" contexts where it defers to the DO dialect.
@KK. When a block is "dead" (e.g. in a non-evaluative context) the answer is up to the dialect author. So VID could have been designed to ascribe all kinds of meaning to what to do with what comes after an image word.
 
@GrahamChiu If there are only two integers, there's no point in making it a dialect. It only makes sense to dialect if there can be more ranges and individual positions.
 
KK.
@HostileFork Ok. I am still working my way through the VID part in Nick's tutorial, hopefully will complete it within an hour or two.
After that, the next thing is blocks, series, strings etc.
 
6:01 AM
@KK. so when the layout parser hits 'image, it looks for a source of the image .. eg file or image data. I guess it evaluates whatever is next in the stream.
@BrianH sure .. as I said, it was intended to do more but never needed to do more in the end
 
One trick I was thinking about years ago was a dialected binary translator. The way it would be efficient enough is that it would compile binary destructuring or structuring functions based on a spec. There would also be a convert wrapper function that would compile and run a spec on the fly, perhaps with memoization. Maybe a similar approach would work here.
 
@KK. The trick here is the VID dialect is leveraging DO/NEXT internally. I showed you how DO on an expression would run everything and then evaluate to the value of the last expression. DO [print "hello" (1 + 2) (3 + 4)] would therefore print out hello, evaluate the 1 + 2 and throw it away, and the result of the whole thing would be 7 from 3 + 4.
 
KK.
@HostileFork Yes.
 
@BrianH I think I have in fact written such a thing years ago :) Must have been a fruitful year for binary processing.
 
KK.
Would it be safe to assume that dialects are like what we call frameworks in other languages? (Other than the fact that dialects let us change the rules of the game according to how we need/want it.)
 
6:07 AM
@KK. Not really. In other languages they are called "domain-specific languages" or DSLs for short.
 
@KK. But there is a way to just say "evaluate the first DO dialect expression where it has been fulfilled". It is DO/NEXT. Try do/next [print "hello" (1 + 2) (3 + 4)] 'pos and then probe pos
 
KK.
>> do/next [print "hello" (1 + 2) (3 + 4)] 'pos
hello
== pos
>> probe pos
** Script Error: pos has no value
** Near: probe pos
>> pos
** Script Error: pos has no value
** Near: pos
 
@KK. Um. Really?
 
KK.
yes.
Maybe you are using R3. (I am using R2)
 
@KK. In R3. It works differently in R2.
@earl Efficient binary processing is done using completely different methods in R3, R2, and R2 with structs. It makes sense to have a compiled dialect here, since the resulting functions would look very different depending on the platform, but would behave the same on the outside.
 
6:12 AM
@BrianH Back then, I ultimately compiled to rebcode (after trying several variations). Along with a (memoising) convenience wrapper.
 
All right have to actually run this and see what it does, I've never done this in R2
 
In R2:
>> set [val pos] do/next [print "hello" (1 + 2) (3 + 4)] probe pos
== [(1 + 2) (3 + 4)]
 
KK.
@BrianH Thanks, it works.
 
Oh, wait, of course val has no value. It's the result of print. Duh.
 
KK.
However, only
>> set [val pos] do/next [print "hello" (1 + 2) (3 + 4)]
>> set [val pos] do/next [print "hello" (1 + 2) (3 + 4)]
hello
== [unset [(1 + 2) (3 + 4)]]
leads to
 
6:17 AM
@KK. What you're seeing here is Rebol doing a trick to return multiple return values from a function by putting them in a block.
 
@KK. Yeah, it looks ugly. We changed do/next for good reasons.
 
@KK. A function can have only one return result, but that result can be a composite structure (typically a block). But it would be kind of lame to say result: two-result-function foo followed by result1: first result and result2: second result.
@KK. set is a trick to shorthand this. set [result1 result2] two-result-function foo
 
@HostileFork @KK, the intermediate block method passed to set [some words] has more overhead than R3's method of setting a passed-in word, but it looks cleaner to people who are used to functional languages.
 
@KK. But this has distracted us from the original point about re-using all of Rebol's DO dialect's hard work in your own dialects without reinventing the wheel. You were asking about parentheses and if they were necessary in the VID dialect or not, as you noticed it worked either way.
 
KK.
Yes. But before we go on, could you say simply in English what this line means?
>> set [val pos] do/next [print "hello" (1 + 2) (3 + 4)]
 
6:23 AM
@KK. Evaluate one expression of the Rebol code [print "hello" (1 + 2) (3 + 4)], store the result of evaluating that expression in val, store the remaining code after that expression in pos.
 
@KK. "Dear set function. I would like to call you with two parameters. The first is a block, it contains two WORD! items that represent the names of things I would like to be used as the identifiers of two variables you will be setting. The second parameter is going to be a block, also with two items."
@KK. The second item is the result of the evaluator crunching forwards and seeing "Dear do function. I would like to call you, but I will signal you to use an optional behavior called /next. Although some optional behaviors change the number of parameters functions take, I know that you are DO and that your /next only represents an option in behavior without adding a parameter."
@KK. This optional behavior warns DO not to just keep crunching through all the expressions it is passed, but to stop after it has finished just one. However rather than just return the result of that expression, it returns also the position of the start of the next expression in case you want it.
@earl As functions only can return a single result and not two, DO just cooks up a block that has the result of evaluating the first complete expression and the position in the series after that. This makes that second parameter that is a block of two items which set was expecting.
 
KK.
Ok. What does print function return?
 
@KK. Were Rebol less elegant this might look like set([val, pos], do([print "hello"; (1 + 2); (3 + 4);], next:true);
 
KK.
>> set [val pos] do/next [print "hello" (1 + 2) (3 + 4)] probe val
hello
** Script Error: val has no value
** Near: probe val
>> set [val pos] do/next ["karunesh" (1 + 2) (3 + 4)] probe val
"karunesh"
== "karunesh"
 
@KK. Good observation. Rebol has a distinction between a variable which is "null" and one that "does not exist", some languages have this distinction also.
 
KK.
6:33 AM
@HostileFork Once I start understanding Rebol code properly, I think I won't like other languages.
(Luckily I will not have to work for others in the future)
 
@KK. The print function returns a special value #[unset!] which is mostly meant to trigger errors when you try to assign it to a word. It is supposed to mean "no value, but in a bad way". As opposed to the none value, which means "no value, but this isn't assumed to be bad".
 
@KK. You might like Red. :-) I think Rebol changes your worldview, but this isn't a one-size fits all world. I believe there are a lot of truly bad languages, PHP is a "Fractal of Bad Design". But there are some nifty ones too. You just might start to appreciate the difference between total crap that is successful in spite of itself, and the families of good languages by people who thought through a design space.
 
In a lot of cases words are also unset when they are created, so as to trigger errors when they are referenced without setting them to something. This is meant to help you track down bugs in your code that would be caused by referencing uninitialized values.
 
@KK. I myself am a huge fan of C++11, but it addresses a different problem space. And practical and legacy concerns have made it very "ugly", but I don't see that part...I see the design and mechanisms behind it.
 
KK.
@HostileFork Ok. But currently I think I will stick to Rebol2 only. Better to learn one first.
@HostileFork fanatical good or bad?
 
6:40 AM
@KK. Be ready to unlearn some bad habits when you switch to R3. R2 had a lot of stuff that needed fixing.
 
KK.
@BrianH :-)
 
@KK. Just to put some closure, again, on your parentheses question: If DO did not have a /NEXT option you would have your hands tied a bit as a dialect author.
 
Weirdly enough, do is built on do/next internally. The source is fun :)
 
@KK. You would be able to call DO with a complete block of code, sure. But you would have to know where the block started and ended. The easiest way to do that would be to look around in the block you were passed containing all the symbolic instructions for your dialect... and when you see something like a paren! series you might just say "well I'll use that"
@KK. Or worse things, that would perhaps look like view layout [image begin-do-code load http://rebol.com/view/bay.jpg end-do-code] :-( The point of Rebol is to give you the building blocks so you don't wind up having to do something that bad.
(Which still isn't that bad compared to what some people do when they try to "think outside the box" in their language, and wind up putting all kinds of stuff into strings and tables. Compare the perl implementation of the whitespace language, which is actually pretty darn good for perl, to my Rebol implementation)
@BrianH you ever see that --^ ?
I used the parse position for the program counter. :-P That was my first time using parse and I was getting carried away.
 
@HostileFork Did you use parse/all? :)
 
6:54 AM
@BrianH It's R3 only. :-P
 
Going through the source earlier, I noticed that return has a /redo option. Pretty much undocumented, except in the source code. I'm looking forward to finding out what it does. @HostileFork, you'd appreciate this being a C++ fan, but I think it might be usable to return expressions that are evaluated in the calling context. Maybe even assignments :)
 
KK.
@HostileFork Is the Rebol [...] in the beginning like a documentation string? I saw the same in the scratchpad file provided by @dt2, and it was something like Rebol ["Do not remove this"]
In R2, the following is an error:
`>> print rejoin ["Hello" space "World"]
** Script Error: space has no value
** Where: rejoin
** Near: space "World" `
 
@KK. So have you come across this yet? code: load "[1 + 2]" then type? code then probe code?
 
KK.
Not yet, let me just come across it in a sec. :-)
 
@KK. For some reason, the word defining space to be mapped to the character #" " was left out of the R2 and R3 compatibility layer, and the person who could tell you why is in...this...very... room! :-)
 
KK.
7:04 AM
Cool:
>> code: load "[1 + 2]"
== [1 + 2]
>> type? code
== block!
>> probe code
[1 + 2]
== [1 + 2]
 
@KK. If you want it, you can have it... space: #" " is all it takes.
 
KK.
@HostileFork Is that you?
 
@KK. @BrianH is responsible for something named R2/forward. It is a library designed to make Rebol 2 act more like Rebol 3 and it comes included in newer Rebol 2 downloads.
 
KK.
Yes. space: #" " works
 
@KK. Now want something else? result: mold [1 + 2] then type? result and probe result
 
KK.
7:07 AM
>> result: mold [1 + 2]
== "[1 + 2]"
>> type? result
== string!
>> probe result
"[1 + 2]"
== "[1 + 2]"
With this, I have found the dictionary page for R2, a page I will be visiting a lot in the coming few days.
 
@HostileFork Yeah, I didn't add sp and space to R2/Forward, sorry, it was an oversight. They are easy to add, obviously.
 
@KK. From strings into structures...and then back into strings again. Now, don't think this is a perfect solution for everything because some aspects of Rebol's runtime in-memory structures do not get well preserved when you turn it into a string and back. It's "incomplete" but still you can get a lot of mileage from it if you can keep a realistic mindset.
 
KK.
@BrianH What do you think about the 'q' in join [m n o p] q ? (Just want to see how you think about it.)
 
Found out what return/redo does. It does tail call optimization!
I am absolutely in favor of keeping q assigned to its current function. I frequently try to exit other consoles and interpreters using q, and am always annoyed when it doesn't work.
 
@KK. Don't expect the moon with Rebol being able to turn its code to strings in back, there is a reality. There was a bug report on Rebol today and I wonder what you think of it: GitHub issue 79
 
7:14 AM
@GrahamChiu there is, and I thought you were already using the SO chat modification script since you asked how to install it
 
KK.
@HostileFork In your whitespace code, what does IMP: [something something-else etc-etc] mean?
 
@BrianH This is why there will inevitably be a Rebol fork. I might as well announce RebolNoQ as of this moment, and people are either with me or against me.
 
@HostileFork and I'll put q: :quit in my rebol.r for that platform :-P
 
KK.
@HostileFork I think your comment there is correct.
See in python:
>>> 8.45 - 8.00 - 0.45
-7.2164496600635175e-16
 
@KK. I did not invent the term. It is the "instruction modification parameter" as laid out in the definition of the whitespace language. The joke of whitespace is that if a language ignores whitespace, you could "hide" a program within the code of another language... by ascribing meaning to the tabs, spaces, and line breaks.
 
7:18 AM
@KK. It's not a Rebol thing, it's a IEEE754 thing.
 
@KK. Just as e.g. 0.1 + 0.1 + 0.1 ...
 
@HostileFork After dealing with Python and VB, I consider whitespace to be the only legitimate significant-whitespace language.
 
KK.
@earl In python,
>>> 0.1 + 0.1 + 0.1
0.30000000000000004
In R2,
>> 0.1 + 0.1 + 0.1
== 0.3
 
@KK. The more general concept is of writing a program where the same input code has different meanings and runs successfully in multiple languages. Of course you could always make up a language that ran the code in the comments of another language and ignored the rest, or whatever. The harder problem is to do the same thing: Polyglot program
 
@KK. We fake it. We don't show all the digits.
 
KK.
7:21 AM
@BrianH Fake or round it?
 
Round it to 15 digits. Which is faking it.
Ladislav has been doing some work to improve this, but it is really working around limitations in the hardware format and math standard.
 
@KK. Look even at Wolfram Alpha. And it does symbolic integration! And can tell you who your father's uncle's sister's nephew's brother's cousin's aunt is. So I think we'll just say it's not a Rebol bug. :-)
 
KK.
@HostileFork I think the same.
 
Wolfram Alpha can also tell you the day after the fourth wednesday two years from today. Which puts Rebol's power in perspective a bit.
But Rebol is open source. :-P And also, it's specifically a philosophy about the design of things. Wolfram Alpha is a big system, too big for any single person to really absorb and understand, like Google and such. It's an aesthetic, a question about architecture.
 
It looks like return/redo can be used to take extra parameters too. It only works when you return functions. It's like returning an expression of do function!.
 
7:29 AM
@BrianH Ah, I tried blocks and gave up
 
I didn't even start testing until I saw how it was implemented in the source. It's a really weird feature.
 
@KK. Imagine you went to the department store and bought a toaster, and the toaster came in a box that was 2m x 2m x 2m. You take the toaster out and it has a big long hose that is very fat and square on one end, and the other end is a small round thing that plugs into the toaster unit itself.
@KK. Then the directions say "First, open your oven and attach the adapter. Now set the temperature dial to 450. Insert toast..."
@KK. "Now plug in the electric cable. On the toast darkness setting knob, turn it until you have found your wifi network. Enter your wifi password."
@KK. Lo and behold, when you enter your WiFi password, a little gate opens up and the hot air from the oven is allowed to flow into the toaster and cook your toast!
Some people are happy. They got their toast. Others will start asking questions. "I don't have an oven and the whole reason I bought the toaster is because I just want toast. Speaking of which, why does it have a power cord if it doesn't actually have heating coils?" (The answer is, that it is for the LCD display and WiFi receiver...that raises more questions...)
@KK. Here is a quote I like, approximated: "The most reliable parts of a system...the ones that never break and need replacing, and never malfunction...are the ones that aren't there."
 
8:31 AM
OK, I had some time to think while I ran an errand: return/redo is a general-purpose trampoline facility for functions. This can be used to implement anything a trampoline can be used for, such as tail call optimization, aspect-oriented programming, function wrappers, even a wrapper for return itself that works. It's a little frightening how useful this can be for power-user code.
2
You can even have functions that don't take parameters return functions that do take parameters, and those returned functions will then take their parameters from the original call site. That can be really useful for evaluation order hacks without needing do/next or get-word parameters. In-place dialecting :)
Checking whether this can be used to break apply security... Nope, still safe.
 
 
3 hours later…
KK.
11:33 AM
@HostileFork Googling for the most reliable parts of a system "the ones that never break" leads to one of your posts as the first result
 
KK.
11:45 AM
Also read your thoughts on Joel Spolsky's UI Design book, and I had never thought of dirtiness the way you talked about it.
 
 
1 hour later…
KK.
1:10 PM
In Rebol 2, why should an empty block be created with a copy function? (Got this from Nick's tutorial)
That is, why is
>> empty-block-with-copy: copy []
better or more appriopriate than
>> empty-block-without-copy: []
Both print the same thing on the Rebol console.
== []
 
1:45 PM
>> foo: func [] [return func [a] [print a]]
>> foo "Hello"
== "Hello"

>> bar: func [] [return/redo func [a] [print a]]
>> bar "Hello"
Hello
Whoa.
 
2:00 PM
@HostileFork Your foo word refers to the constructor function instead of the constructed function, so your foo "Hello" doesn't do what you expect ("Hello" is not passed as argument). Instead you should write it like:
>> foo: do func [] [return func [a] [print a]]
 
@DocKimbel I didn't expect foo to work, I just didn't know bar was possible. :-)
 
First time I see /redo refinement...
I would have rather called it /do or /apply .
 
@DocKimbel The weird name probably calls out the distinction between return do x and return/do x
I suppose the reason it doesn't just do any block is some notion of security...that if it consumes more data out of the calling context it has to do so as a parameter in sequence after the call? If so, it should raise an error if you pass it anything other than a function...
>> myreturn: func [] [return/redo :return]

>> baz: func [] [myreturn "Hello"]

>> print baz
Hello
 
3:02 PM
@KK. Hey KK. I am not the best person to ask some of the "whys" on Rebol's contexts and binding logic. I can more tell you the "what".
Compare loop 5 [data: [] append data "a" print data] to loop 5 [data: copy [] append data "a" print data]
 
KK.
@HostileFork Ok. Thanks.
 
@KK. I'm assuming you're getting a bit of the hang of "seeing" the invisible structure here and how the first, for instance, runs the same as loop 5 [(data: []) (append data "a") (print data)]. The trick to reading it is that you have to know how many parameters a function expects...
 
KK.
@HostileFork I am getting a hang, but slowly. For example, right now I have to read such lines 3-4 times before I get em. :-)
 
@KK. If loop only took one parameter, like print, then the block would not be passed to it. Instead, it would just sit there...and be the result of the whole expression! Try value: negate 5 [data: copy [] append data "a" print data] and then probe value
 
KK.
@HostileFork Since negate only took a single, numeric value, it ignored the rest of the line (the block).
@HostileFork I watched a bit of the Red video you linked here. The speaker seems to be speaking with an accent that can confuse non-native English speakers.
If it is possible, can we have subtitles?
If it takes a lot of time/effort, then maybe I could help in some way? (I know nothing about videos etc)
 
3:15 PM
@KK. I'll look into it...thanks for the help offer, I might take you up on it. :-)
 
KK.
@HostileFork Ok. Lets hope for the best.
 
@KK. So the result of interpreting the whole expression is just the block. While value became -5. Now since you know what print returns, this might not seem entirely confusing once you learn what loop returns :-) value: loop 5 [data: copy [] append data "a" print data]
Then try value: loop 5 [data: copy [] append data "a" print data "kk"]
 
KK.
There seems to be a problem. Maybe it is again because I am using R2
>> value: loop 5 [data: copy [] append data "a" print data]
a
a
a
a
a
** Script Error: value needs a value
** Near: value: loop 5 [data: copy [] append data "a" print data]
 
@KK. Nope, the problem was intentional. :-) Now try the next...
 
KK.
Ok. The "kk" at the end is a string, and it is what is returned to value
print only took a single argument :- data
 
3:24 PM
@KK. Right. This is because when loop is finished, it will return whatever was evaluated the last time in the loop block. a: 0 value: loop 2 [a: a + 1] print value
In the DO dialect, a set-word consumes one complete expression after it and takes that expression's value. So it is like it does a DO/NEXT, gets the value, and puts it in the variable. But then it evaluates to the value also. This is why you can do things like a: b: c: 10 because it is evaluated like a: (b: (c: 10))
 
KK.
@HostileFork I think these are two different LOC. The second line, value: loop 2 [a: a + 1] print value assigns the value 2 to value
@HostileFork I have to leave right now. Hopefully, I will come back tomorrow (Today evening for you.)
Good night.
 
@KK. Nite...
 
4:18 PM
@HostileFork The return wrapper works! There are so many functions that this could help.
 
@BrianH It's definitely cool. Would be cooler if it would actually do blocks and let you run arbitrary code and assignments and such. Have you figured out the rationale or is it just not implemented?
 
@HostileFork "I suppose the reason it doesn't just do any block is some notion of security" - No, it's just exposing the feature that makes do func [] [...] possible. It basically has to go back and redo the function as if it were an inline value. The only purpose is to make it possible for the function to collect arguments from its calling location.
 
@BrianH Oh. Hmmm.
 
4:54 PM
Okay, one of these Red things is, I am now pretty sure a Rebol 3 memory bug of some kind. I have a certain code state, and if you put a print statement pretty much anywhere in the codebase it makes it go away. :-/ At least I have the precise state of the source files which reproduces the bug.
@earl do you run the automated build tests under valgrind?
 
5:17 PM
@HostileFork nope, no valgrind slave yet
 
@earl This thing is a parse problem where for some reason, MMAP_MAP_ANONYMOUS is being run twice in the loader here in red's platform linux.red
The parse rule matches MMAP_MAP_ANONYMOUS, and replaces it with 32
Then, for some unknown reason it also replaces the mmap with 32. :-/
When I try and add print statements around, it stops doing this.
Kind of doesn't matter where I put the print statements in the loader.
Completely reproducible, and perplexing.
I can even add debug code and comment [ ] it out, and it won't do it.
Then take the comment out and it does it again.
 
Sounds quite weird.
 
Indeed.
 
Gotta run now, maybe I can help with some debugging later on.
 
Valgrinding now, slow...
...and nothing. Bah. Hey @KamilTomÅ¡ík
@KamilTomÅ¡ík You might find the dialogue with KK interesting, including some of the things about going back and forth between structured code and strings as well as the sort of linguistic question of choosing to use the invisible understanding of parameter counts or not
 
5:42 PM
@HostileFork "Would be cooler if it would actually do blocks and let you run arbitrary code and assignments and such." - You don't need this to do blocks, you can do them directly since they don't take parameters. And you can do assignments by returning set or a wrapper of it.
 
@BrianH I was thinking more along the lines of foo: func [/local a] [a: 10 return/redo [print a]] a: 20 foo outputting 20. Sure it's possible to throw in a DO but there might be applications for that.
 
Won't work because the a's are bound to different contexts. Blocks don't take parameters.
And Rebol doesn't have scope.
 
Well, 10 would be fine too. Whatever DO would do.
I never know what's possible or impossible with binding, but the idea that it would pretend a: 20 foo had been written as a: 20 do [print a] seems cool. Maybe it's a paradox somehow, all that is generally over my head.
 
That's the problem: There's no point to doing a block somewhere else. Actually, since you used a stack-local word and the function has returned, it wouldn't even return 10, it would trigger an unset word error. It only makes sense to do a block in place. And you don't need more stack to do a block, so return/redo wouldn't be needed to free stack space.
 
00:00 - 18:0018:00 - 00:00

« first day (830 days earlier)      last day (2950 days later) »