Skip to content

Instantly share code, notes, and snippets.

@sogaiu
sogaiu / alex-fowler-response.md
Created November 22, 2024 09:30
alex fowler's results of having investigated line number drift in clojure tooling

sogaiu:

please let us know if you take a look -- last time i looked at nrepl i got pretty confused and i didn't find the docs that i found to be that helpful for me.

alex fowler:

Ok, so I checked. I checked in Calva the VSCode Clojure IDE, and in JeeJah, which is the nREPL implementation for Fennel. And yes, no. They don't update line numbers. They are a victim to the same line number drift. Which makes me think that either I have false memories from the past, or CCW, the ancient Eclipse-based Clojure IDE, had some tricks for this. I don't remember now, it was like 10 years ago, and I don't really use Clojure much these days. You're mentioning alter-meta!, and I remember I heard about it, but I can't find any meaningful usage of it in the CCW's code. It just evals through the nREPL messaging.

Babashka is the same, I think. I used it from Calva, and it forgets line numbers when you re-eval a particular top-level form.

@sogaiu
sogaiu / threads-share-working-directory.janet
Last active November 20, 2024 06:07
can each thread in a process have its own working directory? apparently not by default
# working directory is a highlander property
#
# https://stackoverflow.com/questions/24491746/thread-working-directory
#
# possibly of interest as well: https://devblogs.microsoft.com/oldnewthing/20210816-00/?p=105562
(ev/thread
(fn []
(os/cd "/tmp")
(repeat 2
@sogaiu
sogaiu / expressing-traffic.md
Created November 20, 2024 05:01
expressing traffic between client and server for repls
(-->
  ns  "user"
  op  "eval"
  session  "10299efe-8f84-4b97-814c-21eb6860223b"
  code  "(dotimes [i 3] (Thread/sleep 1000) (println (str \"==> \" i)))\n"
  file  "*cider-repl localhost*"
  line  53
  column  6
 id "15"
@sogaiu
sogaiu / update-var-location-info.md
Created November 18, 2024 07:39
updating location information for vars in clojure
$ clojure
Clojure 1.12.0
user=> (def a 1)
#'user/a
user=> (meta #'user/a)
{:line 1, :column 1, :file "NO_SOURCE_PATH", :name a, :ns #object[clojure.lang.Namespace 0x6ce90bc5 "user"]}
user=> (def b 2)
#'user/b
user=> (meta #'user/b)
@sogaiu
sogaiu / cooperating.janet
Created November 18, 2024 05:15
cooperating vs hogging of event loop
(ev/gather
(ev/spawn
(forever
(ev/sleep 1)
(pp :one)))
(ev/spawn
(forever
(ev/sleep 2)
(pp :two))))
@sogaiu
sogaiu / docker-resources.md
Created November 15, 2024 04:51
docker resources
@sogaiu
sogaiu / 0.input.md
Created November 12, 2024 08:34
pandoc and context experiments
/* Recursive type (Janet) */
#ifdef JANET_NANBOX_64
typedef union Janet Janet;
union Janet {
    uint64_t u64;
    int64_t i64;
    double number;
    void *pointer;
};