Fork me on GitHub
#off-topic
<
2020-06-05
>
Daniel Tan11:06:29

in haskell, how does one translate {:lines [] :pictures []} as a composite type, ala class Page { lines; pictures;}

vlaaad12:06:35

I’ve been writing java all week, refactoring some configs that are parsed from files to java classes, since some subset of configs is shared between different services

vlaaad12:06:07

a week of juggling stupid class hierarchies when in clojure it would have been just loading config as data T_T

vlaaad12:06:35

how do I sneak in clojure into a java shop?

borkdude12:06:20

@danieltanfh95 That would be something like data Page = Page { lines :: [Line], pictures :: [Picture] }

dominicm12:06:57

@vlaaad clojure is just a java dsl for configuration...

dominicm12:06:11

Or so I've heard from java shops who accepted it

dominicm12:06:18

It's only a java library

Daniel Tan12:06:26

what’s good in types vs schemas? technically type classes are just schemas?

borkdude12:06:31

Clojure is a Java DSL for data transformations, yeah sounds good

😄 8
😉 4
borkdude12:06:06

@danieltanfh95 type classes are more like protocols in Clojure

Daniel Tan12:06:02

im just trying to understand why use spec over types/protocols

Lennart Buit12:06:41

Talking as someone who likes Haskell and clojure.spec. Haskells type system is less expressive, but gives you compile time guarantees. clojure.spec is very expressive (its just arbitrary predicates, right), but because it is, usually is only offering runtime checking

Lennart Buit12:06:03

that makes spec a good fit for clojure, it does not impose the rigidity of a type system on a language that aims to be flexible

Lennart Buit12:06:07

If that makes any sense

Daniel Tan12:06:33

any thoughts on this?

Drew Verlee19:06:46

The question "does this meet specification" or "is this provable" isn't just useful at compile time concern imo. I predict more modern languages will blurr this dynamic even further.

Drew Verlee19:06:31

if you head over to future of coding slack people discuss lanagues that seem to do just this. But it takes decades for the changes to seep in. I predicate some big company will promote a language that will do this by 2030. But i have also just randomly been predicting things in hopes of getting one right for the last couple years. I predicate ill get at least one prediction right by 2025. see how easy that is...

vlaaad12:06:06

socially, of course

wombawomba12:06:04

Any recommendations on best practices for setting up authentication for web apps? I want something that will works both on-prem and “in the cloud”, and I’ll probably want to set up Oauth2 and 2FA eventually.

Drew Verlee21:06:04

Dont roll your own auth server. Everything past that depends on your budget, plateform, etc...

Drew Verlee21:06:31

we use keycloak which has a ton of authorization stuff that we ignore and just use auth through the tokens/claims/jwts

wombawomba17:06:44

I’ll take a look at Keycloak, thanks 🙂

Drew Verlee16:06:25

is there a way to save the state on a ssh agent between idk computer restarts? in particular it seems i have to start the agent and add a key: e.g $(ssh-agent -s) && ssh-add -k some_key

dharrigan16:06:03

I use keychain - for many years.

jjttjj18:06:23

I'm working on an emacs-like editor. I have a similar windowing system to emacs with "windows" (the rectangles that divide up a screen) and "buffers": the things that go in the windows and basically provide all ui/functionality. "Buffers" in my app aren't necessarily just for displaying text and could be anything. Trying to think of a better name for "buffers" which doesn't feel right. Any ideas for a good alternative name for "buffer"? I've been using "app" but not in love with that either. Thinking about "mApp" ("mini app", implemented as clojure map), not sure how I feel about that either.

phronmophobic18:06:30

“frame” is related concept

phronmophobic18:06:42

similarly, “viewport”

jjttjj18:06:28

Good ones. I guess atom uses "pane"

👍 8
borkdude18:06:49

in emacs frame is the window which can contain multiple buffers

jjttjj18:06:39

I believe a frame in emacs is what most OSes refer to as "windows", ie the thing you drag around in main OS gui

borkdude19:06:15

that's right

Aron19:06:10

buffer is where the important state is stored? 🙂 I call that display-state, or focus

phronmophobic19:06:37

i mean, there are only so many good words. I wouldn’t depart from historical usage unnecessarily, but it might be better to use a good descriptive word than inventing a new one or using a less apropos word

Aron19:06:33

if you depart from historical editors, you can depart from their terminology

borkdude19:06:39

how does VSCode call them, "open file"?

phronmophobic19:06:11

I was looking at other jargon from architecture, “metope” is interesting.

Aron19:06:31

this is other jargon from architecture, just because you are not familiar with it, doesn't mean it's non-existent or invalid 😛 😄

borkdude19:06:03

I know someone who is working on a windowing GUI library which is going to get that name probably 😉

😁 4
jjttjj19:06:50

cool words 😎 thanks for the brainstorming help

dpsutton22:06:43

> I never returned from my ‘sabbatical’. what a great sentence in the history of clojure book

🙂 48
rich 35
Vincent Cantin20:06:49

because there is no return in Clojure

😃 4