This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-19
Channels
- # announcements (9)
- # babashka (11)
- # beginners (157)
- # calva (10)
- # cider (18)
- # clara (4)
- # clj-kondo (40)
- # cljsrn (8)
- # clojure (29)
- # clojure-europe (11)
- # clojure-italy (1)
- # clojure-nl (2)
- # clojure-spec (4)
- # clojure-sweden (1)
- # clojure-uk (39)
- # clojurescript (32)
- # conjure (1)
- # core-async (2)
- # cursive (20)
- # datomic (7)
- # duct (9)
- # emacs (1)
- # figwheel-main (1)
- # fulcro (24)
- # helix (1)
- # hoplon (20)
- # hugsql (3)
- # jackdaw (5)
- # jobs-discuss (7)
- # lambdaisland (1)
- # malli (5)
- # music (4)
- # off-topic (54)
- # parinfer (2)
- # pedestal (13)
- # re-frame (12)
- # reagent (22)
- # reitit (9)
- # shadow-cljs (89)
- # spacemacs (2)
- # xtdb (21)
Hi, maybe somebody know that: how store data/process like smalltalk, like “os” image, .. so you can stop the process and restart, or pause.. I read about and very interesting (“Smalltalk’s principal claim to fame is its image-based approach to software creation. An image is a snapshot of memory that contains all the objects in your running application or system. It encapsulates the entire execution state of your program. An image can be saved to disk, and execution can later be resumed exactly from where you left off!“) . what is the main solution behind this? save the process data dynamically to bytecode? how to encapsulate the state?
@sb Well, a running process can be largely described by 1) a set of memory address ranges visible to it + their content, 2) the state of CPUs (~ content of their registers), and 3) a set of external OS resources (files, sockets, etc) in use by it. (1) and (2) can be relatively trivially dumped to disk, and, with some OS support, restored from that dump. (3) can be less simple, but there are some tricks that can sometimes help. Some variants of this approach use virtual machine memory / state instead of CPU memory / state.
@jason358 thanks, the answer.. yes, totally new for me.. store state of a running process. really interesting! I think, I try out the easier way 1+2..
There are some libraries / utilities for linux that can handle freezing/unfreezing a process, to some extent, I think
IDEA: A https://ipfs.io / libp2p lib to clojure that
(ipfs/ref {:some "value"}) ;; => #ipfs"<CID block ID>"
(ipfs/deref #ipfs"<CID block ID>") ;;=> {:some "value"}
@jjttjj I notice that clojars displays the coordinates they way you suggested: https://clojars.org/com.clojure-goes-fast/clj-java-decompiler
Yeah, I think I noticed I subconsciously started to look for the clojars link on a readme more often since I started using tools deps due to this
I invoke it from these:
alias t="cd $PROJECT_HOME"
alias tls="clear && t && clj-kondo --lint src"
alias tlt="clear && t && clj-kondo --lint test"
And I feel so good removing my old cobbled dev and build config consisting of a frankenstein combo of lein/boot from the days of yore to deps.edn. Shrunk my compiled JS file by 30kb due to shadow-cljs build report and uberjar from 120M to 76M. Full compilation in 50 secs down from 3 mins.
@naomarik Thanks for the kind words! 🙂
Hi everyone, as Clojure is described as tool for professionals, I would like to hear from you, who work no software companies, consulting, etc. About software engineering practices, do you gather requirements? Design docs? And things like this.
Hi, I have some code that converts yaml to edn. Now, there are several libraries for clj and cljs, but I have not found one for both. As I convert yaml to edn in clj and cljs I would like to use the same code to make sure it returns the same edn on front and backend. 1. Does someone know a library for both clj and cljs that I have just not found? 2. If not, is there a way to run cljs/javascript in the jvm (like nashorn did) or 3. run clj code in the frontend?
@borkdude Because I want to make sure it generates the same output as the javascript one. The only way to be sure, is to use the same code for the conversion, everything else leaves the possibility for differences.
I derive business logic from that, validation for instance, and that should be the same. To be more specific, I have an openapi specification that I can "test" on frontend side and which is then later used to generate backend code.
it’s much easier to run js on the backend than to run a clj library wrapping a java library on the frontend
well, all clj yaml libs I know are based on SnakeYML. Good luck finding a JS lib that does exactly the same
@smith.adriane I am fine with that, but I only know about Nashorn, which is deprecated IIRC.
I’ve used https://github.com/marianoguerra/clj-rhino before, but it’s been a while
@sveri check this out: https://nextjournal.com/kommen/react-server-side-rendering-with-graalvm-for-clojure
I have a scheduling problem. I have a floor layout of rooms that need to be scheduled to optimize social distancing. Constraints are things like, "I don't want to schedule a room for this hour that was scheduled for the previous hour," "never schedule two rooms next to each other." Ideally, I could also maximize distance between rooms and optimize for ease of exit/entry.
I remember a talk where Mark and Alex Engelberg discussed the 12 nurses problem (maybe it was "Solving problems declaratively"?) where he wrapped a Java constraint library, maybe it could give some inspiration?
where would I start researching for solving this type of problem? any good resources on it?
sounds like a logic constraint problem
clara and something like core.logic feel very low level. I can't think of an efficient way to apply them yet
the output I need is a schedule that I can use to allow people to sign up for rooms at various times of day
here’s some resources related to scheduling optimization: https://developers.google.com/optimization/cp/integer_opt_cp https://en.wikipedia.org/wiki/Interval_scheduling https://github.com/topics/scheduling-algorithms
you can probably use the interval scheduling algorithm from wikipedia to find schedules that satisfy your constraints and then assign weights to other attributes (eg. penalizing scheduling rooms next to each other) to sort results by desirability (eg. desirability= kDistanceWeight*distance_between_rooms_sum - kCooldownWeight*time_since_last_meeting_sum
)
it also reminds me of this d3 animation where each dot has a certain force field to it, pushing away other dots.
given a set of rooms and a set of meetings, find schedules that satisfy some set of rules is also a different problem from having a list of potential meeting slots and filtering out the ones that fail some rules.