Fork me on GitHub
#clojure-europe
<
2023-03-09
>
pez08:03:42

🤯 Puzzle game invented, coded, designed and named by ChatGPT: https://sumplete.com/

🤯 4
pez08:03:01

It's not super fun, but anyway. 😃

mdiin08:03:49

I actually think the puzzle is quite fun. Reading the blog post was interesting as well. Thanks for sharing! 😄

pez09:03:56

I loved the blog post.

pez09:03:02

I find that using ChatGPT right can save a lot of time. Using it wrong can waste a lot of time. I'm doing both and think I might be at where I have saved time in total, but hard to tell. I'll probably cut this differently in some months, but right now I use this rule of thumb: 1. Easy task, ”I don't want to type all that!” -> ChatGPT saves me time 2. Medium hard task, ”I could figure it out myself” -> Better figure it out myself 3. Hard task/new terrain, ”Maybe ChatGPT can help me get started?” -> ChatGPT often helps me get started. ChatGPT sometimes has me wasting time, because I try to make it do my work.

otfrom11:03:17

I find it interesting that while ChatGPT and others can come up with lots of options, we still end up having to do a lot of curation.

pez11:03:38

Senior Software Curator. My new title?

simongray08:03:23

Firefox randomly stopped displaying borders on one of the websites I control… WTF

simongray08:03:09

Apparently, using the CSS variable name —border is no no longer possible in Firefox for some odd reason? :man-shrugging:

mdiin08:03:11

I was under the impression CSS variables should be named with double-dashes at the start. Maybe that was not a hard requirement by firefox previously?

reefersleep08:03:29

the world moves so that we’ll never be out of work

reefersleep08:03:48

sighs in legacy

simongray08:03:47

@U0522J5HN it does have double dashes

simongray08:03:44

my mac replaces double dashes with em dashes, that’s why it came out wrong here

👍 2
mdiin08:03:10

Thanks Mac! 😄

mdiin08:03:36

In that case I have no idea.

simongray08:03:50

the logical conclusion is that they added some code that prevents you from using reserved keywords in some other context and this code spilled into the CSS implementation

simongray08:03:37

@U0522J5HN I added the replacement stuff myself, it’s just a little bit annoying when typing out code in non-code apps like Slack 😛

simongray08:03:10

it’s so I can—with a little help from macOS—use syntactically correct dashes

mdiin09:03:23

As long as you’re in control all is well, then I will stop bashing MacOS. 🙂 It’s actually quite neat that it is possible.

simongray09:03:03

but maybe it should be 3 dashes

reefersleep09:03:21

What’s the point of using double dashes? I don’t think I ever notice them when I see them.

reefersleep09:03:28

Well, depending on the font.

simongray09:03:04

double dashes? I just use them for CSS vars. Em dashes, however: https://www.thepunctuationguide.com/em-dash.html

borkdude10:03:06

> my mac replaces double dashes with em dashes, that’s why it came out wrong here This only happens for me on my iPhone, very annoying

pithyless10:03:55

I think that with the longtime browser philosophy of “support all past bugs and guess user intent” all CSS variables with -- should also accept an emdash.

😆 2
mdiin08:03:50

Mornings!

reefersleep08:03:31

Good morning everyone!

simongray09:03:30

I think I will try to separate some code out into libraries today. I have both a SAML library and an xml->hiccup cljc lib

lemuel09:03:03

working on a Laravel app at the moment. I’ve counted 6 different ways to do UI 🙃

🤡 2
samoleary09:03:03

Maidin mhaith!

imre19:03:53

belated dia duit!

☘️ 2
borkdude10:03:17

(System/getenv "MORNING")

java 6
vemv11:03:51

"good"

😆 4
reefersleep11:03:16

Exception in thread "main" java.lang.CoffeeNotInitializedException

😄 2
borkdude11:03:55

CaffeineBufferUnderflow

😄 2
simongray14:03:06

(.initialize (.build (CoffeeFactory.)))

borkdude14:03:33

.close 💩

simongray12:03:08

It's amazing how little coffee you need when you manage to get a night of unbroken sleep 💪

👍 8
👼 6
javahippie13:03:25

A recruiter just called me, looking for a freelancer who knows Clojure and Java. “Ah, finally, it took ages to find somebody who knows Clojure! My client is looking for some help to migrate their Clojure application to Java…” 😢

laughcry 24
😆 2
simongray13:03:39

This deserves a laughcry

laughcry 4
javahippie13:03:42

I think I know who this is, a German Bank that had parts of their core banking system in Clojure. Really sad, but I guess they are not able to find the devs for it. Might become a trend, when more and more companies need more and more devs

Ben Sless13:03:40

You can try to flip the contract on them, build a clojure team and get them going 🙂

borkdude13:03:19

or join with nubank

borkdude13:03:22

they have plenty;)

Ben Sless13:03:03

"Allow me to negotiate a merger"

😆 14
Ben Sless13:03:13

M&As pay very well

mccraigmccraig13:03:14

"why not migrate to java, you'll be able to find loads more devs... 'course you'll also have 5x the amount of code to maintain, but there are always swings and roundabouts :man-shrugging:"

Ben Sless13:03:08

"Why are you trying to increase expenses?"

metal 4
borkdude13:03:23

"What do you mean rewrite in Java, I can just generate .class files for you"

😂 12
Ben Sless13:03:29

"You can pay 2x for half the amount of Clojure developers or 0.8x for 5 times the amount of Java developers, clearly, you should rewrite it in Java and send the bill to finance"

borkdude14:03:40

Oh I know! decompile those generated .class files and voila!

laughcry 6
agile_geek14:03:56

I think u miss the motivation here. The hiring manager is building a "pyramid of prestige" by hiring more ppl to manage and the recruiter gets a cut of each salary for the to first year. Why would they want to be more efficient?

laughcry 10
🤑 4
simongray14:03:12

It’s laughcry ’cause it’s true

💯 4
thomas14:03:19

Java was designed to solve an HR problem.

javahippie14:03:31

I suspect it‘s the classic rewrite reason: „The software is not working that well and has issues, so we need to signal something to management and take action without addressing the root causes like bad communication, muddy requirements and lack of project management. It‘s the language!“

simongray14:03:33

Isn’t the most likely reason that they already have some developers who know Java and none who know Clojure, so the local optima becomes -> hire someone to rewrite it into Java

2
👍 2
agile_geek14:03:36

HR had plenty to do when we used C++, C & COBOL too! Java attempted to solve the hire everyone at once, fire and rehire everywhere problem!

thomas14:03:56

rewrites are seldom the solution to the problem

simongray14:03:36

No, the best solution is probably for the existing devs to learn Clojure and for the organisation to perform an actual knowledge transfer when (before) their Clojure dev left, but most Java devs probably don’t want to learn Clojure, unfortunately.

agile_geek14:03:47

Big bang rewrites never work. I've done incremental "strangler fig" style rewrites successfully.

4
👍 2
genRaiy15:03:58

if I can take an opportunity to have a minor criticism of Clojure ... Java has become better in the last 10 years and Clojure doesn't play so nicely with it any more. I think the core team really need to improve the interop so that the superiority of Clojure remains evident

12
simongray15:03:46

The core team is busy working on Spec, Ray!

😂 6
laughcry 2
agile_geek15:03:00

@U04V5V0V4 I rarely do Java interop so what's now problematic? I can see you can't easily use functional constructs but as you're calling from Clojure I'm not sure why you need them?

javahippie15:03:45

As these constructs become more common in Java, I sometimes had cases where they were expected by library Interfaces. „Pass a lambda expression here“ is an issue from Clojure Interop

👍 6
2
2
grav16:03:19

> Java has become better in the last 10 years and Clojure doesn't play so nicely with it any more @U04V5V0V4 That's sad to hear (not the java-part, the clojure-part). Can you give some examples?

Ben Sless17:03:04

@U052XLL3A functional interfaces and streams are a large part, probably

Ben Sless17:03:09

Next would be support for record types and value types Looking forward, virtual threads

genRaiy17:03:03

pattern matching is coming

genRaiy17:03:20

to Java at least 🙂

Ben Sless17:03:38

Isn't that just compiler level stuff? So core.match already does it, no?

Ben Sless17:03:37

Or one of the other libraries

genRaiy20:03:02

I'm discussing interop not the capability per se

Ben Sless20:03:28

Pardon if the question sounds a bit dumb, but how would interop with java's compiler pattern matching look like?

Mario Trost20:03:29

a little spicy in here, I like it

genRaiy20:03:48

I haven't thought about it @UK0810AQ2 - it's just an example that can't easily be handled as of now

Ben Sless21:03:23

It's just that up until recently Java's compiler was really straightforward, to an extent you could compile Java code manually. Macros already let you extend the compiler, so I'm wondering if there isn't a mismatch between interop with java the language vs java the platform.

genRaiy21:03:32

When you consume libraries it might be an issue

genRaiy21:03:57

Unless I’m missing something

genRaiy21:03:06

Very possible

Ben Sless05:03:42

afaik (not very far) since it's just compiler sugar it should have zero effect on working with libraries that use that feature

mccraigmccraig06:03:31

i haven't tried to use any of the newer jdk features with clj interop - are there blocker issues (e.g. it is impossible to use a java API using lambdas from clojure) or is it just inconvenient (e.g. you can just pass a clj fn to a java lambda API, but it's possible to create a lambda with some awkwardness) ?

javahippie07:03:13

Arguably, the developers of that library made a … decision which made it a lot harder, but it’s not possible to satisfy this API from Clojure

mccraigmccraig07:03:48

oh, lol - so there are some issues where bytecode de/serialization of lambdas (:face_vomiting:) is used ... so to support that clj would have to support compiling a serializable lambda expression

grav07:03:33

Probably missing something, but as far as I can see, the Functionhttps://docs.oracle.com/javase/8/docs/api/java/util/function/Function.html doesn't have a isSynthetic method, so how can that be required?

grav07:03:54

Isn't that something that this particular library dictates?

javahippie07:03:46

Yeah, it’s a library decision to check this, but in the end it is something that Java supports (and which is used), but is impossible from Clojure. Maybe not the best example, because everything which requires a class to be present has the same issues. It’s not a method on the functional interface, it is a method on Class: https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#isSynthetic--

mccraigmccraig07:03:49

it is a current interop impossibility though - given lexical scope perhaps requiring a clj compiler mod to support (without lexical scope i can imagine a macro ASMing a synthetic class)

mccraigmccraig07:03:08

are there any other interop impossibilities ?

javahippie07:03:43

From the top of my head, I don‘t think it is possible to create records or sealed classes in Clojure. Not sure about the usecase of these in Clojure, tbh, but there is „isRecord“ method on the Class, too, and some libraries might only accept records as Parameters due to their specifics

grav07:03:42

Ohew ... lots of java lingo I don't understand here 😅 Just really interesting to me that Clojure is the limitation here. Wonder if someone from Cognitech is aware of those limitations.

javahippie07:03:25

And another thing I wanted to look into for some time are modules. For all of the Java libraries which use the module system until now it seems like their classpath and their module path were identical and they worked with Clojure, but in theory some library maintainers stated, that they do no guarantee that these libraries work if they are not included as modules :thinking_face:

mccraigmccraig07:03:42

hmm... the record thing seems fixable with a macro/ASM (i.e. no clj compiler mod required, but some work) ... and the sealed-class thing might not affect interop much since it's all within a java module boundary ...

mccraigmccraig07:03:22

not sure about the module thing though - i've about reached my limit of browsing java stuff for the day 🙈

javahippie08:03:11

I just forwarded the module question to some Java people who are advocating for modularized libraries all the time, I also need to start doing some actual paying work for the day 😃

👍 2
😄 2
javahippie14:03:32

Short addition: It is at least possible to check if code runs inside a Java module with class.getModule().isNamed(). It is unclear if somebody actually does this, but a library could check if it runs inside a defined module. Running modularized libraries directly on the classpath (or in an “unnamed module”) should not be a problem, if the library maintainer is not doing something egregious

mccraigmccraig14:03:05

having a look at the Module API via https://www.baeldung.com/java-9-module-api - it seems like it should be possible to use that with vanilla clj interop - what is it that is difficult ?

javahippie14:03:23

I’m not sure that the whole definitions of modules and the concept of “module paths” vs “classpaths” can be achieved: https://openjdk.org/projects/jigsaw/quick-start This is configured in the module-info.java file on a package level

mccraigmccraig14:03:21

dyu mean in relation to producing clj code in a module, or to consuming modules from clj code ?

javahippie14:03:46

I meant consuming modules

javahippie14:03:48

(But it’s not like modules are playing a big role in the Java world, anyways right now. Many developer advocates advocate usage of modules, but they are not met with enthusiasm)

mccraigmccraig14:03:40

does consuming modules impact clojure at all - classes are still loaded through the ClassLoader mechanism aren't they ?

genRaiy07:03:55

I listened to https://overcast.fm/+2tVlD5pN4 recently and there is lots of relevant content

☝️ 2
genRaiy07:03:18

The potential size of emojis was a revelation to me

pez08:03:27

Thanks! Will have a listen. That is one of my fav podcasts.

pez08:03:36

I should have asked people to motivate their answers to the poll. It's interesting that 9/10 want the emojis to count as 1 character each. Should be quite few use cases where that makes sense?

genRaiy08:03:28

if you control the content, sure