Fork me on GitHub
#clojure-uk
<
2019-07-30
>
guy07:07:54

Morning! time

maleghast10:07:20

Morning Everyone

Olical10:07:53

Morning! (just about)

Olical10:07:30

Thinking about laptops again, wondering what's the top of the line for Linux stuff right now, Lenovo X1 Carbon? XPS 13/15? :thinking_face:

Olical10:07:52

Ideally 1080p matte non-touch screen too.

practicalli-johnny21:07:00

Lenovo X1 Extreme if you like 15" size laptop, or X1 Carbon if you want a 13" laptop (with a 14' screen). I am excited about the Lenovo X1 Extreme 2nd Gen, with Intel Core 9th Gen processor (8 physical cores - 16 virtual cores) - hopefully our currency doesn't devalue more before its available in the UK. https://www.anandtech.com/show/14328/lenovo-unveils-thinkpad-x1-extreme-gen-2-new-cpu-gpu-oled-display-option

Olical21:07:07

I was tempted to just carry on with the XPS line but I am tempted by the Lenovo... you get a bunch of ports right? The XPS went down the Apple route and said "you only ever need USB-C"

Olical21:07:59

I'm beginning to lean towards the Carbon for the ports etc :thinking_face: I'm really torn though... I care about performance and Linux friendliness too.

practicalli-johnny20:07:13

All Lenovo ThinkPad run Linux perfectly with excellent hardware support (Lenovo never use weird hardware). The X1 machines are predominantly aimed at the business market, so they have a good set of ports. You can also go for the T-series if you want even more ports

practicalli-johnny20:07:58

The X1 Extreme has pretty awesome performance. I have a 5 year old X1 Carbon with 8Gb ram that I use to simultaneously broadcast HD video to YpuTube and run several REPLs, dozens of chrome tabs, about 100 buffers in Spacemacs (I usually turn slack off, but would keep it on if I had 16Gb RAM).

practicalli-johnny20:07:13

Lenovos also have the best keyboards of any laptop availability today

dharrigan11:07:16

I have an X1 Extreme

maleghast11:07:34

I am still VERY happy with this Dell XPS 13" Linux edition that I bottomed and reinstalled with Arch, FWIW @olical

maleghast11:07:07

I am 2 years in with it, pretty much now__ and it still feels brand new.

maleghast11:07:02

(full disclosure, I paid for 16GB RAM so it was a custom build - these days I think__ that they are all 16GB)

maleghast11:07:31

Also, battery is still pretty good FWIW - I can run a Clojure app and code on it and have a browser with a "million" tabs and can do that for 5-6 hours sometimes longer.

mamapitufo12:07:42

I chose the Lenovo x280 over the XPS 13 because it still had USB-A and HDMI (I'm also used to the pointing stick). I'm very happy with it, running Void Linux

mamapitufo12:07:46

some reviews said at the time that the battery life wasn' t great, but I can use it for 8 hours or so, when editing code and running stuff

dominicm12:07:57

@maleghast heroku works perfectly fine with aero, you shouldn't need to do anything strange on top

dominicm12:07:25

(found the code you're referring to, you can definitely restructure that so as to not have that problem - it would be much less painful too)

Olical12:07:29

Thanks for the input, everyone!

dominicm12:07:32

JUXT use the Dell XPS 13 across the whole fleet. They're good as laptops go. Fairly stable, although you'll want to keep the linux-lts kernel installed as backup.

dominicm12:07:20

A little under-powered in the GPU dept perhaps 🙂 But most laptops are. Could have more CPU power too, but cpu v battery I guess. My usage is more similar to a desktop, so I'd probably prefer 1h of battery & a killer cpu but /shrug

thomas12:07:56

I used to have the Lenovo X2xx's when I was at IBM and I liked them, ran Linux on them without problems.

dominicm12:07:14

tbh, I would love to get myself the thinkpad revival they did 😛 But that's not company policy... I don't think the power would allow me to justify it really. I just want it for the retro feel.

Conor13:07:00

You should get one of those mutant Chinese Thinkpads from Shenzhen

Conor13:07:12

I kind of want one but it would be pointless, really

dharrigan14:07:44

What do people around here use for logging? I'm looking at timbre atm.

Olical11:08:11

I stick to timbre, the more JVM / Java-ish logging scares the hell out of me.

dharrigan11:08:33

actually clojure logging seems great

dharrigan11:08:37

works fantastically

Ben Hammond14:07:04

clojure.tools.logging with

dharrigan14:07:08

works great, thank you 🙂

rickmoynihan14:07:06

I personally try to avoid timbre like the plague

rickmoynihan14:07:38

it’s ok, until it’s not

rickmoynihan14:07:08

clojure.tools.logging with slf4j and log4j2 as a backend (which was built to improve on both log4j and logback) is what I’d recommend. Resist any urge to reimagine and improve clojure logging by thinking of it as clojure data or being a non global singleton. If you do these things you’ll be theoretically doing it right; but making your life, or the life of someone in ops even more miserable. Stick with stuff that works, and go with the grain of java logging however messed up it is, it’ll be better than anything you can do.

dharrigan14:07:47

Thank you 🙂 I'm using now clojure.tools.logging with slf4j (which I like :-))

dharrigan14:07:51

works like a charm 😉

dharrigan14:07:16

I'll have a lookg at log4j2

dharrigan14:07:26

I switched to slf4j donkey's years ago

dharrigan14:07:37

but perhaps time to look at log4j v2

rickmoynihan15:07:17

the backend isn’t that important; use whatever you need to that works… though log4j2 is my default choice.

Ben Hammond15:07:44

isn't log4j2 == logback ?

Wes Hall15:07:46

JVM logging is an hilarious mess.

rickmoynihan15:07:25

It is, which is why people need to stop trying to fix the unfixable, and making things worse, and instead just make do with the best solution available… which is essentially the above combination.

Ben Hammond15:07:40

bah I'm always catching myself out with

(into '() (range 10))
=> (9 8 7 6 5 4 3 2 1 0)
if you care about ordering always use a vector
(into [] (range 10))
=> [0 1 2 3 4 5 6 7 8 9]

Ben Hammond15:07:21

(map identity (range 10))
=> (0 1 2 3 4 5 6 7 8 9)

(mapv identity (range 10))
=> [0 1 2 3 4 5 6 7 8 9]
obvs

rickmoynihan15:07:09

What’s wrong with just (range 10)? Or if you want to remove the laziness you can use (doall (range 10)).

yogidevbear16:07:06

@rickmoynihan - Maybe a silly question, but is there a practical reason why someone might opt to remove laziness?

Ben Hammond17:07:13

lazyness is bad when you have open file resources, for example

Ben Hammond17:07:47

also can leave you with head-retention running-out-of-memory headaches

rickmoynihan18:07:05

It can but removing laziness by loading the whole sequence into a realised list in memory is essentially equivalent to head retention, and will also call memory head aches 🙂

yogidevbear18:07:38

This would have been my thinking too. That said, I know how knowledgeable both of you are when it comes to Clojure so 🙂

Ben Hammond08:07:09

the most reliable way I've found to avoid head-retention is to use transduce and (reify IReduceInint (which is just a fancy way to facade loop to make it look more functional)

rickmoynihan08:07:21

I can’t argue with that

rickmoynihan16:07:51

because you want to force effects, or in a dev context, you want to estimate performance independently of the work done in the seq.

👍 4
rickmoynihan16:07:16

or you want the values in a data structure with different performance guarantees, e.g. a vector log/32 lookup instead of linear.

👍 4
Ben Hammond17:07:30

oh there's a bunch of transducers that I didn't bother writing here, so I was surprised when

(into '()
    (comp
      (map #(decorate-recommended-single-category recommended-ids %))
      (filter (comp seq :ids)))
    (sorted-categories display_categories offers)))
modified the ordering

Ben Hammond17:07:57

I think the lesson here is > when would you choose to (into '() ? > and why? > surely you should choose a [] by default

rickmoynihan18:07:52

> when would you choose to (into '() ? Given that clojure.core/reverse already exists, very rarely. You’d normally want: (sequence xf coll) or (seq coll) or something similar.

practicalli-johnny21:07:00

Lenovo X1 Extreme if you like 15" size laptop, or X1 Carbon if you want a 13" laptop (with a 14' screen). I am excited about the Lenovo X1 Extreme 2nd Gen, with Intel Core 9th Gen processor (8 physical cores - 16 virtual cores) - hopefully our currency doesn't devalue more before its available in the UK. https://www.anandtech.com/show/14328/lenovo-unveils-thinkpad-x1-extreme-gen-2-new-cpu-gpu-oled-display-option