ldnclj

Find us on #clojure-uk
pupeno 2015-09-20T08:01:55.000444Z

Good morning.

afhammad 2015-09-20T08:17:49.000445Z

Morning

pupeno 2015-09-20T09:47:45.000446Z

I just got a very quick and dirty server side pre-rendering working with nodejs, reagent, re-frame doing ajax calls. \o/

quentin 2015-09-20T10:11:25.000447Z

yeah :simple_smile:

pupeno 2015-09-20T10:24:35.000448Z

The bad news is that it requires a fork of re-frame. Hopefully my simple change will be merged into it later on.

pupeno 2015-09-20T10:28:51.000449Z

I just wrote (console.log “foo”) in a javascript file. I’m finally thinking in Clojure.

quentin 2015-09-20T10:29:20.000450Z

haha

quentin 2015-09-20T10:29:25.000451Z

congratulations I guess :simple_smile:

thomas 2015-09-20T10:38:30.000452Z

morning

thomas 2015-09-20T10:39:18.000453Z

I have given up on yada for the moment.... 😞

thomas 2015-09-20T10:39:29.000454Z

using compojure again...

thomas 2015-09-20T10:39:54.000455Z

and struggling a bit with a POST command....

afhammad 2015-09-20T10:40:10.000456Z

@pupeno: my younger brother is just starting to get into programming, he’s learning Javascript and often sends me snippets like “(some-function ‘hello’)” and asks me why it doesn’t work, i think he’s destined to be a LISPer

pupeno 2015-09-20T10:41:14.000457Z

@afhammad: hahah. I’m doing an experiment with one of my parters, getting her started with Clojure before trying other languages. We’ll see how that goes.

afhammad 2015-09-20T10:42:35.000458Z

@pupeno: yeh i wonder what the transition from a lisp to a non lisp language is like

thomas 2015-09-20T10:43:25.000459Z

@pupeno: interesting experiment... I remember reading somewhere that some people find lisp easier to start with....

pupeno 2015-09-20T10:44:19.000460Z

I wish I started with a Lisp, but on the other hand, I’m glad I started with C.

pupeno 2015-09-20T10:45:27.000461Z

So far, I don’t know how she’s doing because I don’t have enough experience teaching. She’s struggling with some things but that might be the normal learning process. Some of those are inherent to functional programming, but that doesn’t mean she wouldn’t struggle with the other oo-inherent things.

pupeno 2015-09-20T10:46:22.000462Z

Argh… I also need to fork node-xmlhttprequest 😞

pupeno 2015-09-20T13:33:38.000463Z

And I just finished my pre-rendering library. It works, but it requires forks of node-xmlhttprequest and re-frame (small changes). I’m off for a bit and when I’m back I’ll start documenting it. Hopefully it’ll be out today.

👍 1
quentin 2015-09-20T13:34:42.000464Z

Cool stuff :simple_smile:

afhammad 2015-09-20T13:50:26.000465Z

@pupeno: you are everywhere. I just searched for a cursive cheatsheet and got this: http://www.cheatography.com/pupeno/cheat-sheets/cursive-on-mac-os-x/

pupeno 2015-09-20T15:18:58.000466Z

:simple_smile:

mccraigmccraig 2015-09-20T15:58:10.000467Z

@thomas: what stopped you with yada ?

thomas 2015-09-20T20:29:42.000468Z

@mccraigmccraig too many new steep learning curves at the same time. Still think yada would be better for my use case. But not 100% certain it has all the functionality I need in it.

thomas 2015-09-20T20:30:35.000469Z

There is a comment in one of the tests that maps in atoms aren't supported yet.

mccraigmccraig 2015-09-20T20:30:38.000470Z

@thomas i can understand the learning curve thing, given what you tried

mccraigmccraig 2015-09-20T20:30:45.000471Z

what functionality do you need in yada ?

thomas 2015-09-20T20:31:11.000472Z

And I think that would be very beneficial for my use case

mccraigmccraig 2015-09-20T20:31:43.000473Z

pretty sure atom resources are supported - https://github.com/juxt/yada/blob/master/src/yada/resources/atom_resource.clj

thomas 2015-09-20T20:31:53.000475Z

I have been asked to build a simple rest phonebook service.

thomas 2015-09-20T20:33:33.000478Z

;; TODO: Restore this test once atoms can wrap maps (and other collections)

thomas 2015-09-20T20:33:37.000479Z

is the one I spotted.

mccraigmccraig 2015-09-20T20:34:23.000480Z

ah, gotcha, atoms work, maybe not maps in atoms

mccraigmccraig 2015-09-20T20:34:37.000481Z

but you wouldn't really be wanting to use those would you ? you would want some persistence

thomas 2015-09-20T20:34:46.000482Z

and I think for a simple DB I would need a those...

thomas 2015-09-20T20:35:01.000483Z

for this particular example a in memory DB would be good enough.

mccraigmccraig 2015-09-20T20:35:35.000484Z

well, you don't need to use atoms/maps at all - the AtomResource thing is just a ready-to-roll resource implementation

mccraigmccraig 2015-09-20T20:35:47.000485Z

it's straightforward to create your own resources from functions

thomas 2015-09-20T20:36:33.000486Z

I have to take another look at it...

mccraigmccraig 2015-09-20T20:36:40.000487Z

e.g. here's a login-resource : https://www.refheap.com/bbf94136e5222185236e83ef1

thomas 2015-09-20T20:37:04.000488Z

at the moment my compojure solution is looking pretty good. but not as "complete" as a yada solution woul.

mccraigmccraig 2015-09-20T20:38:09.000489Z

probably a lot more synchronous too :simple_smile: ... i went with yada because i can make everything async

mccraigmccraig 2015-09-20T20:38:24.000490Z

compojure is a lot more mature though, so it will definitely be an easier ride

thomas 2015-09-20T20:38:42.000491Z

yes... but I guess you could replace jetty/ring with http-kit.

thomas 2015-09-20T20:39:10.000492Z

and it is something i was familiar with as well. makes a big difference to get going.

thomas 2015-09-20T20:40:27.000493Z

but I just decided I needed to rewrite bits of it... want to use UUIDs for identifying my resources.

thomas 2015-09-20T20:40:41.000494Z

but that is something for tomorrow... need some sleep now.

mccraigmccraig 2015-09-20T20:41:18.000495Z

ha, i'm deep in the guts of my cassandra client. no sleep for a while yet

thomas 2015-09-20T20:44:00.000496Z

ok good luck. and do get some sleep.

thomas 2015-09-20T20:46:38.000497Z

ttfn