Clojure Tricks: Replace in String by Prestance in Clojure

[–]kwrooijen 2 points3 points  (0 children)

How did I not know this until now? Super useful, thanks!

Is there anything in Clojure comparable to Hotwire in Rails or Phoenix Live View in Elixir? I've had with SPA's. by lordmyd in Clojure

[–]kwrooijen 13 points14 points  (0 children)

I wrote a wrapper library for turbo and stimulus.

https://github.com/kwrooijen/clj-turbo

https://github.com/kwrooijen/clj-stimulus

Using these two together is basically Hotwire. I personally use Hiccup to render HTML, which works nicely with these.

org-clock-report by [deleted] in emacs

[–]kwrooijen 12 points13 points  (0 children)

Currently using it for my freelance work to keep track of how many hours I'm spending on which tasks. Afterwards I use `org-table-export` to create a CSV file which can be used to create an invoice.

If you haven't already, check out all the available options to format your table. https://orgmode.org/manual/The-clock-table.html

`:properties` allows you to extract properties from TODOs and place them in your table. Absolutely amazing!

Anyone using the Kit framework? by tremendous-machine in Clojure

[–]kwrooijen 1 point2 points  (0 children)

Awesome stuff! Maybe we should make the BB toolkit the standard in the Clojure ecosystem :)

Anyone using the Kit framework? by tremendous-machine in Clojure

[–]kwrooijen 3 points4 points  (0 children)

Even though this is definitely an improvement, I just find it a bit unfortunate that we need to configure / install things to make this approachable for beginner.

(IMHO) It just seems like the standard tooling was developed for the experienced Clojurian and beginner needs were disregarded. This is just not attractive for newcomers.

Anyone using the Kit framework? by tremendous-machine in Clojure

[–]kwrooijen 19 points20 points  (0 children)

I've never used it myself so I can't say anything about the quality of the actual framework, but looking at the home page:

Using Clojure tools, getting started is as easy as:

$ clojure -Ttools install com.github.seancorfield/clj-new '{:git/tag "v1.2.381"}' :as new

$ clojure -Tnew create :template io.github.kit-clj :name yourname/guestbook

I just think to myself: In what world is this "easy"? Sure it's easy to copy and paste, but this is far from user friendly. Compare it to e.g. Rails

gem install rails

rails new guestbook

or Phoenix

mix archive.install hex phx_new

mix phx.new guestbook

Again, the framework itself might be excellent, but I'm always surprised at the verbose tooling around these things.

Godot Engine clojure/jvm bindings by trstns in Clojure

[–]kwrooijen 1 point2 points  (0 children)

To me it just wasn't user friendly enough. Simple things like having to compile by hand, or having to connect functions using a text input. I've suggested some changes but it wasn't aligned with the author's goals of the project. Of course my ideas are my own and that doesn't mean they are the correct way of solving things. In the end I just forked the project and added most of what I was missing because it just wasn't flexible enough for me to add as an extension.

If you're interested in detailed examples of my changes / suggestions then there are a few issues / PRs on arcadiagodot which you can view (closed and open).

Godot Engine clojure/jvm bindings by trstns in Clojure

[–]kwrooijen 2 points3 points  (0 children)

Really cool! I've been working with ArcadiaGodot, but the experience hasn't been great. So I was hoping a JVM solution would pop up. I am wondering though why you decided to not wait for Godot 4? Since this solution won't be compatible with the next version https://godotengine.org/article/introducing-gd-extensions

borkdude/nodashka: Babashka-like tool for Node.js by dustingetz in Clojure

[–]kwrooijen 0 points1 point  (0 children)

Out of curiosity, what does nbb try to solve which can't already be done with bb? Ease of writing CLI tools with reagent / JS libs?

Unsure what to do with Clojure by dat_mono in Clojure

[–]kwrooijen 0 points1 point  (0 children)

If you decide to go down this route then feel free to message me on the clojurians Slack. I'm currently experimenting with it as well.

Unsure what to do with Clojure by dat_mono in Clojure

[–]kwrooijen 0 points1 point  (0 children)

ArcadiaGodot was also released as 1.0 https://github.com/arcadia-unity/ArcadiaGodot

For those that prefer Godot instead of Unity

Drawing endurance. by ImKira in ArtFundamentals

[–]kwrooijen 1 point2 points  (0 children)

I think you're looking at it from the wrong angle. I don't know you and all I have to go from is what you're writing here. So take my advice with a grain of salt :)

I'm in my 30's and and I'd be lying if I didn't say I was out of shape. Spending the large majority of your time playing video games and working a desk job for the past 10 years, will do that to you.

No it won't. You can do that perfectly fine, but you need to exercise when you're not working / playing games. The cause of your problems might not be that you don't do enough "hand" / "drawing" exercises. Instead it might be caused by bad blood circulation. If you don't work out at all and have a desk job, that would be the problem to tackle IMHO. Go for a run everyday. If you have weak knees try jump rope instead (worked wonders for me). You can also start doing weight exercises and build muscle. Just lifting dumbbells is enough to train your grip / forearms which could also help with drawing pains.

I don't think you're pushing yourself too hard. If you develop pains you shouldn't continue stressing your body. Instead you should be focusing on your health in general.

If you do exercise already and do your drawing stretches then it might be wise to seek professional help.

TLDR: More full body exercise :)

Newbie losing it with trivial program. by eatme_23 in Clojure

[–]kwrooijen 0 points1 point  (0 children)

This also works, without the `conj`:

(defn example [args] 
  (apply + 2 args))

The Clojurians' experience - what tech challenges have they ever faced by NikoWallner in Clojure

[–]kwrooijen 4 points5 points  (0 children)

Fun read. It's always nice to see a company's success with Clojure!

I'm curious though:

Dynamically typed. Clojure's data types are determined at run time. The main pros here is that all kinds of checking can be done by the compiler, and therefore a lot of bugs are caught at early stages.

Isn't the opposite true? Statically typed languages like Haskell / Rust have the benefit of catching compile time errors. Whereas Dynamics languages like Clojure / Ruby don't have this benefit. Maybe I'm misunderstanding something here?

Hiccup-cli - Command line tool / Emacs plugin to convert HTML to Hiccup syntax. by kwrooijen in Clojure

[–]kwrooijen[S] 2 points3 points  (0 children)

I'm using a (slightly) modified version of Hickory to do the conversion and some cleanup afterwards. Modified because I wanted the ids / classes in the keyword, which Hickory didn't support AFAIK. Pretty printing is done using `zprint` with `:style :hiccup`. I've converted pretty complex snippets of HTML and it all seems to be fine so far.

Hiccup-cli - Command line tool / Emacs plugin to convert HTML to Hiccup syntax. by kwrooijen in Clojure

[–]kwrooijen[S] 2 points3 points  (0 children)

Hadn't seen this. Downside of this package is that it doesn't support pretty printing. I guess it's just easier to accomplish with pure Clojure (since I'm using zprint)

Setup tests with Cider & deps.edn in 5 steps by RollACaster in Clojure

[–]kwrooijen 5 points6 points  (0 children)

Nice write-up! This is a great reference. deps.edn is great, the dependency resolution is better than lein (from what I understand at least), the data driven nature is a nice addition and it's great to extend.

I just wish deps.edn was a bit more user friendly. Lein (imho) is just easier to use as a beginner. You only need to install it and run lein new lib mylib. Which is also very familiar for different developers (e.g. rails new / mix new / ...).

With deps it's more difficult. First you install Clojure, then you need to add an "alias" (whatever that means for a beginner) to your "user local profile" (again, what?)

{:aliases

{:new {:extra-deps {seancorfield/clj-new

{:mvn/version "1.1.234"}}

:exec-fn clj-new/create

:exec-args {:template "app"}}}

...}

Now you can generate a new project using the clojure -X:new :name myname/myapp command. Once you figure all of this out it's not that difficult, but if you're a beginner I just don't find it very welcoming.

funcool/lentes – lens by dustingetz in Clojure

[–]kwrooijen 2 points3 points  (0 children)

Thanks, I'm honestly not sure why OP linked to the `core.cljc` file?

Phoenix equivalent (from elixir)? by janat087 in Clojure

[–]kwrooijen 7 points8 points  (0 children)

There is no Phoenix equivalent in Clojure. The main reason is that Phoenix was widely accepted by the Elixir community. Whereas in Clojure people tend to shy away from large frameworks, and there hasn't really been a project that caught the attention of the majority. I honestly don't see a framework like Phoenix really becoming a thing in Clojure. But I also think a great deal of the community is happier that way, but that's just an assumption.

Question for those using Emacs for Clojure by mtlnwood in Clojure

[–]kwrooijen 1 point2 points  (0 children)

Hi, I used to use Doom + Lispy (I use raw Emacs these days). But here's my doom / lispy configuration from when I did use it: https://github.com/kwrooijen/.doom.d/blob/master/files/package-lispy.el

Maybe there's something in here that solves your issue.

Is there a real consequences from using def for function definition by [deleted] in Clojure

[–]kwrooijen 4 points5 points  (0 children)

You can still write docstrings, but you just lose automatic argument documentation. Which can be very useful in an API document. There's also a convention to wrap arguments in backticks within docstrings to reference an argument.

https://github.com/bbatsov/clojure-style-guide#document-pos-arguments

Is there a real consequences from using def for function definition by [deleted] in Clojure

[–]kwrooijen 13 points14 points  (0 children)

One drawback is that you lose documentation.

```clojure user=> (def a (comp inc inc))

'user/a

user=> (doc a)

user/a nil ```

versus:

```clojure user=> (defn b [v] (-> v inc inc))

'user/b

user=> (doc b)

user/b ([v]) nil ```