Fork me on GitHub
#clojure-uk
<
2018-06-24
>
alexlynham02:06:13

fwiw I think I’ve written < 3 production macros and I’d advise people not to use them if not totally necessary - one of the big of clojure is a simpler mental model and that begins to go away with greater arbitrary abstraction

alexlynham02:06:21

but maybe that’s just me 😕

alexlynham02:06:33

I like that clojure makes me feel less dumb, and I’ll happily do away with features in order to preserve that

seancorfield03:06:57

I find myself only using macros occasionally and pretty much always as syntactic sugar over an existing function. The second most common usage is for code-generation (in the small).

👍 4
dominicm08:06:07

I forgot how useful that immutability thing is:

(or
      (when-let [match-result (match-pattern pattern env)]
        (resolve-handler matched match-result))
      (do (assoc! env :remainder orig-remainder)
          nil))))
I'll live, but will the code?

yogidevbear08:06:00

Morning all 👋

bronsa09:06:38

@dominicm that assoc! usage is broken

bronsa09:06:45

@dominicm with transients you must use them "functionally", using the return value of the last operation as input value to the next

👍 4
bronsa09:06:52

there's no guarntee that bang in place will work

bronsa09:06:10

and indeed it doesn't after 16 operations

bronsa09:06:46

user=> (let [x (transient {})] (dotimes [n 100] (assoc! x n true)) (count (persistent! x)))
8

bronsa09:06:07

well depends on the data structure

dominicm09:06:35

@bronsa I'm in the context of:

(some #(that-fn % transient-map) xs)
And I decided to hack around that-fn performing a modification on :remainder, by "returning" :remainder back to it's original state.

bronsa09:06:39

that's not gonna work

bronsa09:06:51

you have to use transients in reduce style contexts

bronsa09:06:02

or iterate

bronsa09:06:33

anything of the form (f .. (f .. (f ..) ..) ..) instead of (list (f ..) (f ..) (f ..))

bronsa09:06:23

or stop using a bare transient and put it in a mutable bang in place box

dominicm09:06:22

It definitely felt unnatural. Very interesting that a new object is returned when the underlying structure changes. I didn't know there was a problem with this though. What is a mutable bang?

bronsa11:06:30

bang-in-place

bronsa11:06:41

var atom agent etc

maleghast17:06:34

Hello All...

maleghast17:06:03

Quick drive-by Q for a Sunday evening... If you decide that Datomic Cloud is the Datomic for you, what's the deal with development environments..?

maleghast17:06:21

Is anyone using Datomic Cloud or is staying on-prem proving to be better?

maleghast17:06:20

Finally does Datomic Cloud support encrypted at rest data, and how well does it integrate with KMS or similar to facilitate that if it does..?

maleghast17:06:39

(I am trying to figure out if we should run our own Datomic Pro On-Prem and use the PostgreSQL adapter (as we already use PG for "other things") or simply adopt Datomic Cloud)

maleghast17:06:49

If nothing else can I develop my app with Datomic running locally through my developer subscription and then deploy onto a system that uses Datomic Cloud, or are the approaches / features significantly different that I need to make a decision before we get started?

alexlynham19:06:20

^+1 for this, I’ve wondered it too

seancorfield19:06:11

@maleghast Have you tried asking in #datomic ?

dominicm19:06:26

When we asked, we were informed that the datomic team were developing by spinning up personal environments in AWS.

seancorfield19:06:27

Interesting. Yeah, that sort of makes sense but isn't necessarily convenient 🙂

dominicm20:06:47

I like to work on trains sometimes.

dominicm20:06:57

They're definitely doing it with automation though.

dominicm20:06:34

I'm noticing a contention with all this cloud stuff which works against my desire to be functional offline.

seancorfield20:06:15

@dominicm Yeah, I feel more comfortable about a stack I can run isolated, offline, on my laptop.

👍 16
🙂 8
maleghast21:06:48

@seancorfield This is something that is bothering me about adopting Datomic Cloud

maleghast21:06:57

I would be happier if there was an offline version based on Docker containers running local DynamoDB and fake S3 or somesuch...