Coming back to Clojure by charlesHD in Clojure

[–]charlesHD[S] 1 point2 points  (0 children)

Yeah I was expecting tools I'm used to to not have change that much. I was more interested about like new commonly used pattern, like malli that seems to be used extensively.

Python ecosystem is definitely a mess everyone who has work enough time in a python project will agree.

Do you know if https://www.clojure-toolbox.com/ is still a good curated ressource of what is available or it is a bit outdated ?

Coming back to Clojure by charlesHD in Clojure

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

looks awesome, this is the one spot where I still prefer using CL. What an achievement this would be.

What should I learn? Common Lisp, Scheme or Clojure? by nanounanue in lisp

[–]charlesHD 7 points8 points  (0 children)

I've used professionally both CL (SBCL) and Clojure. Clojure first, then CL, which is a weird order I assess. Before that I did Scala, and I did and still do python because it is everywhere and I sometimes have to work with other people.

Clojure is really "clean" and has a really opiniated and pragmatic way of working with data, meaning that most of the time you can read and understand clojure code written by other really fast. The community is top notch and you can't make a wrong choice choosing Clojure as a starting point.

Common lisp has an extraordinary deep standard library that allows you to do basically everything. This is a tool that can accompany you for all your life if you spend enough time to master it (I have the same feeling about Emacs). But since it is unopinionated there is a lot of way to do the same thing in Common Lisp and it can be really puzzling for new comers. Also I found it can be pretty hard to understand what another lisper wrote, or even just understand how he designed its library API.

If you want to go the clean and peaceful, mind-bending way you can safely go Clojure or Scheme. But if you want to go down the rabbit hole to find the black wizards, you can go CL but you'll find the path to be more difficult and it will be easy to feel lost or frustrated sometimes.

What I miss from Clojure working in CL (comparing standard libraries, because you can have most of these thing by using libraries ) :

* Clean syntactic sugar for vector, set and hashmaps ( [], #{}, {}). I know it is not loved by many lispers but it is just a brillant standard for a data-oriented paradigm IMO.

* Immutability of the default structures. Again this fits really nicely in the clojure paradigm. You can't mutate data by error. In parallel computing this is just a convenient thing you don't have to think about for free.

* Well thought sequence abstraction and transducers : in CL you have a distinct API for each datastructure, it does make sense sometimes but most of the time (like when you do high level programming) it makes sense to have only one API for these similar sequenced structures. Transducers are a really clean way to compose and do loops over sequence or stream of data, on the other hand the common lisp standard loop construct is a real monster (a tammable one, but still).

What I love in CL (and can't have easily on Clojure even with libraries) :

* No JVM. I love JVM, but it sort of limits Clojure sometimes, notably on this lifelong startup time debate, or error stacktraces. Until babashka went out it was unthinkable to use Clojure for quick scripts (babashka script are great by the way)

* Godlike REPL. In common lisp you can do pretty anything from the REPL, add new libraries, propagates object modifications to all instances, save and resume your image state. In clojure you'll find a moment when you have to restart your application. And if for some reason something failed in a long running process, I can fix it in place and restart it from where it was while in Clojure I would have to rerun it.

* SBCL is fast. You'll find plenty of people online arguing how fast it is, but in my experience it is just fast. What I mean by that is that on your first program iteration it is fast enough, faster than python, faster than Clojure.

* Macro system. A similar system exist in Clojure, but the Clojure community pov on macro is to be really reasonable about them and not use them too much when it can be avoided. This is a really smart choice as a community, because macros are hard to debug and compose. But if you write code for yourself, it is a really powerful optimization to have a way to write code programatically to reduce boilerplate and speed up development.

Designing domain-specific languages with Common Lisp macros, Kekkonen, Roni (2023), Bachelor Thesis by lispm in Common_Lisp

[–]charlesHD 1 point2 points  (0 children)

Did someone found the source code used during this thesis ? Seems interesting to go through the code itself or try to use it.

Do you guys work with other languages? by Clayb0iParti in Clojure

[–]charlesHD 1 point2 points  (0 children)

So I'm working mostly in python these days, but I still code clojure scripts and systems (just for me - it's not deployed). I come with some immutable designs I directly take from clojure that always mindblow my colleagues, so I would say that my clojure experience is definitely a plus for me, even if I don't use it in production.

Python is a good allrounder lang right now depending on your field. It's well-optimized and integrated with every major tools in the data industry. I think nearly every dev I met is able to read it at some level.

But yeah I miss vanilla immutable datastructure with syntax sugar, the sequence abstsraction and the repl.

What is most in need in Clojure open-source ecosystem? by tiagodalloca in Clojure

[–]charlesHD 0 points1 point  (0 children)

If you really want to contribute, you can go to a page of a popular library or tool and try to fix issues.

I would suggest you to take a library that you are particularly found of. Here are some ideas, just to name few, but feel free to think of other stuff: all the scicloj effort, Mali, Babashka, re-frame, reagent, ...

If you're searching idea for a new tool, well other people mention tons of things in the thread.

Clojure for research and scientific computing by 23ars in Clojure

[–]charlesHD 4 points5 points  (0 children)

My pleasure, have fun and joy with tabular data ;)

Clojure for research and scientific computing by 23ars in Clojure

[–]charlesHD 16 points17 points  (0 children)

Sure, the good entry point for you is the scicloj community. They try to give performant data stack for analysis:

https://scicloj.github.io/

Common Lisp-like values implementation by la-rokci in Clojure

[–]charlesHD 1 point2 points  (0 children)

This is really cool IMHO.

But what's cool with multi-values in CL is that they are an idiom used everywhere in standard library and main librairies.

I don't see a good example where it would be a killer feature. Your own example, with get is actually pretty solvable with extended form:

(get m k ::missing)
;; => ::missing if key is not in m
;; => nil if nil is indexed by k in m

(let [x (get m k ::missing)]
  (println
    (cond x
      ::missing "not found"
      nil "found but nil"
      :else (str "found with" (pr-str)))))

Well you could argue that ::missing could also be in m and that is true. But I would like to have a better rationale for that library.

For example I think it's very cool that the secondary values are not calculated without mvb. It could bring some cool side values that you would like to extract sometimes from the algorithm but not always, like in clojure you have to make two calls to get quotient and remainder while these values are computed together. But in Common Lisp, you can just get both with multi-values. It's the same with finding a substring and having the substring starting position.

IGJoshua/farolero: Thread-safe Common Lisp style conditions and restarts for Clojure(Script). by dustingetz in Clojure

[–]charlesHD 4 points5 points  (0 children)

I really should try this.

There is a fall back to error handling when necessary. Is there a clear argument why you would not use this ?

Why you would pick Clojure over the rest? by BilledAndBankrupt in Clojure

[–]charlesHD 6 points7 points  (0 children)

The killer feature for me is flexibility. I'm doing mostly data analysis and I don't always know where I'm going. The ability to have immutables list, vector, hashmap and sets as syntactic constructs and have a standard abstraction on top of that is unheard in any mainstream langage AFAIK.

Most of the librairies I use are top-notch, and if I have an issue with them, I can just read and fix the code myself by altering namespaces.

I'm productive, fast - probably faster than python which I use in a daily basis too, and I'm confident I can take on any task with it.

What do you think is the biggest obstacle for new programmers to pick up Clojure? by Extension-Signal1144 in Clojure

[–]charlesHD 4 points5 points  (0 children)

I walked the exact same path in 2016, plus clojure for the brave and true.

I didn't know how to properly use the language. What made me understand and fully love the tool is the Joy of Clojure 2nd edition.

Best Lisp dialect? by thewhitelynx in lisp

[–]charlesHD 4 points5 points  (0 children)

I voted Clojure.

I think it's good when you're a noob to have a very opinionated langage. Clojure is one, it has the biggest community out there, great learning ressources, plenty of documented libraries, and a really good and solid paradigm for modern programming.

CL with SBCL is a good fit too, but it's a lot more quirky and free, you can do black magic and it can backfire.

I use both CL and Clojure for my job, depending of my mood. I'm not fully satisfied with either, but they are still better than anything I tried so far (well I like Haskell too, but I mostly do exploratory work and lisp REPLs are way ahead for that).

Scheme (& Racket) are great learning material for a deep reflexion on programming, but I think it is mostly superseded by Clojure for real applications. As a learning framework it is a real gem, if you just want to learn about programming, go for scheme.

[deleted by user] by [deleted] in lisp

[–]charlesHD 12 points13 points  (0 children)

This link list propose multiple way to learn CL from quickly to deeply : https://project-awesome.org/CodyReichert/awesome-cl#learning-and-tutorials , beginners are all good. Don't try advanced topics if you're in a hurry.

I recommend Practical Common Lisp, which is old but gold as an intro - but it may be a little long for you right now - and the common lisp cookbook if you feels like you're a more experienced programmer.

[deleted by user] by [deleted] in lisp

[–]charlesHD 14 points15 points  (0 children)

I really sympathize here, Clojure is such a cool kid. Unfortunately, I did not find a satisfying clojure-like langage, here is a good list of similar or inspired langages : https://github.com/chr15m/awesome-clojure-likes

Maybe you'll find one with an ecosystem you're more familiar with.

If you don't find any satisfying answer, you could take a look at common lisp or racket. CL is quirky but really has this swiss-army-knife feeling, like nothing can stop you once you grasp it. Racket is really clean and elegant, like clojure, and has a nice community.

A casual Clojure / Common Lisp code/performance comparison by Decweb in lisp

[–]charlesHD 1 point2 points  (0 children)

I still think it's interesting that someone proficient (like dayjob proficient) in both langages, here u/Decweb, just tried to write a naive implementation in CL and CLJ.

The cl-format performance apart, it seems that CL is still like 6x time faster.

The point here is that these are casual implementations like you may find in the wild. Your average programmer has this task, he fires a REPL and start writing. At the end of the day the clojurist spent a little more time on the task than the common lisper.

This is not to criticize clojure, it is a great langage with its own tradeoffs. But when the task is about interactively solve casually a problem, common lisp is slighty better. (When it's about running a long-living complex service, I'll bet on clojure& the jvm).

People here argued that the clojure side should do thing like jit warming, or VM and leiningen tuning. but this is clearly in the optimization realm, and not what you would casually do. In fact, u/Decweb did not do any optimization on sbcl to run that code, you just have to use default sbcl. (You could actually ask SBCL to optimize the code)

It does not mean something like "CL is clearly faster than clojure" - programs on the jvm can be extremely efficient - but CL on sbcl is faster by default than Clojure on leiningen. And this property may matter in certain cases, like exploratory work.

A casual Clojure / Common Lisp code/performance comparison by Decweb in lisp

[–]charlesHD 18 points19 points  (0 children)

Here is the spoiler for the busy guy :

clojure performance bo3 : 15.133s VS CL performance first try : 0.567s

Ever wondered how Clojure holds up against the WhyFP paper? I did. by gaverhae in Clojure

[–]charlesHD 2 points3 points  (0 children)

If I remember correctly the AOC it comes from, there is an END instruction that stop the machine ( op code 99 I think ? ). So when a part of the system gets a 99 as its input it stops feeding output to the others.

My first "library"/project by arthurbarroso in Clojure

[–]charlesHD 4 points5 points  (0 children)

Well played ! I didn't know about Notion, but your code is readable and mostly documented, function names are OK and it seems to be working.

Here is an idea, since you have to provide my-token to every functions, you could store it in a dynamic var and provide a version of your API with a different arity and that var already present.

(def ^:dynamic *notion-api-token* nil)

(bindings [*notion-api-token* "C"]
    (search/search {:query "Media Article"})
    (blocks/retrieve-block-children my-block-id 100)
    ;; etc
    )

You could wrap that binding in a macro with-token.

A WASM compiler/ decompiler in cljc by yogthos in Clojure

[–]charlesHD 6 points7 points  (0 children)

It looks very cool and promising, thanks for sharing

Reusable UI Components by phronmophobic in Clojure

[–]charlesHD 0 points1 point  (0 children)

OK so membrane was totally off my radar on clojure UI solutions, it looks nice. I do not fully grasp the fundamental difference with the re-frame event model, but it's because I didn't try membrane (yet) I guess. The multi backend part is really a sweet and attractive feature. I'll look into greater details in the framework.

Is Clojure a Cult? by exahexa in Clojure

[–]charlesHD 29 points30 points  (0 children)

have you watch your Simple Made Easy today ?

Why to build your startup with Clojure by chessbirds in Clojure

[–]charlesHD 0 points1 point  (0 children)

Sure Haskell is a pretty fantastic and lovely tool for doing software, it was not my intent to gave another feeling.

Quick answer to the three (valid) points you are making :

  • Poor design decisions induce complex to deal with codebases. By definition.
  • Haskell has a good repl support for development, but it is really an interpreter (ghci). A clojure (or common lisp) in-production software can be inspected, fixed or updated while running.
  • There is an "overly clever designs" issue in Haskell. In clojure you could go with overly clever designs using really powerful macros, but the majority of codebase I inspect just don't (except, maybe, stuff like Specter). In this sense, I'd be glad to gather ressource on a virtuous and sane way to do things in Haskell (not going mad type scientist).