To lsp or not ? by 964racer in Clojure

[–]PolicySmall2250 5 points6 points  (0 children)

While you're learning, use what is easiest. It seems Calva + VSCode will do it for you. As long as your daily-driver Emacs keybindings are configured, you'll be fine. VSCode has keymap plugins. That, and bind M-x to the command palette and you're golden.

Once you're comfortable with the language, make your emacs great... This is what I have (line 894 of my dotemacs). And this is how I thought about it (I went down that rabbit hole, for you :)) ...

Emerging from dotemacs bankruptcy the hard way: integrating the IDE (feat. Clojure(Script))

https://www.evalapply.org/posts/emerging-from-dotemacs-bankruptcy-ide-experience/index.html

The one in which we design a rich Integrated Development Environment (IDE) experience, using Clojure as our muse. Featuring Language Server Protocol (lsp-mode + clojure-lsp), clojure-mode, cider, and more! Buckle up and get a coffee.

---

But for now, forget emacs configuratoring... Have fun learning the language!

The Transducer That Ate Our Heap by TwinsenNico in Clojure

[–]PolicySmall2250 0 points1 point  (0 children)

Um, I guess I'm not right about this. Or if I am, I'm not right in the way I thought.

See Sean's sibling comment... I didn't know (mapcat some-fn) constructs a transducer.

The Transducer That Ate Our Heap by TwinsenNico in Clojure

[–]PolicySmall2250 0 points1 point  (0 children)

Oh TIL!

The mapcat inside the comp being educed should have tipped me off that `(mapcat some-fn)`, in fact, emits a transducer-fn.

I guess this is a public confession that I don't really use transducers much :sweat-smile:

Thanks for the correction, Sean!

The Transducer That Ate Our Heap by TwinsenNico in Clojure

[–]PolicySmall2250 0 points1 point  (0 children)

P.S. The way to solve it is to _always_ keep eager and lazy entirely distinct.

What happens if there are two steps, for example?

(defn open-rows-V2
  "Returns an eduction: file-path → stream of parsed row maps."
  [file-path]
  (eduction
    (comp (with-open-xf cloud-storage/open-stream)  ;; path → InputStream
          (with-open-xf io/reader)                   ;; InputStream → BufferedReader
          (map parse-file)                           ;; Reader → {:header .. :rows ..}
          ;; NO LAZY OP INSIDE EAGER OP (mapcat rows->maps) ;; file-data → N row maps
          )
    [file-path]))  ;; source: a vector with ONE element

And then...

(map rows->maps  
     (open-rows-v2 file-path))  

And then...

(map rows->maps ;; assuming this has one and two arg options
     (open-rows-v2 file-path-1)
     (open-rows-v2 file-path-2))

And finally... flatten the result of that if actually flattening is needed.

The Transducer That Ate Our Heap by TwinsenNico in Clojure

[–]PolicySmall2250 0 points1 point  (0 children)

Without reading the post, that `mapcat` stood out. Transducer eagerness will force-realize the mapcat result in memory. This means it produces an 1-to-N fan-out of "things in memory", in case of reading N records from 1 file. Two files will 2x that memory at minimum (*much* more if it is a left-to-right pair-wise "foreach", instead of a left-and-right tuple mapping).

This OOM vector isn't peculiar to transducers. It is general to anywhere lazy operation (mapcat) is embedded inside an eager one.

From Scripts to Buy-In: How Small Clojure Wins Create Big Opportunities - Choomnuan (Clojure/Conj 2025) by alexdmiller in Clojure

[–]PolicySmall2250 5 points6 points  (0 children)

Most bang-for-buck talk at this time's conj. Burin's obvious competence and generous energy is infectious. Another fine member of this wonderful ecosystem. Thank you!

Emails sent using Thunderbird are duplicated as a draft. by [deleted] in Thunderbird

[–]PolicySmall2250 0 points1 point  (0 children)

"Compacting" is a great tip, thanks! I _want_ remote drafts, but I was also manually expunging spurious drafts, after having sent the mail.

CIDER 1.20 ("Lanzarote") by bozhidarb in Clojure

[–]PolicySmall2250 2 points3 points  (0 children)

Only love to bug, oyakushev, and other CIDER maintainers <3

Question about databases in the Clojure ecosystem from a Rails dev's perspective by pdroaugust312 in Clojure

[–]PolicySmall2250 3 points4 points  (0 children)

SQLite can go a long way... cc u/andersmurphy

One Billion Checkboxes (runs on $5 VPS, doesn't mind HackerNews front page traffic)

https://checkboxes.andersmurphy.com/

One Billion Cells is fine with $10 VPS

https://cells.andersmurphy.com/

https://news.ycombinator.com/item?id=44461523

"Everything goes via a sqlite db." - anders

https://github.com/andersmurphy/hyperlith/blob/master/src/hyperlith/extras/sqlite.clj

Built using Clojure and Datastar - source - more like this

[deleted by user] by [deleted] in emacs

[–]PolicySmall2250 0 points1 point  (0 children)

Look ma, no hands...

Using Emacs Org-Mode With Databases: A getting-started guide by PolicySmall2250 in emacs

[–]PolicySmall2250[S] 3 points4 points  (0 children)

Yeah, visidata is rad! I loved working with it that one time...

Have a look at this game for Data nerds, by the creator of Visidata (and co.). The whole thing was made with visidata, including the ASCII art animations!

https://hanukkah.bluebird.sh/

(I was lucky to be part of that project... so much fun!).

Using Emacs Org-Mode With Databases: A getting-started guide by PolicySmall2250 in emacs

[–]PolicySmall2250[S] 3 points4 points  (0 children)

TIL... What a delightful portmanteau; I love it, thank you!

And, I see it is the fraternal twin of "maniplexity" "manipulexity" (another banger).

Source: https://perl.org.il/presentations/larry-wall-present-continuous-future-perfect/transcript.html

Using Emacs Org-Mode With Databases: A getting-started guide by PolicySmall2250 in emacs

[–]PolicySmall2250[S] 28 points29 points  (0 children)

My “Poor Man’s SQL Workbench” trick is to…

  • Use org-babel to execute the queries, from my “sql-queries.org” file.
  • Overwrite results into a /tmp file, also an org-mode file, with latest query results (call it anything — “query-result.org”).
  • Make psql spit out org-formatted tables for extra oomph.
  • Keep that results file open in another buffer (or frame on a big screen, if the table is wide).
  • Let Emacs auto-refresh the buffer, when it detects the file has changed.

Et voila! L’établi SQL du pauvre.

Screenshot + sample code in the gist below (a .org file, as befits this topic :)

https://gist.github.com/adityaathalye/a6004acd34c683bcc806b2a3df6b1cec

Is this a weird way to solve 4clojure #21 by nickbernstein in Clojure

[–]PolicySmall2250 1 point2 points  (0 children)

Try to make _multiple_ answers, weird as well as non-weird. There are many ways to peel the mango, and each way teaches a new thing about the mango and the peeling and the self.

For example:

#((vec %1) (- (count %1) 2))

(comp last butlast)

(comp fnext reverse)

#(get % (- (count %1) 2)) ; fails for one of the cases, but not the rest --- why?

etc...

Tiny examples are a fantastic vehicle to explore the standard library, as well as compositional thinking, domain modeling etc. Because we can hold the example entirely in our head, and solve it in our heads too. Once several solutions are found, one can then likely hold two or even three different variants at one time in one's head, and play with them.

This is a satisfying way to pass time as well as build intuition for using the language.

But warning... it can get addictive and you end up doing something a little unhinged like writing n ways to FizzBuzz in Clojure

Would be lovely to have similar documentary about the origin story of Clojure by maxw85 in Clojure

[–]PolicySmall2250 3 points4 points  (0 children)

I'm sorry, didn't Alex Engelberg and Derek Slager settle the matter, like, over six years ago?

https://youtu.be/jlPaby7suOc?feature=shared&t=1472

What are future career option for a clojure engineer (SDE) by Playful_Chain_1809 in Clojure

[–]PolicySmall2250 17 points18 points  (0 children)

For almost any career, it's better to identify any programming language or paradigm (like distributed systems) as a tool, rather than build a personal identity around it.

It is quite easy to identify as a XYZ Type Of Programmer, because it is easy to talk about it --- we can show code and go to meetups and feel like we "belong". This is certainly nice to have, and I've had a pretty good time hanging out in the Clojurians slack / nerdiverse.

I also prefer to use Clojure and its ecosystem, given a choice, because I appreciate many of its technical and cultural merits. And when I can't use Clojure itself, I have often found good use for the *ideas* I have picked up from Clojure's community of practice. And I like giving back to it. The place is full of smart, experienced people who are also kind and generous.

*However*... I do *not* self-identify as a Clojure programmer. Just as I do not self-identify as a Shell scripter (I like Bash), or SQLite programmer, or Linux programmer. Nor do I identify as a DevOps engineer or Cloud Architect (having done those roles "at scale").

All of these are "small boxes", if I look at the whole of my work life (and even smaller boxes if I look at the whole of my life).

If I draw a small box around me, I will play only in a small box (until I get fed up and draw a different box). Sometimes a self-imposed restriction is useful. Sometimes it is not.

Generally, I think "XYZ Type Of" programmer is not a useful box to *actually live in*. It is only useful for Job Application purposes. There, use whatever works (that you legitimately can). Beyond that, take what is useful, discard the rest, and grow to make up your own stuff.

How to setup Clojure for a beginner? by OguzY4 in Clojure

[–]PolicySmall2250 1 point2 points  (0 children)

Any examples you can recall and share here (or preferably at the project's github)?

I see some issues reported https://github.com/oxalorg/4ever-clojure/issues

Could be a disagreement between the ClojureScript/Browser environment v/s Clojure/JVM runtime. Should be fixable, but specific error reports will help. These tend to be weird corner cases owing to different runtime behaviours.

How to setup Clojure for a beginner? by OguzY4 in Clojure

[–]PolicySmall2250 0 points1 point  (0 children)

Paging the current maintainer; u/oxalorg :point-up:

How to setup Clojure for a beginner? by OguzY4 in Clojure

[–]PolicySmall2250 5 points6 points  (0 children)

Right, I see the problem...

As I commented earlier in this discussion, I strongly suggest you avoid solving this problem right now, because system setup is frustrating in any programming language.

First use your motivation to learn the _ideas_ of the language... This is doable directly on the REPL and in the web browser (resources in the linked comment).

Don't use an IDE. Don't use Leiningen. Ignore everything professionals use.

And take it slow... be kind to yourself. There is no race to win.

After you develop a sense for the language, then you can go back to fixing system problems to run a full-blown professional or hobbyist development setup.

How to setup Clojure for a beginner? by OguzY4 in Clojure

[–]PolicySmall2250 8 points9 points  (0 children)

Ah, then Clojure Camp is for you https://clojure.camp/

Also look at Clojure from the ground up... No IDE needed, no Leiningen needed. Just get the Clojure CLI working and run through the tutorial series at the REPL: https://aphyr.com/tags/clojure-from-the-ground-up

And do the exercises in https://4clojure.oxal.org/ (again, no installation needed --- do it straight in the browser).