Fork me on GitHub
#off-topic
<
2020-04-15
>
yonatanel08:04:35

In a defn podcast episode from a year ago Timothy Baldridge mentioned a talk that demonstrates a core.async fork that can pause channels, show a diagram etc and I can't find it. Does anybody know where it is? He said it was in Clojure West or conj. https://player.fm/series/defn-2464514/ep-41-timothy-baldridge-aka-halgari

dominicm09:04:27

I remember a talk at euroclj Slovakia about it

dominicm09:04:49

Hmm, or maybe they just referenced it

sogaiu10:04:02

it's not this sort of thing right? https://www.youtube.com/watch?v=oPv-TY_XQ60

👍 4
yonatanel11:04:35

@UG1C3AD5Z Seems like that's the one. Thanks!

👍 4
dominicm12:04:38

Continuing https://clojurians.slack.com/archives/C03S1KBA2/p1586949510040800 For a long time I felt like types were a weakness of clojure. But over time I've changed my mind. Not knowing what data looks like is a completely separate proposition from having a compiler enforce it for you.

p-himik12:04:46

Well, not completely. If the compiler enforces types, then you will know what types you have. But whether it's something that will overall be useful is hard to tell.

sova-soars-the-sora12:04:10

I think the problems pointed out with typed data can be avoided with changes in coder behavior

sova-soars-the-sora12:04:01

Maybe you're used to measuring ground coffee with a precisely calibrated spoon and now someone shows you that you just need to push a button and it will take the correct amount, you might flounder for a long time trying to re-implement the precise measuring tools, which turn out to be entirely unnecessary for the flow. I think it's more about avoiding unnecessary work, and types are more often than not unnecessary, in my opinion. I would be interested in counter-examples that demonstrate the opposite.

naomarik12:04:56

I've been using malli recently to describe the shape of my data with extremely understandable error messages. It's been absurdly helpful because you can even specify if data structure is closed, which Rich seemed to not want in spec. I think any language that doesn't give you tools to describe data will become unwieldly as it grows. It seems his complaints are mainly that they didn't have a nice way of specifying data, which I actually haven't had until malli.

😮 4
flowthing12:04:42

I think closed spec checking is coming in spec2 (https://insideclojure.org/2019/04/19/journal/).

dominicm14:04:53

@U2FRKM4TW You're right. Although I suppose you could eschew typed compiler checking for some other kinds - I don't know what exists in that space though.

p-himik14:04:11

Linters, no?

👍 4
dominicm14:04:15

What I think is particularly interesting, is that I don't know that tools are necessarily what we need in order to solve this problem. For sure, once we've written something down in some form (comment, DSL) it would be nice to gain extra benefits from that (and this is the premise upon which I feel spec attempts to base itself - maximum leverage from your input). > I think the problems pointed out with typed data can be avoided with changes in coder behavior I think this is exactly right. I'll expand on it by pointing at something like Ring middleware. In a typed language, you will need to define N types in order to express the various requests as they pass through: Request -> RequestWithJSONBody -> RequestWithJSONBodyAndTimingInfo ... Obviously in many languages with types you don't do that, you model the problem otherwise to solve this problem. In Clojure we just create a hashmap and allow for ambiguity between the middleware. But you can offset that ambiguity by saying that X middleware takes "A ring request with the expectation that the :body is a clojure data structure". There, you know what it takes now! But what this doesn't do is force you to rethink your modelling altogether: "Maybe X should be a function which takes a clojure structure and is called from the request".

🐝 4
dominicm14:04:11

@U2FRKM4TW I was thinking more "program flow without types" sort of space. Some linters probably into that category (no def inside def).

p-himik14:04:26

Maybe I still misunderstand what you mean, but linters (or something else) that do type inference sound like they should allow you to create "program flows without types".

dominicm16:04:22

Sorry, I'm agreeing 😂 You're right! Kondo is a good example of this.

🙂 4
Bill Phillips02:04:22

There’s a lot that I don’t know about this topic. What I do know is that when folks at Microsoft wanted to build real refactoring tools for JavaScript, another dynamic language, they built TypeScript to do it

Bill Phillips02:04:11

I also know from my own work that automated refactoring tools are worth their weight in gold when doing maintenance work on a large codebase

sova-soars-the-sora15:04:21

It's hard for me to add lots of meta data to code and keep it read-able... if code and meta data can be the same that is ideal

sova-soars-the-sora15:04:05

but I would still like some way of knowing what lightening a function is capable of ... some standard way of seeing ins and outs of functions could be powerful

teodorlu14:04:36

I think types are a great tool to ensure cohesion within a codebase. They are less helpful for cross-system design and cross-system cohesion. Rich's The Language of the System helped me get a grasp on this. https://www.youtube.com/watch?v=ROor6_NGIWU

😲 4
jjttjj13:04:17

I want  a setup where I can have a clojure web server which can dynamically add new domains, with SSL certificates set up? The sites would be low traffic and I'm not worried about high performance. After experimenting with a few approaches I’ve found using letsencrypt’s certbot plus nginx to be the easiest process for getting SSL working for a domain. I believe adding a domain name will just involve a few command line calls and making a new nginx config file for the domain.  I’m a little bit worried though that this will end up being a pain to manage at some point, having a bunch of text files in config format (nginx) that’s not really great to change programatically. I’m thinking I’ll just have the data about the domains in edn somewhere, and a clojure function that can generate all the config files and shell strings to execute.  Part of me thinks it would be nicer to have a JVM-only solution without nginx, but it seems like there is less easy to use tooling out there for these setups, and that there will be a learning curve to pull this off. Would this be worth it?  Is there an obvious better path to go down to achieve this? Has anyone done anything like this? Any tips or tricks?

pauldub13:04:07

I've used openresty SSL module with great success. We used to provision the certificate from our application using ACME's DNS challenge, and then have a small openresty reverse proxy using this module (https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/ssl.md) simply grabbing the certificate from redis. Our use case was to provide a whitelabel Q&A page on our customer's domain.

pauldub13:04:52

It amounts to about ~150 lines of configuration and lua code and has worked like a charm so far.

orestis15:04:52

Probably not valid for your use case by we use AWS for all this. Only downside is that you can attach a max of 25-50 certs to a load balancer, which in practice means you may have to either merge your certs or use more load balancers.

myguidingstar13:04:32

@jjttjj Caddy can be a simpler alternate to nginx

4
jjttjj13:04:27

woah, caddy seems pretty great, thanks for the suggestion!

jjttjj13:04:21

totally hands off https is exactly what I want

David Perrenoud14:04:40

Just as a warning: I went back to Nginx because of the breaking changes of Caddy 2. Some plugins such as rate limiting are entirely missing

orestis16:04:14

Any suggestions/recommendations for an online translation management tool? I know of Transifex but their support for ICU messages is limited.