« first day (1861 days earlier)      last day (1919 days later) » 

12:12 AM
>> get object [a: 10 b: 20]
 
; Brought to you by: try.rebol.nl
== [10 20]
 
red> get object [a: 10 b: 20]
 
; Brought to you by: try.rebol.nl
*** Script error: get does not allow object for its word argument
*** Where: get
*** Stack: do-console all not unset? set do first head reduce do* _execute if all not unset? set do first head reduce do* get
 
I do not like that "feature" of get.
values-of, to match words-of, maybe?
 
@HostileFork Thank for your help! If I change this line to return Copy_String(mo.series, 0, -1); I get that error --- I don't understand why....
 
12:14 AM
@giuliolunati Well, if before it did not create a series... and now it did... then you will have a leaked series if you do not have a free somewhere. Think of it just like a malloc() and free()... if you have a malloc() you need a free somewhere, or you need to hand the pointer to someone who will free it later...
@giuliolunati If you are changing the contract you might want to give it a name like Make_Mold_Print_Value(). Then look at the callers and see what they all do with it. If you see a caller who calls it, uses the data, and then is done... then put a Free_Series() when they are done. If they are putting it into a REBVAL that is a string with Val_Init_String, that will take care of it so you shouldn't need a Free_Series()
Copy_String makes a new series, like Make_Series does.
 
@HostileFork but apparently works here
 
@giuliolunati The difference is because of what the callers do with the information. MOLD is generally making something to be put into a REBVAL that the user gets back. So when it does the Val_Init_String on that REBVAL, then the string gets handed to the garbage collector and you're clear. But PRINT just prints the data and never puts it in a value, so it is dropped on the floor.
@giuliolunati You need to go to the places that are done with the data like here. Once the print is done, if that series is not going to be used anymore, it needs to be freed...or it counts as a leak. The only way to not count as a leak is to free it -or- to make sure it gets given to the garbage collector.
 
@HostileFork oh, thanks! :-)
 
@giuliolunati But consider how the old mold buffer worked and it didn't need to copy the data. What you probably actually want is a way to get back not a copy of the data in this case... you probably just want to ask the mold stack "where is your data pointer right now"
That way, you don't pay for making a copy and then a free that you don't need.
You only need to copy data out of the mold stack if it is going to be taken off to have a life of its own somewhere, like in a string given to the user. If it's just temporary, leave it on the stack and just use the data pointer at the offset where it is.
 
@HostileFork right!
 
12:24 AM
So the interface here should be asking the mold stack for a REBUNI*, not a REBSER
(And it should know that if the mold stack gets dropped down or messed with, that pointer won't be good anymore...that's the difference between getting your own copy and using it while it's on the stack...)
 
@HostileFork or, I can return the offset and explicitly use BUF_MOLD in caller?
 
@giuliolunati I think the pointer is probably better, and avoiding mention of the buffer by name. It's best if you can just think of the stack as "abstract" and not know the details of how it is implemented.
 
12:40 AM
Late, sorry, but @HostileFork I must say truly impressive job on assassinating REB_END. Kudos on top of kudos.
 
@HostileFork but then I lack information about tail ... uhm, must rely on terminator ...
 
1:00 AM
@MarkI Tx. For my next trick... data structure design which always places a platform aligned pointer after REBVAL arrays... github.com/metaeducation/ren-c/blob/…
Then, using the 2nd bit being 1 to be "formatted space". This will also be zero in pointers, but will help check to make sure an END isn't written over top of one of these pointers, as debug builds will check to make sure that bit is not zero before writing said end
(Release builds will skip formatting and checking)
So in the pooled memory if you need a series with 4 elements, you ask for a series with 4 elements. The end will be "just there", as with the chunk stack, as the sunk cost of a pointer you needed anyway.
You may write your own ends earlier than that if need be.
(Clearly I'm going with the embedded route priority vs. the GUI stuff.)
 
I vaguely recall differing implementations of arrays in Rebol 2 -- three I think, regular, list, and hash. Could Rebol 3 have anything similar?
 
@MarkI I'm in favor abstractly of the idea of being able to "hint" things such that their interface doesn't change but their underlying performance changes to be aware of a usage pattern.
 
I am not asking you to do it, or even to stop preventing it from being possible if that's what you've decided needs to happen.
 
A hashed access block isn't a terrible idea nor necessarily terribly hard, but it shouldn't have a different datatype
Having a different datatype is a terrible idea.
 
Agreed. I myself was simply unsure of how hard the "not terribly hard" was, so thanks for the reassurance.
And of course I have no idea of how the Rebol 2 versions were implemented.
Except that they were a different datatype and that that's bad :)
 
1:15 AM
A list access block would be relatively easy as well
 
I currently am pondering make-block-arity-2 [<list>][a b c] for the syntax.
It at least also fits with #[block! [<list>][a b c]] construction form.
 
Hmmm. Well, the no keywords thing does get in the way of such choices when you need the information a-priori.
 
It's actually a kind of refinement in the abstract, which is always sort of keywordy.
 
But that's kind of a far-off need, while sorting of the principles of equality in FIND and such is a near term need. See beginning analysis at: github.com/hostilefork/rebol-proposals/blob/master/…
 
But I am not suggesting make-block/list. At least, not without some prompting.
@HostileFork Thanks, I will absorb and ponder.
I myself am having similar grapples with significance in lexemes.
How do you talk about two different lexemes representing the same value? That they're the same but different?
NOTE: I am posing the questions rhetorically!
 
 
2 hours later…
3:33 AM
So I've brought up the overloading of # before, that it seems it's doing too much work. It's the character indicator with #"A", it's the binary indicator with #{AE}, it's the construction syntax indicator with #[...], it's the #issue indicator... :-/
My proposal was that characters go with the entity symbol, as &"A", and add support for HTML5 entities and numeric syntax (dropping the semicolons) They may not be perfect, but they're standard
#issue seems not negotiable these days just with #tag being the way people think of tagging things. I think the synonyms workings in Ren-C where types are not named by the system will help with all those concerns about whether it's issue! or hashtag!... doesn't matter. Synonyms are fine.
Plan -4 offers us more choices for binary and construction syntax. Keywordless-ness suggests some previous proposals like hex{AE} would be poor fits, but symbols do open up. ${AECF} for binary isn't that bad, and $ is really being used for one thing that is likely to not get used much by the majority of developers.
So that would split symbolic responsibility a bit more evenly, with # doing issue and construction syntax, & doing characters (and likely something else), and $ doing money and binary.
Such a change could be made backward compatible.
 
4:38 AM
#<> %[] %() %<> $[] $() $"" ${} $<> @[] @() @"" @{} @<> are all still available. I posit moving & from word to syntax is a jump.
Cool ideas, keep them coming, keeping the group alive and the creative juices flowing ...
>> [%{}]
 
; Brought to you by: try.rebol.nl
== [%"" ""]
 
Wish that one was ... either more or less, turns out! ... available.
 
@MarkI Moving & is a jump but it's a particularly useless word character.
 
Prejudice, prejudice! :)
 
red> type? @(a b c d)
 
4:45 AM
; Brought to you by: try.rebol.nl
*** Script error: a has no value
*** Where: type?
*** Stack: do-console all not unset? set do first head reduce do* _execute if all not unset? set do first head reduce do* type?
 
There are some howlers in there, I agree. Back-tick is particularly bad.
 
Is @() Red's map literal?
 
I thought it was #()
 
red> type? #(a b c d)
 
@HostileFork I'm not sure I understand...
 
4:47 AM
Works in Try Red 0.5.4 ...
red> version
 
; Brought to you by: try.rebol.nl
== "3.6.22"
 
And that's what it responds with as well.
 
5:00 AM
@MarkI So in this object analysis one question is about being able to remove fields. Removing them and unsetting them not being the same thing necessarily. If you could remove fields from an object, what would the syntax be?
 
Make unbind work on paths maybe?
Actually, you can unbind a word bound to the object already! Why doesn't that do exactly that?
Maybe that's not the syntax you are looking for though.
 
I want to actually delete the key permanently
 
That's what I mean too. It should do that, unbinding an object word is a no-op otherwise.
 
What would happen is it would copy the keylist and the symbol/key in the last slot would jump up to fill it in. Then the value in the last frame slot would jump to fill in the corresponding variable.
 
Oh. I see what you mean. Yeah, it would have to be a path-taking version of unbind.
 
5:10 AM
And the general idea is that all lookups check for a match on symbol with the one they think is at that index. Thus the index is effectively a cache.
If you get a cache miss, it searches... if it finds, it recaches the word. If it doesn't find, you get an error.
It's rather cheap, actually.
 
So just an additional check every lookup?
 
Small one, and it's based on the index too
 
It's the usual trade-off. Rebind now, or relook later.
 
e.g. you're looking in the parallel array at that index. In the scheme of things not much. And if you think a flag to avoid the check is cheaper than just doing the check you could have fixed-sized objects not do it.
I imagine the check is about equal within any reasonable concerning order of magnitude.
 
Yeah I'd think there's not enough to gain there as well.
 
5:12 AM
But, I do test these things.
The real cost is the same cost as the append... you can't modify the keylist directly if it's shared with other objects.
So it's the copy you have to make on the delete, to avoid screwing the other objects that didn't delete that key.
 
It would be fastest if you only deleted fields from the tail, and never looked for them again.
 
Doesn't make that much a difference. The order is not supposed to matter (we should do something to help enforce that invariant, like alphabetize them or something)
Or choose some arbitrary but deterministic non-useful ordering
So deleting in the middle should just be as easy as swapping out the tail with the hole
 
@HostileFork Are object keylists shared in Ren/C currently?
 
@MarkI Yes, same mechanic as R3-Alpha, this is the first I've really started going after objects... I've bumped up against them because I had to, but now I'm on the vision quest... got rid of FRAME!... now the "self" of an ERROR! knows it's an error, module frames know they're modules (for as long as modules live), etc...
Been pushing toward terminology. Functions have PARAMS and ARGS... Contexts have KEYS and VARS
Then the series holding these are paramlist, arglist, keylist, varlist
Words have a "target". This target can be the varlist of a frame, or the paramlist of a function.
Without some semblance of clarity on this, the code was extremely hard to grok.
And... no assertions to help you out...
So mostly I just went around with the scaffolding of figuring out what the invariants were (or were supposed to be, or where they were missing) and now I'm leaning heavily on those asserts and such to make changes.
And it's paid off, these are some pretty hefty things...death of END!, death of FRAME!... two things that if you ever saw them there was a bug...
 
@HostileFork Um ... just checking ... wouldn't the target be an ARG for a function?
 
5:21 AM
Can't be. The arg pointers may not be alive if the function's not on the stack and it's one of those non-closure deals.
 
You are sure right, it is confusing.
If PARAM is to KEY as ARG is to VAR then "target" means one in one and the other in the other.
 
Especially confusing that a lot of changes seem to have come after the fact, and so you try and get an understanding of what a "frame" is and then it's VAL_WORD_FRAME and then you start getting negative index numbers...
 
Head. Hurts. Must. Smash.
 
I'm now forcing actual type separation between REBFRM and REBSER so you can't mix them up.
It's a boatload of fun.
FRAME_VARLIST(frame) => REBSER*
FRAME_KEYLIST(frame) => REBSER*
FRAME_KEY(frame, n) => REBVAL* (typeset! ... with symbol)
FRAME_VAR(frame, n) => REBVAL* (any-value! or unset!)
FRAME_CONTEXT(frame) => REBVAL* (any-context!)
...
FRAME_CONTEXT(frame) is actually BLK_HEAD(FRAME_VARLIST(frame)). The 0th element is the canon REBVAL which this frame makes when it's in value form.
Hence params and args start at 1. Today, the 0th key is sometimes the word 'self and sometimes not. Previously it was a recipe requesting the FRAME! in vars[0] to be used to reconstitute an object value, but it was always an OBJECT! and it would lose any additional fields an object or error or port or module might have besides the frame.
Now, interestingly, vars[0] really is the self. It's got the right type and all the slots filled, not just the frame. So you can just pick it out directly.
Equally interestingly, that's not how I want to do self. I want the value available, but I'm probably going to use keys[0] for something more interesting.
It is, however, how the answer for bind-of is given back when all you have is a frame pointer. Which is how you would make a self word in userspace if you wanted one.
@MarkI All make sense? :-)
 
Jester, thy name is Surely.
 
5:31 AM
vars[0] is also how definitional return can work on closures. Return's REBVAL looks like a native function, and it has its spec and paramlist intact to be invoked by the evaluator normally...but one pointer-sized slot was chewed out. That was the slot for the native code function.
In its place is now either a paramlist (for a function's definitional return) or one of these varlists of a frame (for a closure's definitional return).
But the deal is that the throw name has to be the function or closure value itself...full REBVAL sized...because that's the throw that was set up to be caught. So it reconstitutes the value from vars[0] in either case from that one pointer slot.
 
6:04 AM
Hm. IMPORT needs an /INTO switch so you can say where to do the import.
import/into some-module :self
 
Looks like by default it gets imported into the user context. Can't think off-hand of why I'd need to do anything else ...
IIRC the user context is a little "special".
 
Ren Garden has a different context per tab...each time you make a tab it clones the user context.
They're isolated... anyway, so this means you only get the import if you make a new tab and it copies the user context again.
 
6:28 AM
In theory with the path trick of /self, then you should be able to reach out into the calling context and get its self automatically...except I suggested that was a kind of security risk. That you shouldn't allow it unless self was bound specifically to something in that object's inheritance path.
Which isn't to say security on the whole has been properly sorted out, and it would be a huge undertaking to start looking at that...
 
6:45 AM
>> bind quote (a) object [a: 10]
 
; Brought to you by: try.rebol.nl
; rebol.com/r3/docs/errors/script-expect-arg.html
    *** ERROR
** Script error: bind does not allow paren! for its word argument
** Where:
** Near: try load/all join %/users/try-REBOL/data/ system/script/args...
 
Laaaame. And... fixed in Ren-C :-)
red> bind quote (a) object [a: 10]
 
; Brought to you by: try.rebol.nl
*** Script error: bind does not allow paren for its word argument
*** Where: bind
*** Stack: do-console all not unset? set do first head reduce do* _execute if all not unset? set do first head reduce do* bind
 
Laaaame. :-)
 
7:11 AM
@giuliolunati Actions definitely need to be able to dispatch off something other than the first argument. Consider for-each... if you're going to customize that, you want it to have the dispatch on the data argument... that's #2.
Though perhaps there should be a boilerplate for-each that sets up the variables and bindings and then calls a generator. I dunno. But point is, you should be able to extend for-each to a custom type...
 
7:35 AM
So IF, UNLESS, and EITHER have some hidden unknown uses now, making them kind of ALSO-ish. You can evaluate multiple expressions... run both of them and then pick one result. either condition (some stuff) (some other stuff)... both clauses will run, and you'll conveniently be able to pick one result value or the other with no intermediate variable. It's a rather internally efficient way to do that.
 
 
2 hours later…
10:04 AM
Hello @noein
@johnk I may have found that bug...
 
10:16 AM
So Rebmu might need a way to say .A./.B. => a /b for some .A. and .B. I think. IIRC right now a/B => a/b: while a/b is a regular path (it has to be because lowercase Rebmu is an escape to ordinary Rebol). That leaves A/b and A/B... unfortunately cA/b => c a/b and cA/B => c a/b: hence I guess you just have to space it... a /b
 
10:36 AM
@johnk Let me know if this helps the bot, it solved an instance of that assert you had that I was getting...
 
11:13 AM
@HostileFork Absolutely. In my experimental implementation one can customize over n-th arg, for example 1 + fraction 2 3 gives 5/3
And I don't understand utility of actions ... natives also can dispatch...
 
@giuliolunati It may be that wanting to be dispatched on a type is a bit in the typeset, and that you could put it on any function argument. Then if an object or its parent(s) refer to that function, it would be a candidate for the dispatch. If the argument didn't respond as wanting to process it, then it could fall through to the function body to either give an error or do some kind of default.
foo: function [bar [<dispatch> object! integer!] baz [string!]] [
    if integer? bar [return some-integer-processing bar baz]
    fail "object didn't want to process foo"
]
i-handle-foo: object compose [my-foo (:foo)] [
    my-foo: function [bar [object!] baz [string!]] [
        ;-- do something
    ]
]
I'm not completely sure on what the spec "dialect" will look like for establishing the correspondence, but the key here is to avoid doing this through matching up names of things. So as above, some correspondence has to be made between my-foo inside of i-handle-foo and the function value of foo, not the word foo.
I've also wondered if you should be able to make object values "interpreter-active" so that they evaluate. It's a little bit scary to think of, but also a bit interesting. So if you really wanted the object value you would use a get-word (as with function) but if you didn't, it might have a behavior.
 
11:41 AM
In Rebol's "freeform" desire, one bit of that is the desire to be less freeform... there really does need to be a good way to make sure you get single complete evaluations with nothing left over. As a simple example: step [print "Hello" 10 . print "Goodbye"] Imagine if that would give an error because step does a DO/NEXT on print "Hello" and doesn't find a . or an end
 
12:06 PM
@HostileFork about spec dialect, I propose: reduce [:foo 'my-foo :bar func[...][...] ...] i.e. every action/native item is associated to next item, select-like; if next item is word, then search that in body; if next item is function, execute that.
 
@giuliolunati I'd like the spec dialects to be as close to each other as possible for MAKE FUNCTION! and MAKE OBJECT!. If you would like to make a generator that works differently that will be an option...the goal is to make pretty much anything possible at the user level, but keep it basic and low level internally. So I do not think defining functions in the spec itself will be part of the MAKE OBJECT! behavior...that would be a generator if it existed.
Think of how I plan now for features like:
foo: function [x <with> y (10 + 20)] [
    x: x + 1
    print x
    y: y + 1
    print y
]

>> foo 5
6
31

>> foo 5
6
32
Initializations, default values, making a persistent object at the time of generation, locals gathering... all of this is possible in "userspace" when the foundations are right! So any user could write FUNCTION, or something like it but different that they prefer.
 
 
4 hours later…
4:11 PM
@HostileFork tell me if I can help with objects...
 
5:10 PM
@HostileFork Super lame, clearly!
Hm. Can this be a case of a tough result choice?
(10) or 10?
Both have a bad side ...
 
5:24 PM
I keep this one-liner handy, so I can prepend it to multi-line code I want to paste into a Rebol console:
r: "" l: "" until [append append r l "^/" empty? l: input] do r ; magic multi-liner!
2
 
 
2 hours later…
6:56 PM
@MarkI s: "" do while [not empty? l: input] [s: join s [input l]]. I forget offhand what the not empty? single word is. Of course if we had "real until" that would be s: "" do until [empty? l: input] [s: join s [input l]]
Still need a better word than repend for what repend does. I kind of liked calling it JOIN and current join being JOIN-OF, kind of like my idea for REVERSE and REVERSE-OF etc.
Er, I meant to join l with a newline there.
s: "" do while [not empty? l: input] [s: join s [l newline]]
Indeed, code: "" do (until [empty? line: input] [join code [line newline]]) would be quite nice.
 
7:51 PM
@HostileFork is the field extra.size used anywhere for string series? I wanna use it to return an extra len from Mold_Print_Value.
 
@giuliolunati It's not used yet but it is for very special purposes, and I'm about to use it for some things that are the kinds of things for which it is intended. If you need to return a length then just take an optional parameter by pointer... ... Mold_Print_Value(REBCNT *len_out, ...). Check to see if the pointer is non-null and if so, *len_out = len.
I like to put output parameters like that leftmost in the arg list, so they are "closest to the left like the return value"
 
Ok, thanks.
 
 
1 hour later…
9:15 PM
posted on December 05, 2015 by hostilefork

FRAME! was never supposed to leak into the user's awareness (though it did by virtue of being in the list of available types, and sometimes a bug would leak or display one). The reason for FRAME! was due to Rebol's "one-series-model-size fits all" model. If an OBJECT! were to be representable and passed around as a 32-bit or 64-bit pointer to a REBSER series node, there weren't enough bits i

posted on December 05, 2015 by hostilefork

This takes another step toward moving module implementation completely into user space (and having no separate module type). It unwinds the mechanics so that the entirety of making a module comes from MODULE the generator making a single call to to module! to convert the object it has been building. Hence make module! [[spec][body]] is gone. One must now use: module [spec] [body] For

 
10:09 PM
Hum, I just realized something about the intersection of my two tricks. :-/ If I try and chew out a value header bit to signal the "I live at the front of a series node which is the data itself", then that mucks with the ability to byte-copy a value from point A to point B without some macro that updates that bit.
Unacceptable cost, I'm afraid. That means the REBSER will have to be sizeof(REBVAL) + 2 * sizeof(void*).
(larger in debug builds due to tracking information currently, anyway)
 
10:39 PM
@giuliolunati I apologize if upcoming very massive commits disrupt your work! :-/ You will be free to ask any questions you need to help you recover from them...
They tie in heavily to this "modify with confidence" I keep talking about...
 
10:56 PM
@HostileFork NP, you're doing great work, and I'll wait for it! :-)
 

« first day (1861 days earlier)      last day (1919 days later) »