Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 01 2018 17:34
    @greggirwin banned @BIjeuca_twitter
  • Dec 03 2017 05:53
    @PeterWAWood banned @matrixbot
  • Sep 28 2016 12:20
    @PeterWAWood banned @TimeSeriesLord
gltewalt (The other Greg)
@gltewalt:matrix.org
[m]
@Oldes: the REBOL results on binary are what I expected
Gregg Irwin
@greggirwin

To be clear, @dockimbel said that PR was premature. Lots of good comments in the tickets. It seems reasonable, but does have some open questions.

Since there are a number of easy ways to do it at the mezz level, and performance is not likely an issue if we're talking about display, this doesn't seem like a pressing issue. Remember, this is a lossy operation we're talking about, so it's not useful for data interchange, where performance might matter.

Oldes Huhuman
@Oldes
I think that there is equality that with more closed pull request with reason like prematurity, the higher chance there is, that the person will not try any pull request anymore.
And if there is a question, which repeats so often like this one, it deserves some response.
Oldes Huhuman
@Oldes
And I must repeat, that I consider just one proper way to do it now in Red.. the solutions which does not use enbase should not be counted.
Oldes Huhuman
@Oldes
@greggirwin what are the open questions? I think that if there is mold and form producing same result and people are repeatedly trying to get own solution to have form output, than there is no question to me.
Gregg Irwin
@greggirwin

I think that there is equality that with more closed pull request with reason like prematurity, the higher chance there is, that the person will not try any pull request anymore.

Agreed, 100%. This is something that makes open source work, or teamwork of any kind, challenging. It's like the old humorous saying "Be open minded, but not so open minded that your brains fall out." Deciding what to accept and what to reject is not a simple binary question.

Let's find the best place, wiki page or red-by-example, for FAQs like this, and make sure enbase is the answer there.

Open questions are things like what @meijeru notes in #3133 and newline issues. Next up would be this one:

>> system/options/binary-base: 64
== 64
>> form #{616D73}
== "64#{YW1z}"

Red doesn't work like R2 (above) yet, but should it? If so, does 64#{YW1z} become YW1z when formed? Now we have global state involved, as we discussed with codec options, where PitL becomes much more treacherous. Some lib changes system/options/binary-base and suddenly form produces different results behind your back.

I think that if there is mold and form producing same result and people are repeatedly trying to get own solution to have form output, than there is no question to me.

I'd like to see why people want this form. What are the use cases? Do we know that?

Oldes Huhuman
@Oldes
>> system/options/binary-base: 64 print ["MD5 is" res: checksum data 'md5 "(" mold res ")"]
MD5 is D41D8CD98F00B204E9800998ECF8427E ( 64#{1B2M2Y8AsgTpgAmY7PhCfg==} )
I thought that this question was resolved... base64 is not for humans.
And I made result on one line only. As it is not practical to have it multiline.
Gregg Irwin
@greggirwin

base64 is not for humans.

Neither is base-16. :^)

Agreed on base-64. It's a workaround for binary transmission.

Greg T
@gltewalt
What I expected, as a reader, was for form to present #{616D73} as 616D73, like rebol.
However... "#{}" are valid characters in a string. Without form doing any extra work, the Red result is technically correct, right?
Maybe it should be the concern of the conceptual "presentation layer". format, print, etc
Since what he wanted was a typical string representation, and wasn't concerned with transforming the type
Gregg Irwin
@greggirwin

R2:

>> form #{616D73}
== "#{616D73}"

R3:

>> form #{616D73}
== "#{616D73}"

Formed values are determined on a type by type basis, as to what is best. We could make hard and fast rules, but that would produce more technically consistent, but perhaps less useful results. When form says "user-friendly string representation" it's a softer, more flexible rule than mold.

Here's the question I asked:

I'd like to see why people want this form. What are the use cases?

Start there.

gltewalt (The other Greg)
@gltewalt:matrix.org
[m]
Oldes output
>> mold #{3132}
== "#{3132}"

>> form #{3132}
== "3132"

>> to string! #{3132}
== "12"
Gregg Irwin
@greggirwin
We all need to be clear, unfortunately, about which "rebol" does what. :^\
gltewalt (The other Greg)
@gltewalt:matrix.org
[m]
Use case is that a consumer doesn't care that about our particular lexical identifiers. That is, #{ } means nothing to them. They expect to see 616D73
Presenting data for outsiders
As we know, we can make it so, with mezzanic incantations
Gregg Irwin
@greggirwin
Let me clarify: Concrete use cases. Who has used this in an actual app?
gltewalt (The other Greg)
@gltewalt:matrix.org
[m]
I haven't ran into it.. maybe ask @ams02468
I can see why it cones up periodically, though
Gregg Irwin
@greggirwin
I found one place I used it , generating v4 UUIDs. enbase/base occurs in a lot of old R2 code, not always base 16. Without digging in, the use case that jumps out at me is emitting data, because other formats, like XML or JSON, may want values as hex strings, and the return value of checksum is a key partner there. But that's not really where form is best applied, since it's for data interchange.
Oldes Huhuman
@Oldes
@greggirwin I can find many examples in my years old code.. like this or that... and many more.
ne1uno
@ne1uno
html hex colors, though names are nicer you still need RGB
can also be tuple, not specifically binary
why to-string #{..}renders aschII? is it utf8 also?
Oldes Huhuman
@Oldes

here I would now use:

md5: form checksum skip inBuffer 2 'md5

instead of:

md5: enbase/base checksum/method skip inBuffer 2 'md5 16
ne1uno
@ne1uno
seems like form could go either string or hex. need at least 2 forms
Gregg Irwin
@greggirwin

@Oldes, I think we're seeing the same patterns.

@ne1uno where are hex colors used as binary! in Red? e.g. pixels in images are tuples.

My suggestion is to look at to-hex and see if it can be extended (I wish it were a mezz, for easier playing). It's used in the Red codebase is in the JSON emitter, for \u chars, but a dozen places or so in %.r support files in the core. It returns an issue, as R2 did, but bear in mind that they were a string type in R2 and a word type in Red. @ne1uno already noted that it's an alternative approach to enbase.

Format will likely have hex output support, as a side note.

For now, I'd wrap enbase, though we have a number of places "hex" is used in a name, but for different purposes. form-as-hex could be a name to use as a playground.

Oldes Huhuman
@Oldes
I wonder why there must be so many words about it.. as I said.. if there is mold and form producing same result, why not to have form produce something different and reduce the required code? Never mind.. time to read some book and sleep ;-)
I introduced this change in my Rebol fork 2 years ago, and I was not hit with any side effect. I can just enjoy the result, because when I trace some binary values, I really don't have to see them decorated with #{ and }.
Oldes Huhuman
@Oldes
And as I review quickly some code.. I should remove many mold calls... bad habit from R2 days... because:
Time               | Evals  | S.made | S.expa | Memory      | Code
1.0x (1μs)         | 2      | 2      | 0      | 80          | [append "" #{CAFE}]
1.5x (2μs)         | 3      | 2      | 0      | 80          | [append "" mold #{CAFE}]
LP Olivier
@olivier_lp_twitter
Hi, Ive discovered Red a few years ago, as the rebol next generation. I came a a few time ago and trying to get compilation option. I try to understand why sometimes the release mode has to be done because -c option fails. And the no-runtime option I really dont get it
hiiamboris
@hiiamboris
I can't say what --no-runtime is used for, maybe testing the compiler. Never used it.
-c may fail for numerous reasons, depends on your code
most importantly, when libRedRT lacks some runtime exports your script might use
zentrog
@zentrog:matrix.org
[m]
—no-runtime is probably useful if you have only Red/System code and want the smallest possible executable size
hiiamboris
@hiiamboris
in that case you can just declare Red/System header
zentrog
@zentrog:matrix.org
[m]
Oh, that has the same effect?
hiiamboris
@hiiamboris
runtime is only included into Red scripts
zentrog
@zentrog:matrix.org
[m]
I seem to remember reading that there is a way to call Red functions from Red/System. So does that mean there is also a way to tell the compiler to include the runtime?
hiiamboris
@hiiamboris
You just start with 'Red' and then go down to '#system'.
ams0_0
@ams02468
hi guys how can hide text in field?
ne1uno
@ne1uno
password?
Gregg Irwin
@greggirwin
password, e.g. view [field password]
ams0_0
@ams02468
This is a good method, but is not it a way that does not even show the number of characters?
Inside the cli, I matched the background color with the color of the words