Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 14:41
    dockimbel closed #5048
  • 14:41
    dockimbel commented #5048
  • 14:41
    dockimbel labeled #5048
  • 14:39
    dockimbel closed #5043
  • 14:39
    dockimbel commented #5043
  • 14:38
    dockimbel labeled #5043
  • 14:38
    dockimbel labeled #5043
  • 14:38
    dockimbel labeled #5043
  • 14:38
    dockimbel assigned #5043
  • 14:38

    dockimbel on master

    FIX: issue #5043 (LOAD/INTO doe… (compare)

  • 14:10
    dockimbel closed #5042
  • 14:10
    dockimbel labeled #5042
  • 14:10
    dockimbel labeled #5042
  • 14:10
    dockimbel labeled #5042
  • 14:10

    dockimbel on master

    TESTS: regression test for #5042 Merge branch 'master' of github… (compare)

  • 14:06

    dockimbel on master

    TESTS: regression test for #504… (compare)

  • 14:05
    hiiamboris commented #5041
  • 14:03
    dockimbel assigned #5042
  • 14:03

    dockimbel on master

    FIX: issue #5042 (transcode/int… (compare)

  • 14:03
    dockimbel commented #5042
GiuseppeChillemi
@GiuseppeChillemi
Bound? on Rebol is Buggy, as you can see: :point_up: 27 giugno 2021 00:52
Gregg Irwin
@greggirwin
My instinct says you're making this harder than it needs to be, but I don't know enough about what you're trying to do to know for sure.
GiuseppeChillemi
@GiuseppeChillemi
I want to execute code on the remote side. I am passing commands together with their arguments. They are terminals values, words are used as symbols and no context is sent. I will try later to make remote work contexts for the lines I am passing.
There is a reason I am choosing this way:

I am experimenting into creating commands that can be run either locally or remotely:

A command could be run as

command/ref arg1 arg2 refarg1

but if you write

server: HTTP://192.168.0.22
command/ref/remote arg1 arg2 refarg1 server

Then command creates a block with its name and parameter, and executes it remotely. Then it receives the result from the remote server.

GiuseppeChillemi
@GiuseppeChillemi
(Remotely, the same command exists and it is avaliable inside the execution context)
Gregg Irwin
@greggirwin

Using a refinement to make it remote seems to be the complicating factor. As far as you're concerned, a call is complete (command/ref arg1 arg2 refarg1), correct? So you can store that internally as a block, and make the remote part separate if it's used.

my-call: [command/ref arg1 arg2 refarg1]
do my-call ; local
RPC reduce [my-call 'on server] ; remote, semi-dialected block for fun.

RPC does all the magic and the func is none the wiser.

i.e. RPC sends the block to the server who does it, and returns the result.
GiuseppeChillemi
@GiuseppeChillemi

I don't know about RPC function but I remember having seen it in Cheyenne.
Yes, refinement is the complication factor but I have chosen to have it on purpose. I have already made experiments with:

  • blocks
  • objects
  • Dialected blocks

Mostly I have experimented creating functions whose arguments is a block or an object containing the arg/value pairs and build the internal function context bypassing the function interface, doing everything by hand. It worked well but the experiment goals is to pass regular Redbol commands and bind them to a remote object with contains the "allowed" commands and I want to take into the picture passing refinements too.
This It is the most difficult thing as I have no way to get a make specs with refinents as set words.

I have in mind that one day we will have protected contexts like in Rebol3, so we could safely bind blocks to them without removing refinements of functions, so cutting the expressiveness of Redbol languages.
Gregg Irwin
@greggirwin
RPC is just a placeholder name. :^)
Red is about message passing for this kind of thing. Think of your RPCs as dialected message blocks, look at reb-services for inspiration, and keep us posted.
GiuseppeChillemi
@GiuseppeChillemi
@greggirwin I have already a RPC like function, it is called RUN-REMOTE. You simply provide a block of code and it Is executed remotely and you receive the return value.
As I have said this experiment goal is to have regular functions which run on a remote server just having the /remote refinement set and passing the server address, so they recreate the command needed to run themselves. This to not change the current usual coding, otherwise everything would become run-remote compose [command/arg (arg1 arg2 arg3 refarg)]
As make blocks are not usable for the refinement setting problem, it remains another approach, map everything to the apply syntax. I will try.
GiuseppeChillemi
@GiuseppeChillemi
(Edited)
With /remote server the command just dispatches the request to an execution server`
Goodnight!
(I will reread your messages tomorrow as they contain other useful topics)
lnxw37d4
@lnxw37d4:matrix.org
[m]
It is time to add 2-3 new entries to https://www.red-lang.org/ so that people cruising by can see that development and use are still active.
GiuseppeChillemi
@GiuseppeChillemi

@greggirwin Another option to transfer the current function context words and refinements and the values, is to use the set syntax. It is perfect for keeping trace of refinements:

ctx: [[a b c /red ref-arg] [a b c false false]]

You have just to convert /red to word before executing set

When words-of and values-of will be implemented for function it will be easy to write

ctx: reduce [words-of context? 'ref values-of context? 'ref]

Also set words argument could accept refinements, so you can simply write:

set ctx/1 ctx/2
hiiamboris
@hiiamboris
Nenad withdrew binding info from refinements so they won't be possible to set.
GiuseppeChillemi
@GiuseppeChillemi
I don't know the reason but I don't like this. It complicates the portability of blocks, forcing us to have a sidecar.
hiiamboris
@hiiamboris
Reason is refinements and issues are symbolic only tokens by design and should not carry any hidden payload.
hiiamboris
@hiiamboris

By far my most common case for filenames is date-naming them, which isn't a good match for composite and handled better by format.

It's good until you want to customize it a lot.

GiuseppeChillemi
@GiuseppeChillemi
The problem is that we do not have a direct make block nor a visual representation of the context with refinements information. Also, actually there is no easy way of getting the refinements from the inside without parsing the specs block.
Once you get all in [[keys][values]] split form with refinement you have to make a last management of the keys block to extrapolate the refinements, change to words and build a separate refinements block in case you would need this information.
GiuseppeChillemi
@GiuseppeChillemi
While for objects contexts it is easy to manage, copy and transfer it, for function ones it is very complicated.
Greg T
@gltewalt
Sorry about my github blunders
Gregg Irwin
@greggirwin
@lnxw37d4:matrix.org thanks for the reminder. :+1:

It's good until you want to customize it a lot.

I guess I've always customized them a lot, because it's so helpful IMO. e.g. zero padding counts and ISO8601 formatting dates, so lexical sorting works.

gltewalt (The other Greg)
@gltewalt:matrix.org
[m]
Backtick itself isn't hard to type. It's one keystroke on my keyboard
Gregg Irwin
@greggirwin
By itself, I agree. But #' has a shift and unshift, and '" ... "' has shift-unshift on each end, plus wide space between the backtick and quote, at least on U.S. keyboards. Using ticks, as Gitter is driving me mad trying to get backtick syntax right.
Greg T
@gltewalt
Wide space between backtick and quote, but backtick is close to the left hand
About as close as ( ) is for the right hand
hiiamboris
@hiiamboris
@greggirwin if `"..."` is so utterly bad for you, let's consider just an empty issue # "...", because #` is completely ugly and using only opening quote makes no sense to me, if it's quotes they should be on both ends. # "..." is somewhat similar to char syntax though. But then any other symbol allowed in issues will be better than backquote. ## #! #$ #% #= #| #/ #\ #. #~
hiiamboris
@hiiamboris
I would still prefer them backticks on both ends. Simplest syntax and readable unless your font is not monospace and you're not using syntax highlights.
hiiamboris
@hiiamboris
(editor) (gittard) (GUI console) this is how it looks for me without any steps done on my end (and I would highlight backticks and all operators)
hiiamboris
@hiiamboris

A poll from Nenad ☻

Which way to you guys use try most of the time?

  1. To silence errors, as in if error? try [...] [..after-error recovery..]
  2. To catch errors and process them later, as in set/any 'err try [...] (... later err is processed...)
  3. I never used try

Please post your answers into thread if possible. Thanks.

18 replies
Oldes Huhuman
@Oldes
@hiiamboris may I ask what we should expect as a result of this poll? And why Nenad is not asking here himself anymore?
Gregg Irwin
@greggirwin

The new try/keep feature is there now, for including stack traces, but we don't know if it should be the default.

Being on Gitter can take a lot of time and pull focus. When there's a Nenad sighting, people tend to swarm. I'm sure he'll reappear here at some point.

gltewalt (The other Greg)
@gltewalt:matrix.org
[m]
Instead of try / catch, how about... what amounts to enums... custom types that only accept a few things - either succeeds or the error message comes directly from the type
Gregg Irwin
@greggirwin
Do you mean like specific exception values, as in Java?
Note that in Red try/catch isn't a thing. We have throw/catch which is not specifically error related, but is about general non-local flow control.
gltewalt (The other Greg)
@gltewalt:matrix.org
[m]
See the chit chat room
Yes, but when I think of try, catch is always trying to sneak into to the party
Into
Gregg Irwin
@greggirwin
Ah, category types as in Haskell, got it.
Gregg Irwin
@greggirwin
For those more versed in Java and Haskell, the two approaches are very similar, aren't they? You have to declare all the specific exception/error types that can occur, and then you need to specifically handle each one of them.
gltewalt (The other Greg)
@gltewalt:matrix.org
[m]
I dont know much about Java. I could never bring myself to use it.
gltewalt (The other Greg)
@gltewalt:matrix.org
[m]
You handle each one in a custom type that ideally models your application - for error messages, There's a separate type for recovery.
Gregg Irwin
@greggirwin
It's an age-old question, without a single answer that is right for every situation. Treating errors symbolically moves toward general symbolic computing, which Red is well suited for.