Fork me on GitHub
#clojure-uk
<
2016-12-15
>
agile_geek07:12:16

@dominicm @glenjamin that's going to be more than annoying in early stages of development when Spec's are fluid. Going to break that lovely REPL based flow. Probably not a big problem in more mature code bases when changes to Spec should be accretions anyway (according to the "Word of Hickey"). Does this just mean you explore data using the REPL and add Spec when it's more stable, will that mean reloading Spec's registry becomes less important?

agile_geek08:12:29

Very interesting article on abstractions and how important it is to see them at different levels and interact with them....made me realise in a deeper way why I think Clojure is the best language I've found so far for exploring problems. http://worrydream.com/LadderOfAbstraction/

agile_geek08:12:39

Also provides another slant on the static vs dynamic typing argument.

agile_geek08:12:11

and is a reason why I disagreed with @krisajenkins about the detail of the approach on how he explored his problem space with data modelling. This article talks about exploring 3 dimensions simultaneously (time [or behaviour over time], data, structure [code])

thomas08:12:21

certianly looks very good...

glenjamin08:12:56

hrm, so it looks like a system built on c.t.n for reloading specs would be doable

agile_geek08:12:06

It's my morning for posting interesting articles. Here's another one relevant to why I found learning Clojure hard...and rewarding. https://hbr.org/2016/11/why-the-problem-with-learning-is-unlearning

glenjamin08:12:00

after unloading the old namespaces but before loading the new ones, you’d have to (swap! clojure.spec/registry-ref and remove namespaced keywords which match

agile_geek08:12:28

@glenjamin so definitely possible then

glenjamin08:12:53

well, it depends on what exactly the ^:private metadata does

glenjamin08:12:07

but iirc it only stops it being imported, not being accessed fully-qualified

agile_geek08:12:36

yeah I'm not sure but I think I remember being able to poke at private def's in test namespaces.

kevin4209:12:46

haha nice picture

mccraigmccraig09:12:23

@glenjamin @#'some.ns/some-private-var does let you get at ^:private defs

glenjamin09:12:31

that’s the one

agile_geek09:12:19

feels a bit like the reflection hack in Java

tcoupland09:12:18

blimey, didn't see how much chat my spec snarking caused!

mariusz_jachimowicz09:12:11

Anyone tried to understand Clojure internals - compiler and all that stuff? Reading Elixir internals == pleasure, reading Clojure internals == nightmare

tcoupland09:12:06

there was a talk at euroclojure a couple of years ago on that very topic, Finding Monsters in the Clojure Compiler, something like that

reborg10:12:30

https://vimeo.com/100518965 ? Yeah, some beasts in there.

tcoupland10:12:12

it was a jolly good talk to 🙂

reborg10:12:45

That talk was given in front of Rich (who also made the first comment). Still shivering...

agile_geek10:12:38

Saved...to be watched later

dominicm10:12:52

@agile_geek I agree with your assessment about early stages of spec vs late stages. Might be a problem if you delete a spec in a large codebase, and start building new stuff — without realising that some specs still point to the deleted one! But this workflow is perhaps not one that spec intends to resolve.

agile_geek14:12:44

Apart from @pupeno, anyone done isomorphic Reagent app? I'm looking into this now and wondered what the issues and tradeoffs are? For example, rendering server-side using node.js works but is it possible to run an nREPL and connect into the node process?

mccraigmccraig14:12:12

@agile_geek we've got an isomorphic reagent app

mccraigmccraig14:12:57

ah, but are you meaning cljs backend, rather than just code-sharing between cljs and clj ?

agile_geek14:12:16

Yeah we share code in cljc files

agile_geek14:12:25

We need server side rendering for SEO

agile_geek14:12:30

and performance

Pablo Fernandez14:12:26

Having a performance gain is hard unless you cache the results.

Pablo Fernandez14:12:12

@mccraigmccraig how do you run the reagent app on the server?

mccraigmccraig14:12:59

@pupeno we don't - we just do some code-sharing between the front and back ends

Pablo Fernandez14:12:28

@agile_geek i don't remember a lot, but I'd be surprised if you can't get the repl going.

Pablo Fernandez14:12:52

@agile_geek happy to sit down with you and see if I can help.

Pablo Fernandez14:12:12

We are due for a catch up anyway.

agile_geek14:12:40

Performance issue is only really initial load so shouldn't be that hard - SEO is the killer. Despite Google claiming they can index client side rendering we get very little indexed

Pablo Fernandez14:12:06

@mccraigmccraig what @agile_geek is talking about is prerendering the app on the server.

agile_geek14:12:19

@pupeno did you end up using node or Nashorn?

mccraigmccraig14:12:20

yeah, i know now @pupeno 🙂

Pablo Fernandez14:12:34

Yeah, I've heard from other makers of an SPA that Google is not really indexing them.

Pablo Fernandez14:12:23

@agile_geek: no, Nashorn doesn't implement xmlhttprequest

Pablo Fernandez14:12:54

If you have a non Ajax SPA, it could work. But who does that anyway?

dominicm14:12:55

If you're lazy, you can do http://prerender.io

dominicm14:12:51

Depending on the app, it may not be worth the bother of fiddling with js engines.

agile_geek14:12:44

@dominicm I'm all for being lazy!

dominicm14:12:44

prerender may save you some work then!

lsnape14:12:14

that looks pretty neat thanks dominicm 🙂

glenjamin15:12:37

you can still do it on nashorn if you wanted

glenjamin15:12:50

you’d need to swap out the HTTP lib at a slightly higher layer

glenjamin15:12:02

that’s the approach i’ve done with a NodeJS/React app

glenjamin15:12:23

API compatible HTTP lib running in the browser and server

glenjamin15:12:10

i’ve done plenty of server rendering with JS and React, calling React.renderToString is the easy bit, it’s deciding how to do data fetching that’s tricky

glenjamin15:12:30

if your component’s data requirements can be processed fairly statically (ie. without rendering) then it’s not too bad

mccraigmccraig15:12:14

i can imagine that, should i really need to, for my re-frame app i could initialise the app-db statically for server-side rendering

glenjamin15:12:19

that’s fine if you’re ok with 1 node process = 1 request at a time

glenjamin15:12:41

otherwise you’d need some sort of isolation between them

practicalli-johnny16:12:45

@agile_geek are you joining the hangout today?

agile_geek16:12:44

@jr0cket I did decline the invite

agile_geek16:12:20

I don't represent Style and I'm working on different stuff from Abby. Got too much to do

dominicm16:12:04

#clojure-uk: Style insider information