Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 23 00:49

    qtxie on master

    FIX: avoid warning when using r… (compare)

  • Sep 22 12:33
    hiiamboris commented #3396
  • Sep 22 12:29
    hiiamboris commented #3396
  • Sep 22 12:27
    hiiamboris commented #3396
  • Sep 22 12:17
    dockimbel labeled #4041
  • Sep 22 12:17
    dockimbel commented #4041
  • Sep 22 12:04
    dockimbel commented #3396
  • Sep 22 07:26

    qtxie on master

    FIX: check the return from mall… (compare)

  • Sep 22 02:05

    qtxie on master

    Revert "FIX: simple fix `reques… (compare)

  • Sep 21 17:54
    greggirwin commented #4924
  • Sep 21 03:15
    qtxie commented #4617
  • Sep 21 02:40
    qtxie commented #4617
  • Sep 21 02:38
    qtxie commented #4617
  • Sep 21 02:35
    qtxie commented #4617
  • Sep 20 20:07
    dockimbel closed #4969
  • Sep 20 20:07
    dockimbel labeled #4969
  • Sep 20 20:07
    dockimbel labeled #4969
  • Sep 20 20:07
    dockimbel labeled #4969
  • Sep 20 20:05
    dockimbel milestoned #4969
  • Sep 20 20:05

    dockimbel on master

    FIX: issue #4969 (Copy of error… (compare)

Qingtian
@qtxie

btw - how could GUI benefit from a subpixel accuracy?

One example is the caret in the gui-console. The position is not accurate for now. When you press Enter key many times in the gui-console, you'll notice it.

hiiamboris
@hiiamboris
Yes, think also of draw used with scale. Think of the points expressed in red/REP#34. Think of the red/red#3336 problem (computing the text size).
Boleslav Březovský
@rebolek
Custom GUI styles would benefit from it. I've got code in Rebol that is point!less (haha) to port to Red without floating pair!.
Petr Krenzelok
@pekr
Thanks for the answers re the subpixel accuracy usefulness. As for the name point!all the way ....
Toomas Vooglaid
@toomasv

@pekr Here is an example of subpixel accuracy importance. (You'll need also dftc.red and coffee).

If you run the file and stop the animation (by clicking on it) and then zoom into (wheel) then you might find the end-point of all the blue lines and see that orange line is drawn actually in a bit different place than the end-point of blue vectors. Blue ones are placed with sub-pixel accuracy, but orange line with pair!, i.e. pixel accuracy. (You can move the pic with mid-down dragging, ctrl-wheel to change rate).

Also, smallest circles are mis-sized and misplaced because there seems to be a lower limit on circle radius :)

Nenad Rakocevic
@dockimbel
@hiiamboris The comma syntactic treatment is a decade-long discussion about keeping or dropping comma as decimal separator. Maybe it's time to revisit it. Though it's a pandora box, the resulting discussions usually have low signal/noise ratio, as many people tend to express their personal opinions instead of giving factual arguments.
hiiamboris
@hiiamboris
I've two arguments:
  • better worst-case readability: 1.0,2.0 vs 1.0x2.0
  • we get shorter syntax variant for free: 1,2 vs 1.0x2.0
Nenad Rakocevic
@dockimbel
I see three main arguments for dropping the decimal comma:
  1. Demography: when taking the top 30 countries ranked by population, the ones using decimal point add up to ~4.5B, while the decimal comma ones add up to ~1.2B.
  2. Inconsistency in human-friendliness goal: comma is used by many in financial and scientific communities as digits grouping symbol. So why would we be more human-friendly by accepting 1,234 rather than 1,000,000? Moreover, why should we insist on localizing the decimal separator, if we don't localize everything else?
  3. Pretty much all the mainstream PL are standardizing on decimal point, freeing the comma for other literal forms.
@hiiamboris I agree.
R cqls
@rcqls
As a French mathematician, I never use comma as decimal (as we should do) since it is incoherent with list of numbers as in the example given by @hiiamboris 1,2 or 1.0,2.0.
Nenad Rakocevic
@dockimbel
@rcqls As a French too, I always use a comma when hand-writing, but a point for decimals when typing on a keyboard.
R cqls
@rcqls
@dockimbel That’s funny!
Jean-François CAUCHE
@jeffakakaneda_twitter
Hello ! I'm from France, former user of Rebol for my PhD in medieval history. I was really happy to discover Red. I'm using it actually for personal uses as I don't really work in the computer science field but always passionate and I'm teaching code and art to kids (and big kids too ;-) ) in schools and museums during workshops. I plan to use Red in my activity in order to make them discover this language and all its capacities. I join this room in order to meet people and discover more about Red.
hiiamboris
@hiiamboris
Hello and welcome, @jeffakakaneda_twitter :)
If you're more familiar with Rebol than Red yet, https://github.com/red/red/wiki/[DOC]-Differences-between-Red-and-Rebol page may be of help to you.
https://gitter.im/red/help is a place where we will help you learn Red :)
Jean-François CAUCHE
@jeffakakaneda_twitter
Thanks ! I wonder if there will be some Red users or a Red event at FOSDEM in Brussels in february.
Oldes Huhuman
@Oldes
What is advantage of having pair! 1x1 and point! 1.0x1.0?
Boleslav Březovský
@rebolek
speed?
Oldes Huhuman
@Oldes
Have you counted the difference? I don't think there will be significant difference, but it will definitely complicate things elsewhere.
Boleslav Březovský
@rebolek

so it's math.

As using floats for pairs is not always desirable (because of side-effects in float handlings), we are considering keeping the pair! as is, and introducing a new similar 2D type, but relying on floats.

Oldes Huhuman
@Oldes
I mean... what is wrong with having pair! based on float32 as it is in Rebol3?
When I read this, than only that No bitwise operations. (and, or, xor), which I never used.
Having float pair when dealing with images is a good thing imho.
So my opinion is, that it is definitely good to have float pair, but not two very similar types, which differ only in internal implementation.
Btw... I would like to have more dimensional points as a datatype.
Boleslav Březovský
@rebolek
@Oldes that's like saying we don't need integer! because we have float!
nedzadarek
@nedzadarek
@rebolek @Oldes it depends on the implementation of a floating numbers. According to stackoverflow answer the Lua used "floats" as it's number representation. I read that they didn't have "big problems" with "float handlings" nor speed.
As fair I remember DEC64 (implemented by @hiiamboris but I couldn't find the link) does not have that problems.

The number type represents real (double-precision floating-point) numbers. Lua has no integer type, as it does not need it. There is a widespread misconception about floating-point arithmetic errors and some people fear that even a simple increment can go weird with floating-point numbers. The fact is that, when you use a double to represent an integer, there is no rounding error at all (unless the number is greater than 100,000,000,000,000). Specifically, a Lua number can represent any long integer without rounding problems. Moreover, most modern CPUs do floating-point arithmetic as fast as (or even faster than) integer arithmetic.

Source

Petr Krenzelok
@pekr
In Czech locale, comma is used as a decimal separator too. But - I do hate it. Using it for a thousands separator looks even mor weird though. MS allowing locales and translation of function names in Excel was imo one of the worst decisions ever.
My question though is, what would we gain be freeing comma? Do you really want to see something like 1.2,1.1 instead of 1.2x1.1? I also fear that freeing comma will attract ppl to use it in arrays or vectors :-)
Galen Ivanov
@GalenIvanov
@pekr Yes, as concat/append in APL/J/K
Alvydas Vitkauskas
@avitkauskas
Supporting comma as decimal separator is really not needed and it is inconsistent in a way. When writting code you are actually writting in English (all the keywords are English anyway), so it's just normal to use "English locale". Should comma be used somewhere else and where - it's another question.
GiuseppeChillemi
@GiuseppeChillemi
point! ? What about matrix! ?
nedzadarek
@nedzadarek
@avitkauskas you can translate keywords (there were the post in the website) but if you want to share your code - yes, you should use English.
Gregg Irwin
@greggirwin

@dockimbel agreed on your points, er, comments. I believe you proposed point! as the name initially, which I thought was fine, but coordinate! is much more specific and perhaps better, even if longer. Other domain uses of point may not be common, but there can really be no confusion about coordinate!

Did your original syntax proposal use parens around the numbers? e.g. (1.0, 2.0, 3.0) My gut instinct prefers that over a non-spaced comma connector sigil. It's also a direct mapping of mathematical notation.

I'm in the U.S., so can't have an unbiased perspective on commas. I think the original intent was good on Carl's part, but I don't know that it has been a practical benefit.

Vladimir Vasilyev
@9214
  • pair! with float32! - I always thought that pair! will be casted to float! when one of its components overflows, the way it does with integer! and float!, and that float-based pair will be created with <float>x<float>; point! with optional 3rd component makes sense, and common notation for that is (x, y, z). But I'd prefer pair! and point! to be merged together, if possible, as it's just an implementation detail and discrete vs. continuous difference, which IMO shouldn't be user-facing.
  • as for discussion about comma support in floats - some data is kept that way (esp. in DSV/CSV tables), so it might make sense to keep them as loadable lexical forms (this parallels recent discussion about JSON codec and messy external data); there's no substantial gain from ditching it... but then it makes (x, y, z) point! literal form a bit ambiguous.
Respectech
@Respectech
@jeffakakaneda_twitter I'm hoping to go to FOSDEM, so if I can make it there should at least be one other. :-)
Jean-François CAUCHE
@jeffakakaneda_twitter
@Respectech Great ! I generally spend the whole weekend there.
Vladimir Vasilyev
@9214
(Continuing) another thing to consider is how to support point! in VID, Draw and View, and how to interpret its 3rd component (we're talking about 2D interfaces and images here). I also recall some ad-hoc point! struct being used in Parse, to track internal state.
hiiamboris
@hiiamboris
If we accept the (x, y, z) form, I suppose , becomes a word delimiter (like brackets), then both (x,y,z) and (x , y , z) are also valid? How will this form live along the paren! and compose is what I'm concerned with. Will comma become as sort of a composition operator that concatenates numbers into a point!? May then words and expressions be used instead of numbers in place of x y and z?
Vladimir Vasilyev
@9214

Will comma become as sort of a composition operator that concatenates numbers into a point!?

In such case parens are not strictly required and we end up with

  • value that has no direct lexical form (like e.g. object! or function!) and require evaluation to be created
  • esoteric concatenation operator (or point! constructor?) on the level of APL family, which is limited solely to point! values

May then words and expressions be used instead of numbers in place of x y and z?

That's a more general question WRT support of symbols in aggregate values, e.g. use r.g.b in tuple! or quantity% in percent! (BTW, does axb pair! smells fishy to you?).

Vladimir Vasilyev
@9214
Though, all examples are :fish:y: r.g.b is a valid word!, and in quantity% % receives a special lexical treatment.
>> type? 'r.g.b
== word!
>> [quantity%]
== [quantity %]
nedzadarek
@nedzadarek
Is it some kind of "reduced functions" enough:
r: g: b: 123 
tuple>: func [arr] [to-tuple reduce arr]
tuple> [r g b] ; == 123.123.123
?
Dave Andersen
@dander
Is there any relationship with the proposed point! type(s) and vector!? Is vector! more akin to a sequence type?
Vladimir Vasilyev
@9214
@dander what do you mean by "sequence type"? vector! is homogeneous (can keep only values of the same type) and supports scalar operations. You can, in theory, have vector! of point!s.
Dave Andersen
@dander
@9214 I was mainly thinking about whether or not it has a fixed length (but maybe didn't have that question formed in my mind), rather than the types that it can hold. I think that does answer my question, since the point! is more like a struct, and the vector! is more like a constrained block!
Vladimir Vasilyev
@9214
@dander proposed point! can keep up to 3 float32! elements, that's a hard limit on cell's payload size. Both point! and vector! are "like a struct", implementation-wise, it's just that vector! keeps a reference to external buffer with all the data.
Dave Andersen
@dander
It sounds like they fit totally different uses. Thanks for the explanation
Softknobs
@Softknobs
Hi, I was missing some web development with Red. So I ported a minimal example of libmicrohttpd server usage to Red. Bindings are minimal and the example only serves one page but it can be expanded. Code and library binaries (Windows/Linux) can be found here:
https://github.com/Softknobs/RedLibmicrohttpdPoC
Gregg Irwin
@greggirwin

:point_up: September 24, 2019 1:56 PM Interesting questions @hiiamboris. If we think of point! like pair!, then no. They are strictly numeric in literal form. But if we think of them like parens, compose/reduce should work just fine. Effectively, the commas are there only to identify the literal form and are invisible otherwise. So the lexer can still identify them. Boy, it's a can of worms though, isn't it? It also forces the comma-as-decimal issue.

My gut says no to a non-paren, comma-connected syntax. But I'll have to think about it more, and try to overcome my history. What is the value in supporting it, I wonder?

My original thought, long ago, was simply to extend pair syntax to allow a third, optional segment. The argument, which we face even now, is that floats are harder to read in that context. But let's think about that, along with how literal coordinate! values would likely be written. Will we use them with placeholder words, to be composed? What are the use cases for entirely literal coordinate! values? Integer pairs, and their primary use(s) are easy. Pixels in UIs with VID and image sizes. What other literal pair values do people use? Anyone?

Can we identify the primary use cases for literal coordinate! values? Chime in people. Some math cases, certainly, and possibly some multipliers in 3D systems.

After literal forms that humans write, we have stored/exchanged values, which humans may see, but don't deal with too much, except in debugging. Then there are those values we never, ever see. We care about 1. We don't care about 3. 2 seems not so important to me in my current mood. Given that, I'm not likely to write floats out to a lot of decimal places by hand anyway, so the harm seems minimal when it comes to readability. That's true for either pair or paren syntax.

If that all makes sense, the value of paren syntax is being closer to mathematical notation. That's big. Is it big enough to warrant a completely separate syntax from pairs, which live in a similar domain for some uses? That's a really tough call.