« first day (2586 days earlier)      last day (1194 days later) » 

12:18 AM
posted on November 28, 2017 by hostilefork

The GetFileSize API returns two DWORDs worth of size, for the low and high 32-bits of the file's actual 64-bit size. For some reason, errors are indicated by returning a low size of 0xffffffff and using SetLastError() to something other than NO_ERROR. But if the last error is NO_ERROR, that means the file really is 0xffffffff bytes long. R3-Alpha doesn't check the error condition, hence it c

 
 
2 hours later…
1:57 AM
posted on November 29, 2017 by @hostilefork Brian Dickens

@hostilefork wrote: I have to say that I am very gung-ho about the new behavior with OF. That's a word that didn't have a previous usage, and seeing how pleasing it is, I've asked if we might want to consider rethinking if some words that were formerly prefix (AT, IN, TO might be reasonable candidates for adaptation). But going further out there, I wa

 
@johnk ^-- I'm liking the NON as the reverse maybe.
Of course you can write a simple version as if not integer? x [...] but when it's more complicated... unless maybe [even? integer!] x [...] or if not maybe [even? integer!] x [...] vs. if non [even? integer!] x [...]
Originally MAYBE was called IS, until IS got taken to higher purpose. I'd be happy if a better word were found for it, but IS is off-limits. :-(
@Brett RE: users leveraging the evaluator in dialects, they will be able to. But issues like in our experiences with MATH haven't changed...you just can't predict the boundaries of an expression before you DO(/NEXT) it. I've taken it pretty seriously that the workings of the evaluator by successive DO/NEXTs, if you do not change anything between the DO/NEXTS, will act the same as DO...and that's harder than it sounds.
 
@HostileFork non makes sense (although it looks more English if it is hyphenated :-)
 
if non- [even? integer!] x [...] :-/ Well, that's outside the box, but in Plan -4 it can't be if non-[even? integer!] x [...]
I saw something that made me think Plan -4 might possibly need another exception, and I should have written it down, because now I don't remember it. :-(
 
2:13 AM
not to mention ruling out hyphens in words ..
 
Well the weaker version would just suggest you always put it in a block
 
I was thinking of to as well. "42" to integer! is very readable
 
I think the thing is there always has to be a fallback for these infix thingies
Even though Ren-C has some mad tricks for completing one expression on the left now, it still can put you in the situation of needing parenthesization on the left if you've got something bigger than that.
It would be easier to "sacrifice" TO to infix if there was a good prefix form. I guess CONVERT might be a starting bid.
 
Is it theoretically possible to have to act as both infix and prefix depending on context?
I don't like the idea of adding new words to what is already a wordy language
 
@HostileFork Aren't the various TO- functions the fallback, as -OF functions would still be fallbacks for OF functions?
 
2:18 AM
Jul 14 at 19:16, by HostileFork
+: enfix function [a [<end> any-value!] b [any-value! <...>]] [
    if set? 'a [ ;-- there's a value on the left, not <end>
        add a (take b) ;-- normal add of one right hand value
     ] else [ ;-- nothing on left, switch to variadic sum
        sum: 0
        while [not tail? b] [
            sum: add sum (take b)
        ]
    ]
]
@rgchris Hmmm.
 
There's still a use for them as whole, individual functions (pass-thru argument for example): map-each value ["1" "2" "3"] :to-integer
 
@johnk I am tempted to say that the standard + be willing to kick in and do (+ x y z), so I do think this mechanic may have its places, but we don't have a lot of experience with the pitfalls.
@rgchris Yep, and I think it's cool how OneFunction means specialization works even if your only vocabulary is map-each value ["1" "2" "3"] (specialize 'of [type: integer!])
The historical relationship between IN and BIND suggests that having IN be the enfix form would be okay, but I had a new spin on that where IN didn't mutate the bindings so it was semantically different.
Speaking of which, I had a successful virtual binding experiment that raised a bunch of new questions about the method, but... it worked. Virtualized binding of functions inside objects without making copies of those functions.
I was actually a bit shocked it worked first try.
But that's when I realized I needed a new name for the subset of virtualized binding that accomplished, I called it "derived binding"
@rgchris I don't know how you feel about ELSE and THEN or if you've used them, but to me it feels like having a bit of brainwashing taken off. EITHER has its applications for certain situations of precedence you want to do without parenthesization, but in 99% of what I'm writing, I don't care for EITHER and I'm happy to not be forced to use it.
 
I'm ok with having the choice. Might take a bit to come around on that one.
 
I feel these other ideas, like OF... or getting out of the trap of == and !== (both ugly and confusing to C programmers) and getting back to = is equal?, these are big things.
 
Responded to your forum post with EACH.
 
2:34 AM
@rgchris @johnk suggested that, too Looks pretty good, though if it's another example of namespacing (pick enumerating functions out of the list registered with EACH) then it's maybe not as "interesting" to me as if EACH [...] generated some kind of entity getting passed to FOR or MAP, or something. But that doesn't make it bad.
 
@HostileFork Great minds, etc. (although he didn't suggest COLLECT :P)
 
Back in the day I was trying things like for x [1 to 10] [...] vs. for x [1 thru 10] [...], and that was built on the idea that you could say g: generates [1 to 10] and get a function, then call print g print g print g and get 1 2 3 out of that.
 
Wikipedia is always useful in these discussions ...
"In most ALGOL-like languages conversion and casting are distinctly different concepts. In these languages, conversion refers to either implicitly or explicitly changing a value from one data type storage format to another. The storage needs may change as a result of the conversion, including a possible loss of precision or truncation. The word cast, on the other hand, refers to explicitly changing the interpretation of the bit pattern representing a value..."
 
Yup. We've been calling cast "AS"
But maybe CAST can be prefix AS.
 
/me disappears to read up about AS
 
2:40 AM
@johnk block: copy [a b c] | group: as group! block | append group 'd | probe block => [a b c d]
@johnk I wondered if there was something inherently bad about the same underlying data leaking out as different types, and had once raised an issue over it, but I decided it's a feature and not a bug. Red has too (independently added AS mechanics, just the same as I had)
@rgchris I realized that if you alias a writable STRING! via AS into a BINARY!, it could just be checked for legitimate UTF-8 modifications. If the underlying series carries a bit that says "I'm UTF-8" then just don't allow any modifications via binary to make it invalid.
That's not rocket science. Actually implementing UTF-8 everywhere is... well, it's huuuuge. (but very big steps have been taken, and it's looking promising)
@rgchris In other news, another meaning of OF I'd been trying out was to make copying versions of things that mutated by default. So instead of join copy block stuff you could say join-of block stuff. I don't feel that goes with the theme anymore. I know you don't like join+ block stuff. So it makes one wonder if sticking with the basics and writing join copy block stuff isn't so bad.
The only misgiving I have is that these operations can usually be done in a more optimal way if they know you're copying the first element, e.g. join-copy block stuff can make decisions more efficiently than join copy block stuff can.
But join-copy is fairly hideous. I dunno. joined block stuff?
 
@HostileFork premature optimisation. When we write the jit we can fix it :-)
 
2:56 AM
@johnk Even without JIT is actually possible (not necessarily the best idea) for JOIN to lookahead for copy and act differently if it sees it there.
e.g. if it sees COPY and if copy looks up to the :COPY native it thinks it knows, act different.
I remember seeing this video quite a while ago, when such things were not everyday PC ability:
 
Programming languages are primarily intended for humans to read and understand so we have to optimise from them over the machine
 
@johnk Yup, but the goal here is really about sticking really low to the metal, "giving a magical experience but not invoking magic".
I want it to be byte-conscious, interpreter-clock-cycle-conscious, and expressivity-conscious all at once.
On the "is join copy block stuff so bad" idea, I very much think of Rebol's DO as a kind of modern assembly language. It's supposed to keep your feet on the ground about what you're doing. Even if you can make join-copy more efficient than join copy, you aren't going to get an order of magnitude improvement. It may be that the COPY being prominent makes you think more about what you're doing and what it costs.
(I will point out for Rebol2'ers that Ren-C's "JOIN" is actually "REPEND"-like, taking the name as a mutate-by-default operation)
 
3:28 AM
Oh, another word. was. Hmm. x: 10 | x: 20 | if x was 10 [print "Maybe some sort of weird debugging feature?"]
 
 
14 hours later…
5:52 PM
posted on November 29, 2017 by @hostilefork Brian Dickens

@hostilefork wrote: Infix isn't common in languages Rebol would typically be compared with (maybe Haskell, but I'm the only person who would probably see any parallels between Rebol and Haskell). I've defended the broader notion of "enfix" (which permits postfix, as well as choosing to fall back as prefix, or behaving variadically with multiple right h

 
6:35 PM
@MarkI As far as I can tell, wchar_t is DOA. No one cares about it. Even in unixODBC they simulate UCS-2. I propose no API support for wchar_t, just UTF8 and unsigned 16-bit int UTF16. It's good enough for Windows, and then anyone on Linux with some non-standard wchar_t size is on their own.
This iODBC is the first I've heard of anyone actually trying to use variant size wchar_t
 
6:51 PM
17
A: Why was wchar_t invented?

Aaron DigullaSee Wikipedia. Basically, it's a portable type for "text" in the current locale (with umlauts). It predates Unicode and doesn't solve many problems, so today, it mostly exists for backward compatibility. Don't use it unless you have to.

 
@HostileFork Yah, wchar_t is horrible, broken, and outdated. I have luckily been able to get away with not ever using it.
 
@MarkI It seems to me that it should be the responsibility of reference sites, e.g. cppreference, to say "this sucks" don't use it, but I guess if they got into editorializing instead of just being facts-based that's a slippery slope.
Question I have is if the APIs should end in W anyway, just for brevity. rebStringW() vs. rebStringUTF16()
If unixodbc still uses SQLWCHAR, then a "wide character" can mean what you pick it to mean.
But I do like being specific, when one can be.
 
@HostileFork I'd prefer unique, preferably bizarre, names for 8-byte and 16-byte strings ... how about rebunits() and rebtwins()? I'm actually only half-joking here, believe it or not!
 
7:07 PM
Anyone who participates in Rebol believing something wacky is probably not going to surprise me. :-)
 
Of course, saner heads must prevail in the C space.
 
I consider the attempts to bow to pre-C99 a bit of an intellectual exercise at this point, it really is a bit nuts to still be trying to code in a pre-<stdint> time
But I want the time-traveling artifact. I need it for a parallel universe.
I even still kind of want to build a DOS Ren-C. Probably an easier project than Amiga. I mentioned Zach Barth did a port of a game to DOS. His kickstarter goal was $200, and he got $4k.
 
8:10 PM
Interesting to read through some old Rebol 3 development blogs. Carl asks specifically about the "unset" assignments and says:
The original reason was to prevent accidents like:
name: age: date: city: print something

But, in retrospect, such a "catch" is not really that beneficial.
@MarkI ^-- And hey, there you are, posting at 4am.
 

« first day (2586 days earlier)      last day (1194 days later) »