Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 19:41
    hiiamboris labeled #4945
  • 19:41
    hiiamboris opened #4945
  • 19:03
    greggirwin commented #4944
  • 18:38
    hiiamboris edited #4944
  • 18:37
    hiiamboris commented #4944
  • 03:20

    qtxie on Direct2D

    (compare)

  • 03:19

    qtxie on line-pattern

    (compare)

  • 03:19

    qtxie on master

    FEAT: DRAW: add LINE-PATTERN co… FEAT: DRAW: add LINE-PATTERN co… FEAT: DRAW: add LINE-PATTERN co… and 2 more (compare)

  • 03:18

    qtxie on line-pattern

    FEAT: DRAW: add LINE-PATTERN co… FIX: free memory when finishing… FEAT: scale dash pattern by lin… (compare)

  • Aug 04 18:30
    greggirwin commented on 9e0a4a4
  • Aug 04 18:15
    hiiamboris commented on 9e0a4a4
  • Aug 04 17:51
    greggirwin commented #4944
  • Aug 04 17:50
    greggirwin commented #4944
  • Aug 04 17:32
    greggirwin commented on 9e0a4a4
  • Aug 04 17:20
    greggirwin commented #4943
  • Aug 04 12:21

    qtxie on line-pattern

    FEAT: DRAW: add LINE-PATTERN co… (compare)

  • Aug 04 11:35
    hiiamboris commented #4944
  • Aug 04 11:33
    hiiamboris commented #4944
karthik
@kskarthik:poddery.com
[m]
Thanks! I will try
karthik
@kskarthik:poddery.com
[m]
@greggirwin: is there source code repo of the beta website? Regarding porting the old blog, blogspot exporters exists. We can experiment once you can export to xml format
Gregg Irwin
@greggirwin
@hiiamboris noted that it's at https://github.com/red/web-red. @x8x manages our servers, and also did the progress site and another variant that is more dev oriented. I don't know how far he got on R&D for blog transfer, but all help is welcome.
karthik
@kskarthik:poddery.com
[m]
@x8x ping!
Can you share the blogspot XML format?
karthik
@kskarthik:poddery.com
[m]
@gtzip: blogspot has option to export entire blog to XML. We could use that to migrate
gltewalt (The other Greg)
@gltewalt:matrix.org
[m]
Is that the only format? Can it export to json?
karthik
@kskarthik:poddery.com
[m]
gltewalt (The other Greg): no, only to XML file AFAIK
karthik
@kskarthik:poddery.com
[m]
Raghu Ranganathan
@razetime
what is the equivalent of found? in Red other than not-equal? NONE?
hiiamboris
@hiiamboris
if find ..., found?: none <> find ..., found?: not none? find ...
Raghu Ranganathan
@razetime
thanks a lot
none <> is the shortest approach, which I'll use
hiiamboris
@hiiamboris
yeah there's also to logic! find ... but again a bit longer ;)
not not find .. - not recommended, too cryptic
Raghu Ranganathan
@razetime
I'll note those down
I did try not not before you showed none <> :P
after all, unreadability is one of the more fun parts in golf
hiiamboris
@hiiamboris
haha
karthik
@kskarthik:poddery.com
[m]
@razetime: you're working on any program in Red or exploring?
1 reply
karthik
@kskarthik:poddery.com
[m]
BTW Any there any real world programs in Red?
Galen Ivanov
@GalenIvanov
@razetime to logic! find ... can be shortened to to on find... (or any one of true false on off yes no instead no)
11 replies
gltewalt (The other Greg)
@gltewalt:matrix.org
[m]

Small advantage to that weird naming style where the first letter is a type hint.
sHeadings
fVerify-headings

Or something like that

Hard to find one word verbs for functions.
Which probably means in a perfect world that my functions are doing too much
Gregg Irwin
@greggirwin
I used Hungarian Notation a lot in the 90s. If you only have 6 types, starting with unique letters, it works much better than it would in Red. Also why you end up with things like sz as prefixes for "C string", because that makes sense. Well, it does if you're a C programmer. But it's also onerous to maintain, and often hints at leaking details through large systems. If you have a rich, strong type system, it's less helpful.
hardkorebob
@hardkorebob
Wow. Amazing work. Truly what the future has to be more like. I'm truly blown away at this. Im glad I started to research new languages. Looking forward in having some hands-on. Will build latest from source on a Devuan 3 amd64.
hiiamboris
@hiiamboris
We all share the feeling. Welcome @hardkorebob
hardkorebob
@hardkorebob
I'm here to help too. I am fluent in Spanish as well.
Thank you hiiamboris
hiiamboris
@hiiamboris
In the topic of https://gitter.im/red/red/welcome room you'll find learning resources we're usually advising. There's a huge lot of work ahead in Red, so I'm sure everyone willing to help will find a way that he likes best ;)
hardkorebob
@hardkorebob
I was about to ask. :)
Gregg Irwin
@greggirwin
Welcome @hardkorebob !
hiiamboris
@hiiamboris

We were discussing string interpolation with Gregg, and would like others input.

Preliminary design was #composite macro and composite function. Both are described here, but TL;DR is #composite turns a string into a rejoin with block and composite does it internally and returns rejoined string:

>> probe expand-directives [#composite {"(player)" "(vfile)" --audio-file "(afile)"}]
[rejoin [{"} (player) {" "} (vfile) {" --audio-file "} (afile) {"}]]

The latter as you can see gets very ugly at times. So first purpose of it is readability. Second purpose is localization (see on the same page).

There are however some issues.

  • #composite is a long thing to type. I found myself writing macro wrappers around it: #print for print #composite, ERROR for do make error! #composite and so on.
  • #composite can't accept strings indirectly (being a macro), e.g. strings conditionally fetched or built at runtime.
  • composite (func) requires runtime binding, and that we provide it every time (see the above page for details). Which is a bag of gotchas for everyone not deeply familiar with Red.
  • What escape syntax should be preferred? Current implementation uses (\ to denote literal (, which is backwards ☻

My stats so far are:

  • ERROR is a very common use case, probably 50-70% of my use of composite.
  • #print is most of the rest.
  • other #composite uses are present (e.g. composing file content) but not very numerous.
  • composite (function) I only used once.

Some recent ideas:

  • Replace #composite "value=(v)" with a shorter macro, e.g. `"value=(v)"` . Backtick does not stick to strings and tags, but stick to files and raw-strings (though it can be fixed). No need for wrappers anymore. Such triple quotes are harder to count visually though.
  • Most languages reserve some quotation format for this (very common) use. We could code backticks directly in the lexer to transform strings like `value=(v)` into rejoin ["value=" (v)] (or just into blocks?) on load. That however harms localization, as we don't get the string form anymore and need some kludges to extract it.
  • We can build and expand macros at runtime as shown above, so there really is no strict need for composite function and we may even abandon it, or make it a wrapper around the macro: build the macro pattern, expand, bind and evaluate.

What do you guys think? Any ideas on how to best support interpolation? Have you used it (or wanted to use) in your code?

gtzip
@gtzip
Value for templating?
I've used rejoin and compose rejoin as a common pattern for some templates.
At first i wished for it, but rejoin with a block is essentially bizzaro string interpolation. The inverse sort of.
Its a must for string heavy languages, but for red?
Gregg Irwin
@greggirwin
Another question is the markers for placeholders. In mine I used :( ... ): (what @hiiamboris refers to as the sad eomji format. :^) @giesse pointed out in another chat the main binding problem, which Boris also covers. Basically, the simple case where you use it in a func, but then it needs a context given because it's not a block to begin with.
Greg T
@gltewalt
log-info compstr "Started worker <%name%> PID: (<%pid%>)"
Is there something against the rebol choice of <%..%> ?
I know that folks are used to parens for compose
Sad emoji isn't bad until you throw in set-words or get words
Greg T
@gltewalt
And forgive me if I've forgotten if backticks make for an illegal word
Those would be fairly clean
I suppose going by the boris breakdown, I'd prefer \var\ ^\text\, then (var) (\text)
Greg T
@gltewalt
And would vote for macro
hiiamboris
@hiiamboris

Is there something against the rebol choice of <%..%> ?

So unreadable IMO as if it was not designed at all ;)

hardkorebob
@hardkorebob
Im not a developer per se. I do work with the command line a lot in Linux and I would consider myself a PowerUser than anything else. Readability is definitely very nice but maybe the whole thing needs to relooked at. I dunno. Just my 2 cents.