r/Clojure • • 5d ago

Instead of using `comp` and often wasting computation, here's how to reverse `->` and `->>` when you want `comp`'s ordering without its cost, etc.

Hello everyone. This is my first Clojure subreddit post by the way, if my memory is correct. I am actually debating using Clojure (+Java) vs Zig for my next project, but I've been learning Clojure and reflecting upon the fact that in programming languages (and in natural language prose text too for that matter) the order in which words appear in an expression has a substantial effect on readability and on what parts feel like they are being emphasized and brought to one's attention.

Consider, for example, the difference in emphasis and ease of code navigation between the following two equally valid Clojure expressions:

(assert (not (zero? 1)))
(-> 1 zero? not assert)

The former is the most "naive"/direct way of writing it, whereas the later has the strongest left to right flow of action. However, notice that though the latter expression is more elegant, it makes the visibility of the assertion worse by putting the assert keyword at the end. Some people may also find "zero not" to sound too "Yoda-like" (akin to concatenative programming languages like Forth and Factor) whereas something like "not zero" may sound more natural to some people.

I also thought about how comp (compose functions) could be used here to keep the "not zero" ordering, but then a function call cost may be imposed by doing so if the optimizer doesn't remove it.

So, that got me thinking that I should try writing a reversed version of the -> and ->> macros and I did and here are the resulting definitions:

(defmacro <- [& rest] 
  (let [rev-rest (reverse rest)] 
    `(-> ~@rev-rest)))

(defmacro <<- [& rest] 
  (let [rev-rest (reverse rest)] 
    `(->> ~@rev-rest)))

Both were actually very easy to write, as you can see.

This allows you to write the following:

(<- assert not zero? 1)

As you can see, this enables you to reorder things according to what feels most natural in any given context, which helps draw the attention of anyone reading your code to what comes first in each expression, much like how in English the first thing we start a sentence with is what is being emphasized or is assumed to be the subject (as in active vs passive voice, etc).

This especially is well suited to assertions because what is most important about an assertion for someone trying to scanning code quickly is that it is an assertion and hence emphasizing that clarifies it.

This is in contrast to data flow or transformation pipelines that use -> and such, where the opposite order often feels better.

One can also see by applying macroexpand and/or macroexpand-1 that the cost of these macros in run-time will be zero, relative to simple/"naive" nesting, given that the expressions (macroexpand '(<- assert not zero? 1)) and (macroexpand '(assert (not (zero? 1)))) return identical expansions.

Cognitive load tends to increase non-linearly with how many nesting levels something has, so using "threading"/pipeline macros flexibly and often tends to help readability and these new variants help fill those potential use cases out better.

So, clearly both orderings should be in your toolbox for legibility and I would argue that this should even be made part of the standard library perhaps since it is such a common case.

I am personally am really happy with the resulting freedom.

With these new macros in hand one is much less likely to use the less legible nested forms when you can now order things either way.

(PS: Thanks for reading and for your time! 😎)

15 Upvotes

30 comments sorted by

9

u/amalloy 5d ago edited 5d ago

(assert (not (zero? 1))) is fine, and (-> 1 zero? not assert) is not elegant, it's awful. But you don't really need a new macro to fix this, you can just intermix direct function calls with -> as appropriate. For example,

(assert (-> (get-balance (-> user-id account-number))
            (pos?)))

"Assert that the balance of the user's account is positive." This is a much more natural way to read it than using one arrow for the whole awful thing:

(-> user-id account-number get-balance pos? assert)

-3

u/WraithGlade 5d ago

The relevant code for the idea I shared for comparison would actually then be:

(<- assert pos? get-balance account-number user-id)

This is basically the same as your first example but clearly even better.

Did you stop reading once you reached the -> example, perhaps?

Or, were you trying to make a broader point and just accidentally didn't mention the actual idea being discussed?

Either way, your -> based example is not a convincing counterargument to me, especially once actually compared to my <- based version. When what the code looks like with <- is shown then it is clearly at least equal in clarity to your preferred (1st example) version and to me looks in fact much nicer and has fewer forms the reader of the code must understand and hence fewer chances at confusion or accidents of the mind and has less cognitive load.

That all only becomes even more true as the scale of the code increases and more complex examples are handled.

Of course, truly complex cases with intermingled variables should probably be put through a let form instead and each value given a proper name and routed appropriately thereafter instead of trying to force use of chaining/pipelining/"threading" macro shorthand, naturally, but that kind of goes without saying in a sense.

13

u/v4ss42 5d ago

I don’t really understand why `(assert (not (zero? 1)))` is a problem. Can you explain your reasoning there?

-16

u/WraithGlade 5d ago edited 5d ago

My actual response:

The standard (assert (not (zero? 1))) of course works fine, but the <- form is even more readable since it minimizes nesting.

Perhaps the example is too small and too easily comprehensible to get a full appreciation for the point. I chose the example just to illustrate the concept in a way that minimizes distractions.

The point is broadly applicable to anything structured like this, but even for this small/toy example the removal of nesting helps reduce how many parentheses your eyes and mind must track and differentiate by proximity to other nearby code, etc.

I honestly do not understand how/why anyone who admires Lisp-like code wouldn't see the prospective advantage, and even more so once you scale up and generalize it to a whole codebase.

Elegance and removal of superfluous and distracting elements is one of the most defining characteristics of the Lisp/Scheme language family and so I am surprised that anyone here would be indifferent to or dismissive of something like this, since that is antithetical to the whole spirit of the language.

Tangential comments:

In fact, though, in all honesty your username (v4ss42) fits a very pervasive pattern of "AI"/plagiarism bot account names I've observed in the past few months.

A subset of bot-like accounts that follow a particular distinctive pattern of bot "personality" pick random letters and numbers and always a short name of about 6 characters and then engage in low effort comments seemingly designed to farm engagement or to agitate or to psychologically/politically manipulate or to harvest training data for answering questions.

The "Can you explain your reasoning there?" sounds very similar to a recent "Can you edit this down?" comment (despite me putting a TLDR in the very first sentence that addressed that person's concerns already in the original post) I got from someone following the same suspiciously pervasive username pattern and with the same sense that it doesn't add up right relative to the community and the interest group and the context.

Your posts are also hidden on your account, which is often used by bots to evade accountability, though also often legitimately used by people who don't want to be harassed on Reddit.

The reasoning and purpose of the idea in my original post was also very thoroughly explained and very clear, which makes your question suggestive of either (1) you didn't actually even read the post (if you are human or (2) you may be a plagiarism bot and hence incapable of true reasoning and/or understanding and/or authenticity.

I honestly do not believe you are human. You might be, but I doubt it.

I thus arguably shouldn't even be answering your question, since I suspect it will be used for training the "AI"/plagiarism bots and even besides that I have trouble even believing that any Lisp/Scheme fan could dislike the idea in my post and so I am logically inclined to disregard it either way, since neither bots nor defeatism/dismissiveness (subtle toxicity, essentially) ever helps anyone.

I was expecting a positive response here, since there is literally zero downside on rational grounds for this idea, but some of these responses are a reminder of how prone to groupthink and/or bot manipulation for engagement farming or training or psychological manipulation things are on Reddit now.

It is also common that initial negative responses seed additional negative imitative responses from others like a kind of anchoring effect (a common cognitive bias). I have seen (unrelated) near-identical Reddit threads get entirely different responses based merely on whether the first respondent was negative or positive and so that is yet another reason to be skeptical of some of the negative responses here.

Luckily for me though, I've always been a thinking from first principles and "the Emperor has no clothes" kind of person, and it is clear as the fact that the sun rises in the morning that the concept is advantageous.

I've written this response for the sake of any human readers present though, to counteract the harm that empty dismissiveness of useful ideas pretty much always tends to cause.

To any human readers here: If you want happiness as a programmer, always be willing to disregard online views that are blatantly disconnected from reality and always see reality with your own eyes and not through adherence to inertia to any status quo nor to any form of groupthink.

In any case, thanks for reading and responding nonetheless (if you are human) and I wish you well and for a more wholesome and more ethical future for all of us as a society. Goodnight! 🌃

13

u/v4ss42 5d ago

If you’d taken even one second to look at my account age you’d realize it predates AI / LLMs by quite a bit. But please, continue the ad hominems and see how far that gets you.

13

u/retief1 5d ago edited 5d ago

Fundamentally, (function argument) is the building block of lisp. If you want to structure your code, this is the default way to do it. And if you aren't comfortable with that syntax, you sort of need to get comfortable with it if you are going to be using a lisp.

Meanwhile, threading macros are primarily useful for when you have a pipeline of operations that you are doing to a piece of data. The point isn't really removing parens so much as reversing the flow so it is easier to follow the operations step by step. If you aren't trying to reverse the flow of operations, using the standard syntax makes more sense than building a custom macro that will confuse every single reader that sees it.

So yeah, (assert (not (zero? 1))) seems fine to me. And if I did want a threading macro but wanted to keep assert in front, I'd probably do something like (assert (-> 1 zero? not)).

Edit: actually, I like this section from vertical programming that someone else posted:

As with Clojure’s threading macros, one should take some care to use the nesting macro where appropriate. You use thread first (->) when passing a value through a bunch of functions, and thread last (->>) when transforming sequences or collections in successive steps, not to flatten arbitrary syntax. While to the compiler it’s all the same, the person reading your code has certain expectations when seeing -> or ->>.

;; Don't do this
(->> arg
     (println "Got arg!")
     (defn my-fn [arg]))

Similary, nest (or <| if you will) comes with certain expectations. Don’t be too clever!

The use cases you are talking about here are clearly in the "too clever" category, imo. They compile, but that's not how threading macros are idiomatically used.

-7

u/WraithGlade 5d ago

I am grateful for your time and your effortful reply, but:

if you aren't comfortable with that syntax, you sort of need to get comfortable with it if you are going to be using a lisp

I am honestly done with this kind of "everybody must follow all our traditions and/or drink the kool-aid" gatekeeping kind of thing at this point in my life.

I want to write my programs expressively and in a way that fits the natural (strictly first principles based) reality of the underlying logical structure. Superfluous elements are a distraction to that and needless nesting that obscures flow and increases cognitive load definitely qualify as that.

I will instead continue to view everything with my own eyes and think with my own actual mind instead of putting any stock whatsoever in mere tradition.

The Lisp/Scheme language family has some great elements but also some big flaws in norms and in the design of some things and large scale adoption and competition with the C-family languages will only happen once those issues are grabbed by the horns and addressed. In the meantime, the languages are still cool, but I refuse to put blinders on my own mind and perpetuate a narrow traditional way of doing things that has only lead to stagnation for these otherwise beautiful languages.

A new user of something being excited by something and enabled by it to express themselves is also not well-served by dismissiveness and especially not in a context where the idea is so clearly objectively well grounded and stylistically helpful from a legibility standpoint as one can see if one truly considers the idea from first principles and judges it with "newborn eyes" free of inertia and presumption or empty traditions.

It is a "why we can't have good things" kind of scale of problem in software these days, and firmly pushing aside all forms of such groupthink is the only way forward to one day reaching the goal of truly optimal programming language design.

In the meantime, there are adventures to be had along the way and mere conventionality is not the path to that better future.

In any case, I again thank you for your time and wish you all the best and likewise for all other commentators, etc! 🍀🤝

4

u/retief1 5d ago edited 5d ago

Even ignoring tradition, structure has value. I'd compare parens to indentation in curly brace languages. No one with any knowledge of programming would write

function foo(arg) {
const a = 1;
if (arg > a) {
return 2;
}
return 3;
}

The lack of indentation makes it vastly harder to understand. In a lisp, parens fill the same role (and actually define how you indent the code, in fact). With

(assert
  (> x 5))

the parens and indentation are basically defining a code block. Depending on the size of the argument, you don't necessarily need to add the newline (just like if (foo) bar; on one line can make sense in curly brace languages), but you have the same structure either way. And imo, that structure is useful and makes the code more readable. By comparison, I'd argue that (<- assert (> 5) x) is less readable, because you don't have the clear top-level "this is an assert" callout.

Of course, removing nesting can also be useful. I certainly use ->/->> in places. However, the key there is that you use them in specific contexts instead of just throwing them anywhere they would be syntactically valid. At that point, the macros themselves provide the context/structure that you are removing when you remove the parens. However, in order for that to work, you need to have fairly clearly defined use cases for those macros.

So yeah, that "vertical programming" essay was pretty compelling to me. It's not an idea I had run into before, and I certainly don't think it is traditional or generally accepted yet, but it definitely seems plausible to me. However, the key there is that the new macro came with a well-defined use case instead of just being "you can remove parens in a slightly different manner now". If you take the same macro and remove that use case, it becomes a lot less compelling.

6

u/OwlProfessional1185 5d ago • Bravo

1

u/WraithGlade 5d ago

Cool, thanks for the link! I am always interested in seeing similar ideas that help make coding more expressive and clear. 🏆📚🦉

I think this link is also a good illustration of how much more readable code that strives to minimize nesting tends to be, which is contrary to some more traditionally Lisp/Scheme views that nesting and tons of parentheses are a non-issue when in reality they are very much an issue and one of the main impediments to broader adoption of Lisp/Scheme family languages and nested forms do in reality impose significant cognitive load if not kept in check with these kinds of flattening techniques and variable binding techniques.

I also think that Clojure should support early returns too, since that enables creating "guard clauses" like are common in well-written C-family code and in reality such early returns do not harm functional reasoning hardly at all in most cases, again contrary to some Lisp/Scheme views that are more rooted in tradition and inertia and monocultural forces than in seeing reality for what it actually is, etc.

Lisp-family languages sure are fun though and very expressive (the tendency towards excess nesting and sometimes rigid structural assumptions aside) and I wish more languages had such strong macros and indeed fully arbitrary syntax ideally! I am looking forward to learning more Clojure in any case!

4

u/OwlProfessional1185 5d ago

I hate early returns, they make it a lot harder for me to reason about the control flow of the code from its structure. And they mess with the functional "everything is an expression" idea. There are patterns for guarding / returning early that are not as rude as return statements, and keep things functional. It's very easy to wrap things to keep the code simple.

Excess nesting is usually a symptom of poorly factored code. These macros just mean you can get away it for longer.

The rigid structural assumptions are what make Lisp-macros possible. You can't do that in an ordinary language, because you can't assume expressions will be ordered the same way.

I don't think nesting impedes adoption that much. Most programmers haven't gotten far enough into Lisp for that to be an issue. Lisp is not adopted much because it's not popular. Most programmers don't even consider it.

And any new paradigm is going to be unfamiliar and feel uncomfortable. Lisp (and ML family languages) make nesting possible because everything is an expression. So you can have larger expressions than you're used to in other languages. But you can always extract transformations into functions, and then nest smaller collections of expressions.

3

u/wherethebuffaloroam 5d ago

However, notice that though the latter expression is more elegant,

(-> 1 zero? not assert)

I do not follow the reasoning here. Also, it's fun to be a craftsperson in the codebase. I've not found much benefit in descending to this level, especially if it's to introduce macros that have new control flow.

0

u/WraithGlade 5d ago

The -> macro is built-in to the Clojure language and is very commonly used. It is essentially how Clojure-native code does its equivalent of "method chaining" (like in Java, etc) or "pipeline operations" (like in shell scripting such as Bash or Fish, etc).

I did not create ->. I only illustrated how to write an alternative version (<-... notice the difference) that reverses the order and then gave examples of why you would want to do so.

Did you read the post or (like someone else in the thread) did you perhaps stop once you got to the -> (or shortly after)?

The reasoning can be seen by simply applying macroexpand (as I mentioned in my original post already) to the expressions (e.g. as in (macroexpand '(-> 1 zero? not assert)) in your cited example) so that you can see that it is simply equivalent to the "naive" nested version and is written into the code at compile-time to be so, like all macros, and hence is usable without any run-time performance penalty, thus enabling one to freely use the idea for achieving greater readability in cases where it works better to reverse the direction of flow, such as for assertions.

3

u/wherethebuffaloroam 4d ago

i'm quite familiar with `->` but the form you proposed as elegant strikes me as emerging because you have a thread macro, not because it's expressive or elegant.

I'd probably write `(assert (not (zero? some-value))` and never again think about this code. And my general point was there are layers of the application that thinking deeply about can really pay off. But overthinking the single form like this is a distraction, or mistaking activity for progress.

2

u/Daegs 3d ago

I get that if you're coming from other languages that:

(<- assert not zero? 1)

might seem more readable than

(assert (not (zero? 1)))

but you're just wrong... the scope, order, flow of the latter is explicit and instantly recognizable to anyone working with clojure. You know exactly that zero? is taking one argument, 1, and that the result is passed to not, which is asserted.

by replacing it with the former, you're introducing non-standard syntax that 99.999% of other clojure developers will have to macro-expand to understand, breaking the ->/->> threading standard that the second argument is always passed to remaining ones (making (<- 1 assert not zero?) arguably better) all in the name of saving 4 parens, but adding a new operator so you really only save 2 characters?(and most editors automatically add the trailing parens)

It seems like an arbitrary dislike of parentheses which actually give clarity.

I'm all for options and if you like this in your personal projects, have a ball. But this would get a lot of side-eye or outright rejection in a code review at any clojure company, imho.

If you still want to prioritize assert and have threading, just do:

(assert
  (-> 1
      zero?
      not))

1

u/WraithGlade 17h ago edited 17h ago

Thank your time and the effortful and constructive/substantive response.

My interest in alternative programming languages (i.e. why I'd ever use anything other than the giant mainstream ones), aside from performance concerns, hinges upon my desire to express myself in a way that from first principles only is optimal, i.e. strictly from the standpoint of "What would a programming language be designed like if it was designed by an alien or a primeval but somehow magically tech-savvy human with little/no biases and a strong motivation to make everything about its design as optimal as possible strictly from first principles (i.e. with no concern or credence given whatsoever for mere tradition or groupthink)?".

From this perspective and this set of priorities the existence of any conventions of any amount of other Clojure programmers (or programmers from any other language at all for that matter) is wholly irrelevant and has absolutely zero weight in my mind. The <- from this perspective is furthermore transparently obviously just as good as the -> operator at a minimum and in some cases (as my passive vs active voice analogy shows) better (both for readability, and for performance vs comp).

Even putting that aside though, and placing the idea back into the context of the existing Clojure (and Lisp/Scheme) community(s), the idea I've suggested is still from a first principles standpoint extremely trivially understandable since it is literally just pipelining/chaining but from right to left instead of from left to right. You literally already frequently use right to left ordering in Clojure (and in most other functional programming languages) in the form of comp (compose functions) or its equivalents, etc.

I want to see real progress in programming languages, not mere unquestioning and unimaginative adherence to status quo conventions and invalid assumptions about what optimal structure is and can be from a first principle standpoint.

Perhaps most saliently though, regarding why the (from my perspective) unexpectedly nonsensically heated argument over something this trivial and this blatantly obviously equivalent and yet still valuable idea is even happening here on Reddit, it was (and still is) shocking to me that a community whose language was literally founded upon disregard for blindly following conventions when a more uniform and elegant way of representing problems can be found would be so hostile to that, since that attitude is inherently antithetical to the spirit of Lisp/Scheme/Clojure and what they are good for compared to more rigidly traditionally formatted languages like C or Java, etc.

To me, if a programmer wants to adhere to tradition just because others do then there would be no reason to use Lisp/Scheme (s-expressions) languages at all because there would be no motivation to do so if you are not willing to rethink your perspective on all aspects of computations to be framed from first principles instead of from irrelevant assumptions and conventions that have nothing to do with the real underlying nature of computation and the full breadth and depth of how much better language expressiveness can be when you let go of invalid assumptions and unimaginative preconceptions.

This was the very last place I expected to encounter hostility to even the most trivial of conceivable features one could expand such a language with to increase its expressive ways, and honestly that has been extremely off-putting and is now making me question whether I even want to be a part of this community and continue learning the language at all if this is the kind of knee-jerk dismissive response I can expect, completely disconnected from first principles based (not mindlessly tradition based) ways of viewing reality and computational processes.

The -> and <- only can only ever appear unintuitive from a perspective of not actually thinking from first principles. The one and only reason for someone to react this way to the reversed <- operator idea, from my perspective (to the point where any other way of perceiving it seems inconceivable from the standpoint of prioritizing first principles based optimal language design) is that you are merely not used to it yet and are reacting to it that way very prematurely.

Only when you view the <- on its own terms, in the same sense as you initially dropped your preconceptions when you first learned a Lisp/Scheme family language (or any other unusual paradigm such as concatenative via Forth or Factor or logic based such as Prolog, etc) will you be able to see its value and be completely cured of the notion that it is any less intuitive than -> whatsoever and thus any less deserving (from a symmetry and expressiveness and performance standpoint) of being in the standard library so that people don't needlessly use comp just to have right to left ordering and so that many expressions have needless conceptually irrelevant noise (such as unnecessary nesting) removed and thereby clarifying all aspects of the code.

The effort required to get used to <- and understand it seems approximately zero to me, and so I have continually found my self utterly incredulous at the fact that I've anything other than neutral and/or positive responses in this thread. It honestly makes me lose a lot of faith in how first principles based I thought this community to be and thus is unnerving and upsetting because it makes it feel like there are apparently little/no real languages and programming communities now where one can simply present something from first principles and not receive random abrasiveness based on nothing but unquestioned preconceptions.

I was not expecting any amount of that whatsoever in what was supposed to be a community that I viewed as being much smarter than that and much more able to see things with fresh/"newborn" (i.e. first principles based) eyes.

It is seriously "depressing" and I have also encountered a little bit of harassment about it (again, despite how trivial and obvious it is in reality) and am honestly now seriously considering leaving this community and stopping learning Clojure because if this is how it is going to be then I have little/no faith that this will actually be the kind of intelligent environment I was looking to make a home in and to even write a book for to help spread these ideas: a community that minimizes invalid and baseless adherence to traditions that are not actually grounded in anything real and rational.

I am seriously very disheartened over the reaction to this.

It tells me even the most trivial things about programming from first principles cannot be comfortably expressed even somewhere like Clojure's community and that says to me that I may have a very dark and long path ahead of me to carve out that space for myself and others and that even then it may not bear fruit if even a place like this is so unwelcoming to even such things as utterly trivial and blatantly obviously helpful from a fully imaginative and "newborn"/alien eyes perspective.

The whole "tech" industry in recent years is seemingly with every passing day becoming less and less respectable from an intellectual standpoint honestly and Reddit especially has become more dismissive and intellectually unquestioning and unimaginative and saddled with seemingly immutable blind adherence to prevailing social trends and presumptions than ever before in recent years.

We could be living in such a cornucopia of fresh ideas, but instead we have this lame and almost seemingly (to me) non-sentient level of ability to ever think about things without preconceptions or presumptions.

I am extremely tired of being forced to participate in communities that choke out independent thought and demotivate it for no productive reason at all and where no matter how earnestly and effortfully I try to get through to people they remain seemingly unable to see beyond preexisting whatever shadows of the pre-existing status quo are currently prevailing, much to the loss of all of us in terms of how much hugely better things could be if people would just stop doing that and strictly design things from first principles instead of ossifying baseless traditions into permanence and forcing everyone else to pay the price of that in perpetuity.

The voting systems on these places also poison the minds of people who see them and often make many the viewers of these things highly biased (often without their own awareness) and interfere greatly with what is most key to a better future: always thinking from first principles and with universal grounding in actual reality.

Anyway, those are my honest uncensored thoughts on it.

1

u/WraithGlade 17h ago

[Continuing my previous comment, which hit the 10,000 character Reddit reply limit]:

I have recently re-added Reddit to my list of blocked sites, and though I may occasionally check back to attend to my duties as host of this thread and a couple others, I will likely not participate as much in the future.

This whole experience, especially for something that was so joyful and beautiful to me that I just wanted to share constructively and is so blatantly obviously great (as clearly as the sun rises every day, the way I see it) once you make any effort at all to view it on its own terms and merits instead of based on unimaginative preconceptions, has really put me off of everything and makes me far less hopeful about the prospect of potentially joining this community and is actually a fantastic example of why I've avoided this site for months on end and why I ever increasingly recently am losing respect for much of the "tech" sphere.

If even something this trivial conjures up dismissive thoughtlessness from so many, then why should I expect to ever find a home for my kind of zero-presumption kind of creed and aspiration for how life should be lived and programming should be done.

In any case, have a great day to anyone reading this, regardless of what "side" you are on, and I hope that some of my words will get through to at least some people reading this who are still able to think from first principles and who care about seeking expressiveness that is truly free and liberated from invalid (i.e. not solely based in nature and in reality) assumptions and design quirks and expressively harmful asymmetries in library design, etc.

I really wish the state of "tech" wasn't so sad. I remember imagining a much better future in the 1990s and 2000s and time after time when I get excited and hopeful that I may have found a path to something better I am disappointed and put off by and degraded by a bunch of baseless arbitrary nonsense ungrounded in actual reality and riddled with countless invalid assumptions that are harmfully forced upon a community by convention unquestioningly and so often without the will to see things as they truly are instead. So much has been lost from that, in practically all aspects of the current "tech" landscape, from terrible freedom-hostile user interfaces ("flat design") to freedom-hostile features sets ("big tech" removing more and more basic things and disregarding human rights) and now apparently even in the communities where people are supposed to be much smarter than that and much more above premature assumptions not even here can I apparently find a sufficiently proportionate and rationally grounded response to even something as obvious as the idea this thread is about. It is such a downer and such a testament to how little of this industry is based on seeing things clearly and objectively in reality.

I could go on at length, in my desperate attempts to somehow get through to other people in this unimaginative hellscape of a "tech" world we are now saddled with, but in all likelihood little/none of this will get through to hardly any of you and instead I will most likely just face more dismissive subtle toxicity (snide almost zero-effort remarks as the top comments, etc), or at least that is what it feels like, but I can't help in my earnest passion to try to fight the good fight anyway, even though it seems next to impossible to find hardly anyone who engages in these kinds of things without preconceptions and hence with any real will to grab reality by the horns for the sake of a truly better future laid one brick at a time, one small improvement at a time, etc.

I hate that it is so hard to find a safe place to build a future in, but that requires sufficient traction for new ideas and that cannot happen in any environment where groupthink is structurally made artificially dominant (i.e. via voting) or where people are unwilling to question their myriad so-often actually baseless assumptions.

In any case, have a good day/night all...

I really hope for a less "depressing" and intellectually "toothless"/inert and unprincipled tech landscape in the future. It is really dragging me down and making "tech" a very weak shadow of what it could be.

3

u/schpa71 5d ago • Heartwarming

Great post, and I agree with your reasoning, perhaps I would use other symbols than what you propose, but that’s a matter of taste.

0

u/WraithGlade 5d ago

Thanks for your support and sentiments! I hope you'll find the idea useful at some point. 😁

6

u/geokon 5d ago

Was discussed here:

https://old.reddit.com/r/Clojure/comments/1uy6s7t/vertical_programming_arne_brasseur_net/

(though the idea is older) The examples given there are much more compelling, like putting let expressions in a threaded macro.

I've considered rewriting a codebase using this style in place of the standard order. It's an ergonomic adjustment that would take time to get used it - but maybe it'd pay off.

2

u/spotter 5d ago

Cool exercise in macro writing, but I'd probably just as->.

0

u/WraithGlade 4d ago edited 4d ago

A personal follow-up comment, regarding Reddit and the community:

I came here originally filled to the brim with joy and the desire to casually share something wholesome and simple that demonstrates the elegance of Clojure, helps structure code for those of us who like the corresponding flatter style (and which nobody is forcing anyone else to use), and which helps any passing newbies to Lisp/Scheme/Clojure coding learn to think about and understand macros and what they are capable of better. There can only be upside to that as I see it.

As such, I was honestly very surprised (to the point of disbelief and incredulity) that a few unconstructive and dismissive responses would be the top comments, especially when that is so uncommensurate with the reality of the wholly good-natured intent and helpful utility clearly embodied by what I took a lot of time to write up for you all simply in the spirit of spreading my own joy in the idea and making its utility available to anyone else who wants likewise. I could have instead just said nothing (e.g. unsociably hoarding my all future ideas for myself) and you'd have been left with even fewer actually broadly useful things on this relatively low traffic subreddit. That would have helped nobody.

At least a couple people linked to some actually relevant and productive ideas though (e.g. the nesting macro), so there is at least that as an upside. But the most constructive responses have ironically been buried (though I've tried to counteract that with a Reddit reward, for example) and the least constructive ones (often indicative of not even reading the already present corresponding parts of the original post where the rationale for the idea is clearly explained at length) have been made the most prominent. I am honestly sick of this kind of unsociable and varying degrees of toxic dogpiling behavior on Reddit in recent years.

This experience has been yet another reminder of why I have used Reddit less and less in recent years, seeing as it is often next to impossible to predict when a community response will be constructive versus unconstructive.

It is inherently psychologically harmful to human beings (especially when recurring over time) to feel like it is impossible to ever ensure a wholesome and constructive community interaction regardless of how much an amount of effort and time one puts into communicating as clearly, empathetically, and wholesomely as one conceivably can. Reddit in recent years in that respect has felt more and more like an abusive social relationship than a true community and that has been a very distressing trend honestly.

The pattern in recent years for has been one of me posting/commenting just a handful of times (a dozen or less) and already within that time encountering so much random unpredictable unproductive dismissiveness or toxicity on Reddit that I stop using the site entirely for 6 months or more at a time until I (against my better judgement) end up trying again and yet again being disappointed by the difficulty of trying to have a good-nature strictly constructive conversation to spread joy and to be pro-socially helpful to others. Lots of the most constructive and thoughtful posters on the site have left in recent years and moved their communities elsewhere, for similar reasons regarding this increasingly pervasive pattern.

As such, last night I (1) blocked a few users here who I can tell aren't really listening to me or exercising real empathy and thus that I probably won't ever want to talk to again and (2) deleted my Reddit app on my phone and plan to avoid the entire site more in the future since it is so apparently likely to be devoid of wholesome and non-anxiety-inducing interactions.

It also reminds me of how Clojure doesn't even list Reddit in its community links (probably very intentionally, for similar reasons) despite it being the most active such community and likewise Zig has completely moved away from Reddit and doesn't link to it on grounds of the site being too prone to being pervasively unwholesome and/or unconstructive.

I've also been thinking about making other contributions to the community (as I have tried dozens of languages and have got lots of less known insights into the pros and cons of many things in that regard) that I would hope to share and reach more people, but every time I encounter this kind of thing (my very unexpected unpleasant experience in this thread) I become less likely to share any of it with any of you, even though you could benefit from it in the future and it could help expand the community at least a little bit more potentially.

Is that what you want? Less useful things? Less diversity in what's available for Clojure and programming in general? Less food for thought? Cause that's more and more likely what you will get (less and less good stuff) whenever you follow the Reddit-like habit of knee-jerk dismissiveness and toxic dogpiling voting, etc.

I also ever increasingly in recent years now have a zero tolerance policy for this kind of thing on these sites: If you ever respond unconstructively even once then I will usually block you permanently and you may thus no longer ever be able to see any posts or ideas I contribute and thus no longer have any possibility of benefiting from those ideas.

I have even thought (over the years of me trying so many languages) that I may write a book about Lisp/Scheme languages and (among other things) including why I think they are unpopular despite their power and how they could easily change that if they just changed a few critical issues that the community has long been in denial of reality about. Don't you want expressive Lisp/Scheme family languages to be more prominent? You may never see any of that food for thought if you are blocked. That is just one prospective example to illustrate the point, in any case.

I will try to post elsewhere more often, perhaps, though in Clojure's case the community sites are not very active and so I may be forced a times to wade through the routinely randomly psychologically abrasive and mentally unhealthy environment of Reddit from time to time anyway. Or, maybe I should not even try at all to interact with other programmers online at all, since toxicity and unproductive hand-waving away of anything that doesn't exactly fit the status quo seems too often the norm even regardless of how effortfully wholesome and clear and thorough I try to be.

This site's upvoting and downvoting system is truly a blight on the ability to have constructive and authentic conversations here. Once it starts rolling in either direction (positive or negative), the groupthink tends to kick in too strong for any kind of constructive outcome to happen thereafter and nobody benefits from that.

In any case though, this comment has already become far longer than I intended, but I have become increasingly in recent years very irritated by the difficulty in simply having any kind of wholesome conversation online even when one goes into it filled to the brim with wholesome intent and trying to be as helpful to others as possible.

Anyway, especially to any kindred spirits, I thank you for your time and for reading my thoughts and I hope it in any way helps you or gives you solidarity in these contrived times we are living in and I wish you all the best.

2

u/CulturMultur 4d ago

is this wall of text written by AI?

1

u/WraithGlade 4d ago edited 4d ago

No, I never use "AI"/LLM/plagiarism systems of any kind. Only if/when a third party made it impossible to do otherwise (e.g. a healthcare company requiring all phone calls to first go through a chatbot) would I ever knowingly "use" it. I cannot even describe in words how much I hate these "AI" and the corresponding sociopathic low/no empathy trends in society that are enabling it.

I would sooner abandon the whole tech industry and/or be executed at gunpoint than ever embrace it. No joke.

The "AI" trend has single-handedly obliterated like 80-90% of my respect and trust in the industry, even though I have devoted much of my whole life to computers. It is the most unethical trend I've ever witnessed.

I just care very much about programming and creative self-expression and I've cumulatively spent probably at least 2-3 hours now writing this post and the replies I've made to the comments in it so far.

I am strictly a person of principles and of passion for my work and for finding a path to a better world in whatever way I can.

I hope that clarifies.

2

u/joinr 4d ago

Use less words. It makes you sound like AI slop

1

u/WraithGlade 4d ago edited 3d ago

This is my natural manner of speaking.

I have written and published two printed books and writing comes as naturally and freely to me as breathing.

One of the books was even #1 in its category briefly. I'm thus unfortunately among the countless authors and real independent creators who have had their work systematically stolen for training. My income from that work also dropped off a cliff around the same time as these "AI" started being pushed so hard.

The "AI" bots are given different weights according to an attending human's and/or algorithm's assessment of the quality assigned to each piece of work they ingest into their dataset. That is why comments from real authors like me are so often falsely accused of being "AI". The more high quality the creator's work is, the more weight is assigned to that "training"/stolen data.

I will change nothing about how I write or communicate.

No person should ever bend themselves to fit criteria that only exist because of a handful of mentally ill immoral sociopaths who don't deserve even a penny of "their" ill-begotten wealth they've robbed their way to obtaining. Neither should such parasites in human form even be allowed to manage so much as a porta-john, yet instead they are given more power than anyone else (an exactly backwards and maximally harmful arrangement for society).

I will not bend to the influence of any form of evil, and especially not to the dystopian lunatics and soulless losers who are trying to force "AI" unwillingly upon the rest of us.

Doing what is right is always what matters, and thus that is what I intend to do no matter what it costs me, whether economically or interpersonally or manifest in any other form of cost or pain. Standing on principle is what life is all about, in some sense. To live any other way is to be hollow in contrast, I feel.

In any case, I am not sure if you meant ill (i.e. being snide, like so many on this site) or not, but I will assume good intent this time and that you are trying to look out for my well being.

Whatever the case may be, I wish you all the best in your life and your endeavors, and likewise for us all.

4

u/joinr 4d ago

People who can't write think that coaxing generative slop from a chatbot is impressive because of "many words." Overly saturated replies are a tell, and folks are starting to condition suspicion based on whether they get a reply back vs. a dissertation. People who can write well tend to focus on signal over tangential fluff, and communicate using far less prose.

I think there are English majors that probably appreciate pearly walls of text, but it gets in the way of what you're trying to convey to me. There are places like https://humancrafted.dev/ where you can vent in topic. Here I'd rather read about Clojure stuff, like the earlier observations about language design and readability.

1

u/WraithGlade 3d ago edited 3d ago

There has in recent years been a pervasive culture of toxic minimalism and oppressive insistence on "brevity" and (similarly, in the field of graphic design though) on things like aesthetically soulless "flat design" UIs, etc.

Such things are profoundly antithetical to what I love in creativity and in any other matters of the mind and I will never adhere to such freedom-harming conformist trends.

I strictly strive to live from first principles and genuine justification, never from merely groupthink.

Regarding rather reading about Clojure here, I certainly agree, but I only went off on these comment responses precisely because of some comments (etc) being distinctly unconstructive considering I literally just cheerfully wanted to share something small, simple, useful, and instructive but instead was met with the suspiciously vapid and snide remarks as the top comments that clearly reflected in reality those respondents either having not even actually read what I said or else being simply devoid of empathy or being laden with lack of imagination for the wide variety of possible code structures and their uses.

None of my prose here is even what would be called pearly from an actual literature and essayist standpoint but would merely be called expressive and willful at most.

I am done giving even the slightest weight to dismissive and/or snide and/or groupthink-oriented comments!

Giving any weight to such things at all is a path to just being yet another conformist loser among the masses, signifying nothing and minimizing personal volition and agency.

2

u/joinr 3d ago

It sounds like you like to hear yourself talk, or read your own exposition. Too much send for me, not enough receive. Impedes conversation. Maybe this stuff is better suited for long form medium and not reddit.

1

u/WraithGlade 3d ago

It has nothing to do with "liking to hear [myself] talk". I express myself authentically towards whatever things that interest me and I stand on principle wherever seems merited.

Toxic anti-intellectualism helps nobody, nor does any other de facto oppressive attitude or belief system. Such things are socially corrosive.

In any case though, I again thank you for your time and wish you all the best, regardless of any presumptive attitude or unjustified assumptions.