Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 04:20
    toomasv commented #2433
  • 02:18
    qtxie commented #4759
  • 01:32
    qtxie closed #4852
  • 01:26
    qtxie labeled #4859
  • 01:10
    qtxie closed #4897
  • 01:10
    qtxie commented #4897
  • Sep 27 23:07
    greggirwin commented #101
  • Sep 27 21:40

    dockimbel on interp-events

    FEAT: more accurate input block… (compare)

  • Sep 27 21:37
    hiiamboris commented #101
  • Sep 27 21:37
    hiiamboris commented #101
  • Sep 27 21:33
    greggirwin commented #101
  • Sep 27 21:29
    greggirwin commented #2433
  • Sep 27 16:54
    hiiamboris labeled #4971
  • Sep 27 16:54
    hiiamboris labeled #4971
  • Sep 27 16:53
    hiiamboris opened #4971
  • Sep 27 16:43
    hiiamboris commented #4269
  • Sep 27 14:11
    dockimbel assigned #4970
  • Sep 27 11:37
    hiiamboris commented on 1af4458
  • Sep 27 10:57
    Oldes commented #4759
  • Sep 27 10:56
    hiiamboris commented #4759
François Jouen
@ldci
Hi reducers. redCV can be used now with raspberry boards:)
hiiamboris
@hiiamboris
:+1:
François Jouen
@ldci
@hiiamboris Thanks!
Jose Luis
@planetsizecpu
Good job!
Galen Ivanov
@GalenIvanov
:+1:
Oldes Huhuman
@Oldes
Regarding making a block from a file, I would propose this:
>> to block! %/z/f/e/
== [%/z/f/e/]
>> make block! %/z/f/e/
== [%/ %z/ %f/ %e/]
@giesse and also:
>> to block! to string! %/z/f/e/
== ["/z/f/e/"]
hiiamboris
@hiiamboris
how is this better than what we have, and than split?
Oldes Huhuman
@Oldes
@hiiamboris having some meaningful result instead of error is always better to me... now there is:
>> make block! %/z/f/e/
*** Script Error: cannot MAKE block! from: %/z/f/e/

>> to block! to string! %/z/f%20f/e/
*** Syntax Error: (line 1) invalid path at f/e/

>> split %/z/f/e/ [before #"/"]
*** Script Error: split does not allow block! for its dlm argument
Not mentioning, that I would prefer to have [%/ %z/ %f/ %e/] instead of [%/z %/f %/e %/] or [%"" %z %f %e ""]
hiiamboris
@hiiamboris
>> split %/z/f/e/ [after #"/"]
== [%/ %z/ %f/ %e/]
Gregg Irwin
@greggirwin
@Oldes, good point on long running processes vs cron. In the largest Rebol systems I wrote, I had a main crontroller that spawned tasks and used IPC to communicate with them. The main controller itself was a GUI app, which did slowly leak memory and had to be restarted once a year or more because of that.
Oldes Huhuman
@Oldes
@hiiamboris fine, but that is Gregg's experimental split and to be honest, it's quite a complex script. Anyway.. I don't need to split files in such a way, so it's not a big issue for me. I would probably use some easy parse rule to count the number of file parts or use simple split file #"/" and handle the edge cases.
Oldes Huhuman
@Oldes
@henrikmk if you want to just count parts... it would be more memory friendly to use something like:
count-file-parts: function[f [file!]][
    n: 0
    ch: complement charset #"/"
    parse f [opt #"/" any [some ch opt #"/" (n: n + 1)]]
    n
]
count-file-parts %/z/f/e/ ;== 3
count-file-parts %z/f/e/  ;== 3
count-file-parts %z/f/e   ;== 3
zentrog
@zentrog:matrix.org
[m]
Another alternative for watching a filesystem instead of polling, or cron would be to subscribe to filesystem events with inotify but would probably require some red/system, or a higher-level wrapper from inotify-tools
Gregg Irwin
@greggirwin

@Oldes my experiment is intentionally large in scope. Why do you care if it's complex? One of the goals with it is to have, e.g., @hiiamboris post an example that gives you exactly what you wanted, and that the intent is clear.

In the domain of splitting things into pieces, are we better off with a module that covers 98% of use cases, or a simple function that covers 50%, and having users write custom splitters for the other 50%, with all the edge cases, where more things can go wrong? That's something I hope to find out.

Oldes Huhuman
@Oldes
I have nothing against your split. I just wanted to note, that we could have a meaningful result from make block! file instead of current error and that to block! string should have consistent result with to block! file and not current weak and buggy split.
Boleslav Březovský
@rebolek
@Oldes your version should be named more appropiately count-named-file-parts otherwise one could argue that length of %/z/f/e/ is 5 and not 3.
Gregg Irwin
@greggirwin
@zentrog:matrix.org we need a cross platform solution. Windows has a notification API, and MacOS does as well, so it's doable. I don't know if we want to look at that as new event! types, outside View, or via I/O ports.
Oldes Huhuman
@Oldes
Even with proposed make block! file change, I would personally use function like count-file-parts above, because it is much more lightweight (not creating X series just to get a number).
hiiamboris
@hiiamboris
Current weak and buggy split is load I believe. We're just misusing it here.
Oldes Huhuman
@Oldes
@rebolek it was just an example... I don't know exact use case.
Boleslav Březovský
@rebolek
Of course, I’m just nitpicking, sorry.
Gregg Irwin
@greggirwin
My view is that filenames are strings, and conversion to block should treat them as such consistently. If we give them special treatment, then we should next ask what to do with URLs, and then emails and tags.
Oldes Huhuman
@Oldes

If you ask, than we could have for example:

>> make block! user@foo.cz
== ["user" "foo.cz"]

instead of:

*** Script Error: cannot MAKE block! from: user@foo.cz
Gregg Irwin
@greggirwin
Shouldn't the result be ["user" "foo" "cz"]?
Oldes Huhuman
@Oldes
Why to have multiple string types when every type would have same meaning.
zentrog
@zentrog:matrix.org
[m]
@greggirwin: It would be cool, but way down my list of things I would want to see built into Red. Might be a neat use case for modules though. Has there been some thoughts about how a module could contain cross-platform routines with a common high-level interface?
Gregg Irwin
@greggirwin
And what happens with URLs? It's a can of worms that may be hard to predict reliably for users.
Oldes Huhuman
@Oldes
I don't know... I'm just ventilating my thoughts.
Anyway.. my long standing idea is to have an intelligent query. Where I could do:
>> query/mode url 'scheme
== http
>> query/mode url [scheme host]
== [http "foo.cz"]
>> query/mode url [scheme: host:]
== [scheme: http host: "foo.cz"]
Oldes Huhuman
@Oldes
(not a priority as well for me)
Gregg Irwin
@greggirwin

Why to have multiple string types when every type would have same meaning.

They do have different meaning, as their original type. So let's ask what happens if we do this.

  • Block! now has to understand the lexical form of any-string! types, which couples it to those forms internally.

  • For each type, we have to decide what the constituent parts become. For file!, all results can be file!. For email!, should they all become strings? URLs? Does it handle path seps intelligently when round-tripping? Can all values round-trip? (side note: Ladislav did some great work on split-path + rejoin, with round-tripping as a consideration.)

>> to url! ["http://" "a" "b/" "c"]
== http://://a/b//c

Identifying use cases helps here, so we can see where gaps are that have real value.

I'm 100% behind writing these things down and analyzing it. These are important docs in any case.

On query, so kind of like GQL @Oldes?
That ties in with HOFs from the aspect of selectors, and also with the concept of specs/schemas. I have notes on both of those, including vet <spec> so you can confirm if data conforms to a given spec.
Gregg Irwin
@greggirwin
@zentrog:matrix.org so far modules have been designed from the organizational and source/interpreted view. I don't know of a "fat binary" format for shared modules, but wrapping platform specifics would work just like all other R/S code. The reason I mention "interpreted" is because modular compilation is not high on our roadmap, and is a big task. We will work hard to plan for that in the module design, so nothing has to change for users when it's supported. That is, you can run interpreted or compile your app normally, but every module will be recompiled, just like the runtime. To offset the speed hit there, you can still build custom runtimes which include modules, just like view today, for dev mode work.
zentrog
@zentrog:matrix.org
[m]
If it simplifies things to assume modules containing Red/System must be compiled, that would make perfect sense to me. Is the general plan for them to just be .red or .reds files? Other eventual features like compiling to shared library, or JIT compilation would solve some of those issues too.
Once modules are available for general use, I think it lowers the bar a lot for community members to contribute features like this, and experiment easier without needing to worrying so much about how it would fit into the Red project
hiiamboris
@hiiamboris
@greggirwin I don't think recompiling every module is a good idea at all. I'd rather go R3 way and improve it.
Henrik Mikael Kristensen
@henrikmk
@Oldes thanks. I ended up with a function that loops through split-path. I may also need it for serialization, because some file names can't be molded either in R2.
Respectech
@Respectech
@rebred In the past, I have used the Linux program incron which is like cron but its operations are based on changes to a filesystem. You can have a process launched immediately when any directory is changed using incron.
Gregg Irwin
@greggirwin

There are many aspects to modules. We do want people to be able to build, share, and use them, and for them to be bundled together. It should be possible for someone to group modules, put a consistent interface over them, and release that. Ideally, there is a package and organization system that supports this, and also an optional blockchain aspect for verification and tokenomics.

There are ways to hack around platform issues, but security is perhaps the most important element in all this.

To @hiiamboris' point, sometimes you won't even have access to a module's source, but I don't have a unified design for modules vs shared libraries.

Oldes Huhuman
@Oldes
@henrikmk that must be pretty heavy solution :-/
Henrik Mikael Kristensen
@henrikmk
@Oldes anything for the customer. but we have done far, far heavier things to make it work. for example, the native R2 SELECT has been ditched, because it has bugs, so we wrote our own mezzanine there.
Greg T
@gltewalt
My view is that filenames are strings, and conversion to block should treat them as such consistently. If we give them special treatment, then we should next ask what to do with URLs, and then emails and tags.
>> p: to-path "x/y/z"
== x/y/z
>> type? p
== path!
>> length? p
== 1
>> length? 'x/y/z
== 3
rebred
@rebred
@Oldes @Respectech thank you!!!
FLuX LoOP
@x8x
@rebred Yet another option, use systemd path units, have a look here https://www.putorius.net/systemd-path-units.html
Maciej Łoziński
@loziniak

blockchain aspect for verification and tokenomics

super cool!

Speed
@XANOZOID
Hello! Instead of trying to make a window fit everything in a GUI, is there anyway to make containers like panel or tab panel show a scrollbar when they overflow? I tried looking at a number of examples and the documents but found no evidence of scrolling outside of an area facet. Thanks!
hiiamboris
@hiiamboris
Not out of the box, but if you desperately need one: https://gitlab.com/hiiamboris/red-mezz-warehouse/-/blob/master/scrollpanel.md
Speed
@XANOZOID
Ahhh yeah i really need one. I am thinking i may just use Red for my processing for this app and something else for the UI then. No problem! I'll take a look at your link
though!