Fork me on GitHub
#beginners
<
2022-04-29
>
Jon Olick03:04:13

Only 505 more core functions to go… lol 🙂 https://github.com/Zelex/jo_lisp

Jon Olick03:04:19

luckily many of them are not applicable as this isn’t java hosted.

didibus04:04:48

Cool project, I love seeing more Clojure in more place. But I have to ask, since it is interpreted, I'm not sure how you plan to achieve faster performance than JVM JIT Clojure?

didibus04:04:36

For example, take Python and Ruby, both have really advance C implementations of their interpreter, and yet the Java versions tend to be faster, because the JVM JIT is just that good.

didibus04:04:28

Sidenote: Was beginner really the channel you wanted to announce this in? There's a #announcements channel which would seem a better place.

1
Jon Olick14:04:58

It's currently interpreted :) not going to stay that way

👍 1
Jon Olick14:04:11

Just thinking long term of where I want it

Jon Olick14:04:26

Also, I suspect automatic parallelization is going to be a huge win

dumrat07:04:05

How to turn logging off in ring jetty adapter? It's cluttering my console.

Ferdinand Beyer08:04:01

I think you can’t turn it off directly, but you can configure logging to not include entries from Jetty. I think Jetty uses SLF4J, so you should configure this. Do you know how your logging stack looks like? A popular choice is to use logback, then you can configure which levels to log for certain loggers, and can mute Jetty

👍 1
dharrigan08:04:20

You can also do this:

dharrigan08:04:22

-J-Dorg.eclipse.jetty.util.log.announce=false

👍 1
dharrigan08:04:51

(in addition to settling the appropriate log levels as above)

Yogesvara Das09:04:13

does clojure have destructure syntax for maps that will let me destructure 1 kv pair and refer to the rest of the kv pairs in another map?

delaguardo09:04:54

you already have the rest of the kv pairs as a reference to original map

Yogesvara Das10:04:06

but I would like if I could get a new map without the kv pairs I've pulled out

Yogesvara Das10:04:45

(let [{a :a & rest} {:a 1 :b 2 :c 3}] ...) doesn't seem to work.

delaguardo10:04:02

there is no such operation map destructuring but you can be more explicit and write something like that:

(let [{a :a :as m} {:a 1 :b 2 :c 3}
      rest (dissoc m :a)]
  ...)

Yogesvara Das10:04:04

I guess that'll have to do. Thank you.

Alex Miller (Clojure team)13:04:38

maps are unordered so this doesn't make sense - you could get any kv pair

Yogesvara Das14:04:21

I'm not sure why it would require ordering. It would just be sugar for the above. Patterns and destructing are just to my knowledge sugar too.

delaguardo14:04:15

the destructure pattern you asked: & binding is a synonym to (rest ...) which applicable only to ordered data structure

Yogesvara Das14:04:01

is that a language/implementation limitation tho? or just a convention limitation

delaguardo14:04:19

rest function is rest function. you can't suddenly give it another meaning which you have to in case unordered data structure.

Yogesvara Das14:04:50

I was more alluding to it possibly being an extension to let or a change to how & expands

didibus18:04:20

People have built utils for this, it comes up once in a while. I can't remember them though 😛

didibus18:04:28

But no, there's no core feature to do this

rayat09:04:19

Hello, how can I directly add as a dependency to a lein project a specific github repo at a particular branch or commit? https://clojurians.slack.com/archives/CLDK6MFMK/p1651220427757339?thread_ts=1651220020.065459&amp;cid=CLDK6MFMK

delaguardo09:04:35

leiningen can't have git-based dependencies. You can try using some plugin that does that - https://github.com/tobyhede/lein-git-deps

rayat09:04:32

Oh dang - I don't think I'd be able to get that into my work project. Thanks anyways!

practicalli-johnny10:04:06

For your own development environment you could add a deps.edn file with the project dependencies and use Clojure CLI to run the REPL with hotloading. https://practical.li/clojure/alternative-tools/clojure-cli/hotload-libraries-editor.html The project code should not care if the REPL is run with Leiningen or Clojure CLI (unless using a Leiningen plugin that injects application code - e.g lein-ring)

rayat10:04:03

Hmm, I'm not too familiar with much of that, lemme try to understand: 1. From a high level, since this is a library I'd like to add to my work project, but likely cannot do so if I also had to add lein plugins, your suggested method is a personal, local stopgap until the next version of the lib is released, right? 2. Though it's a good learning experience, I've never actually run any clojure REPLs outside of using my IDE's jack-in with my work project's lein build/aliases/profiles or whatever. a. But since I don't know when the lib might next release, learning this might take less time anyways I guess! b. I will look into this 3. I'm not an expert on what our setup looks like, but I do know it's a Lein Monolith monorepo, idk if that injects anything Thanks!

practicalli-johnny11:04:49

1) suggested local setup as it was implied the project had restrictions as to what could be contributed I have added a simple deps.edn config file to work with a more monolithic project previously, allowing me to add on just the libraries I need to work on that project 2) There is a relatively small learning curve to Clojure CLI. There is a project called depify that can generate a deps.edn file with the same dependencies as the project.clj file (although not the profiles or aliases) Clojure CLI has aliases but not profiles. Aliases can be composed together when starting a REPL via the editor to make a variety of "profiles". The editor should detect Clojure CLI deps.edn config file in the root of the project (it may ask you to choose if it finds both) 3) sounds complicated. A monorepo can add complexity in general, although if organised well it should not have too... Depends how much thought went into the design. I has such a project and spent days trying to get it to work, eventually adding a deps.edn file to stop Leiningen configuration doing something I didn't understand.

wow 1
1
thanks3 1
practicalli-johnny11:04:43

Perhaps a simpler approach is to clone the git repository you want as a dependency, check out the preferred branch and commit, then build an uberjar from that with lein jar and install that jar locally with lein install An existing jar in the .mvn/repository may need to be deleted or the version changed in project.clj if Leiningen is not using the jar you built and installed.

😮 1
rayat12:04:28

I like the sound of that second one haha. I really appreciate your taking and interest and helping out man!!

👍 1
littleli11:04:04

Do we have a good tutorial on how to produce (DOs and DONTs) and publish libraries to clojars?

littleli12:04:37

actually sorry, I think this is right what I need: https://clojure.org/guides/deps_and_cli#_using_git_libraries

2