clojure

New to Clojure? Try the #beginners channel. Official docs: https://clojure.org/ Searchable message archives: https://clojurians-log.clojureverse.org/
devn 2021-03-02T01:30:30.399800Z

it also does the nice thing and will ignore thing if it is prepended with _, like _thing to signal unused

Valentín 2021-03-02T03:08:51.400200Z

Hi everybody

Valentín 2021-03-02T03:09:49.400900Z

does somebody know how to convert this java line code into clojure code?

Valentín 2021-03-02T03:09:53.401100Z

this.API = (WindowsNamedPipeLibrary) Native.loadLibrary("kernel32", WindowsNamedPipeLibrary.class, W32APIOptions.UNICODE_OPTIONS)

Valentín 2021-03-02T03:10:20.401800Z

I've been trying this...

Valentín 2021-03-02T03:11:24.402Z

(defn get-API []
  ;this.API = (WindowsNamedPipeLibrary) Native.loadLibrary("kernel32", WindowsNamedPipeLibrary.class, W32APIOptions.UNICODE_OPTIONS)
  (let [interface-class (.getClass osquery-clj.interfaces.IWindowsNamedPipeLibrary)
        unicode-options (W32APIOptions/UNICODE_OPTIONS)
        API ^osquery-clj.interfaces.IWindowsNamedPipeLibrary (Native/loadLibrary "kernel32" interface-class unicode-options)]
    API))

2021-03-02T03:13:38.402900Z

You should print out the value of interface-class

phronmophobic 2021-03-02T03:22:46.404600Z

what error are you getting?

Valentín 2021-03-02T03:22:53.404800Z

Im getting that error Interface (Class) of library=kernel32 does not extend Library

phronmophobic 2021-03-02T03:25:25.405900Z

For JNA, I've been using something like:

(def objlib (try
              (com.sun.jna.NativeLibrary/getInstance "CoreFoundation")
              (catch java.lang.UnsatisfiedLinkError e
                nil)))
It looks like you can pass in an options map to this call too. Does this work for you?
(def api (try
              (com.sun.jna.NativeLibrary/getInstance "kernel32" (W32APIOptions/UNICODE_OPTIONS))
              (catch java.lang.UnsatisfiedLinkError e
                nil)))

seancorfield 2021-03-02T03:29:54.406600Z

UNICODE_OPTIONS is not a function so the parens look wrong around that.

p-himik 2021-03-02T09:50:58.421200Z

I remember reading the code in Clojure compiler that would explicitly turn (MyClass/STATIC_FIELD) into a regular static field lookup. Can't quickly find it right now though. Perhaps it even worked that way for (.regularNotCallableField myObject)...

phronmophobic 2021-03-02T03:30:35.407200Z

that part works though

> (W32APIOptions/UNICODE_OPTIONS)
{"type-mapper" #object[com.sun.jna.win32.W32APITypeMapper 0x4a9f4493 "com.sun.jna.win32.W32APITypeMapper@4a9f4493"], "function-mapper" #object[com.sun.jna.win32.W32APIFunctionMapper 0x703d3680 "com.sun.jna.win32.W32APIFunctionMapper@703d3680"]}
¯\(ツ)

phronmophobic 2021-03-02T03:30:57.407400Z

it also works without the parens :thinking_face:

phronmophobic 2021-03-02T03:32:53.408Z

that block is from my repl, so I can confirm it works with and without parens

phronmophobic 2021-03-02T03:33:03.408200Z

unless my repl is doing something goofy

Valentín 2021-03-02T03:33:20.408700Z

now it seems it is working

Valentín 2021-03-02T03:33:32.409100Z

(defn get-API []
  ;this.API = (WindowsNamedPipeLibrary) Native.loadLibrary("kernel32", WindowsNamedPipeLibrary.class, W32APIOptions.UNICODE_OPTIONS)
  (let [interface-class osquery-clj.interfaces.IWindowsNamedPipeLibrary
        unicode-options W32APIOptions/UNICODE_OPTIONS
        API ^osquery-clj.interfaces.IWindowsNamedPipeLibrary (Native/loadLibrary "kernel32" interface-class unicode-options)]
    API))

seancorfield 2021-03-02T03:33:46.409600Z

And as for WindowsNamedPipeLibrary.class, in Clojure the class name evaluates to the class itself, so WindowsNamedPipeLibrary should be all you need?

Valentín 2021-03-02T03:34:20.409900Z

yes you are right

seancorfield 2021-03-02T03:35:29.410500Z

I'm just kind of puzzled by a Java interface that seems to have data members...

Valentín 2021-03-02T03:35:43.410800Z

with that change it seems its working

seancorfield 2021-03-02T03:36:09.411100Z

My Java is rustier than I thought? 🙂

Valentín 2021-03-02T03:36:34.411500Z

thanks all

phronmophobic 2021-03-02T03:36:37.411600Z

there's some odd things in JNA to make interop with c better

phronmophobic 2021-03-02T03:36:58.411800Z

honestly, I'm not sure how all of it works

seancorfield 2021-03-02T03:38:15.412100Z

Apparently you can declare variables (data members) in an interface and they are treated as static final. TIL.

1
raspasov 2021-03-02T04:53:50.412400Z

@pez hmm that sounds quite strange (esp the 200x)… what kind of code are you running and how many cores is the machine? What’s the (pipeline n …) number?

raspasov 2021-03-02T04:54:40.412600Z

Is it pure functions or is there IO in the code?

pez 2021-03-02T06:52:39.412800Z

I’ll make a repro.

pez 2021-03-02T07:52:37.413100Z

I think this is similar enough to what I do in my program, where I have a boolean-array where some positions are set, and some are not. Most are not. Then I want the indexes of the set bits of every odd position from the array, as a sequence.

(let [n 1000000
      ba (boolean-array n)
      every-other (range 1 n 2)
      prob 0.15
      sample-size (long (* n prob))
      to-ch (a/chan 1)
      from-ch (a/to-chan every-other)]
  (doseq [i (take sample-size
                  (random-sample prob (range n)))]
    (aset ba i true))

  (println "filter")
  (time
   (count
    (filter #(aget ba %) every-other)))

  (println "transduce")
  (time
   (count
    (transduce
     (filter #(aget ba %))
     conj
     every-other)))

  (println "core.reducers/filter")
  (time
   (count
    (into [] (r/filter #(aget ba %) every-other))))

  (println "core.async/pipeline")
  (time
   (do
     (a/pipeline 4 to-ch (filter #(aget ba %)) from-ch)
     (count
      (a/<!! (a/into [] to-ch))))))

pez 2021-03-02T07:54:04.413300Z

Output:

filter
"Elapsed time: 24.779003 msecs"
transduce
"Elapsed time: 23.854725 msecs"
core.reducers/filter
"Elapsed time: 23.759016 msecs"
core.async/pipeline
"Elapsed time: 3535.955765 msecs"
=> 74885

vandr0iy 2021-03-02T09:06:23.415500Z

Hi everybody! I gotta hook up a call (sentry 🙂 ) to all of the exceptions (`Throwable`s) in my application. Is there a nice AOP way to do it by adding a hook somewhere once?

lassemaatta 2021-03-02T09:21:20.415600Z

What kind of application are you developing? For example with a HTTP stack you can create a http middleware, which catches and re-throws the exceptions thrown by the handler(s) and reports them to sentry

dharrigan 2021-03-02T09:28:59.415800Z

You can try this:

dharrigan 2021-03-02T09:29:02.416Z

(defn ^:private set-default-exception-handler
  [sentry-logger]
  (Thread/setDefaultUncaughtExceptionHandler
   (reify Thread$UncaughtExceptionHandler
     (uncaughtException [_ thread ex]
       (log/warn ex "Uncaught Exception!")
       (sentry-logger {:throwable ex})))))

👍 1
dharrigan 2021-03-02T09:29:33.416200Z

You simply need to then provide a sentry-logger, which is a function that creates a sentry instance, configured as you see fit...

vandr0iy 2021-03-02T09:30:08.416400Z

hmmm ☝️ that's one way to do it

dharrigan 2021-03-02T09:30:23.416600Z

Works for moi in my application 🙂

vandr0iy 2021-03-02T09:30:54.416800Z

of course, I'd have to add the sentry hook to all of the caught exceptions - but that's mostly search and replace

vandr0iy 2021-03-02T09:31:09.417Z

yeah, I like this one. Thank you!

dharrigan 2021-03-02T09:31:26.417200Z

you're welcome. 🙂

dharrigan 2021-03-02T09:31:41.417500Z

btw, which sentry library are you using?

vandr0iy 2021-03-02T09:32:00.417700Z

I think I'll go with the official one. Got any reccomendations?

dharrigan 2021-03-02T09:32:18.417900Z

Which one would that be?

lassemaatta 2021-03-02T09:33:32.418100Z

I recently had some problems with the official one (`sentry-clj`?), it failed to report some clojure exceptions properly. raven-clj did not have this issue.

dharrigan 2021-03-02T09:33:56.418400Z

Which version of the sentry-clj are you using?

vandr0iy 2021-03-02T09:34:24.418800Z

@dharrigan sentry-clj

lassemaatta 2021-03-02T09:34:29.419Z

good question, I believe I tried the latest one a few weeks ago

vandr0iy 2021-03-02T09:34:49.419200Z

I also saw one from exoscale - is it worth it? which one are you using?

dharrigan 2021-03-02T09:35:04.419400Z

I'm maintaining the semi-official one

lassemaatta 2021-03-02T09:35:28.419600Z

(sorry, I didn't mean to hijack this thread with my own issues 😄 )

dharrigan 2021-03-02T09:35:31.419800Z

sentry-clj isn't official, in the sense that it's not sanctioned by Sentry. It's deemed a community-driven effort

dharrigan 2021-03-02T09:36:05.420200Z

If you have issues with sentry-clj, raise an issue on github and I'll see what I can do 🙂

dharrigan 2021-03-02T09:36:33.420400Z

PRs are welcome 'tho 🙂

borkdude 2021-03-02T10:36:38.425100Z

I'm a bit surprised that transit doesn't offer support for serializing arrays out of the box:

user=> (write-transit [1 2 3])
"[1,2,3]"
user=> (write-transit (into-array [1 2 3]))
Execution error (NullPointerException) at com.cognitect.transit.impl.AbstractEmitter/marshalTop (AbstractEmitter.java:203).
null

raspasov 2021-03-02T11:00:23.425400Z

I guess it focuses on Clojure data, and arrays are host-specific things:

raspasov 2021-03-02T11:00:35.425700Z

(into-array [1 2 3]) => #object[“[Ljava.lang.Long;” 0x55cad8a0 “[Ljava.lang.Long;@55cad8a0"]

borkdude 2021-03-02T11:02:16.425900Z

So are byte arrays, yet it supports them:

user=> (write-transit (.getBytes "foo"))
"[\"~#'\",\"~bZm9v\"]"

raspasov 2021-03-02T11:04:11.426300Z

I see… I don’t have other guesses 🙂

Timofey Sitnikov 2021-03-02T12:39:54.428800Z

Good Morning Clojurians, if I make a mistake and require something that I should not have, and get this:

user=> (require 'development)
Syntax error (FileNotFoundException) compiling at (app/model/session.clj:1:1).
Could not locate datascript/core__init.class, datascript/core.clj or datascript/core.cljc on classpath.
It seems like after fixing the issue, I have to completely restart the REPL for it to work properly. Would there be a process to fix and not have to restart the REPL?

borkdude 2021-03-02T12:45:33.429400Z

@timofey.sitnikov in the leiningen world you have pomegranate for this, in the deps.edn world there is something called add-lib

p-himik 2021-03-02T12:45:38.429500Z

Yes. You can use a different classloader that allows adding things to the classpath in runtime. While it may sound complicated, there are already implementations out there. Probably the easiest way to start using such functionality is to look at Sean Corfield's dot-clojure repo: https://github.com/seancorfield/dot-clojure Namely, search for :add-libs in the README.

1
p-himik 2021-03-02T12:46:03.429800Z

(I'm assuming you're using deps.edn)

Ben Sless 2021-03-02T13:54:27.430400Z

I there a way to override a specific method implementation in a defrecord?

borkdude 2021-03-02T14:20:40.430700Z

Hmm, maybe :extend-via-metadata helps somehow?

user=> (defprotocol Foo :extend-via-metadata true (foo [_]) (bar [_]))
Foo
user=> (defrecord FooRec [] Foo (foo [_] :foo) (bar [_] :bar))
user.FooRec
user=> (foo (->FooRec))
:foo
user=> (foo (with-meta (->FooRec) {`foo (fn [_] :overriden)}))
:foo
user=> (foo (with-meta (into {} (->FooRec)) {`foo (fn [_] :overriden)}))
:overriden
:thinking_face:

borkdude 2021-03-02T14:21:21.430900Z

But not really I think

borkdude 2021-03-02T14:21:39.431100Z

Do you mean a defrecord instance of the defrecord type btw?

Ben Sless 2021-03-02T14:23:55.431300Z

The idea was to override the equality methods for a record, but I can roll my own with a minimal deftype

borkdude 2021-03-02T14:24:39.431500Z

oh right

Ben Sless 2021-03-02T14:25:16.431700Z

Things got less pleasant where I had to implement my own hasheq 😞

alexmiller 2021-03-02T14:38:12.431900Z

you should not do this

alexmiller 2021-03-02T14:38:35.432100Z

if you want custom equality/hashing semantics, you should deftype

nooga 2021-03-02T15:21:15.434300Z

dumb question about internals: is the compiler supposed to evaluate each top level form one-by-one when compiling? it has to learn about macros somehow as it goes

nooga 2021-03-02T15:21:51.434800Z

or is there some more advanced magic involved?

alexmiller 2021-03-02T15:23:17.435200Z

the compiler first reads (string -> clojure data)

alexmiller 2021-03-02T15:23:49.435800Z

then compiles, then evaluates

emccue 2021-03-02T15:24:34.436600Z

@vandr0iy you can make your own try catch

alexmiller 2021-03-02T15:24:35.436800Z

compiling an expr will look at the thing in function position. if that's a macro, it expands the macro (this happens until it's not a macro)

emccue 2021-03-02T15:24:40.436900Z

thats always on the table

alexmiller 2021-03-02T15:25:19.438200Z

a macro is just a function that takes a form (clojure data representing a function call) as input and returns an alternate form (clojure data) to replace it with

emccue 2021-03-02T15:25:34.438600Z

not recommending it but you can always make

(custom/try
   ...
   (catch RuntimeException e
     ...)
   (finally
     ...))

emccue 2021-03-02T15:25:46.439100Z

and expand it to have whatever calls to sentry you want

alexmiller 2021-03-02T15:25:50.439400Z

the unit of compilation/evaluation is a single top-level form (not a file)

👍 1
emccue 2021-03-02T15:25:53.439500Z

that would be the AOP-iest way

nooga 2021-03-02T15:26:31.440300Z

yes, but defmacro is basically (do (defn x ...) (set-macro! (var x))) and that set-macro! call has to be evaluated for the compiler to know that x is a macro

nooga 2021-03-02T15:26:47.440700Z

ah right, that’s what I was wondering about

nooga 2021-03-02T15:26:57.441Z

thanks @alexmiller 👍

nooga 2021-03-02T15:27:55.441100Z

obviously it is not called set-macro! in Clojure, used that name for brevity

Ben Sless 2021-03-02T17:23:06.441800Z

That's what I ended up doing

p-himik 2021-03-02T18:06:38.442400Z

Could someone please point me to the repo that tracks the Clojure CLI bash script?

p-himik 2021-03-02T18:09:17.443Z

Thanks! Would've never thought to look in something that has "brew" in its name. :) And for some reason Google doesn't index the repo.

seancorfield 2021-03-02T18:17:35.443200Z

https://clojure.org/releases/tools is also a useful reference, listing all the releases and the changes in each.

👍 1
p-himik 2021-03-02T18:30:51.446400Z

I'm trying to use clojure.tools.namespace.repl/refresh and I've stumbled upon an interesting issue. When called for the first time, it seems to reload absolutely all Clojure files that it could find in the classpath. Regardless of whether they have been loaded before or not. The problem is that I have a few files that aren't loaded and require extra dependencies to be loaded. Clearly, I don't want refresh to load them at all. Is it possible to fix it on my end? Would it make sense to alter something in clojure.tools.namespace to support reloading only the files that have been loaded before?

mkvlr 2021-03-02T18:34:38.448400Z

we’re also seeing this, iirc it’s a problem with tools namespace not seeding the timestamp it uses to track what needs to be compiled directly

p-himik 2021-03-02T18:35:43.448600Z

Not sure. The docstring explicitly says that it will load all files upon the first call: > Scans source code directories for files which have changed (since the last time this function was run)

mkvlr 2021-03-02T18:39:09.450200Z

yeah, might well be a design decision but it’s annoying in our project where you need to wait forever the first time you call it

mkvlr 2021-03-02T18:39:39.451500Z

preseeding this timestamp might be worth a try

p-himik 2021-03-02T18:40:30.451700Z

Oh, that might help, I'll try that!

mkvlr 2021-03-02T18:43:04.452Z

please let me know if it does!

alexmiller 2021-03-02T18:48:48.453100Z

Yes, the repo name is bad and we have a ticket for that (but it requires updating a bunch of infrastructure so has not seemed worth it so far)

2021-03-02T18:49:21.453900Z

PSA: Clojars is having DNS issues - our provider (DNSimple) is having an outage, which is making it impossible to resolve http://clojars.org in some parts of the world. Hopefully they will get it fixed soon.

❤️ 1
alexmiller 2021-03-02T18:49:57.455Z

Note that the script linked above does have some variable replacement done on it before it gets published so you can’t just use it as is

p-himik 2021-03-02T18:49:59.455200Z

OK, adding

(alter-var-root #'clojure.tools.namespace.repl/refresh-tracker
                assoc :clojure.tools.namespace.dir/time (System/currentTimeMillis))
seems to work. However, it truly fixes only the initial loading issue. It will not fix a situation where you change some file that has not yet been loaded (and that cannot be loaded due to a missing dep for example) and then call refresh.

👍 1
alexmiller 2021-03-02T18:51:00.456500Z

Often when people ask this, their real need is something else which might have a better answer if you care to share

p-himik 2021-03-02T18:51:57.456700Z

Thanks! Yeah, I was just curious about the history of commits that first introduced clojure.libfile and later removed it. Cursive seems to still set the clojure.libfile property.

alexmiller 2021-03-02T19:10:29.459100Z

Ah, yeah, that’s dead, replaced by the basis property. I was setting both so add-lib would keep working but that’s updated now

👍 1
p-himik 2021-03-02T19:30:07.459800Z

Got it working properly (or at least, as I want it to work) with this:

(alter-var-root #'clojure.tools.namespace.repl/remove-disabled
                (fn [orig-remove-disabled]
                  (fn [tracker]
                    (let [filter-loaded #(filter find-ns %)]
                      (-> tracker
                          orig-remove-disabled
                          (update :clojure.tools.namespace.track/unload filter-loaded)
                          (update :clojure.tools.namespace.track/load filter-loaded))))))

p-himik 2021-03-02T19:33:49.460Z

@alexmiller You're the latest contributor to tools.namespace - do you have any thoughts on the above? Would it make sense to add such a behavior to the lib, perhaps under a flag or via a function that changers some var, like disable-reload! already does?

alexmiller 2021-03-02T19:34:14.460200Z

please file a question on ask.clojure..

👍 1
alexmiller 2021-03-02T19:34:20.460500Z

don't have time to look at it atm

2021-03-02T19:41:14.462500Z

I remember I found a tool similar to Ansible but written in Clojure, it’s not pallet, it was recently developed, I can’t find. any idea?

lukasz 2021-03-02T19:45:32.462700Z

Spire? https://github.com/epiccastle/spire

2021-03-02T20:04:27.464300Z

Yes thank you

vemv 2021-03-02T20:19:20.464600Z

Looks like you aren't invoking set-refresh-dirs beforehand? It's very recommendable to do so

p-himik 2021-03-02T20:24:08.464800Z

It still doesn't solve item 1 in the post above. It's easy to forget to add a newly created dir there. It's impossible to have a file that you don't want to load in the same dir with a file that should be reloaded.

vemv 2021-03-02T20:27:32.465Z

> It's easy to forget to add a newly created dir there. Can be solved in a number of ways; this is not a place to question t.n's API/design. > It will attempt to (re)load even the files that haven't been loaded before. This doesn't make sense, t.n's very job is loading code. Its first load will typically load all your project's code; if you aren't doing this you are following a custom/hybrid approach

p-himik 2021-03-02T20:31:14.465200Z

And I don't think that it's an invalid approach. At the very least, mkvlr above seems to share it with me.

mkvlr 2021-03-02T20:37:50.467100Z

@vemv IMO there’s nothing to reload when you call refresh after you project boots without code changes

vemv 2021-03-02T20:40:14.467600Z

there's everything to reload because nothing can be assumed to have been required. If something else was requireing your code, making refresh perceivedly redundant, you should have a careful look at what/why is doing that. https://github.com/stuartsierra/reloaded is the canonical example of how to setup a project using t.n.

p-himik 2021-03-02T20:43:55.467900Z

Still, it doesn't invalidate the desire to be able to adhere to, as you called it, a custom/hybrid approach.

vemv 2021-03-02T20:45:33.468100Z

I didn't suggest so

alexmiller 2021-03-02T21:22:40.471400Z

I’m not tracking this thread so please make sure relevant info ends up on the ask question, thanks!

seancorfield 2021-03-02T22:48:52.473800Z

We discourage cross-posting. People who want to see news and articles will subscribe to that channel. It's the same reason that articles/videos/etc are generally disallowed in #announcements -- it is for project/library releases only (and maintainers are discouraged from posting too often -- that's why we have #releases for more minor updates).

Timofey Sitnikov 2021-03-02T22:50:00.474100Z

OK, so how do you start? Do you just execute a single command and everything gets re-loaded?

seancorfield 2021-03-02T22:50:47.474300Z

FYI, every new member is automatically subscribed to #news-and-articles -- so if that channel has fewer people it is because they've chosen to leave it.

Felipe Reigosa 2021-03-02T22:50:59.474500Z

Got it. Sorry 😬

seancorfield 2021-03-02T22:51:41.474800Z

I deleted it from #clojure as it seems you are getting feedback in #news-and-articles

👍 1
seancorfield 2021-03-02T22:52:10.475100Z

Sometimes you just need to be patient before people get around to responding 🙂

Felipe Reigosa 2021-03-02T22:54:01.475300Z

Maybe I got greedy, it's not like nobody cared, I'll stick to announcements from now on. 😀

devn 2021-03-02T22:58:18.475600Z

Thanks for the heads up @tcrawley — and glad it was sorted quickly.

p-himik 2021-03-02T22:59:13.475800Z

Nothing gets reloaded. You require t.d.a (tools.deps.alpha) and call the right function to add a dependency in runtime. The linked repo mentions this near the description of :add-libs: "see the example load-master function in the comments in my deps.edn". That example explains pretty much everything.

2021-03-02T23:21:16.484400Z

Hello Clojure friends. It's your prodigal son who's spent some time wandering in statically typed functional land, especially OCaml as of late. Compared to Clojure, OCaml's experience for live editing is really subpar, and I want to improve it. There are 2 routes I'm considering: 1. Add better REPL support in my editor (similar to Calva/CIDER) 2. Don't do a REPL per se, but instead do something like https://quokkajs.com/. Whereas a REPL is stateful, Quokka just runs a file and prints results inline in the editor, discarding the context each time. What do you guys think? I'm guessing that experienced Clojurians probably think 1 is strictly better than 2. Could you explain why?

vemv 2021-03-03T09:59:48.486700Z

Retrofitting a "real" repl into an existing language might be harder than it sounds. See https://news.ycombinator.com/item?id=25620256

2021-03-04T19:34:18.094700Z

the workflow that worked for me with OCaml was structuring my projects so that I could iteratively re-compile and run targetting the specific feature I was working on (kind of a TDD flow), since the OCaml compiler is extremely fast and its repl is significantly different from the compiler

2021-03-04T19:35:23.094900Z

with my OCaml projects I could compile to native code and run in less time than clojure typically takes to get a repl prompt

p-himik 2021-03-02T23:31:44.484800Z

One thing that immediately comes to mind - CPU intensive work. It wouldn't be fun to wait for something to finish each time you run the file or to keep track of all the temporary files with intermediate results. Another thing is side-effects. You usually don't want to repeat them unless necessary.

2021-03-02T23:34:05.485Z

Come to think of it, Quokka has some pretty crazy heuristics for finding exactly what code needs to be rerun to mitigate those issues @p-himik. Re implementing those for OCaml would not be fun, whereas with a REPL, the user decides what needs to be rerun.

Alys Brooks 2021-03-02T23:35:45.485200Z

I suspect a Quokka-style setup up is easier to get up and running since you don't have to maintain a connection so I don't know about strictly superior. Although if you're coming up with heuristics, it's probably not simpler anymore. Also, the reloading entire files avoids situations where, e.g., you're running (g (f val))) but the actual code running is (old-g (current-f val))) because you forgot to re-evalute your new definition of g.

p-himik 2021-03-02T23:36:30.485400Z

@d4hines Perhaps - apart from having a glance at the website, I'm not that familiar with Quokka so I was talking about just running a file each time.

Alys Brooks 2021-03-02T23:38:04.485600Z

I think the REPL approach is ultimately better because like you said, the user can decide and you can include shortcuts to reload the entire file. But running everything from scratch has a certain simplicity. I don't think it's well-suited to Clojure due to the startup time, but it might work for ClojureScript or something like Lumo or Babashka.