This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-28
Channels
- # asami (1)
- # aws (9)
- # babashka (16)
- # beginners (32)
- # calva (2)
- # clj-kondo (20)
- # cljdoc (6)
- # clojure (35)
- # clojure-dev (25)
- # clojure-europe (11)
- # clojure-india (1)
- # clojure-norway (2)
- # clojure-spec (26)
- # clojure-uk (1)
- # clojurescript (41)
- # conjure (3)
- # css (9)
- # cursive (18)
- # data-oriented-programming (6)
- # data-science (2)
- # emacs (47)
- # events (1)
- # fulcro (15)
- # graalvm (30)
- # gratitude (7)
- # honeysql (27)
- # inf-clojure (4)
- # introduce-yourself (2)
- # lsp (129)
- # malli (7)
- # missionary (21)
- # nbb (17)
- # off-topic (18)
- # re-frame (6)
- # releases (1)
- # shadow-cljs (120)
- # vim (7)
- # xtdb (15)
nice blog, there's also setjmp, which is like a goto on steroid, allows you to reset the stack to a previous position. It think there was a try catch macro implemented with it. (Also allows to leak a lot of memory)
People on reddit pointed that out - I hacked a try/catch macro in the comments with it
Man, I really enjoy the dry tone, then "this is actually what OpenBLAS does" or "and here's some real firmware that just crashes" 😂
I would really appreciate it if you provided source code links with line numbers! Example: https://github.com/torvalds/linux/blob/master/tools/testing/selftests/net/ipsec.c#L131-L151
I can make that update. You can tell at a certain point I stopped looking for real world examples
I'm at "7. Return a boolean and take two out params" now. Really enjoying the reading. Thanks for writing it up! 😄
Don't know if this channel is the right one to ask. But do you know of any
blogpost or talk about the size of clojure libraries
(I expect them to be
smaller)?
Can't google anything in English (but managed to find one in my native
language). I am writing an article and would like to have a reference instead of proving it myself
Which clojure libraries are you looking at that are bigger than expected?
If libraries are large, it's typically non-clojure code that is the bulk of the size.
No, I have a point in my article that Clojure libraries are typically smaller than libraries on any other language. But instead of proving it myself I want to reference on something.
I'm not aware of any specific analysis, but it probably wouldn't be too much work to come up with some numbers. Some resources that might be helpful: • Clojars is the main host for clojure libraries and has some endpoints, https://github.com/clojars/clojars-web/wiki/Data • You can find a list of clojure github projects from https://github.com/phronmophobic/dewey (my project). • I wrote a small utility for analyzing the size of clojure libraries called https://github.com/phronmophobic/snowball. It's a pretty straightforward usage of https://github.com/clojure/tools.deps.alpha.
Thank you for that reply. But I only have a FAQ at the end of my blogpost about this subject, and It seems to be like a whole article by itself. For example, there is a parser library in java — Antlr. And in Clojure — Instaparse. They are incomparable because of several things like performance and APIs in different languages Antlr has. I am not sure if raw numbers like average lines of code per library really matters, as lots of libraries are just wrappers above Java. If there is a talk that has this subject mentioned at least I would have a reference to it. And I get this idea in the first place because there is such a talk in Russian that I referenced in my Russian blogpost copy.
compare interfaces instead of clocs. there are 15 public top level functions and records in instaparse.core namespace and for something simple you actually need just one. then compare with antlr java doc https://www.antlr.org/api/Java/org/antlr/v4/runtime/package-summary.html
I can't recall anything for libraries specifically but there have been a couple of code comparisons of the same project like the RealWorld web app that shows Clojure(script) needing much less code: https://medium.com/dailyjs/a-realworld-comparison-of-front-end-frameworks-2020-4e50655fe4c1 and this article describes a rewrite of an app going from 3000 lines of Objective C to 1500 lines of JS/React to 500 lines of cljs: https://itrevolution.com/love-letter-to-clojure-part-1/
Some Js libraries are really small as well. Most Java libraries are quite big through. Not sure how to make a fair comparison.
Yeah, lots of JS libraries are really small and are used everywhere, which is actually a horrible thing...