Fixing the Piping/Chaining Issue (Rev 3)

Good point—but quite a bit of this proposal is already redundant with |> and , but with better ergonomics and lower compiler strain.

And let’s not forget the urge which inspired this whole saga, which is to provide a proper chaining syntax for autocomplete hints, esp. for multi-arg functions.

1 Like

Update: Previously I had forced every local assignment to be a local assignment. I have decided to relax this, so that chains are now able to mutate existing identifiers in their enclosing scope.

Chain scopes are still hard local scopes, so for mutating global variables the global keyword must be used.

1 Like

I think this proposal is indeed much more appealing and more interesting than the previous two, for this proposal is much more easy to understand from someone who has occasionally used Underscores.jl, although I do hope the .x{f, g, h} syntax be replaced by something more “Julian” like x chain f g h end.

With the first proposal, I really lost myself in the / and \ stuff. The second one is also non-intuitive to understand: it is very strange to think that f in x--(f; it^2+it; it/5) fundamentally different from a value, and instead a shortcut for f(it) without the parentheses and the placeholder it.

As a side note, I think you should update the link in the first proposal to directly link to this one. I just spent 10 minutes to read the second proposal only to discover that it is abandoned.

3 Likes

I really like the underscore syntax for partial applications.

It reminds me a lot about the underscore in F#, where it is used as a wildcard in pattern matching. So my brain basically saved it as “fill that space in with x”, and that maps nicely to this new functionality.

I find partial application to be elegantly represented via _ :ok_hand:t3:
Good job!

The second part, MethodChains, seems also too good to not do that way.

I totally understand, how this is a rare occasion, where everything lines up this way, in a language that has already settled in so many ways.

Julia has already used lots of operator symbols and syntax constructs for other functionality.

I find that syntax intuitive, and fitting. It looks quite clean to me, and although I could have preferred something a little more declarative, so something that visually signals what it does, such as |>, >>, is it fine as it is, and I love it. :+1:t3: :heart:

The last part, about multiple chaining, is the most interesting part.
COBOL is known for this type of column based programming, and I don’t know if you know that.

It’s mocked a lot for it, and both the language and the feature are somehow MEMEs. :wink:
But I like how it looks at a first glance, and I am ready to defend it in the public. :smiley:

Overall, great work, and great that you invited the community in such an open-minded way.

4 Likes

Hi @uniment , and thanks for all the work you are doing in this space. I think the functionality are great, and the options that are opened by the multi chaining are very interesting.

I was wondering about what your plan on registering* the package where. I’d love to use it on Pluto (and although it’s possible to do it, using Pkg.add breaks Pluto’s package manager). Is there something we can do to help you?

  • I assume you intend to register it, but I might be wrong.
1 Like

So, what is the etiquette here? Would it be ok to fork this package if it is still of interest to the community and the author is not engaging with it anymore?

1 Like

You might open an issue on their repo in case they’re just not monitoring Discourse. Otherwise go ahead and fork.

Keep in mind there is a lot of disagreement on how to handle the chaining issue so each additional packge will be yet another package in the sea of such packages, even if it’s a particularly good package.

2 Likes

Apologies for my tardiness! I’ve been AFK for a while and have forgotten how to use a computer. I’ll see about registering it soon.

5 Likes

Amazing. And sorry for having pestered you :sweat_smile:

1 Like

Trying the examples in this repo and then using it in tandem with the PartialFuns package gives the sensation of tripping the light fantastic in Milton’s original sense. Twenty years ago when I first looked at the language structure manipulations possible in Mathematica using pattern matching to operate on the language itself, I experienced a similar, ‘Wow.’ I have some hesitancy about incorporating them into work projects given the exploratory nature of both, though I haven’t yet made them break.

4 Likes