« first day (1216 days earlier)      last day (2564 days later) » 
00:00 - 19:0019:00 - 00:00

12:00 AM
@earl right. In theory we could do this with a datatype in Rebol, a datatype because path access and PICK/POKE/ordinals would need to be different things.
 
Welcome to the Rebol and Red room. See our FAQ. Cool, you have a reputation score of 92983 so chat away!
 
If you live in Alameda, you probably should. :)
 
@RebolBot
x: y: 10
context [x: 20 if true [y: 20]]
print x
print y
 
@BrianH Potion did/does this with at(<integer>) and at(key=*), IIRC. Right?
 
; Brought to you by: tryrebol.esperconsultancy.nl
10
20
 
12:05 AM
@earl and that doesn't even get into the namespacing stuff that even Potion didn't support directly.
 
For random reasons I had somehow forgotten that context was just object, so you can write through to any set-words not in the top level. :-/
That makes context especially deceptive.
 
@HostileFork I assume you are meaning not in the "top level of the context", right?
 
@earl Yes.
Is there a locals-gathering function-like abstraction for getting the real desired result? e.g.
 
@HostileFork and a poorly chosen term, especially given that the language is built around context-sensitive semantics (for a better use of the word "context").
 
x: y: 10
result: scope [x: 20 if true [y: 20] "some string"]
print x
print y
print result
Something that would output 10 10 some string. That would be useful. CONTEXT not so much.
 
12:08 AM
@HostileFork deep locals-gathering is almost never the desired result when constructing objects.
 
@BrianH Well, seems even Potion doesn't separate between index and key spaces:
 
@BrianH I understand, but it is for something presented as CONTEXT or SCOPE.
 
(Sorry, bad example.)
 
@HostileFork module.
 
@BrianH Oh. Then module is good. :-)
 
12:10 AM
# Potion:
>> ('foo', 0='bar')
=> (0=bar)
 
@HostileFork generally you don't want to do deep locals-gathering because it messes up your nested scopes and exports too much. But, if you need to, you can use options: [isolate] in your module and it will gather all of the words and bind them to the module.
 
@BrianH (So that behaviour in Potion seems to be just like e.g. Lua.)
 
@earl sorry, I had to look it up. Potion supports the XML model with the lick type, not the table.
[name (attr1='string', attr2=10) 'TEXT HERE']
:15003975 do you mean convert Rebol code to javascript code, or just output javascript code as data? We can do the latter.
 
Output javascript code
 
@giuliolunati it's just text, so yes.
 
12:19 AM
Ok, maybe there exist some library or so to do this? Or must do by myself?
 
@earl I forgot the name part of the XML model, being a different thing than the attributes or the contents. Potion supports that too, with the lick.
 
@BrianH But I think scope [...] is a better name for something that returns its last value in evaluation. If I write module [...] I would expect to get something back that represented the module. An object would be fine, so I could say something like m: module [...] print m/version.
 
@giuliolunati you don't need anything special to output Javascript, it's just text. You might prefer to use a library to help you figure out which text to output, but that depends entirely on what you want the javascript to do.
 
Whats this about Potion? :D
 
I was mentioning about how it supports the important parts of the XML data model directly, while no other non-XML non-HTML language does. Mostly to show how rare such support is compared to the JSON data model, which is really commonly supported directly.
 
12:24 AM
@BrianH Thanks for looking it up.
 
runciter.net/potion - original site is down, of course.
 
@BrianH Oh yeah, it does that. Did we talk about that at some point, or was I just exploring that separately? That came up in FTL, the data language was looking to have XML-levels of complexity and that worried me.
 
@BrianH So how's that different to e.g. JavaScripts dormant E4X?
 
I eventually decided that if the addressing could be worked out without using convoluted xpath-esque methods that it could be considered okay, especially if it was a bit more strict about how each component should be used.
 
@AnthonyMichaelCook it doesn't support namespaces, schema, or the really complex stuff, not even entities. It just supports the core element data model: name, attributes, contents, all separate.
 
12:27 AM
@BrianH Right, thats what I meant too.
 
@earl from what I could tell (at a very shallow glance), E4X basically has an internal model that's like the DOM. And the DOM doesn't really support the XML element semantic model directly, it just fakes it with normal objects.
 
@BrianH I noticed it really helps me to visualize data models by converting them to YAML/JSON or other data languages, to see how well they translate.
 
@BrianH Ok. Thanks for the patience. I'm growing more confident that I understand what you're getting at :)
 
Well, YAML is basically JSON with entities. It has the same constraints as most objects and arrays and strings but not all together in one thing languages. You have to jump through some hoops to express other things
 
@BrianH Yeah thats sorta the reason I find it useful.
 
12:35 AM
posted on February 27, 2014 by fork

[Comment] I never understood why OBJECT [a: b:] shouldn't be an error, so definitely support it being an error. What I thought CONTEXT was for was to create a little local scope where you wouldn't write through to the external environment. But it only works for the top level set-words you pass it, as it's just calling make object! x: y: 10 result: context [x: 20 if true [y: 20] "something"]

 
Sometimes I like to go lower and skip the objects. For instance, that Potion code above: [name [attr1 'string' attr2 10] ['TEXT HERE']]
 
@BrianH So one Q left: I assume that if the "name" part is left out and would be external or as an attribute, you'd already consider that "faking", right?
 
@earl yup, you got it.
 
@BrianH Thanks :)
 
@AnthonyMichaelCook here's a good one: Objects, without the objects. context [x: 1] == the-object: [[self x] [:the-object 1]]
More or less. I'd have to review the source again to make it exact.
 
12:52 AM
@BrianH Hmmmm... pondering, and wondering if it should be the case that MODULE is to OBJECT as FUNCTION is to FUNC... ?
 
MODULE takes two parameters, the first affecting the evaluation. So the better comparison is FUNCTION vs DOES.
 
@BrianH Okay, I see. Actually, it seems to me that SCOPE is the missing analogue to DOES.
 
MODULE basically makes an object with an associated spec (the header). Normal objects can have such a header, but don't because we haven't designed that feature yet, let alone implemented it.
 
@RebolBot
m: module [a] [a: 10 b: 20]
print m/a
print m/b
 
; Brought to you by: tryrebol.esperconsultancy.nl
10
20
 
1:00 AM
@BrianH What does the spec do? It doesn't hide members...
 
@RebolBot
m: module [options: [isolate]] [a: 10 if true [b: 20]]
print m/a
print m/b
 
; Brought to you by: tryrebol.esperconsultancy.nl
10
20
 
The spec is just like the header of a Rebol script, same treatment of the block. Some of the header fields don't apply to modules created with the module function though, such as needs or compress, and some of the options don't affect it either, like options: [delay].
 
Okay, making a bit more sense. It seems then that what people may have been seeking with context before would have been better said as context: func [blk [block!]] [module [] copy blk] ?
 
However, everything that doesn't apply to modules created with module can be translated statically by a preprocessor. There is nothing that you can do with module script files that can't be translated to a series of module calls, sometimes with some code collecting the exports of private modules into an object that can be passed to module/mixin.
@HostileFork without the copy, but yes. But that scope function needs a different trick, since it returns the result of executing the code block.
 
1:12 AM
It seems it would be useful... in the cases of both object and module... to have a way of getting that last-evaluative result back from the make! call as well as the object! and module!
 
@RebolBot
scope: func [code [block!]] [do bind/copy/set code construct []]
a: 1 b: 2
probe scope [a: 10 if true [b: 20] reduce [a b]]
print [a b]
 
; Brought to you by: tryrebol.esperconsultancy.nl
[10 20]
1 2
 
Done, there's the basics of your scope.
 
; Brought to you by: tryrebol.esperconsultancy.nl
[10 20]
1 2
 
Probably be faster to use make object! 0 instead of construct, but that's the basics.
 
1:21 AM
@BrianH Nifty! If it's the basics, what doesn't it do?
I meant to say that SCOPE was the collecting analogue to DO--not DOES--earlier.
 
It binds self, so if you don't want that you're SOL. But I generally want that for this kind of thing. Also, it's subject to issue.cc/r3/539 and is missing doc strings.
 
@BrianH Hmmm on that issue. Looks like something that needs help from the system, to say "return and exit don't mean return from ME, they mean return from the caller". Then you could have return/override and exit/override to bypass that. Special indicator in the function specification dialect to say twoloop: func [blk [block!] control: 'caller] [loop 5 blk loop 5 blk return/override "override control: 'caller interpretation of return"]
return-double: func [value control: 'caller] [return 2 * value]
 
@HostileFork With definitionally scoped return/exit, you don't even need the /override.
But it's still debated if we should keep both dynamically (current) and definitionally scoped return, or only use the later, or whatnot ...
 
@HostileFork there were two blockers on this. First, we never figured out what to call the damn option (we were waiting for Carl to decide, but he was busy at the time). It corresponds to the [throw] option of Rebol 2, but is completely different because the semantic model is different, as is the options syntax in general. Second, Ladislav took this as an opportunity to request that return and exit become keywords (definitional return), and that sidetracked the discussion to oblivion.
 
1:38 AM
Well, all very interesting; as long as it's known about and needs to be addressed for other reasons and isn't particular to scope.
 
@earl there are problems with definitional return (similar to the collect nesting problem for keep), and it has a lot of overhead that would slow everything down for functions (the same overhead as closures). But there are upsides too. It seems like a big change to fix a small problem though.
 
@BrianH The overhead depends a lot on the actual implementation. I still maintain that it can be done with very little overhead.
 
@HostileFork it affects every written-in-Rebol control function that executes blocks of code. There's been a backhanded plus side to it though: It encourages people to convert such functions to natives to work around it, which speeds up Rebol as a whole.
 
But let's do ourselves a favour and not sidetrack into two heatedly debated topics on a single day :)
 
@earl I really wasn't as concerned about the overhead as I was the nesting problem.
 
1:43 AM
@BrianH News to me.
But also to me: another day.
 
@earl No prob. It was debated in AltME, so it's basically lost, except in my memory.
 
After this discussion, I think that I'm leaning toward thinking that CONTEXT should be repurposed to be more like module, as opposed to gotten rid of.
 
I still just want to be able to write mezz control functions. But I also see the benefit of indirectly encouraging people to convert such functions to natives. It did a wonderful job of making Rebol quicker when the loop functions were made native :)
 
@HostileFork Note that changing CONTEXT is extremely problematic, compatibility-wise. It is very widely used.
The OBJECT constructor is a relatively recent addition (not even in R2/Forward, for example). So previously, you had to decide between make object! and context. Guess which was widely preferred ...
 
@HostileFork I just don't like the name "context" being used for something related to objects. It really confuses any explanation of Rebol semantics, which are context-sensitive. But making the old context an optional but included by default function would be OK.
 
1:49 AM
Well, another word I guess. Time to hit the Thesaurus. "environment"?
 
I've had to use that word when explaining Rebol's objects to other people. It makes sense to anyone with any knowledge of Lisp.
Object works too.
 
Well, what I was asking for as SCOPE could be CONFINE. Then SCOPE could be the better CONTEXT.
Because CONFINE is more a verb, like DO, you wouldn't be expecting an object back but think of it more as an evaluation.
SCOPE could be thought of as returning some kind of object pertaining to the scope.
 
We don't want to imply that we have scopes either :) But didn't we say that OBJECT would be the better CONTEXT? Remember, deep-collecting set-words isn't necessarily better, it's just different.
 
Yes, object is the better context if context users did not previously want deep collection. I was under the impression that was what it was for, for some reason. I think all of this is a testimony to how muddied the understanding gets...
I was exposed at some point to the idea that both CONTEXT and OBJECT called MAKE OBJECT! under the hood, but that fact hadn't spread and settled beyond the understandings I'd gotten from seeing usage examples of CONTEXT and what I wanted to believe that it did.
 
And we don't deep-collect set-words in modules either, because it hides errors, allocates unnecessary words in the module's object, and hides errors. Plus, most of those words get overridden by FUNCTION, CLOSURE, and nested objects anyways.
The main reason it makes sense to deep-collect in that scope function is that the object is thrown away afterwards.
 
2:02 AM
So OBJECT is the better CONTEXT for people who were using it to mean OBJECT. And SCOPE could be the better CONTEXT for people like me (maybe I'm the only one) who expected it to do something besides what it actually does. And CONFINE could be that same thing adjusted for when you don't want the object!/module! back, but wanted to throw it away and just keep the value.
 
@HostileFork SCOPE sounds better for that last one. Deep-collecting is not that useful for objects that you want to keep.
 
@RebolBot
module [] [a: 10 if true [b: 20]]
 
; Brought to you by: tryrebol.esperconsultancy.nl
; rebol.com/r3/docs/errors/script-not-defined.html
    *** ERROR
** Script error: b: word is not bound to a context
** Where: if do -apply- make module
** Near: if true [b: 20]
 
Okay I think I got confused there because somewhere along the line I thought module did do a deep collect.
 
Remember when I used options: [isolate]? That does a deep-collect of every word in the module, not just the set-words. Then they're initialized from lib, as normal module words are.
 
2:10 AM
Okay. Well, putting all of these disparate ideas together I guess you summarized it there with Deep-collecting is not that useful for objects that you want to keep. In which case, then yes. I guess SCOPE should do as above, and CONTEXT should just die and people use object.
 
@RebolBot
module [options: [isolate]] [a: 10 if true [b: 20]]
 
; Brought to you by: tryrebol.esperconsultancy.nl
== make module! [
    a: 10
    if: make native! [[
        {If TRUE condition, return arg; evaluate block args by default}
        condition
        true-branch
        /else {If FALSE condition, return second arg; evaluate block by default}
        false-branch
        /only "Suppress evaluation of block args."
    ]]
    true: true
    b: 20
]
 
Without the words being initialized from lib, that would just be a big problem.
But, without options: [isolate] that word not being initialized helpfully was pointed out as being an error.
 
Okay, well thanks for the module introduction. Previously I knew nothing about them, now I kind of think I get some of the deal.
 
You usually only isolate modules that need to be isolated from external changes, so they run the same after the module is loaded and then things are overridden later. They aren't overridden in the module, so their behavior is more predictable. However, it can be useful for hiding errors that you can't be assed to fix.
 
2:19 AM
I guess my drive for the deep-collecting CONTEXT-like thing was just wanting to cover all the permutations rather than having an application. It's SCOPE that I would have the applications for.
 
Yup :)
Shall I write it up in a ticket?
 
Sounds good.
bbiab...
 
2:35 AM
@HostileFork done.
 
@RebolBot do help has
 
; Brought to you by: tryrebol.esperconsultancy.nl
USAGE:
    HAS vars body

DESCRIPTION:
    A shortcut to define a function that has local variables but no arguments.
    HAS is a function value.

ARGUMENTS:
    vars -- List of words that are local to the function (block!)
    body -- The body block of the function (block!)
 
posted on February 27, 2014 by BrianH

[Wish] Basically, it's like USE but with FUNCTION's set-word gathering. Used like USE for doing a block of code with local variables, but without needing to declare those variables. In this case we want the local context to have 'self like a normal object, just for utility. Similar to doing the code in an object's spec block, but deep-collecting set-words instead of shallow, returning the resu

posted on February 27, 2014 by BrianH

[Comment] See #2119 for SCOPE.

 
@BrianH code should be body in the implementation...
 
@HostileFork it is in the ticket. Oh, right, fixed.
 
2:43 AM
@BrianH I mean the parameter name is body...not code
 
@HostileFork right, fixed.
 
@RebolBot do help use
 
; Brought to you by: tryrebol.esperconsultancy.nl
USAGE:
    USE vars body

DESCRIPTION:
    Defines words local to a block.
    USE is a function value.

ARGUMENTS:
    vars -- Local word(s) to the block (block! word!)
    body -- Block to evaluate (block!)
 
posted on February 27, 2014 by BrianH

[Comment] It's worth noting that the MODULE function's /mixin option takes exactly this object as a parameter. We might want to unify the naming a little.

 
I wonder if there is an analogue to use that does the gathering and you tell it what not to be local? :-/ What would that be called?
 
2:46 AM
@HostileFork do function/extern.
The main way you tell something to not be local when using locals-gathering stuff is to assign with set instead of set-words.
 
Fair enough.
 
It's rare enough to be OK to have to use the function, but common enough that it's a well-known pattern.
 
3:08 AM
@HostileFork interesting - so the person trying to clean-up the language never heard of CONSTRUCT :-)
I am either wrong or I somehow don't understand, that noone mentioned a security in regards to construct. But I might overlooked it in over almost 300 messages since I last read SO chat.
 
posted on February 27, 2014 by abolka

[Comment] On the naming: I'd slightly prefer private-lib, even though it's a bit longer. I envision it being seldomly used in practice (and typically by very specialised code), which would well warrant the more explicit name.

 
IIRC, the security was one of the reasons, why the Construct was added. When we did CGI, we wanted to construct the object, but we also wanted to prevent direct evaluation, because some field could contain malicious code.
 
@pekr BrianH mentioned security in passing, but thanks for detailing that notion a bit.
 
Well, just skimmed over the debate of context vs objects or eventually remove context. But pretty please - don't remove construct :-)
I would like to point out, that Bruno updated his CALL implementation for Red, Red/System. It seems to be almost on pair witht he R2 implementation, hence exceeding almost useless R3 CALL. I wonder if it could be used to integrate into R3? github.com/red/red/tree/master/system/library/call
btw - Carl once expressed his will to share R2 CALL implementation. Maybe he even did so. Does anyone remember, if he posted the code? R2 is being able to call even cmd commands like 'dir, whereas R3 is not, nor is Red version. Would be interesting to study or point Bruno to the possible solution ...
 
3:39 AM
@pekr Very nice, yes. Linux only, though. We could add that (Linux only) rather soon to R3 as well.
To be fair: most likely "Linux & OSX only".
(& Syllable & other POSIX platforms.)
 
@pekr heck no, I love construct. We even improved it relative to Rebol 2.
@pekr I remember R2's CALL having some API problems that we might want to clean up while we're at it. But functionality is definitely lacking in R3's version, so it would be great to fill that out.
 
 
1 hour later…
5:13 AM
posted on February 27, 2014 by Jacob

Here is an arbitrary example that I came up with(sorry forgot to respond to this question)... (defmacro compute-at-compile [x] (let [pi-times2 (* 3.14159 2)] `(+ ~pi-times2 x))) (compute-at-compile 1) which would become... (+ 6.28318 1) so, pi-times2 was calculated at compile time, before run time.

 
 
3 hours later…
8:18 AM
@BrianH Dare I ask what construct is?
 
8:47 AM
@AnthonyMichaelCook CONSTRUCT is like OBJECT except it doesn't evaluate.
@RebolBot
foo: 10
probe object [bar: foo + 10]
 
; Brought to you by: tryrebol.esperconsultancy.nl
make object! [
    bar: 20
]
== RESULT is an object of value:
   bar             integer!  20
 
@RebolBot
probe construct [bar: foo + 10]
 
; Brought to you by: tryrebol.esperconsultancy.nl
make object! [
    bar: 'foo
]
== RESULT is an object of value:
   bar             word!     foo
 
So it looks for set-word! and makes an object by just taking whatever comes immediately after each set-word literally. It's used to load Rebol headers, and @pekr I actually had heard about it as being related to that (when I asked why there isn't a firm standard for whether you should use a lit-word or a word when saying something like [Language: English] or [Language: 'English])
I've not, however, had a situation where I've gone looking for something that does that. The above example of throwing away the + 10 sort of demonstrates why. So it's not in the forefront of my mind, and when pulled into a conversation as another general way to make objects... the context is missing (pun intended) for remembering "oh, that's what construct was. it's that header thing I never use that got mentioned once."
 
OK, I was just worried you might suggest to remove Construct, because you never heard about it before :-) I really think it came during the CGI module period or something like that, because ppl used simple way to create an object from CGI data received. And making the object simply - evaluates, Construct does not ...
 
8:59 AM
And I will argue that one not having been around to become engrossed in the winding history of Rebol--yet still having an eye toward wanting to understand the language--makes one a perfect skeptic for driving the cleanup. I'm not forking Rebol and making incompatible changes and throwing away knowledge in the process--I'm ferreting out explanations and getting them in writing where possible.
CONSTRUCT may be a weird name instead of OBJECT/NOEVAL or OBJECT/SAFE.
It would be more discoverable if you could say HELP OBJECT and see the option to not evaluate, and it would free up that extra word.
It sounds like the flexibility of make object! has been made limited by the fact that it's not done like make module! with a pair of blocks to include a spec.
e.g. make object! [[evaluate: no] [bar: foo + 10]]
While changing make object! to work in that way would be disruptive, it is probably the case that very few calls to make object! start with blocks. Hence if there was no block, it could trigger an error. Those affected would receive the suggestion: "use object instead". They could then use that as a chance to review if what they really wanted was object/safe
One might also argue that this could be a way to ask module or object to return the evaluation result and throw away the constructed object.
bind: func [body [block!]] [make object! compose [[return: 'last] (bind-stuff body)]
 
@pekr Should be using AltWebForm! :)
 
Sorry I meant SCOPE not bind.
Should there be SCOPE and SCOPE/SHALLOW? I think /DEEP should be the default, but the cheapness of SCOPE/SHALLOW might make it nicer
 
9:20 AM
posted on February 28, 2014 by Chris

Rebol Desktop: Web Viewer http://desktop.rebol.info/ View the Rebol Desktop on the web! Source: https://github.com/revault/desktop.rebol.info (first iteration)

 
@HostileFork - Carl planned to exted creation of objects by using specs block, it was not just defined yet - rebol.net/cgi-bin/r3blog.r?view=0350#comments
 
9:38 AM
@RebolBot
m: map [bar: foo + 10]
probe m
print m/bar
 
; Brought to you by: tryrebol.esperconsultancy.nl
make map! [
    bar: foo
    + 10
]
foo
 
@RebolBot
o: construct [bar: foo + 10]
probe o
print o/bar
 
; Brought to you by: tryrebol.esperconsultancy.nl
make object! [
    bar: 'foo
]
foo
 
@RebolBot delete
@RebolBot
m: map [bar: foo + 10]
probe words-of m
probe body-of m
probe spec-of m
 
; Brought to you by: tryrebol.esperconsultancy.nl
; rebol.com/r3/docs/errors/script-invalid-arg.html
    [bar: +]
[bar: foo + 10]
*** ERROR
** Script error: invalid argument: spec
** Where: reflect spec-of
** Near: reflect :value 'spec
 
9:44 AM
@johnk If you edit a request to RebolBot you've made previously, it would be nice if it edited the corresponding response instead of adding a new one. If you don't want it to edit, you should copy and paste to make a new request.
 
10:30 AM
@HostileFork not trivial until the response is a reply. That needs the reply to report fixed width formatting. Chicken meet the egg.
I could embed a unique id in the response text then parse it out and do it that way, but it sounds like it could take time. It would be nice ...
 
10:47 AM
@johnk Doesn't RebolBot have a short term memory? I wouldn't mind it not working across restarts. You could have a map and prune it after 2 minutes have passed to keep it from growing without limit.
So on each access, run through and wipe any map entries older than 2 minutes.
 
11:06 AM
@HostileFork yes, it could be done. It would need a unique ref in case 2 people are talking to the bot so we don't delete the wrong response.
 
11:46 AM
Going back to tinkering with node.js, JSON config files, JavaScript/CSS/HTML... I don't think people of the world appreciate how we are really trying to eliminate suffering around here. :-/
 
12:21 PM
Sam Holder, Brighton, United Kingdom
12.5k 1 32 69
Welcome to the Rebol and Red room. See our FAQ. Cool, you have a reputation score of 12538 so chat away!
 
Greetings @SamHolder. It says you're active in the RegEx tag. Heard of Rebol or Red, and PARSE?
 
1:04 PM
I will also mention, that in a short span of time, NodeJS libraries have broken absolutely everything. Semantic changes to functions without changing the names. Yet they're right up there with Ruby in popularity rate for Q&A. (Perhaps because they are breaking so many things...)
But the popularity, deployment, documentation, and funding for NodeJS and the attention it is getting is enviable. And this is proof that people are willing to work within a framework of change when there are far more codebases active than Rebol.
Not advocating breaking things for the sake of breaking them, just that this should weigh very heavily in peoples' minds when considering getting things right for a clean future vs. worrying about breakage.
 
 
1 hour later…
2:15 PM
kol, Budapest, Hungary
8.9k 1 16 40
Welcome to the Rebol and Red room. See our FAQ. Cool, you have a reputation score of 8860 so chat away!
 
Welcome @kol. Curious about Red and/or Rebol? :-)
 
kol
Yeah. I'm just reading red-lang.org/p/contributions.html
 
@kol Cool. I've recently started a little overview Trello of Rebol and Red links. You might find Why Rebol, Red, and the Parse Dialect are Cool of interest.
@RebolBot
print ["I'm here to help, too..." (reverse "lok@")]
 
; Brought to you by: tryrebol.esperconsultancy.nl
I'm here to help, too... @kol
 
 
1 hour later…
3:48 PM
@pekr construct is used to process headers in the mezzanine load stuff. It's not going away.
@HostileFork the main obvious use of scope is to do things safely. A shallow version wouldn't be as safe. Btw, it should be faster than use in Rebol 3 based on what it does, but I haven't timed them.
 
@BrianH Note my remarks though on using a name for something that is fundamentally about "safe" object construction. It takes away a word when object/safe would be more transparent and discoverable; if you think it's something people should know about. But I think more analysis is needed--as with the map and object examples--to really understand what the types are for.
Basically to put together a rationale why everything exists, and if it has weird properties (like construct [bar: foo + 10] tossing the + 10 into oblivion without warning), why such weird-propertied things are useful and can't be addressed another way.
So this does kind of mean a top to bottom of "you could do... BUT" and have every i dotted and t crossed.
 
Well, object would be a mezzanine wrapper, and mezzanine wrappers with options have overhead to process them. The construct function is faster because it's native and specialized, which is why we use it in high-efficiency mezzanines.
 
Unfortunately we don't really have a "good" wiki place to hammer it out. Having been using Draem I actually feel like GitHub with that, and doing pull requests and merges, is probably better than most wikis. :-/ Google Docs is okay but the versioning is kind of wonky if you want to look through the past, and it's not good for code samples.
 
@HostileFork Indeed it actually seems to get people more interested in it. My secret belief is that people use Node because they were already bad at JS in the browser, now they can be bad at JS everywhere.
 
I do want numbers on these speed tests though. Now that Rebol is open source, we can look around and find performance in new places. We can also start thinking about "performance regressions" in the tests, and setting some bounds of what we think it should be able to do on what system and say we're not going to let it get too much worse than that.
 
3:58 PM
But maybe thats just because I used JS back in the 90s, before pretty much anyone respected it as a real language, and I've interviewed people who never progressed beyond that era.
 
@AnthonyMichaelCook It's just not an interesting language to me. I'm hard-pressed to think of anything I like about it, especially with Rebol and Red around showing the contrasts so glaringly.
 
@HostileFork Benchmarking is a good thing to throw into a CI suite. If suddenly a chunk of code is running twice as long you want to know it.
 
@AnthonyMichaelCook Rebol is trying to stay buildable in old compilers on old systems (Commodore Amigas, you name it), and it's ANSI C and will always be. There is a bunch of vague talk about why to write code one way or another because of maybe breaking an old compiler somewhere. I think there needs to be someone with a VM running a build on the flakiest oldest compiler anyone cares about, and put that in the CI.
And then, if that can be kept working, don't worry about other unknown old compilers. I thought the Amiga would be a good one for historical reasons.
 
@HostileFork I don't really think its easily comparable to Rebol really, and its implementation of closure-function-object was quite interesting in developing a deeper understanding of both OO and Functional languages. However, in practice I think the language is probably doing more harm than good and was bettered suited as an academic experiment gone wrong.
 
I think Rebol should stay around to stably bootstrap Red into existence, and that bootstrap should be kept working... even once Red self hosts.
Feb 1 at 3:50, by HostileFork
in Is JavaScript Bad?, 4 mins ago, by HostileFork
"Is JavaScript Bad" => It's unremarkable. To call unremarkable designs bad is kind of like saying something like "Ikea furniture is bad". I'll stick with just saying it's unremarkable--future AI will not get JavaScript tattoos unless they are trying to rile their parents.
 
4:05 PM
As long as modern GCC, modern Clang, modern MSVC (at least 2012), the old version of GCC used for OSX PPC, and the old version of GCC that they use to make BeOS apps work, that should be sufficient. But if we need to add more, that's cool.
I want to try TCC though.
 
@HostileFork Sure. Find the platforms people care about, test against them. Though I would caution (not that anyone would/should listen) that overdependence on older architectures would handicap a language into being for legacy systems only.
@HostileFork Haha. Even bad milk when properly utilized can become something useful.
 
@HostileFork Rebol will also be good in places where being compiled in C would be a benefit. Usually for business or government use. But some platforms have special compilers needed, and those compilers often implement the C language (NaCL being a notable example).
 
@BrianH I was thinking a TCC port that produced Red/System as the IL would be an interesting exercise, and potentially useful--in particular for leveraging existing C regression test suites to make sure Red/System was working on all the platforms.
 
@BrianH TCC would be useful imho. It's supposed to be ANSI C compliant, so it should work.
 
Plus it would be cool.
 
4:11 PM
And a good proof-of-compatibility test.
 
Only question would be whether to write it in Rebol or Red, and that's why I keep wanting the answer to be "compatible subset".
 
@HostileFork I suspect that due to the different in goals and affinity for change between the two projects that they will get more and more out of sync rather than more similar.
 
TCC may be the only C99 that still is able to make WinCE programs, if you want old-school :)
 
@HostileFork Rebol 2's WinCE ARM build was made by my personal request, to support an old netbook I was given as payment for a job once. That is why it doesn't have soft keyboard support, it was made for a device with a hard keyboard. I used that build to help me pass statistics class in college.
 
4:20 PM
@HostileFork Thats pretty classic.
 
@AnthonyMichaelCook we've been using social pressure to encourage compatibility in comparable features, and a push for modularity to handle the incompatible ones. But we are focusing on core semantics - they have different application models, just because of the nature of the languages.
 
@BrianH I'm just not anyone should be pushing for that compatibility, at least not at this stage. Not due to a difference structurally, but culturally. I'd be afraid of holding Red back or of upsetting Rebol's conservative sensibilities.
 
@AnthonyMichaelCook things like compatibility of the basic built-in functions, the indexing numbering model, the real core stuff. And Rebol's not been as conservative lately. The main thing that Rebol has is people who have thought through a lot of language design issues for Rebol-like languages. Rebol is a good source of advice for Red.
Anyway, we have a lot of people who participate in both communities. Even pros who are paid to do so.
 
@BrianH Is Red 0-indexed?
 
4:36 PM
@AnthonyMichaelCook No, they're indexed in the way that Rebol 2 was, and Rebol 3 is going to be changed to be.
1-based, no 0. But I'm adding on 0-based contiguous functions to both.
Part of that indexing compromise mentioned in the top-starred message here. issue.cc/r3/2117
 
In other news: it has taken a few days and nights of teeth-gnashing to get there, (between the chatting and maintenance here). But I successfully patched up blackhighlighter so the NodeJS port works with a couple years later of changes, and can deploy directly from GitHub to Nodejitsu.
One of my motivations for picking them was that they advertised giving free node deployments to open source projects for a minimal server; basically what would cost $9/mo if your project wasn't open source. However, they only do that if your deployment is hosted at subdomain.nodejitsu.com.
 
@AnthonyMichaelCook I've been referring to the Rebol 2 model as Roman indexing :)
 
@BrianH Yeah I was reading that. Personally 0-indexing has always bugged me. It's even more jarring in Ruby which is generally so friendly and has all the ordinalized methods and reverse indexing.
If there's going to be a 0 which gives you the first element, there should be a -0 that gives you the last.
 
@AnthonyMichaelCook read the debate at issue.cc/r3/1983 as well, that's where I was explaining the rationale for supporting both. That ticket was created a little later in the compromise-making process.
 
@AnthonyMichaelCook With Rebol's series model, negative indices have to satisfy a far more straightforward neccessity, so that doesn't make much sense.
 
4:47 PM
Yeah, we have offset references.
 
@BrianH was pick/zero instead of pickz ever considered? Not sure if that makes sense to others
or too much overhead?
 
@kealist I think it was considered, but it didn't fly as a compromise.
 
@kealist yeah, it definitely has path decoding overhead, plus pick is a core action so adding any options to it slows down Rebol altogether and makes it harder to write port schemes. It's easier and faster to write a native wrapper. Plus, index?/zero looks silly.
 
@BrianH I think supporting both is fine. I intend to with FTL, but 0-indexing won't be syntax or first class, it'll be in separate "offset" methods.
@earl I don't know how negative indicies work in Rebol, so I can't speak to them. :)
 
I'm still suspicious that there would/should be any impact on invocations with no refinements, by having refinements that are not used. If it would slow down a case at all, that would be when you are using some refinements (but not all).
 
4:55 PM
@AnthonyMichaelCook yeah, that index-vs-offset naming proved useful for understanding the difference.
 
@AnthonyMichaelCook Rebol series are two-way cursor like things, which can be positioned right in the middle of some underlying data.
 
@RebolBot do/3
pos: skip [a b c d e] 2
print pick pos 1
print pick pos 0
print pick pos -1
 
@HostileFork Please continue.
 
@BrianH Ordinal vs offset, but then we'll probably sidetrack into anthropomorphic and linguistic debates again :)
 
@RebolBot do/2
pos: skip [a b c d e] 2
print pick pos 1
print pick pos 0
print pick pos -1
 
4:56 PM
; Brought to you by: tryrebol.esperconsultancy.nl
c
none
b
 
@RebolBot
;-- do/3 is implicit, apparently no explicit option exists
pos: skip [a b c d e] 2
print pick pos 1
print pick pos 0
print pick pos -1
 
; Brought to you by: tryrebol.esperconsultancy.nl
== none
 
@RebolBot
pos: skip [a b c d e] 2
print pick pos 1
print pick pos 0
print pick pos -1
 
; Brought to you by: tryrebol.esperconsultancy.nl
c
b
a
 
Comments should work in RebolBot...
 
4:59 PM
@RebolBot do/2
data: [a b c d e]
ptr: skip data 2
print ["Positive index at offset 2:" pick ptr 1]
print ["Negative index at offset 2:" pick ptr -1]
 
@AnthonyMichaelCook Anyway, it changed where -1 was just one element back from the current position (in Rebol2) to where 0 was one element back from the current position (in Rebol3). I like the compromise.
 
; Brought to you by: tryrebol.esperconsultancy.nl
Positive index at offset 2: c
Negative index at offset 2: b
 
@HostileFork not much impact, for natives, just an extra comparison and some math. It gets worse with ports though. However, if the extra comparison and math could be put in the dispatcher, so ports schemes themselves don't need to handle it. The main problem is that the /zero only applies to certain types, so having the different typespec is itself an advantage which speeds things up too.
 
@HostileFork Thats kinda how the SH family of languages do it. $1 is your first argument while $0 is the command name.
 
@AnthonyMichaelCook skip still works in offsets though. The index equivalent is at.
 
5:01 PM
@BrianH What is skip?
 
@AnthonyMichaelCook One cursor positioning primitive. Others: next (skip ... 1), back (skip ... -1).
 
; Brought to you by: tryrebol.esperconsultancy.nl
At head position:  a b c d
Offset 1:  b c d
Offset 2:  c d
 
@RebolBot
data: [a b c d]
print ["Moving around: " back next next data]
 
; Brought to you by: tryrebol.esperconsultancy.nl
Moving around:  b c d
 
Will resort to just pasting examples :)
 
5:04 PM
(Tangent note: I take it back about the Nodejitsu only doing custom domains on business plans. The business plans just have different instructions for how to do it.)
 
5:58 PM
@earl Ah, cursors, okay. What about 0-hole?
 
@AnthonyMichaelCook When you have two-way cursor-like semantics and ordinals-as-indices ("1-based"), the meaning of 0 as an index becomes problematic.
 
@earl "index out of range"?
 
Right. Then you have a non-contiguous index space and that's the "zero hole" :)
 
Gotcha, thats what was meant by "non-contiguous". I think thats a little disingenuous though, since its never expected that all numbers are valid indicies.
 
The main implication of this is that index arithmetic (at least for offset-series) becomes extremely awkward.
Or outright broken, depending on your point of view.
 
6:11 PM
Why should offsets be broken? 0-offset is the first element.
 
Certainly. If you use offsets, that problem goes away.
 
hyde, Europe
11.5k 3 15 47
Welcome to the Rebol and Red room. See our FAQ. Cool, you have a reputation score of 11497 so chat away!
 
"offset-series" is abbreviated Rebol-lingo for "cursors not positioned at the head posiiton".
 
@earl I think thats the big advantage of allowing both approaches.
 
@AnthonyMichaelCook And that, in a nutshell, is what the "Rebold & Red indexing compromise" is about :)
Rebol 2 primarily had ordinals-as-indices, leaving you with the 0-hole and making index arithmetic a mess.
On top of that, the zero hole in R2 was "silent" in as far as it didn't even raise an error, but rather left you with a perfectly fine value and plenty of opportunity for silent corruption.
 
6:16 PM
@earl Silent failures are the worst. I want them to go down screaming.
 
Rebol 3 therefore started with a contiguous index space, where "1" means the "first element forward" and "0" the "first element backward". Which satisfied the index arithmetic desires, but left the "naturalistic" camp unsettled.
Compromise now is, to have two sets of methods: one for ordinal indexing and one for offset indexing.
And screaming errors for the falling into the zero hole with ordinal indexing.
@RebolBot do/red
data: skip [a b c d e] 2
probe pick data -2
probe pick data -1
probe pick data 0
probe pick data 1
probe pick data 2
 
; Brought to you by: tryrebol.esperconsultancy.nl
a
b
none
c
d
== d
 
(Ouch.)
(NB: "none" is a perfectly valid value, not a loud and screaming error.)
 
@AnthonyMichaelCook "its never expected that all numbers are valid indicies" contiguous means that there are no gaps between the indices within the range of possible indices - this is for an integral number space, mind you, so "all numbers" are integers. The 0-hole makes it non-contiguous.
Just a clarification :)
Out-of-bounds indices are another matter. We decided to not presume that these were an error in Rebol 3, we just return none instead to indicate no data there. But we aren't yet fully consistent with bounds, so it's possible to generate values that don't behave the way you'd expect. It's a matter of a debate that's barely started. No consensus here yet.
 
@BrianH What in your mind is a "really compelling" case study for why indexing out of bounds wouldn't be an error?
 
6:30 PM
@BrianH Ruby loves to throw around "nil" (their version of none, sorta) such as addressing a hash key that doesn't exist will give you a nil. The problem I've run into is that you want to know if the key (or index in this case) exists and only want the value then.
In Ruby this is made more difficult because nil evaluates to false in conditionals (I don't know about Rebol) so you end up having to do some convoluted hash.has_key?(:foo) logic and then still have to do hash[:foo] later. It's still not easy to see if there's an error there or not, its something you get to figure out.
However, I am just stating a perceived problem, I am not entirely certain of a clean solution.
 
If none is a legal value, then not differentiating "pick [] 1" from "pick [none] 1" seems like more trouble than it is worth. You can't use it in series iteration to tell if you've reached the end (if it's a block series)
 
@HostileFork basically, with positional access to series, whether or not data off one of the ends of the series is "not there" or "should be an error to even try to get access to" really depends on the particular situation. I've seen either case be the appropriate interpretation. And in situations like that, the Rebol 3 design policy is to not presume what you can make a good case for either way, unless it's a safety issue.
 
Well if you can think of one of the good cases it would be useful to study. I can only think of bad ones.
 
With lazy evaluated lists and threaded environments with queues its a much bigger problem because you can't do length-checking of the list beforehand.
(because its changing dynamically/infinite/whatever)
 
@HostileFork and you have reached the core of the new interpretation of none. In Rebol 3, thematically, there is no difference between pick [] 1 and pick [#[none]] 1, because as far as series are concerned, none is a placeholder that means "nothing is here". It's a way to put a non-erroneous value hole in the middle of a block.
If there is no security downside to off-the-end access, and you have easy ways of checking the bounds if for you going off the end is an error, then there is no downside to not presuming that going off the end is an error. Because it might not be.
 
6:42 PM
Also, whats the issue with index-arithmetic? Why is a 0-hole so troublesome while negative numbers aren't?
I feel like I've asked this question before long ago..
 
@AnthonyMichaelCook none is treated as false in most conditional expressions. Not the logical operators for some reason (and this is under debate), but there are non-operator functions that correspond to AND and OR (not XOR) which treat none as false.
 
@BrianH Is there a way to coerce none into a false?
 
@AnthonyMichaelCook true?.
@AnthonyMichaelCook having a 0 hole means that index arithmetic can sometimes result in an index that isn't there, so you have to do separate calculations and use conditional checks for positive and negative indices. But working in indexes at all is bad for math - the math works better with 0-based offsets. So that's why our proposed functions for helping with index math are 0-based contiguous.
 
@RebolBot
to logic! none
 
; Brought to you by: tryrebol.esperconsultancy.nl
== false
 
6:48 PM
@AnthonyMichaelCook technically, you can use not none? as well, but most of the time that you want to coerce a none to a false, you want to coerce truthy values to true as well. But true? is (recently) basically the same as to logic!.
 
@RebolBot
to logic! 0
 
; Brought to you by: tryrebol.esperconsultancy.nl
== true
 
@BrianH I've been wanting to draw up a table of "nothing" "false" "fail" etc and map them according to a few different languages to get a feel for the way they're handled. It seems its a pretty tricky thing for any language to get right.
 
@RebolBot
if 0 [print "because a zero integer is not treated like false or none in Rebol conditionals... It is a thing with a value."
 
@HostileFork Please continue.
 
6:52 PM
Well with the closing bracket.
I think prime numbers should be true, everything else false.
 
For Rebol (and Red?) only none and false are falsey, everything else is truthy. Though #[unset!] is truthy only in cases where it's able to be evaluated without triggering an error (it's primary intended use is to be the not-a-value that triggers helpful errors).
 
@HostileFork Absolutely. Nothing is more predictable.
 
@HostileFork and think of what it will do with the build times, and to the program size to include that table? It'll be great!
 
@BrianH It's so verifiable .. eventually!
@BrianH Oh okay, so thats not radically different from Ruby. I can see the use of 0-falsiness in a language like C because its so messy, but generally.. I don't think its a great plan.
 
00:00 - 19:0019:00 - 00:00

« first day (1216 days earlier)      last day (2564 days later) »