« first day (3545 days earlier)      last day (235 days later) » 

1:00 AM
@rgchris Pursuant to what we seem to agree on, this moves to SET, SET-WORD! and SET-PATH! accepting all values including NULL and VOID!, with the expectation that you pre-filter. A trivial NON implementation gives NON NULL, NON VOID!, NON INTEGER! etc. to fill in for basic negative checking: github.com/metaeducation/ren-c/commit/…
This means SET takes the place of the former "SET*" specialization which tried to gloss over the naming of the /ANY or /OPT refinement. It just doesn't have a refinement now.
On the side of GET, it now errors on VOID! and uses the historical name for the refinement /ANY to get a VOID!...with the notion that makes some sense because it will now get ANY-VALUE!.
To make this any good, though, it also needs the patch that uninitialized variables (including typos) are VOID!, not NULL. That has been the case in Ren-C ever since the dawn of not-erroring-on-NULL-WORD! fetch, else typos could not be caught.
So I will go dig that change up now.
 
1:46 AM
I just made a mistake which maybe makes an argument against what I had said about voided? 'some-var being better than undefined? 'some-var... it's maybe too easy to mix up with void? 'some-var. :-( I just made the mistake, and I know what I'm doing.
I've been going with unset? 'some-var being the test for NULL, not nulled? 'some-var.
It seems it could go either way, so anyone with an opinion should say something.
 
 
2 hours later…
3:37 AM
@rgchris Okay I've patched in a bit of the other part, which is that "undefined" variables (e.g. typos and locals) are VOID! instead of NULL in R3C now. So they error as appropriate. Note that to make things a bit clearer it gets rid of UNSET since you can just say x: void or x: null depending on what you meant.
 
posted on July 15, 2020 by @hostilefork Brian Dickens

@hostilefork wrote: The following is the behavior of Rebol2 when a GET-WORD! is used on an "UNSET!" value: rebol2>> unset 'x rebol2>> type? :x ** Script Error: x has no value So you would have to fall back on GET/ANY to really get a VOID! rebol2>> type? get/any 'x == unset! But Red and R3-Alpha decided to be more lenient in this res

 
 
10 hours later…
1:26 PM
@HostileForksaysdonttrustSE I do wonder if there'd be a way to override this, for example—OF could be allowed to reflect on VOID values as more likely than not, you're going to catch a typo if you get a result you don't expect. type of :thing is common enough and more awkward when expressed as type of get/any 'thing.
That might be overloading the function spec, not sure.
 
2:13 PM
Statusupdate on my website database. This is a MariaDB database and there is the mySQL driver available. (If it were an Oracle MySQL then there was a possibility that could also be equipped with an ODBC driver) But as it is no Wondiws, ODBC is not available.
So if I want to use the database using my REN-C I would need to either communicate my queries to anotgher script language and get the results back from them, or use a REN-C native mySQL driver.
I think I saw the Perl DBI code for their driver somewhere, so drawing board, here I come again.
 
2:35 PM
How compatible is the MariaDB TCP API to MySQL?
 
2:49 PM
@iArnold You could also switch to the $5/mo DigitalOcean plan and have an ssh login to do whatever experiments you want. You can also push a button and make backup snapshots (though these can wind up costing you a few cents extra) but this way you can freeze points in time and tinker with installing software and get yourself out of jams if it doesn't go well.
You can make a local virtual machine at the same linux version and tinker there, then whatever you do on the local machine that you like you can mirror on the server.
 
@rgchris Pretty much compatible, the PHP and Perl both use the MySQL driver provided/installed.
@HostileForksaysdonttrustSE That is no fun (and costs money besides that). Should be standard possible
 
@iArnold There is Shixin's driver which would require a wee bit of tweaking. Am looking at my reworked QM version to see if it's trivial to port (I use MySQL a fair bit, so worth the effort).
@HostileForksaysdonttrustSE Can you use FAIL to raise a named error (i.e. one in SYSTEM/CATALOG/ERRORS)?
Answer—no, but I think I'll write a module-specific one.
 
3:18 PM
@rgchris FAIL is usermode code. I have been soliciting designs for being able to express error IDs. some dicussion here about that. I would rather progress be made on this front, and it's one of the reason why so much is being expressed in usermode--it's to make it easy to prototype and innovate in dialects.
@rgchris Be mindful of advancements on the master branch, e.g. master's FAIL
If you are in a function func [x] [if whatever [fail 'x]] the error will implicate the callsite, so you won't see the "if" in the failing stack.
You can optionally add a message to that, e.g. if there's no quoted word immediately after the FAIL it will assume the next thing is the text or block to report. As above, that may be left blank. Both may be if you just say [... fail] or (... fail) then it just is a generic failure.
 
4:24 PM
In Rebol 2, 63 and 1345345280 => 53. How do you get the same result in Ren-C?
 
@rgchris The mathematical operators were set as AND+, OR+, XOR+. This is still something which is open to debate.
 
I get 0 from and+
 
I have proposed a dialect called "bitwise" which would be smarter than that.
1345345280 => 0b1010000001100000101011100000000
        63 => 0b0000000000000000000000000111111
@rgchris Rebol2 is smoking crack.
Red says 0.
 
Wait, I think I missed something here...
I copied the wrong number there. Sigh.....
This is why:
nr: 1345345333x1
== 1.34534528e9x1

>> nr/x
== 1345345280.0
I guess pairs can't really be used for this type of thing.
 
4:41 PM
@rgchris Hm, R3-Alpha gave back DECIMAL! always. But I thought Ren-C is supposed to be preserving; if you put in an integer you should get an integer out. It actually remembers.
Or maybe I just made it remember but give back DECIMAL! anyway because I didn't feel like changing the tests.
If you want INTEGER!-in, INTEGER!-out, that is possible in Ren-C.
PAIR! is an actual pairing of values, like a very optimized two-element BLOCK!.
This was done for several reasons, one of which is I didn't want yet-another-granularity-of-DECIMAL! for the compact float form packed in a PAIR! cell.
As well as yet-another-granularity-of-INTEGER!, because you couldn't fit 64-bit (or in the future arbitrary precision) in the PAIR! cell. I came up with a different optimization that avoided the introduction of a new spectrum of precision and range.
It wasn't a priority for me. But if you will fix the tests I will change it.
Mechanically, a PAIR! can store any two values compactly. Interface-wise it only exposes INTEGER! and DECIMAL! at this time. And apparently extraction converts stored integers to DECIMAL! to be backward compatible (with R3-alpha test), but it does not have to do that.
 
Might be worth it, there are some conveniences to operating with pairs.
 
5:03 PM
Ok, need to figure out what's going on here:
rebol2> 1345345333x1 * 256x1 => 811021568x1
Ah, truncated to four bytes.
 
of: enfixed func [
    :property [word!]
    :look [<...> <opt> any-value!]
    value [<...> <opt> any-value!]
][
    reflect either void? get/any try match [word! path!] first look [
        take look
        void
    ][
        take value
    ] property
]
>> type of asdfasdf
== #[datatype! void!]

>> type of first [<a> #b {c}]
== #[datatype! tag!]
@rgchris Proof what you ask for is technically possible, but it shows some of the mechanical weirdness involved.
Basically if you want TYPE to generally evaluate full expressions normally, you are going on a heuristic that says that if the word that follows looks up to VOID! then you want a void answer, otherwise you want to do an evaluation step and ask about the property of that.
Here you get back to your loss of a typo safety net. type of firrst [<a> #b {c}] wouldn't cause an error when you probably meant it to.
You may only use FIRST on hard-quoted variadics, so you have to have two variadic "taps" on the feed.
I think the variadics are good for showing you the rules that the evaluator has internallly for itself.
Anyway, I like offering such power. I also am pretty proud of the chaining stuff, how TRY turns the NULL result out of match into a BLANK!, which then gives a BLANK! to GET which it knows means "blank in null out"...
(You probably have to say ENFIX instead of ENFIXED in R3C)
 
6:02 PM
This seems to work. Is there a more efficient method?
shift-32: func [value [integer!] bits [integer!]][
    debin [be +/- 4] enbin [be + 4] (shift/logical value bits) and+ 4294967295
]
 
@rgchris If that's what you want precisely, probably not.
 
I think so.
 
As with most things, it could be optimally written in C if you want it and it's super important to do a lot.
If it's done only occasionally, that seems fine.
I was suggesting this "bitwise" dialect be very crafty about such things, but never made it.
I think ENBIN and DEBIN are a tremendous leg up over what was there before.
 
Certainly a leg-up on obscure hidden features of the Rebol 2 PAIR! type...
 
6:23 PM
>> p: make pair! [2.5 7]
== 2.5x7

>> p/1
== 2.5

>> type of p/1
== decimal!

>> type of p/2
== integer!

>> p + 5
== 7.5x12

>> p * 10
== 25.0x70

>> p + 5x5
== 7.5x9.5
@rgchris I've hacked up a little bit of pair genericness, I will let you test it and be the program manager for it, as well as to rewrite the tests in your own image.
What this does is takes advantage of the PAIR!s reuse of INTEGER! and DECIMAL! types to then say that the behavior of a pair inherits from those types.
A 2-arity arithmetic function will just act as the memberwise additions if you use a PAIR! on a PAIR!. If you use an arity-2 function with a non-pair, it will combine each pair member with that non-paired thing. e.g. p + 5 acts as p + 5x5, but p + 7x10 will add 7 to the first pair member and 10 to the second.
Anyway, the whole benefit here is just not inventing a whole new type of number and having a parallel math subsystem based on being a scrooge and storing two floats in one cell.
But not being as inefficient as a 2-element block; it's a single node trick, covered in my talk I believe.
 
6:58 PM
@rgchris pair changes for you to test and contemplate.
 
7:24 PM
Small bug in the p + 5x5 above, I'm fixing it...
@rgchris Another open question is if PAIR!s are immutable or not. Because they point indirectly at a series node, the option exits to make it so that p/1: 10 will change that pair's X, and other references would see it. And you can choose to lock them or const them or not. This would make them like very efficient two element blocks. That's one direction. We could also say that they are immutable.
 
7:46 PM
@HostileForksaysdonttrustSE I'll have a go...
Any reason why the following aren't equivalent? -- (be gentle, my brain is almost fried today):
2147483647 and+ debin [be + 4] enbin [be +/- 4] value
either negative? value [value + 2147483647][value]
Holds for positive numbers and zero, but negative numbers are one off.
 
 
1 hour later…
9:15 PM
@rgchris If I knew it would work for R3-Alpha, then I would do the translation to REN-C. Brian mentioned difference in sync and async ports that would make R2 version port impossible.
Being able to use MySQL will be a big win.
 
@iArnold I haven't tested it, maybe worth a try...
@iArnold I'm not sure why it'd be impossible? (but try the R3-Alpha version first)
 
10:07 PM
@rgchris are you trying to make 31-bit signed integers (?)
 
I guess. I'm converting some uncommented code.
 
Well, that makes -1 into 7FFFFFFE, which would be the largest-valued output for a negative input it makes. So it looks like you're staying in 31-bit range.
You can do that more easily by zeroing the 32nd bit of a 32-bit enbin of a signed integer.
Which is what you are trying to do but aren't.
Let me think why not.
Hm, no it's actually a 31-bit signed integer minus one if negative.
@rgchris Well the mechanics of what that is, is "if the number is positive, return it, otherwise return it minus one. clip the result at 31 bits"
This is, again, the kind of thing I envisioned bitwise dialect doing so you didn't have to write C to get it efficient.
AND doesn't implement subtraction (or addition) on its own, so you'll need to say 2147483647 and+ debin [be + 4] enbin [be +/- 4] either positive? value [value] [value - 1].
If I saw the context I'd probably be able to tell you why they're doing it.
 
11:04 PM
posted on July 15, 2020 by @hostilefork Brian Dickens

@hostilefork wrote: With the creation of ENBIN and DEBIN, I think I showed off how a Rebol approach of dialecting could truly make something easy that's painful in other languages (and a historical pain point in Rebol too, with how people had to wrestle with TO INTEGER! and TO BINARY! conversions). Under the buzzword BITWISE I've had the notion that a l

 
11:30 PM
@HostileForksaysdonttrustSE Here's the context.
I've looked at other implementations in other languages and there's no fudging with this.
 
@rgchris None of the implementations are commented? :-/
 
Here's GO.
Here's a working version (R3C).
 
@rgchris Well, it's cryptography, so I take it back. Don't really know what the "negative minus one" logic would be good for.
 
It's this bit that doesn't make sense—why does it need that int-64 int-32 two-step?
(doesn't work without it)
 
11:46 PM
@rgchris Well it wants minus one if it's negative. It could have been a typo in the original... they thought they were doing a 31-bit negative encoding by adding it but used the wrong constant, and it just got canonized.
If this is a standard encryption and DocKimbel's code encrypts/decrypts code inserted by non-Rebol installations correctly, then maybe an error in MySQL's code. If his is incompatible with theirs, then he may have picked the wrong constant.
I just looks like a mistake to me.
Off by one error are not uncommon.
 
I'm starting to have my doubts now—I thought Doc's was known to work.
do gist.githubusercontent.com/rgchris/…
pass: to binary! "a-password" seed: to binary! "£12345678abcdef"
probe crypt-v10 pass seed
probe crypt-v10-bad pass seed
Frankly it's hard to tell because it's used for older implementations of MySQL which has since moved on to SHA1 and SHA256.
 

« first day (3545 days earlier)      last day (235 days later) »