This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-01
Channels
- # admin-announcements (8)
- # arachne (11)
- # beginners (17)
- # boot (64)
- # cider (26)
- # cljs-dev (7)
- # cljsrn (1)
- # clojure (115)
- # clojure-belgium (2)
- # clojure-dusseldorf (15)
- # clojure-poland (15)
- # clojure-russia (62)
- # clojure-spec (86)
- # clojure-uk (208)
- # clojurescript (36)
- # cursive (4)
- # datavis (11)
- # datomic (44)
- # editors (9)
- # hoplon (21)
- # jobs (4)
- # mount (21)
- # off-topic (3)
- # om (113)
- # onyx (65)
- # parinfer (2)
- # perun (3)
- # proton (6)
- # re-frame (29)
- # reagent (20)
- # yada (3)
Morning. Sitting on train with table to myself this morning. Working on a website for my company and putting finishing touches to SOW I wrote on Friday before I send it out this morning.
I’m playing with CircleCi today. Evaluating it for our iOS builds. We’re generally a little obsessed with keeping things in house like maintaining various Jenkins workers etc when we could be lazy and farm it out. Then we could spend more time ‘adding value’ rather than god damn yak shaving.
@paulspencerwilliams: I've used CircleCI for my pet projects for almost two years now. I like it better than Travis. Not done any seriously large or complex build pipelines though.
We now have a travis server internally… so far so good. but haven’t it used it extensively yet.
we're using circleci for our stuff. I presume it works with gitlab (if/when we migrate)
using circle at work at the mo, had no real problems with it. Used travis heavily for OSS stuff, mostly works well also
main thing you’re lacking vs jenkins is being able to wire lots of disparate jobs together with complicated rules
Of course if you need/want to 'grow your own' CI you could look at http://www.lambda.cd/
agile_geek: feels like you could put other types of flows together with that. I wonder at what point it would start to be annoying that the domain was CI/CD rather than some other job DAG
@otfrom I had similar thoughts
that's annoying. It looks like slack edits don't come through on the irc interface. :-\
Always hard to tell with a comment like that 😄
re: asciidoc - the thing I’m currently loving, though it’s a bit hacky, is the diagram plugin. My docs have UML sequence diagrams embedded, in plain text, which show up as images in the final output. http://asciidoctor.org/docs/asciidoctor-diagram/
is it a short-form of a more obvious expression ?
@dominicm: it had some peculiar bugs for me with where images got written - I had to have it creating images in the source images directory, which then means they have to be explicitly ignored from my git commits.
That, and I’m always a bit conservative about plugins that involve shelling out to command-line apps - it does work, but it’s pretty loose integration. Not that I can immediatedly think of a better option 🙂
I've had success with it in that regard, but I'm not sure why it would be different. I've only used it for fairly simple diagrams, on linux. Everything works first time on Linux I find 😉
I’ve used websequencediagrams a lot, and someone recently showed me a flow-chart version
I’ve used plantuml all over the place, it’s the main diagramming thing I use now in asciidoc as well
https://github.com/asciidocfx/AsciidocFX this implements it's own version of the uml diagram plugin, and it's plantuml is native java.
The asciidoctor plantuml integration pulls down a ruby gem that embeds the plantuml jar file, then shells out to java to run it.
That reminds me my other pain point with the diagramming stuff - when something goes wrong, you get no information - no logs, no diagnostics. For someone whose ruby is a little rusty, it was quite painful diagnosing what was broken.
I had some good results with http://knsv.github.io/mermaid/
@korny: In the ruby asciidoctor it does, it would be tricky to do something else though. It'd be nice to have cross-platform apis for every language for every tool. We don't have that yet though really 😕 AsciidocFX uses AsciidoctorJ, and my understanding is that because it runs in the JVM already, it depends on PlantUML dep, and calls into it for doing plantuml, instead of java->ruby->java
@glenjamin: mermaid is one of the tools wrapped by the asciidoctor diagram plugin - it does look nice, be handy sometimes to generate gantt diagrams
say what you like about the “we build our tools in JS” crowd, but they generally also know how to make a nice website 😄
@glenjamin: I adblock. I didn't even know it had ads.
@glenjamin: I think it's quite interesting that libsass is being written in C so it can target nodejs and ruby.
i think originally it was just “to be fast”, and then someone in Node-land picked it up and people jumped on board
https://github.com/yogthos/lein-sass <- emscripten’d libsass running on nashorn wrapped in lein
Depends on circumstances but always favour the specific - catch Exception.
Generally an Error (the other throwable) is not something your app can sensibly handle anyway
@korny: log and re-throw...oh we are going into anti-pattern territory there 😉 http://rolf-engelhard.de/2013/04/logging-anti-patterns-part-ii/
Exception usually for me.
However, when your code is a bit of callback called from somewhere inside someone else’s code, and you want that code to clean up resources appropriately, but don’t trust that code to log what really went wrong and where… then you sometimes have to log log log
I thought we'd put these debates to bed in 2002? Generally speaking (and there are 'exceptions' to the rule...pardon the pun!). 1. Either throw onwards or deal with exception (not do something then re-throw) 2. Always catch the most specific exception that makes sense (i.e. it's ok to catch a more generic exception if all exceptions inheriting from that one are handled the same) 3. Log at point of handling 4. Don't swallow an exception and throw a new one (you lose the original stack trace)
Having spent months reviewing Java and dealing with massive unhelpful logs in an 'enterprise' Java app this stuff is a sore point with me!
I'm thinking ArithmeticError is the one I'd want to be able to handle (this is in an IoC bit where we are passing in funcs doing calcs on data)
Oh I forgot one: 5. Kill anyone who does this
catch (Exception e) {
LOGGER.error(e.getMessage());
}
I love seeing the text of an exception with absolutely no contextual information about where in the code it occurred!@otfrom: if your strategy for dealing with the Error is only applicable for ArithmeticError then catch that specifically.
If it's more generic use the most specific Error/Exception you that makes sense.
but I'd still go with try checking it first!
agile_geek: this is some code that will be wrapping code like that and I'd like to be able to catch things we miss in test and code reviews
@otfrom: as I said in that case. Deal with the most specific thing you can sensibly deal with.
@agile_geek: the other thing I’ve learned (the hard way) in clojure - if at all possible, don’t use exceptions. Better to return a value that indicates failure, than to throw an exception. YMMV of course
But in a world of laziness and macros and core.async, an explicit error return value is easy to deal with and reason about, whereas an exception can lead to madness.
is the error monad considered harmful ? not used it, but it seemed like a reasonable approach to dealing with exceptions
I think clojure.spec is definitely one way to go.
mccraigmccraig: I actually think it is a really good idea, but I think it should be combined w/something like core.spec
Of course, in the absence of error monads, a well defined error return value is perfectly fine in my book, as long as you have good tests/contracts/schemas to make it explicit.
My complete lack of understanding of Monads, despite trying to grok them at least 10 times, let's me down in this conversation. However, I get the feeling that as Clojure lacks static typing and has heterogenous collections we tend to end up passing context around in maps more? Hence @korny's error return value?
An error monad (as I understand it) basically means you define a type that says “this type can be T or an error” where T was the original return value.
and honest pointing you at the paper is not saying RTFM. There were a lot of easy things I wasn't getting around why until I read that
In the absence of strong types, I can write something like:
(defn process [foo]
(try
(str “result:” (/ foo 0))
(catch Exception e
(log “oopsie” e)
::error)))))))
the important thing with monads in Haskell is that the compiler will force you to have a branch that deals with the error
the "type T or error" is just a sum type. Which is useful in clojure but not checked at compile time un fortunately.
but then the caller needs to know that this function returns either a String or ::error - no compiler to help
@otfrom: I never thought it was RTFM 😄 All help appreciated.
(and thinking about it I think Java's typed Exceptions are trying to do something monad like)
Presumably core.specs conform would indicate if expected return value was not of correct spec as well as generative tests?
agile_geek: I'd use core.spec to say I could either get a number or an error back and then have the tests tell me that I wasn't handling the error
@otfrom: ok, I understand now
Yeah, I guess checked exceptions form the 'contract' part that spec gives you but not sure they're at all 'monadic'?
I need to actually use spec..I've just read about it and watched @stuarthalloway's youtube video on spec.
Maybe and Error are nice and all, but when you combine them with bind
don’t you lose stack traces?
whenever i’ve combined a bunch of things together using their monadic nature, i’ve had a vague unease about that
(this nicely sums up my problems with Java types: http://www.michaelnygard.com/blog/2016/07/wittgenstein-and-design/ )
and this on sum and product types: http://blog.jenkster.com/2016/06/functional-mumbo-jumbo-adts.html from Kris Jenkins sorted out a lot of the rest of my thinking on types (though I read that first)
The stuff from spec about how type positions without names are rubbish struck a chord with me too
It seems to me (in my incredibly simplistic viewpoint) that 'typing' seems to get into trouble when we get specific compound types? This is definitely the root of a lot of issues in Java and C#
oh, that’s annoying - Gary Bernhardt did a great talk at strangeloop 2015 (sort of) about types vs tests. But it’s not online
@agile_geek: I think that’s an issue with langs that have sub-typing like scala
@glenjamin: if your error-side type is, say, an ex-info
then you get to keep stacktraces
Types in those lang's don't compose well.
There’s a transcript at least https://github.com/strangeloop/StrangeLoop2015/blob/master/transcripts/Gary%20Bernhardt%20StrangeLoop%209-25-15.txt
Anyway I better stop reading this interesting thread on my laptop and get back to the incredibly uninteresting code reviews on client laptop!
agile_geek: I think it is just a problem of trying to create good sets/categories/ontologies. They just don't map that well (or at least clearly) on to the real world
If anyone is in London tonight, I'll be giving a talk on Clojure development with Spacemacs / Emacs & Cider - its a last minute thing, but should be able to show off a range of stuff. If anyone wants to share anything, come along
https://skillsmatter.com/meetups/7893-your-regular-church-of-emacs-service
Nope, but I am creating an online workshop - which should have plenty of animated gifs (once I get the hang of them). The workshop may take a few weeks to finish...
@jr0cket: oh bad luck mate...I'm going to be there 👎
I'll be covering stuff like:
- Adding the Clojure layer - Running the REPL & evaluating code - Running tests & test reports - Structural editing (smartparens/paredit fun) - Emacs common commands - Emacs cool stuff (multiple cursors, kill-ring / visual undo, - Clojure docs, auto-completion, snippets - Clojure refactoring with clj-refactor
If anyone wants to do debugging, happy to see what you can do...
I dont debug, except with println
The cider-nrepl debugging nrepl op commands are somewhat confusing "open a channel to send commands"
@agile_geek: I know you're researching these things currently, so I ask because you're probably in posession of this knowledge already. Is onyx's workflow and catalogue system unique to Onyx? Or do other distributed systems use it?
@dominicm: seems someone has ported parinfer to emacs https://www.reddit.com/r/emacs/comments/44s57t/parinfer_has_been_ported_to_emacs_lisp/
@jr0cket: A library, not a tool. https://github.com/oakmac/parinfer-elisp#usage
I've never used aggressive-indent. So I can't say. I have used parinfer. I really liked it
I'm happy with smartparens and other jiggery pokery in Spacemacs (usually just pressing the tab key). But parinfer looks nice
https://github.com/snoe/nvim-parinfer.js a clojurescript plugin, which hooks the parinfer.js library (the one implementation to rule them all)
@dominicm: re: onyx the catalogue & workflow are unique to it afaik. I've used Storm for stream processing and onyx is far easier and has better separation of concerns.
@agile_geek: Awesome, thanks. I think I'm going to use something similar for writing a data specification library for clojure.
Watch some of @michaeldrogalis talks on justification and philosophy I think he makes some gr8 points
@glenjamin: ooooh. GDS power grab...that looks bad. Especially for @philandstuff
the new guy is from the DWP > At DWP Kevin played a pivotal role in successfully introducing a range of digital services and products and growing the DWP digital academy.
@agile_geek: thanks for the tip
@glenjamin: I know ppl working at DWP and they say DWP is doing a power grab on HMRC digital...poaching resources. But I think ppl at HMRC have wised up that although DWP says they're doing things differently they are not as forward thinking as HMRC Digital are.
yeah that was were HMRC were 18 months ago but they've moved on a lot
oh, I tell a lie - it’s 2 now: http://dwp-digital-services.herokuapp.com/
still a bit 'project' thinking though
GDS is a shining beacon but sounds like it may get watered down cos senior civil servants are jealous of it's success
I think the branding could do with a re-work. From a departmental point-of-view GDS is a set of advice, guidelines and principles
DWP have some very mixed bits - some good, some bad. I probably shouldn’t make any comments though. But it’s not all bad.
korny: regarding exceptions vs error values... One interesting thing you could do is return an exception as an error value instead of throwing it... That way you do capture a stacktrace
true - though I don’t know that the stack trace has any value to a caller, beyond diagnostics after failure. I’d prefer to log the stack trace, assuming you have something slurping up and indexing the logs.
Where I worked in Leeds there were plenty of good people trying to do good work, but getting into public beta or beyond was being made increasingly difficult
there's no value to a caller for the stacktrace... but it does let you capture context... obvs you could use a log for that too
@glenjamin: so most astonishing thing about that statement is you worked in Leeds...and survived!
Got to be a little careful as I might be working there some of time in next few months ;-)
I know. Once @otfrom left the place picked up
It's quiet but okay. Are you moving there?
They're currently trying to rebrand as a commuter town. I'm moving closer to MK. I'm moving to an area infamously known as Tramp Hill.
Sorry, I'm confused. Nuneaton is miles from Mk.
@paulspencerwilliams: I currently travel ~2 hours to MK from Leicester. But my girlfriend is still in Uni in Leicester. So we needed a midway. The trains all change at Nuneaton.
Yes, I occasionally travel to London via Nuneaton. I live about 20 minute drive from there in a village called Overseal.