« first day (1636 days earlier)      last day (2144 days later) » 

12:04 AM
@HostileFork Re comments in JSON and them not being there for a reason: Is that the reason you are referring to: plus.google.com/+DouglasCrockfordEsq/posts/RK8qyGVaGSr (Just wondering.)
 
@earl They're contentious with the purpose of establishing a wire transfer format; they're lost in a parse and have "nowhere to go"...the same problem as what we have with reading in and putting out Rebol as value (e.g. munging Draem files to fit new formats, it loses all my comments...so I don't use any).
-Wall build down to zero warnings. Now -Wextra...
 
 
1 hour later…
1:21 AM
Modulo -Wunused-parameter, down to no warnings with -Wall and -Wextra in both gcc and clang
 
1:53 AM
@earl I forgot C++98 didn't have long long :-/
 
2:03 AM
hi there hostilefork
thanks for helping me join this room
 
@HostileFork It converts CR to LF, and CRLF to LF. Pretty standard stuff, coded as opaquely as possible, which is also standard.
@HostileFork There is a flaw in your recoding.
 
@AlexanderGuo Sure, welcome! What's up? Feel free to share some about your background
 
Try following through what happens if you pass in "^(cr)Xabc", you will get "^(lf)abc" in your version.
If you hate the 1/-1 unsigned trick, use 1 and 2, to me it looks cleaner that way too.
 
2:18 AM
@MarkI Thanks, fixing. Yes, I dislike using a "flag" as a tristate.
It says flag, it should mean flag
 
1 and 2 is actually using the bits in the flag, like you're supposed to.
You disagree with multibit flags? All flags must be boolean variables in their entirety?
 
@MarkI The datatype REBFLG seems to just be a native-size boolean, we were just discussing that. I don't have a problem with bits and flags, just that's not what REBFLG is intended for and there's enough weirdness already.
Including in that particular case that the weirdness simply didn't work because the type is unsigned.
 
Wait ... what? I thought REBFLG was the multibit flag type ... it isn't?
 
Its ostensible purpose is to be the native-sized variant of a byte-sized REBOOL.
Holding TRUE and FALSE, but being bigger to maybe be faster.
 
Yah, I see, wow, REBCNT is actually used as the multibit flagword, REBFLG as the value of one flag bit in it.
Super-dumb to tristate it. OK, overly tricky, at best.
 
2:28 AM
Broken as it's unsigned and being compared < 0
 
There's no need to preserve the passed-in type.
@HostileFork You've confirmed it doesn't work? Not just looks like it shouldn't work?
I mean, maybe that's why Rebol only builds with "minimal" compilers, it needs to be a broken one :)
As far as I know, most compilers will actually be fooled by this, that's why I called it a trick ...
 
@MarkI Well, if a value declared to be unsigned compares as being less than 0, I'd call it a "bug"...although who knows. I'm just addressing the higher warning levels.
 
s/broken/generous-as-far-as-undefined-behaviour-goes/
I have not tested it either, I wonder how much exercise this code line has had ...
I agree it would be sad if it depended on a compiler bug, no matter how common.
I shall try tcc with full warnings, but I do not have high hopes.
I mean, really, why isn't such a comparison flagged as an error in the first place?
If gcc is kind enough to rate this a warning only, there must be some accepted fallback behaviour, possibly the behaviour needed.
 
I'd imagine the default behavior would be to optimize it out
 
@HostileFork Wanna bet? Never mind, I am joking. I am not going to say anything more about it until I test it.
 
2:46 AM
@iharob: For an unsigned integer x, x >= 0 is always true, yes. — Kerrek SB Jan 11 at 0:14
 
@MarkI That's not undefined behaviour. It causes an arithmetic conversion well-defined by the standard.
General rule is: mixing signed and unsigned operands, the signed one is converted to unsigned.
 
@earl Thanks, I'm sure I knew that sometime, been too long out of the C standards world.
 
So the signed "0" is converted to unsigned "0" (a rather unexciting conversion) and then ccr < 0 is done over two unsigneds, which is an always-false comparison.
The "accepted fallback behaviour" indeed is: compare as asked; and if you optimise, feel free to optimise all that stuff away. There's a long tradition of people writing e.g. while (1) or if (0), that's (most likely) why this is not an error and not even one of the default warnings.
 
So we are agreed it's easy to test :)
 
Sure. <Misappropriate famous Knuth quote here>
 
2:54 AM
But I am slightly surprised, as you hint, that there can even be a warning here, if the standard is so clear about what is to happen.
 
That warning is only there, in most compilers, if you turn up warnings to eleven.
 
So that's a "announce every automatic conversion performed" level, sounds painful.
 
But then, there's also things beyond the standard :)
@MarkI Nah, it's more limited and rather specific:
       -Wtype-limits
           Warn if a comparison is always true or always false due to the
           limited range of the data type, but do not warn for constant
           expressions.  For example, warn if an unsigned variable is compared
           against zero with < or >=.  This warning is also enabled by
           -Wextra.
(From GCC's documentation.)
 
@earl Cool.
I am so childishly excited that we are actually fixing bugs like this, I never thought it would happen ...
8
 
@MarkI I think that's partly because a momentum is starting to build. Things getting done is directly proportional to the number of people wanting to get things done. :-)
 
3:06 AM
My goal isn't to gold plate Rebol as written, but to reign in the sources and get it under control enough so that the number of mystery bugs goes down, so that it may be adapted into showcasing the design ideas that have just sort of sat around on the factory floor for too long.
4
Making it easy to adapt with confidence is the goal.
 
@RebolBot
;; "foo^Mbar" in UTF16-LE
write %/tmp/foo #{FEFF0066006F006F000D006200610072}
read/string %/tmp/foo
 
; Brought to you by: try.rebol.nl
== "foobar"
 
@MarkI Not sure if that's convincing enough as a test case for you. READ/string'ing UTF-16 is about the only thing that executes this particular code path. (READ/lines being the second, because it implies /string.)
 
3:39 AM
There is some tricky stuff one learns with more warnings.
13
Q: What sense do these clobbered variable warnings make?

Dietrich EppI have a function like this: #include <setjmp.h> jmp_buf buf; void func2(int g); extern int some_global; void func(int x) { if (setjmp(buf)) return; if (some_global) x += 5; func2(x); } GCC (gcc (Debian 4.4.5-8) 4.4.5) gives a warning: test.c: In function ‘func’: ...

 
4:04 AM
That's a good warning. Too bad the compiler isn't smarter about giving it to you :-/
 
 
2 hours later…
6:30 AM
https://github.com/red/red/pull/1109
GitHub
Red Pull Req—FEAT: change collation tables to char vectors.
qtxie
1429835113
 
 
1 hour later…
7:35 AM
Now building as standards-compliant -Wall -Wextra -pedantic under Clang for both C99 and C++98, minus two warnings: unused declarations and long long under C++ (not standard until C++11, in C since C99)
 
7:57 AM
I should clarify that by "building" I mean "with no warnings"
 
8:35 AM
posted on April 24, 2015 by qtxie

Note: Only support char! and integer! element now.

 
 
1 hour later…
9:54 AM
Hm, what's the best way of trying to appease a compiler that can't tell if a variable has been initialized or not which is monitoring something like a loop from 0 to N, where it uses a condition like loopCounter & 1 to determine if it's going to pick a new value in to accumulate?
for (j = 0; j < c; j++) {
    if (j & 1 == 0) {x = ...;}
    if (x) {...}
}
It seems what many people do is a throwaway assignment before the loop. Kind of random. But this pattern is a little tough to "rewire"
Having the warnings around and tightening things is good, though. Here's an example, @MarkI ... one of your favorites regarding zero-length filepaths and reading an uninitialized c
 
https://github.com/red/red/pull/1111
GitHub
Red Pull Req—FIX: set path on vector! does not support char! datatype
qtxie
1429847698
 
 
1 hour later…
11:09 AM
Well, over time I can say all of this has led me to an understanding of ACTION!, and the difference between MAKE and TO.
 
11:25 AM
>> help for
 
; Brought to you by: try.rebol.nl
USAGE:
    FOR 'word start end bump body

DESCRIPTION:
    Evaluate a block over a range of values. (See also: REPEAT)
    FOR is a native value.

ARGUMENTS:
    word -- Variable to hold current value (word!)
    start -- Starting value (series! number!)
    end -- Ending value (series! number!)
    bump -- Amount to skip each time (number!)
    body -- Block to evaluate (block!)
 
I'm guessing many of you don't really know or care what for x [1 2 3] [a b c] -7 [print x] does. :-/
 
I would care!! I would immediatly throw away that code and rewrite it in something that is maintainable.
 
Well, it was causing me trouble, so I demoted the already-intended-to-be-changed FOR to just counting.
 
 
2 hours later…
1:26 PM
After some grief and a little cheating, GCC considers the code to be C99 and C++89 compliant with no warnings from -Wall and -Wextra (modulo -Wno-unused-parameter and -Wno-long-long)
GCC and Clang happy now (with TCC soon to join the party), the plan moves on now to its sinister "phase two".
 
1:44 PM
@HostileFork Can't resist:
>> for x [1 2 3] [a b c] -7 [print x]
 
; Brought to you by: try.rebol.nl
1 2 3
 
Seems right to me ...
@HostileFork Wow, good catch HF.
 
@MarkI I have an interesting mixture of thought about this, where I look and think "there's a methodology in here which really could be honed down to a manageable piece of legacy infrastructure". As grumpy as I get, trying to read sources like the dtoa also makes me grumpy. There's got to be some happy medium in all of this...
And it does seem to hinge on "expressive questions", like the indentation levels and where the returns are, or if the code is on the same line as the condition for an IF (which is a nuisance in the debugger, but is that the fault of the debugger or the fault of the source notational choice?)
It seems that what happened is that Rebol started out fairly straightforward and "lost its way" a bit, falling under the atrophies of being pulled in too many directions...not being open source and leading to the design of a parallel type hierarchy to the one already established due to not wanting to "expose the guts". With the source open, I think these things could be pushed back and the core problems focused upon...which have thousands of CureCode tickets worth of thinking pending.
@MarkI Speaking of which, do you have an opinion on the requirement-or-lack-thereof for boilerplate blocks on IF/UNLESS/EITHER bodies?
>> print if 1 < 2 "Hello"
 
2:04 PM
; Brought to you by: try.rebol.nl
Hello
 
>> print if 1 > 2 "Nope"
 
; Brought to you by: try.rebol.nl
none
 
(NewPrint would just do a newline by default on that, as print [x] is the same as print x, and printing a NONE yields nothing in order to allow conditionals more easily to "drop out" of the print)
Interesting ties to ALSO... which I thought should evaluate blocks...but BrianH said no; that because it always evaluates both branches that parentheses are fine, and you should invoke DO explicitly on blocks.
>> also (1 + 2) (print "Hello")
 
; Brought to you by: try.rebol.nl
Hello
== 3
 
>> also [1 + 2] [print "Hello"]
 
2:09 PM
; Brought to you by: try.rebol.nl
== [1 + 2]
 
status: by-design
>> not 0
 
; Brought to you by: try.rebol.nl
== false
 
If one is to merge C programming styles and Rebol programming styles, it would seem that writing code treating numeric integral zero as "false" runs counter to the belief that falsehood comes from either logical falsehood -or- nothingness, to which I'd argue a NULL pointer is closer.
Hence I think we should be able to agree that int x = 0; if (!x) {...} is poor style for a Reb/Red/C coder. (I also, as a C++ coder, hate that.)
"When in Rebol, do as the Rebols do."
 
2:28 PM
@earl Thanks, that is certainly enough to convince me.
 
2:55 PM
I don't know that I believe in UTYPE!. I think I believe that some simple "object-like" declaration minus spec is accomplished with HAS, similar to DOES. A more complex "object-like" declaration does have a spec, in which it identifies mappings of ACTION!--not words for the actions, but actions themselves by identity--and implements them.
This may run counter to previous ideas where I said all ANY-FUNCTION! would be unified under one type, or it may not.
Surface idea being that if APPEND is an ACTION!, then you can get its identity via :APPEND. Dispatch-wise, this has nothing to do with the word "APPEND".
If you decided you were going to make an object that implemented APPEND, you would specify that connection not by how you named your methods (though you might overlap them) - yet something vaguely resembling object [:append my-append] [my-append: function [...] [...]]
If the object spec block were "rich enough" it might be subsumed into something more abstract that could do both module behavior and these object/utype behaviors. CONTEXT starts to seem a reasonable name for "that thing"
My current leaning is in modeling things to try and forget about OBJECT and MODULE, and focus on CONTEXT as something with a spec and a body. Then HAS [...body...] is equivalent to CONTEXT [] [...body...], just as DOES [...body...] behaves like FUNCTION [] [...body...] (except it doesn't, but that leads me to DOES/ONLY with no locals gathering.)
 
 
1 hour later…
4:22 PM
=== ATOM FEED OUTPUT ===
%/home/hostilefork/Projects/hostilefork.com/templates/atom.xml
==18881==
==18881== HEAP SUMMARY:
==18881==     in use at exit: 0 bytes in 0 blocks
==18881==   total heap usage: 8,220,032 allocs, 8,220,032 frees, 424,883,474 bytes allocated
==18881==
==18881== All heap blocks were freed -- no leaks are possible
==18881==
==18881== For counts of detected and suppressed errors, rerun with: -v
==18881== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
At one point I thought my website was simple...
Turns out that without memory pooling, the total alloc/free count churns through 424MB.
But the greater achievement is the -pedantic standards compliant valgrind memory error zero and leak zero...
 
4:42 PM
(Note that you are "churning through 424MB" either way--with pooling or without--and pooling has similar problems to any allocator. So this points to areas for general improvement. And I actually reduced allocations a bit...for instance when a series is resized I don't allocate a new REBSER and then copy its header back into the old one and free the new temporary series, I have mechanisms for updating the old REBSER and only allocating new data.)
 
 
2 hours later…
6:46 PM
@HostileFork Aside from readability/style considerations, I don't see a problem.
I would like to see block(s) after every if/unless, but I am hesitant to require them; people's coding styles should be allowed to vary, within reason.
@HostileFork There're a couple of source files like that, and I agree they're monstrous and totally unmaintainable.
I am not sure I see much of an alternative though -- if I have to choose between opaque libraries and opaque source, I'll take the latter every time.
Then at least you have a hope of debugging it if needed.
 
7:41 PM
Further to the block-forming of 'if and 'either branching, the blocks perform the short-cutting.
So, if you have if condition make block! [print 'Hello] for example, the block is actually "made" before the condition is even tested.
Whereas, with if condition [do make block! [print 'Hello]], the block is only made (and then executed) after the condition is tested.
That is, whatever you are passing to the if without wrapping in a block, will get evaluated and the result is what the if will actually see.
But I will say again that I do not think we need to force that result to be a block; it only needs to be evaluatable (which is why unset!s don't work).
 
posted on April 24, 2015 by Steven White

I am trying to understand the VID 'facets' and explain them to myself.  I have gotten through a number of them and they are specified the same way, namely, a facet word, and then a block of values.  In the following example, the MAIN-WINDOW has a box (CONTROL-BUTTONS) with the 'edge' facet followed by the attributes of the edge.  I was hoping that the 'pane' facet

 
 
2 hours later…
9:47 PM
posted on April 25, 2015 by Steven White

I am looking at the documented facets and seeing one called 'options' which I interpret to be used in the manner shown below.  I get an error.  Am I misunderstanding? Thank you. Rebol [     Title: 'VID test harness' ] ;; Paste code below to test     view layout [     options [no-title resize no-border all-over] &

 
 
2 hours later…
11:59 PM
@MarkI Ok. If you're for it, and @rebolek is for it, and I'm for it, and Carl was for it, then people need to lobby DocKimbel who has not been convinced and still wants to enforce boilerplate blocks. My argument for getting it in was that it wasn't in service of "the most freeform language ever invented", also I disliked this idiom:
 

« first day (1636 days earlier)      last day (2144 days later) »