Is there some guide on how to organize dev namespaces? I frequently find myself with a cluttered http://user.clj and plenty of other dev namespaces that I intended to become some kind of workbook for use cases of my software or for certain infrastructure-bugfixing stories. But these get out of hand very quickly and I end up deleting them again - and starting over. Am I holding it wrong? Should I reserve one user namespace for only starting up my system / selecting profile and keep the actual work in comment blocks in src/test?
We use Polylith structure in our mono-repo and we have a base called dev-helper which contains all devstuff and tooling.
User ns is for stuff I need loaded in every REPL. I keep infra-bugfix and utility scripts, runbooks, REPL explanations and so on separate from user.clj in a dir off the root, e.g. repl-notebooks, and load them individually as needed from the repl.
this is my workflow. never using user.clj since it loads unconditionally for everything. nowadays just clj -M:dev:start to start up my entire dev workflow. basically one namespace captures a "workflow", sometimes have more than one, depending on if I want to work on backend/frontend/both etc. https://code.thheller.com/blog/shadow-cljs/2024/10/18/fullstack-cljs-workflow-with-shadow-cljs.html
also sometimes have a src/repl folder for throwaway stuff thats only relevant right now and never needs to compile again and I don't bother updating over time. basically for repl experiments
I'm not quite sure I follow what you're describing but I keep my user.clj minimal and do the sort of work I think you're describing in comment forms in source code.
we have a dev folder on the classpath under our :dev alias. Another thing i really love is that we have a gitignored local/src classpath root. Super nice to have local stuff there that’s on the classpath but not checked in. Of course you can always use the classic load-file on any file as long as you keep namespace deps thoughtful.
In local/src/nocommmit is have:
70 directories, 14387 files
I use the nocommit namespace fragment so linters catch this stuff if any reference is left in the normal tree. The filecount has jumped because there are some actual little programs buried in there with files output, a few node modules, etc. But this kind of stuff on the classpath is extremely useful to me.
I use a dev directory that's an :extra-path for a :dev alias. I don't generally use a user.clj file. I name namespaces in dev as I would any other namespace, though I generally include dev as a segment, e.g.,
(ns com.grzm.some-project.dev.repl)
I can see not naming them like this, as they're not going to collide with another project as they're less likely to collide with other namespaces already on the classpath (and won't be loaded if the project is included as a dependency). I do like the added cohesion it provides me in thinking about the project as a whole.
And, as @dpsutton mentions, often there can end up being small applications included in dev, which can benefit from decomposition into multiple namespaces, and using the same convention I use for any other code is one less exception.yeah that’s what mine is like. CI will fail on it because the classpath won’t be there in CI. But nice to have something that can catch it at commit time. and had a former coworker setup a nocommit linter so you can use ; nocommit or #_ nocommit to make sure little bits of code weren’t committed, so having nocommit.trace or similar in var names just makes it slot into that system
This is how I approach a custom REPL startup, with examples of component / reloaded workflow for web services https://practical.li/clojure/clojure-cli/repl-startup/
Or look at the code in the dev directory of this working project https://github.com/practicalli/gameboard-donut
Wow, thanks a lot to you all :)
Nope. I just have it uncommitted. But you could do sub modules or other stuff. But for me it's more transient than that but more permanent than loading files from /tmp/
Anyone want to make a clojure submission for this? https://github.com/arjaythedev/multicore-server-challenge It is just the conduit app, but the youtube videos by this person have been fun to watch (if a bit slopped)
seems more like a postgres benchmark 😛
> No caching across requests. Every request reads its data from Postgres while it is being served: no response caches, query-result caches, in-memory copies of tables, and no remembered JWT verifications or bcrypt results. Postgres's own buffers are fine. That's the database. Connection pools and prepared statements are fine too: they cache connections and query plans, not data.
yeah, and all the top submissions are epoll-maxing
but still, good to have clojure represent
for http, this one seems better. https://http-arena.com/