« first day (2696 days earlier)      last day (1084 days later) » 

5:44 AM
has length now been deprecated in favour of length-of ??
yet length? has been kept
 
A Red GUI live editor with VID source code auto-updates (proof of concept): https://github.com/mikeyaunish/direct-code https://t.co/VaszlFZoWR
 
6:41 AM
@GrahamChiu I think that length of using the OF reflector is a better idea than just length, if we're not going to cave and just stick with length?. Some of this is about testing things to see how they wind up feeling, making sure they work, etc.
So yes, plain length is deprecated, because I don't think it reads as well and it has rubbed people the wrong way since its introduction.
 
@HostileFork since I had switched to using length I feel deceived! I should just have stayed with length?
 
@GrahamChiu Sorry to deceive you, but that's the cost of research. If we hadn't had the "length" phase we would not have come up with "length of"
 
so length was an evolutionary deadend?
 
If you want to argue for it, maybe it should be a default. If HEAD and TAIL exist as alternatives to HEAD OF and TAIL OF, then perhaps LENGTH should too, as alternatives that come in the box. But if you like it, it's easy to say length: specialize 'of [property: 'length]
 
Well, I'm just moaning because my scripts keep dying with changes in ren-c
 
6:50 AM
In a case like this, we can put it back if it's an inconvenience; we're not going to define LENGTH alone to mean anything else. But everyone has to participate in the process of deciding what the answers to these tricky problems are. The LENGTH? conundrum has been around for quite a while.
I like how length of reads, and so I'm curious to get people's feedback on that as we think about how we might use this kind of infix quoting in other places.
So removing length is like an enforced request-for-comment; you visit your callsites and look at them, and think about how the change feels, and if you see other cases where they might become more natural or readable using these new enfix mechanisms.
 
so length of is going to happen but currently length has been deprecated
 
@GrahamChiu Hard to make promises about what's set in stone, as it's not a good moment for stone-setting. I can say that my present feeling is that LENGTH OF is the best looking answer we have yet for getting the length, and because Rebol's definition is a bit about making the mechanisms match the source as we want it to look, then it will stick, even though the implementation raises questions about this class of reflector.
So if you use it, and find you are a fan of it, that's more data.
And I like being able to write things such as if length of block > 10 [...] as well as if 10 < length of block [...], the underpinnings changing are what make all this possible.
 
getting rid of parens is good!
 
And if you miss if length block > 10 [...] and still feel it's a good expression, that's data too.
 
the less shifty the language is the better
 
7:02 AM
There's a fair amount of subtlety tied up in the illusions, but the goal is to not conflate subtlety with complexity.
 
7:13 AM
Hm, here's one for the weird idea bin, what if OF using a SET-WORD! would use the word both as the property to extract as well as the variable to store it in?
length: of block
if length > 10 [
    print [length "is greater than 10"]
]
 
so of is a generalised extractor which replaces length? ?
 
@GrahamChiu Yes, OF is essentially an infix form of what R3-Alpha called REFLECT
So 'LENGTH and 'HEAD and 'TAIL were added to the list, which was previously 'WORDS, 'VALUES, 'SPEC, 'BODY, 'TITLE...
reflect block 'length => length of block, and it soft quotes so you could say (first [length head]) of block
So in a sense, it doesn't really raise any new questions about this category of "reflectors" that weren't already there in R3-Alpha, but it makes it more pressing to explain what this "reflecting" is and how new reflectors are added, etc.
Should you be able to say set [x: y:] [length head] of block, for instance? Or perhaps like my "wacky" idea, what about [length: head:] of block
 
7:30 AM
words, set-words .. as long as we are consistent everywhere
 
 
3 hours later…
10:24 AM
Or is *length?* deprecated and *length* ok?
In the past Kaj was a great propagator of LENGTH-OF to replace LENGTH? because the latter suggests it returns the answer to the question "is this a length?". One of the major downsides is (to me at least) that LENGTH-OF has that hyphen in it.
 
I often use length variable name, so using it as function name is bit unfortunate IMO, length? makes more sense.
 
It would be nice to be able to use LENGTH for getting the length of a series as well but LENGTH OF is certainly more like real language.
The difference can be that <b>if length block > 10 []</b> could suggest it gets the length of the outcome of block > 10 (true or false) and <b>if length of block > 10 []</b> is asking if the block is larger than 10 units. One thing about it, I have grown accustomed to the reverse Rebol way of testing cionditions in if statements, and like it ebtter now.
@rebolek That usage is a good point. (Also why I like not having English as a native language, so I can use the term from my language without being penalized for using an existing function).
You should start using L for your length variable names ;-) ;-)
 
10:44 AM
that's bit cryptic
 
It is from the series of bad programming habits.
@GrahamChiu It is time to trick @HostileFork into other challenges ;-)
 
11:00 AM
@iArnold the idea was to have set of similar functions body-of, words-of, values-of, length-of and let ? functions only for logical ones ....
 
We do have words-of, do we?
And one of the objections was that all scripts should be changed LENGTH? to LENGTH-OF etc.
 
I know. There is a group of rebollers, who never liked hyphened variants ....
 
(Are they around now?) I was one of them. But I also see the trouble with LENGTH? as explained above.
 
IMO the question "is this a length?" doesn't make sense, so I'm fine with length?.
 
Both points of view are right. For me length? is fine too.
 
 
2 hours later…
12:43 PM
length of being non-hyphenated feels like it solves most complaints, easy to type, no hyphen, looks good. Though it has this can of worms of "what is a reflector, exactly, that takes a word and gets a 'property'". But since REFLECT existed, it's not a new can.
One premise is presumably, these reflectors can't do mutations of the thing it is asking about.
So if foo x needs to change x, you'd not do that as foo of x.
 
1:22 PM
One problem is that if you add a new reflector FOO, and someone else adds a new reflector FOO, which wins? You don't have binding as a fallback, unless it pays attention to the binding of the word...which is possible, but that would mean there'd have to be a foo: somewhere you were bound to, and if you had a local variable called FOO: it would disrupt the idea.
So if the binding were heeded, it would lose one of the benefits of doing things this way, which is being able to use the noun words as variable names.
Replacing it gets more complicated too. If you wanted to have your own LENGTH? that was easier, you'd just say length?: func [...] [...] and it won't affect INDEX? or other things. Here you'd have to hook OF and specifically change its behavior for that one noun. of: adapt 'of [if property = 'length [return ...]]
So there's a bunch of things to think about, but like I said, Rebol has been predicated on "what kind of source do you want" and then trying to solve it with mechanics, rather than being concerned about mechanics to start with and saying that dictates the source style.
 
 
2 hours later…
3:02 PM
@rebolek @iArnold Just clarifying, you know that OF just looks at the word on its left, right? If LENGTH appears without an OF after it, it's just a normal variable, and the two usages do not technically conflict.
I guess that could be annoying if you want to do a global search/replace on the LENGTH word, of course, but in a dialecty language like ours that's fraught with peril in any case ...
 
@MarkI it looks promising. Guess the combination of LENGTH OF is not often found in one's existing codebase, except in comments.
 
3:26 PM
@MarkI I see. What if I have name of reflector stored in some word? How can I do reflector of something?
 
@rebolek It soft quotes, use a GET-WORD!, GET-PATH!, or a GROUP!. (pick [length head] n) of something
Or use REFLECT, which runs the same code but doesn't quote. reflect something property.
Though reflect should probably reorder the arguments, which would make things easier for OF. reflect property something
 
@HostileFork thanks for explanation
@HostileFork reflect something property seems like right order to me, but do as you wish
 
@rebolek Shorter expressions make better first arguments. reflect 'length some-long-expression. I'd think the thing you are reflecting the property out might tend to be the longer expression. It doesn't really matter.
 
3:58 PM
So now that ERROR! is only returned from a single-arity TRAP if it actually traps an error, one doesn't need TRAP/?. That can be done with just not error? trap [...] or, ok? trap [...]. It is now guaranteed that if the expression in the block evaluates to an ERROR! value that isn't raised, then TRAP will return void.
This goes in line with me basically trying to kill off the /? and ? variations of things, like ALL? or IF?.
Because if? ... is really not void? if ..., since all IFs that do not take their branch return void, and branches that produce void become blank. In the long run that would be value? if ... when value? is retaken.
 
 
1 hour later…
5:28 PM
@HostileFork It seems that the usage of the new rebMalloc is quite limited by the fact that Do_Core doesn't allow new Manual Serieses (github.com/metaeducation/ren-c/blob/master/src/include/… and github.com/metaeducation/ren-c/blob/master/src/core/…).
I meant it doesn't allow new series to outlive the current frame.
 
@ShixinZeng Yes, I'm working on that. Basically everything will be managed by default, you will have to rebUnmanage() to get a truly indefinite lifetime...and then you will have to free it. The managed default will apply both to API REBVAL*s and the mallocs, so it will be freed by the frame unless you rebUnmanage() it
The managed default will make the lifetime the same as the current frame.
 
That sounds good
 
Then there may be reference counting, also, so you can rebAddRef() and rebRelease() if you want to register interest in something outliving whatever manual or managed condition it is in
It's all kind of evolving, but, should come together I think.
 
understand
 
@ShixinZeng The reason I don't think indefinite lifetime is a good default is because of how easy it is for things to fail(), and not run the necessary freeing code.
 
5:37 PM
Understand, but that also applies to other resources a program could acquire.
 
So that leaves two possibilities for the default, either being managed and naturally/quietly freeing when the frame it was running during goes away, or be unmanaged and noisily failing when the frame goes away (normally).
True, but if you imagine some locality of code doing its work via Rebol, then having that be able to be relatively safe in cleaning up on errors is an asset...esp if you can use an allocator that is safe in that regard.
 
I always wanted rebol to have destructors like C++ for resource management
 
It seems to me that, it might be nice, if people can write things like printf("The spelling is %s", rebSpellingOf(word)); even if they didn't save that pointer anywhere to free it. The way I'm looking at it is that "you get what you pay for", if it bothers you that it "leaks" you can do something about it.
 
Well, the thing is when you noticed it's leaking, it might not be easy to pinpoint that's the cause, because of other code/noises added
 
I'm adding (right now) a thing that marks frames as being killed by fail() vs exiting normally, which lets you tell when a GC of a handle is done on a frame's behalf due to normal exit, one could offer some kind of instrumentation there for people who cared if you thought of that as a leak.
 
5:47 PM
Interesting, doesn't fail() just skip the intermediate frames? how can you mark them?
 
It walks them before the jump.
 
I see
 
I actually sat down and did a bunch of reading on stackoverflow errors and philosophizing, and it was going to be a forum post but I feel like the writeup (which looks into how Python and Ruby etc. deal with them, in their code) might be of more general interest.
So in theory, when I get a minute, I'll write it as a blog
 
I'd be very interested in reading it
 
Upshot of it is, though, handling stackoverflows in your code really has to be pre-emptive. The ways that respond to the actual stack overflow event as an exception, letting you run code on another thread for a bit before the jump/etc., they're all... not good.
In Ruby, when it has a stackoverflow, there's only 11 frames on the stack. Because they're running a bytecode.
Anyway, further upshot of that is, it's okay to run some code before failing.
 
5:55 PM
I guess so, if failing is rare, the performance hit shouldn't be a big thing.
 
We should be able to use "zero-cost-exceptions" soon if building as C++, and the JavaScript build should be able to use plain JavaScript throw/try/catch instead of setjmp/longjmp emulation.
Zero cost referring to code not paying penalty for the exception handling unless there actually is an exception.
 
That sounds awesome
 
 
5 hours later…
10:31 PM
Fishing for an upvote or two as I'm curious if someone has other than a braindead comment to contribute to this question:
-1
Q: Is there design documentation on PHP-Style Nested Webform Parsing?

rgchrisI'm working on an implementation of a webform decoder and am looking to support the nested key pattern employed by PHP and Ruby/Rails (possibly amongst others). PHP: parse_str(); Ruby: Rack::Utils.parse_nested_query() I've noticed some inconsistencies, for example (behaviour is the same in both...

Good to know that on a Q/A site dedicated to the whys of software engineering, a question about a software engineering choice is somewhat off-topic.
'why did some language designer make some design decision' is not a meaningful question —WTF?
 
10:57 PM
If that site doesn't encourage language designers to participate then they're doing it wrong.
 
@rgchris Done.
 
Thks!
 
11:34 PM
Awesome—question put on hold. The great minds have spoken.
 
11:53 PM
@rgchris Is there a PhP SE forum?
I would think there is ...
 

« first day (2696 days earlier)      last day (1084 days later) »