Fork me on GitHub
#off-topic
<
2018-09-23
>
kulminaator06:09:44

i agree that judging things on 10 years old ruby horrors is a bit harsh, but i have seen very little amounts of code there that makes me think "hey, this looks nice and clean". maybe i have just been following on the paths of people with a very bad touch for ruby.

kulminaator06:09:41

picking up a stihl does not make one a lumberjack

fellshard08:09:37

I've seen very scary Ruby code, and very clean Ruby code, and have found that it is surprisingly easy to write Ruby that feels extremely clean. It's got a lot of sharp edges, to be sure, but those edges are tucked away far better than, say, JS' sharp everything. You have to reach for many of the sharp edges fairly intentionally. It is easy to get overenthusiastic about Ruby's metaprogramming once you learn it, but that's true of pretty much any language with metaprogramming capabilities, best I can see.

kulminaator08:09:01

with javascript my relationship is different ... learned it the very wrong way in the beginning of 2000s, avoided it for 6-7 years meantime, then in 2011 or so picked up the douglas crockford book "javascript the good parts", actually found a way from there how to write it and even partially love it without going insane 🙂

kulminaator08:09:58

i'm a bit sorry to see where the npm world is driving that boat though, too many libraries that depend on too many other libraries of which some lack quality 😞

kulminaator08:09:57

even though the book has aged i can still recommend it as a good read.

fellshard09:09:29

Have read it. I get that it has good parts, but also feel that its sharp points are much more present at all times, and must be consciously avoided. Doubly problematic when it is taught as the first - and often only - language for new developers.

orestis09:09:58

The issue with any language is more about the ecosystem, other programmers, common practices and so forth. You can certainly write good code in any language, but the point is about anyone being able to write reasonably good code.

☝️ 12
fellshard09:09:16

The 'pit' or 'valley of success'

orestis09:09:56

Yep, exactly. Downside being of course you have to climb the hill of learning :)

fellshard09:09:19

(Reminds me, though, that it could be worse - my brother tried an introductory programming course series while going to school for networking. The entire syllabus was PHP. 😧 )

fellshard09:09:07

People have different opinions on PHP, sure, but I'd definitely argue it makes for an extremely poor foundation.

orestis09:09:11

Which is why I hate the “you can write bad code in any language” argument. Sure you can, but do you have to go out of your way to do it or is it the default and you have to be very disciplined to avoid it?

8
☝️ 4
kulminaator09:09:08

well one of my friends from the imperative world looked at clojure and said that he could do what he would normally do and just "def everything and mutate in place that way" 😄

awb9910:09:53

I just finished my first reagent app. And compared to a react/redux/saga app, it is 10 times less overhead code. Hiccup encoding is really smooth, much better than JSX. And it seems that all the async frameworks for js/react are not really needed. Reagent really should be promoted as the new clojure usecase.

💯 4
orestis10:09:36

Do you have time to write a success story blog post somewhere? That would help!

awb9912:09:41

Yeah sure.

awb9912:09:23

I think i might put the project on github also.

awb9912:09:55

Just need to remove a little bit proprietary code..

awb9912:09:01

Then that is easy.

orestis12:09:33

Famous last words ;)

herald10:09:05

i'm also choking from all the overhead code in our react/redux/observables app. sadly there is no interest in adopting clojurescript

awb9912:09:08

Exactly! I also believe the clojure compiler works very well on clojurescript. The Webpack bundler seems not to remove unnecessary code sell. At least the react starter template I used to get started hasn't adopted it nicely.

awb9912:09:31

My only criticism of reagent is that it is much more difficult to load third party components out of the box. I used a very simple highchart component and I had to tweak it big time to get it working in reagent.

herald14:09:49

third-party react components? like this one https://github.com/highcharts/highcharts-react

herald14:09:13

I haven't looked into that with clojurescript, so it's interesting to hear. I guess the JS react component interop that reasonml has is a big plus in that scenario. (which is my best chance of migrating our codebase to something other than JS)

jsa-aerial17:09:41

@UCSJVFV35 I have used Vega, VegaLite and VegaEmbed and all work without a hitch.

awb9917:09:58

@U06C63VL4 using vega in react would be amazing. I have not found any reagent examples on vega homepage; I only found oz which uses vega for reagent, and when I tried it, it sort of has overridden the "/" route of my webserver. Can you recommend any samples ?

awb9917:09:11

(defn home-did-mount [this data] ; (js/console.log "calculating chart: " data) (js/Highcharts.Chart. (reagent/dom-node this) (clj->js (make-chart-config data)))) (defn lineplot [data] (reagent/create-class {:reagent-render home-render :component-did-mount #(home-did-mount % data) ;:component-will-receive-props #(home-did-mount % %2) ; (reagent/props %) :component-did-update (fn [this] (let [ [_ series-values] (reagent/argv this) ] (home-did-mount this series-values))) }))

awb9917:09:22

I had to use override component-did-update in order to get highcharts to work in reagent. I have seen samples that override component-did-mount but none showed how to sort of create a pure function that can be used in a reagent/hiccup template.

jsa-aerial17:09:36

Yeah, I am almost ready to release Hanami https://github.com/jsa-aerial/hanami and Saite https://github.com/jsa-aerial/saite. These are light years beyond Oz and actually in many ways better than Altair (the Python VegaLite only system)

awb9917:09:46

@U06C63VL4 It would be really nice to see more work on this sector. Clojure/Clojurescript should be way more suitable for data-science than Python. But so far Python still has better libraries. Can I use vega / hanami in reagent also?

jsa-aerial17:09:52

Yes, I agree that Clojure(Script) is far better than Python at data crunching overall, but we still have a library gap. Though things like Neanderthal, MXNET, Flare and others are getting closer to 'lib break even'. I think Hanami will go a long way for the vis aspect

jsa-aerial17:09:38

Yes, Hanami is reagent based and re-com enabled. Saite is an example app written on top of Hanami and Aeroviews (coming...) will be another more domain (RNASeq analysis) specific application

awb9918:09:56

@U06C63VL4 Do you have examples for reagent usage? The samples you have in the git repo do not seem to be reagent based...

jsa-aerial19:09:48

@UCSJVFV35 All of those samples are reagent based. As I mentioned Hanami is completely based in reagent and re-com/hiccup. Everyone of those examples is rendered via reagent

jsa-aerial19:09:23

I'm totally lost why you would think otherwise. If you are looking at the code, every render goes through aerial.hanami.core/vgl (under cljs) and that creates a form 3 component for the canvas/svg

awb9919:09:25

@U06C63VL4 cool! Thanks! From quickly reading the github it was not clear to me. That it is reagent based....

jsa-aerial19:09:32

Currently this is on VGL 2.6 and VG 3.3.1 and vegaEmbed 3.16.1 - I built the CLJSJS for these and will be upgrading them for VGL 3.0+ and VG 4.0+ when they are finalized

jsa-aerial20:09:38

@UCSJVFV35 If you are building a vis app (on VGL/VG), Hanami is intended to provide all the base infrastructure for that. It wouldn't surprise me if there are holes - I found some when starting on Aeroviews - and if you found some blocking its use for your case, I would be very interested in fixing those

awb9916:09:49

I will play around with hanami and will let you know how it goes :-)

jsa-aerial03:09:59

Dang - I need to actually release the thing - it's not on Clojars. Well, you could clone and fool around with it I suppose.

awb9911:09:01

How would I use the library then?

jsa-aerial00:09:16

Ha! - exactly why I originally mentioned it was not quite released. As mentioned, cloning could be used, but I agree it is much better to be released. I'll ping you in a few days when it is. You may not find it applicable to what you need - but I have found it very nice in the local work I've been doing.

henrik16:09:55

start(() =>
    ["div",
        ["h1", "Hello hdom"],
        // the hdom-canvas component injects a custom branch-local
        // implementation of the `HDOMImplementation` interface
        // so that one can define virtual child elements representing
        // shapes which will not become DOM nodes, but are translated
        // into canvas API draw calls
        [canvas, { width: 300, height: 300 },
            ["g", { stroke: "none", translate: [50, 50] },
                ["circle", { fill: "red" },
                    [0, 0], 25 + 25 * Math.sin(Date.now() * 0.001)],
                ["text", { fill: "#fff", align: "center", baseLine: "middle" },
                    [0, 0], "Hello"]
            ]
        ]
    ]
);

henrik16:09:21

The similarity to Hiccup can’t be a coincidence

jaihindhreddy-duplicate16:09:36

http://thi.ng is very impressive! Too bad all the libs seem abandoned 😞

lemontea13:09:38

oh no, I originally planned to learn/practice computer graphics/computational geometry (partially) by writing library in clojure (searched this space before and didn’t find any)… I really ought to have heeded the advise here: http://webcomicname.com/post/177768064084 :face_with_monocle:

henrik17:09:31

To me it looks like it has seen activity recently. Mostly one person, but still.

john17:09:11

Most of his current work has been on the TS versions http://thi.ng I believe.

john17:09:48

Is hdom a lightweight vdom implementation?

john17:09:45

hmm, maybe the "target implementation" is a swappable thing

jaihindhreddy-duplicate17:09:21

A potential alternative to react/react-native?

john17:09:08

well, native has its own machinery. But sorta reactish

john17:09:50

But, the swappability maybe means you could put hdom over react too, to get react-native

👍 4
john17:09:11

There've been some vdom experiments in cljs, iirc

kulminaator17:09:18

looking into aws' s3 object listing , i wonder what exactly happened here once upon a time ..

<Contents>
        <Key>text_data_demo.txt</Key>
        <LastModified>2018-09-23T10:34:18.000Z</LastModified>
        <ETag>&quot;9bd9c0a88cc9a89c49ba022e3a21f328&quot;</ETag>
        <Size>30</Size>
        <StorageClass>STANDARD</StorageClass>
    </Contents>
:thinking_face: why is ETag as a silly quoted value here

😬 4
john18:09:14

This here looks pretty cool https://github.com/protocol55/step

👍 8
john18:09:27

Geez, I wonder if this lisp "closure" browser will run Clojurescript compiled by the closure compiler 😂 https://common-lisp.net/project/closure/

john18:09:07

I feel like we're reaching some kind of "epistemic closure" lol