« first day (1856 days earlier)      last day (1924 days later) » 

12:22 AM
@HostileFork Source analysis in Test now checks function spacing.
I've applied DETAB to the script too, I assume it will not cause your changes any grief.
Needs tweak to the C parser first though.
 
@Brett Great! I think these kinds of checks will be very helpful over the long run, they're much better than trying to write up coding style documents and then have people either follow them or not...
I'm working on getting the pesky REBNATIVE(native) and REBNATIVE(action) definitions into the comments and killing %booters.r
 
@HostileFork I was thinking the natural extension would be to have the tool automatically space the function as necessary. But that's for another time.
 
@Brett I like the way this is going where it just warns you
When things rewrite the source there's a lot that can go wrong
 
Would be a programmer tool, but yeah sure.
 
So I like a very clear delineation between "source" and "generated"
 
12:28 AM
Anyway not going to take that on for now since the parser is strong enough for that.
 
I have another new thing that came up out of a performance study, where I learned something I thought was false, and the solution is a little weird but it means we should probably standardize the format of the unpacking of the native args.
 
"unpacking of the native args." ?
 
REBNATIVE(blah)
{
    PARAM(1, first_arg_name);
    PARAM(2, second_arg_name);
    REFINE(3, third_arg_name);
    PARAM(4, fourth_arg_name);

    // Access with ARG(n_arg_name) and REF(third_arg_name)
}
 
Ah.
 
I've worked up a way for this to cost nothing, basically, yet still in the debug build let you see the values...as well as check to make sure you only test refinements for REFinement truth or falsehood.
It came out of looking in the profiler and finding out I had misunderstood something.
So in trying to think of a way around it, I came up with something that could be applied uniformly and cost nothing.
 
12:32 AM
So instrumentation and documentation at the same time?
 
Well the problem is that before if you said D_ARG(5) it was hard to sync up while reading the code, especially when natives.r was a separate place to look
That gave you a pointer direct into the call frame, though.
I thought the compiler would be able to optimize out a const named pointer, so REBVAL * const repeat_count = D_ARG(5); would be free. It wasn't and I read up on why and oh, no, that's not free. You get a pointer variable and an assignment of that pointer variable each call.
In the world of fervent micro-optimization that will not do. 64 bits is 64 bits!
Back in the day that was 2.6x as much memory as you had in all the registers!
I found a wacky compromise that I've been working on that follows the above pattern and it should have equal performance to directly accessing by index, plus debug checks, and if we have a parser check that makes sure each native has a little block like that and it all lines up with the right names and param/refine distinction then it should be helpful.
Also, I've brought back the chunked stack code... in a new form. It's not a chunked call frame stack, it's just a chunked REBVAL array stack. Same code pattern, more generic. It's looking pretty slick.
 
@HostileFork I can have a look at that.
@HostileFork <wave hand past head> :)
 
It will look exactly like the above, the only question is if it will c-ify the names for you. e.g. so you could say PARAM(1, case) even though case is a C keyword, because under the hood the thing you're talking about is a_case or something like that.
@Brett If you want to do arbitrary malloc() and free() type things, where there's no restriction on the ordering... so you can malloc() foo and then malloc() bar and then either free() bar or free() foo next... the allocator can't be as efficient as if you have rules. Like "you can only free the last thing you allocated".
The more rules you're willing to follow the more specialized and narrow that allocator can be.
 
Ok.
 
A lot of Rebol involves making series that have no particular order on when they'll be freed. They'll be freed if-and-when the references to them go away.
 
12:44 AM
@HostileFork To introduce this change, you would do it manually as your start working on a function?
 
@Brett There aren't actually a prohibitive number of natives to go through and do this with by hand.
As long as it gets checked.
 
What C source rewrite tools do you have at your disposal apart from text/search replace?
 
Rebol :-) But if you would like to take a shot at using your tool to give this a shot, it could make an interesting case study!
The main thing being that it requires manual intervention on the existing variables/pointers/etc.
So it's kind of like all the functions need to be looked at anyway.
 
@HostileFork It's an area of ongoing interest for me, I sort of nibble away at it over time.
 
I kind of don't mind doing these things a little at a time. So that's kind of how I feel about the long lines and things. Now that I can change them I'll change them for a while as I see them. When the numbers go down low enough I'll attack individual cases.
Speaking of which I noticed in tmp-funcs that the multi-line prototypes work, but they span several lines
Which is legal C and I don't know I have a terribly strong opinion
Though it looks a bit odd
 
12:49 AM
It's an interesting area, if the C parser had a better structural understanding you might be able to do more sophisticated rewrites even for small cases.
@HostileFork Don't forget rewrite. It does rewrites on strings too. One day you might find it handy.
@HostileFork It can be changed with a bit of effort, but given it is generated I wasn't sure there was a point. However if it's needed for comprehension it can be done.
 
Yup. Looking forward to putting together the power demo in Ren Garden once I'm happy with the core mechanics. Getting sort of close to getting sort of happy.
It's not really necessary, but if you know where to put the replace/all-newline-with-space it probably wouldn't hurt. As a generated file it's exempt from the long lines issue.
 
Btw, I wondered whether something like search should be a native. Maybe a nice user tool.
 
@Brett Interestingly, REPLACE is not a native, even.
>> source replace
 
; Brought to you by: try.rebol.nl
replace: make function! [[
    {Replaces a search value with the replace value within the target series.}
    target [series!] "Series to replace within (modified)"
    search "Value to be replaced (converted if necessary)"
    replace {Value to replace with (called each time if a function)}
    /all "Replace all occurrences"
    /case "Case-sensitive replacement"
    /tail "Return target after the last replacement position"
    /local save-target len value pos do-break
 
Hah. Don't know that I ever looked at that. I have on occasion used a parsed based replace.
 
12:59 AM
The whole thing needs review but I feel like the review needs committees and numbers of people that aren't on hand yet. So to me, critical path is making sure there's something worth forming a committee about on the table, and that people can... (put it up on the jumbotron)... "Modify with Confidence!"
 
 
2 hours later…
2:43 AM
I have been thinking about the naming of ren/c and rebol 3 and how we could move forward
@HostileFork how does rebol-n sound to you?
 
@johnk rebol-X :-) I don't know about the naming. I think that DO is not a bad idea for the utility name; perhaps a little ambitious to try and take such a thing, but think of the other ambitions: red, go, etc.
 
You could view it as an expansion of ren => rebol-n or as rebol 3 where n=3. It also sounds slightly like rebellion
 
I'd be happy if sooner rather than later I could factor things so that there's no platform executable in Ren-C and no one needs to care so much what it is called. For what it is, I think it's acceptable.
Ren-C, Ren-Cpp, are okay names for the libraries to me.
My main worry about making a DO project is that submodules are a bit of a pain to keep in sync. But, we could go ahead and organize Ren-C to separate out the console client as a separate top-level directory. Right now it's kind of "in there somewhere" and people have a hard time finding the main or getting a map.
@johnk I haven't forgotten about your bug report, just in that phase of "hoping something else I'm doing is going to fix it incidentally"...oddly it does happen.
 
@HostileFork no worries. It's getting busy for me in the run up to Xmas so I have limited play time
 
3:16 AM
@HostileFork Done
 
@Brett Cool, thanks! Just looks a little better when it comes up in text searches...
 
Np. Cleans out the commented params too.
 
It is truly amazing how I can change something that seems entirely unrelated to http or ports, and everything works, but somehow magically https and/or http will break. :-/
 
3:32 AM
I had a sort of realization about the need for metadata, that (for instance) a module is more than objects and specs... it's also some keys and values. This could be useful for functions. So I think actually function specs should have up to three blocks.
foo: function [<meta> Category: 'sorting Author: @HostileFork <args> x y z ...] [...]
Things like function could continue to make that syntactically nice, but this is where the control instructions are needed for modules, not in the spec. The spec for objects would serve a purpose more parallel to that for functions.
meta-of could then reflect out this data if present.
 
 
3 hours later…
6:56 AM
So Ren-C is now a fairly solid 20% faster or so than Rebolsource, just in general evaluation. That's despite heavy fixes and definitional returns and a lot of additional things moved around.
6
...but... that was just prep work. :-)
It's now time to drop a train on this thing.
Perhaps prior to dropping said train I will look into @johnk's bug and see if it's gone away yet... ... no it has not. Okay, here goes.
 
7:41 AM
@johnk Okay, hopefully this will take care of it! (or at least, that assertion)
 
 
2 hours later…
9:42 AM
@HostileFork yay, that fixed it.
 
10:16 AM
@HostileFork In the end I'm still listening to some of that experimental Chinese electro music that you sent me a few months ago.
 
11:03 AM
rebol2> source closure
 
; Brought to you by: try.rebol.nl
closure: func [
    "Defines a closure function."
    [catch]
    spec [block!] {Help string (opt) followed by arg words (and opt type and string)}
    body [block!] "The body block of the function"
    /local spc bdy word
][
    spc: make block! 1 + (2 * length? spec)
    insert/only spc [throw]
    bdy: make block! 5 + length? spec
    insert bdy reduce [:do :make :function! spc body]
    parse spec [any [
            set-word! | set word any-word! (
                insert tail bdy to word! :word
 
 
5 hours later…
4:16 PM
@Morwenn The end? Already? Jeez. I thought I'd at least get the frameless natives in before the end...
>> delta-time [loop 100000000 [comment {This is under R3-Alpha}]]
== 0:00:07.136001

>> delta-time [loop 100000000 [comment {This is under Ren/C}]]
== 0:00:03.33231
What might you ask is the implementation of comment in R3-Alpha? Not too much code... ... but I looked at it for a while and thought that maybe it could be a bit faster. :-) The routine got a bit longer, but somehow twice as fast...
>> delta-time [loop 100000000 []]  ;-- Ren-C
== 0:00:01.207096
 
4:58 PM
So there we go. All done! One of the most frequently heard complaints about Rebol has always been: "My comments aren't running fast enough." You're welcome. ;-)
(...of course, no, that is not the point, rather it was a simple first case to attack to demonstrate a new technique.)
 
5:34 PM
@MarkI I believe when I first said I was doing that you asked "what about debugging" and the answer is "basically all frameless natives still have to have a working framed version".
What I did is in debug builds it calls the framed version deterministically half the time, just to exercise both code paths.
I mentioned the good news though, which is that because it's not binary one-or-the-other, we can bring back if/only and friends and it won't kill the optimization. If you don't dispatch from a path, you don't pay for the refinements in frameless dispatch... that opens up framelessness to things that have refinements to optimize for the no-refinements case.
So you win some you lose some with having to make them all hybrids.
 
 
5 hours later…
10:27 PM
how to clear the last block from a list of blocks? ser: [[1] [2] [3]]
clear last makes it [[1] [2] []]
 
@HostileFork Ow, come on :(
 
@Morwenn The Inevitable End is still on my playlist, good stuff. Monument
@RebolBot
ser: [[1] [2] [3]]
take/last ser
probe ser
 
; Brought to you by: try.rebol.nl
[[1] [2]]
== [[1] [2]]
 
@iArnold ^--
 
10:45 PM
@HostileFork Interesting :)
 
@Morwenn So Rebol is getting weirder and faster and more interesting. :-) We had the source conversion so now the specs for natives live in the C code. I learned that I was doing something not-correct, I had the idea in my head (for some reason) that if I did REBVAL * const foo = some_rebval_pointer; that it would be optimized out as an "alias" for some_rebval_pointer and not cost extra.
And It's Not True(tm)
That's another pointer and an assignment.
 
I wouldn't know what would be optimized.
 
@Morwenn Well if we say const int x = 5; that doesn't help it be optimized really either, but it does stop you from doing assignments which will change it, so const keeps you from crossing the line from not needing storage to needing it.
One might think a similar argument could apply to pointers. It does not.
Anyway, tinkering about with callgrind and poking at stuff, not spending a tremendous amount of time with it just enough to check intuition here and there
I found a longstanding off by one error which meant that if you did a series allocation to make it exactly the right size, it thought that exactly the right size was one too few for the data... and would do an unnecessary expansion.
Stuff like that, and going "hey, that's not right, why is that paying for an expand when it explicitly allocated the right size?"
 
11:02 PM
I hardly ever const-qualify temporary variables, except references. Sometimes, the const does not help the optimizer at all for some reason.
 
For the reader, not for the compiler.
 
11:55 PM
Yeah, but when it's a temp burried in math formula, it hardly makes a difference.
const are more important in parameters and return types.
And/or for pointers and references.
 

« first day (1856 days earlier)      last day (1924 days later) »