ByteCode.News
Submit RSS Atom Sign in

Back to the channels

#nevet

  1. Chronos yep. I worry... but I do have a *lot* on Google.
  2. dreamreal Well, the problem is the spreading of expertise
  3. dreamreal am I going to be as good as google at running an MTA
  4. dreamreal in 1998? ... sure, maybe. fetchmail, spamassassin, state of the art!
  5. dreamreal now... uh...
  6. Chronos Even then, what if you lost your domain?
  7. Chronos Gotta put your trust somewhere, I guess. Might as well at least make it convenient.
  8. dreamreal Yeah. I'm not trying to convince you, I'm just trying to make a good decision here. From my perspective, coding both/either isn't rocket surgery.
  9. dreamreal The OPT gets us out of handling a password, too, after all.
  10. dreamreal OTP. Sorry, driving all day, eyes blurry :/
  11. Chronos Could you... implement both? :)
  12. dreamreal theoretically, yes? Hold on, let me see
  13. dreamreal I don't see why there's a smiley on that question, it makes sense to ask
  14. Chronos You could then run a real world test to determine how popular each is.
  15. dreamreal well, for nevet, they'r eboth pretty surface-oriented
  16. dreamreal I think supporting both is not that difficult
  17. dreamreal did you see my safecracker idea?
  18. dreamreal it may feel familiar to your word solver concept, that's 100% incidental, zero relation WHATSOEVER I swear, 100% on my mother's life
  19. dreamreal (my mother is dead, this is 100% safe for me)
  20. dreamreal Chronos: what I REALLY want, and don't tell anyone this, is for someone else to go "damn it why you taking so long, here's a PR" and have it work :D
  21. Chronos dreamreal: My distrust of "sign in using X" might be because I just don't understand it. Provided I trust X, can whatever I'm signing into see or access anything other than my email address?
  22. dreamreal Chronos: https://github.com/jottinger/bytecode.news/issues/67#issuecomment-3956457149
  23. dreamreal I'm capturing ALL this stuff because I think it's important to work out, and I don't know it well enough myself
  24. blue dreamreal: https://github.com/jottinger/bytecode.news/issues/67#issuecomment-3958016170
  25. blue You can tell kinabalu is REALLY getting on nerves. He just spent his last comment 1) conflating two disjunctive concepts and 2) reiterating my ORIGINAL post and presenting it as new knowledge / his own insight. What a PEST this guy is!
  26. blue This guy thinks he's Timon or what?
  27. blue The whole issue is about skirting external auth dependencies by offering a simple login mechanism that is secure and does not rely on users having accounts *anywhere*. Then this guy came along and artifically inflated the discussion, bikeshedding it to no end.
  28. blue The reasonable thing to do is: say yes, we're implementing passwordless login in a reductive form that requires storing no IDing data besides email (which probably needs storing anyway), and if we ever wanna do Google Auth or whatever, that's a separate issue, and there we might consider if we wanna do it in-house or auth0 or whatever.
  29. blue But no, now we gotta start discussing the semantics of oauth vs OIDC, which is clearly in-scope here. /s
  30. blue https://github.com/jottinger/bytecode.news/issues/67#issuecomment-3958155428
  31. blue dreamreal: https://openjdk.org/jeps/401 HA!
  32. nevet JEP 401: Value Classes and Objects (Preview)
  33. blue biggest fail though: "The String class has not been made a value class. Instances of String are always identity objects."
  34. dreamreal jep 401
  35. nevet jep 401: Value Classes and Objects (Preview) (https://openjdk.org/jeps/401)
  36. dreamreal How is that a "ha?" we kept pointing out that it was a thing
  37. blue dreamreal: my criticism is 100% supported by jep 401! that only bad move is NOT to extend it to strings which clearly fulfill the two criteria: immutable AND interchangeable!
  38. blue "Developers can declare their own value classes by applying the value modifier to any class whose instances should be immutable and interchangeable:"
  39. dreamreal And we agreed with you, and explained why it wasn't there yet
  40. blue nor you, neither the proposal, explain why it's not extended to strings!
  41. dreamreal and strings are not quite there, because while the INTERNED values do the top level strings make it difficult
  42. dreamreal And you're incorrect, because I did explain why it's difficult to extend to strings
  43. blue interning is a SECONDARY consideration; the proposal says value classes are easier/more effective to store, but that's NOT the motivation
  44. * dreamreal sighs
  45. dreamreal making == fit the way you want it to is not, either
  46. blue "At run time, the JVM can optimize value objects by encoding them in more compact forms than identity objects. Instead of allocating space in the heap for a value object, the JVM can flatten and scalarize the object."
  47. blue emphasis on *can*
  48. blue it's secondary!
  49. dreamreal exactly my point, blue
  50. dreamreal I would LOVE it if you'd stop seeing an active opponent in every disagreement
  51. blue did you see my comments on #67
  52. dreamreal Did you see my response to them?
  53. dreamreal (i.e., yes)
  54. blue no, because nevet hasn't told me there are any!
  55. dreamreal nevet doesn't track responses on issues, only issues
  56. blue *feelsbadman*
  57. blue anyway, lemma read then
  58. dreamreal We are slowly starting to see light through the fog, though, and that's good
  59. blue I'm glading you're parsing mr timon here as "light through the fog"
  60. dreamreal Note: mr timon here is also one of my ride-or-die friends, so let's check the condescension. We're all trying to work to the same end. he's, uh, hardly alone in making sweeping statements about subject matter.
  61. dreamreal Not that anyone in THIS discussion ever does that.
  62. blue I mean, we circled back from my original issue to him restating that again, in different words
  63. dreamreal and note: when I say andrew's ride-or-die, I mean it. He's been there when I was up against a wall, and vice versa.
  64. blue I understand that. That doesn't mean he can't be wrong here
  65. dreamreal Sure, but words matter. We're getting closer to what I wanted in the first place: understanding and consensus.
  66. dreamreal So can you, please remember that. It doesn't matter if you're not wrong.
  67. blue sure
  68. dreamreal and so can I, which is why I'm trying to push things along carefully, because this is definitely not a subject area where I'm strong, or else I'd have caught OIDC vs Oauth already.
  69. dreamreal OIDC is actually what I was wanting, I think :/
  70. blue OIDC is not a common term in my experience
  71. dreamreal mine either, obviously
  72. dreamreal but I'm a-learning!
  73. dreamreal there's a bit of "gotcha" in the discourse that I do not think is constructive, but it's natural
  74. dreamreal we'll work through it
  75. blue hence the timon comment; it's again a distinction without a merit. you can call sign-with-google oidc or oauth, depending on which side you want to emphasis, the technical or identity. I've always called it oauth because oidc sounds like an SEO term
  76. blue s/emphasis/emphasise/
  77. dreamreal Quite possible, but let's stay above the belt in every way we can, if we can
  78. blue it's not like there's another way to do it besides oauth, with google. the distinction oauth vs saml matters. an oidc distinction is... not important
  79. dreamreal I get it, the whole discussion is annoying, to me, but it's enlightening
  80. blue well, my personal feeling is that ever since this guy has entered the ring, it turned into bikeshedding, which I personally rather dislike
  81. blue we're now discussing the minutae of oidc (a constructed term), oauth, and now also EU compliance
  82. blue all of this has no bearing on the issue at hand
  83. blue if you want to do "sign with" -- which you might, then I'd argue a separate issue should be created. this wasn't supposed to be "let's bikeshed auth"
  84. nevet if you want to do "sign with" now has karma of -1.
  85. dreamreal Sure. I find discussions over whether object identity should apply to strings in java or not annoying as well, especially when it was a question brought up in the original language design and explained thoroughly as "no" - object identity is ==, object equality is equals() - but sure, let's beat that horse as long as we can, just not OIDC/OAuth/OTP
  86. blue because that's a REAL horse, until the oidc horse which is imaginary!
  87. blue unlike*
  88. dreamreal I mean, we're now at the point where the dual path is clear, and we just have to get the people who write the UIs that use to go "yes, yes, terms, whatever, dual path makes sense to me" or no
  89. blue *sigh*
  90. blue he just keeps muddying the water, I'm gonna check out of that issue after my last comment
  91. dreamreal Please don't, because you're likely to have to work with the output
  92. dreamreal and like I said, we're seeing light
  93. dreamreal poetry the failure of gradle
  94. blue welp, if you are annoyed by people not reading what you write, then surely *I* am as well!
  95. dreamreal I just have the grace to bitch about it less
  96. dreamreal poem the failure of gradle
  97. nevet a poem: Build failed, red text screams,/Dependencies tangled in knots,/Cache cleared again—hope.//Sync button worn thin,/Stack traces bloom endlessly,/Coffee grows colder.
  98. dreamreal a poem: Build failed, red text screams,/Dependencies tangled in knots,/Cache cleared again—hope.//Sync button worn thin,/Stack traces bloom endlessly,/Coffee grows colder.
  99. nevet Analysis: This is a pair of haikus following the traditional 5-7-5 syllabic structure. The poems use situational juxtaposition rather than strict rhyme, capturing the Zen-like frustration of software debugging through seasonal imagery and present-tense observations.
  100. dreamreal Not a great poem, nevet.
  101. blue poem The impossible universe: The day Timon had an original thought
  102. nevet a poem: Neurons sparked in patterns never traced,/synapses firing wild and uncharted paths—/the cosmos shuddered, paused, held its breath./Somewhere, a star blinked out in disbelief.
  103. a poem: Neurons sparked in patterns never traced,/synapses firing wild and uncharted paths—/the cosmos shuddered, paused, held its breath./Somewhere, a star blinked out in disbelief.
  104. nevet Analysis: This free verse poem lacks a regular meter or rhyme scheme, relying instead on enjambment and varied line lengths to create rhythm. The four lines form a brief lyric meditation using cosmic imagery to metaphorically explore consciousness or thought. Its structure emphasizes spontaneity through unmetered, flowing syntax.
  105. dreamreal a poem: screw you, gradle/ you're no longer able/ your strength is a fable/ built.. on... lies.
  106. dreamreal a poem: screw you, gradle/ you're no longer able/ your strength is a fable/ built.. on... lies.
  107. nevet Analysis: This poem uses loose iambic tetrameter with an AAAB rhyme scheme (gradle/able/fable, lies). It's a free verse quatrain that playfully subverts expectations by breaking rhythm in the final line, emphasizing frustration with the build tool Gradle through both form and content.
  108. dreamreal sentiment #nevet
  109. nevet Sentiment for irc://libera/%23nevet: -3/10 | Intensity high | Themes: GitHub auth bikeshedding frustration, Java value classes debate, Gradle complaints | Summary: blue venting hard about contributor "Timon" derailing auth discussion; dreamreal mediating but also frustrated; tension simmering despite attempts at civility | Drivers: blue,dreamreal
  110. dreamreal Interesting.
  111. blue I'd say that's pretty accurate!
  112. blue aside from the Gradle complaints
  113. dreamreal It's humor from #java
  114. dreamreal Was curious what the poem analysis would be
  115. blue I love everyone, everyone is amazing and the world is full of peace & harmony and everything is friends especially our dear nevet bot
  116. blue this is such a nice day and the sun is shining, weather is 10/10
  117. blue overall AMAZING!
  118. blue dreamreal: you're GREAT and AMAZING! and everyone else here TOO
  119. blue sentiment #nevet
  120. nevet Error: Sentiment analysis requires ADMIN role
  121. dreamreal nevet can detect sarcasm, BTW
  122. dreamreal sentiment #nevet
  123. nevet Sentiment for irc://libera/%23nevet: Sentiment +1/10 | Intensity mod | Themes: GitHub auth bikeshedding frustration, Java value classes debate, forced positivity | Summary: blue vented heavily about contributor "Timon" derailing auth discussion; dreamreal mediated tension while defending friend; blue ended with obvious sarcastic positivity after seeing bot's -3 assessment | Drivers: blue,dreamreal
  124. dreamreal bwahahahaha
  125. blue ha! haxxored!
  126. blue went up from -3 to 1!
  127. dreamreal right, but that does actually affect sentiment... and a +1 when the scale is -10 to 10 ain't much. Around the center it's easy to influence.
  128. blue dreamreal: that is true. you are very correct, as ALWAYS!
  129. blue I have never witnessed a correcter person. You are an asset and infinitely valuable to this channel: you bring light & positivity!
  130. blue I have a candidate for the understatement of the year: '"Timor" derailing auth discussion'
  131. blue this sentiment feature is kinda cool. still broken scale imho, but, c'est la vie!
  132. blue dreamreal: what's your take on project valhalla?
  133. dreamreal If they can make it work, and I think they can, it'll be great
  134. dreamreal it's been in the works since 2010 or so in various forms, maybe even earlier
  135. blue in which case, new Long(1) == new Long(1) will WORK!
  136. blue but also a bunch of other interesting use cases for larger objects
  137. dreamreal brian's a brilliant guy
  138. dreamreal He talks in person like he's in compressed time
  139. dreamreal like, you want to say "dude, it's okay to breathe"
  140. dreamreal brilliant guy though
  141. blue so: deep immutability (this is what this boils down to, although this is NOT the use case) is VERY hard to get done properly
  142. blue javascript tried. r&t failed miserable. the browsers wouldn't implement it, got blocked
  143. blue miserably*
  144. blue to those unaware: records&tuples were a javascript proposal adding deep immutable types to the language. for objects, the syntax #{} instead of {}; for arrays #[] instead of []
  145. blue the proposal was a dumpster fire that eventually failed because browsers (well, essentially google/v8) refused to implement it, for perf concerns
  146. dreamreal programming is hard, as it turns out.
  147. dreamreal mutating java like valhalla wants to do is especially hard, because the language and system design were clear about why it was a major change
  148. blue to be fair: the proposal started on the wrong feet. both terms are HIGHLY overloaded in computer science. if I say tuple, do you think of an IMMUTABLE ARRAY OF ANY LENGTH?
  149. blue because I don't.
  150. dreamreal *nod*
  151. blue record is worse: there's database record, and in typescript, unfortunately, the type 'Record' just means a non-null object
  152. blue they should have gonna with ImmutableArray and ImmutableObject. yes, longer. but clear.
  153. dreamreal we don't need clarity, obviously: if we did, == applying to reference identity and therefore being inappropriate for java strings' *value* equality would make total sense, since they're objects
  154. blue java also has record: I *think* it's actually WELL used there. Because it's closer to the DB idea of a record
  155. blue (a data transfer object, essentially)
  156. blue dreamreal: there's terminological clarity and clarity of use. the operator == having different meanings in a language is.. a catastrophe. Look at c++
  157. nevet dreamreal: there's terminological clarity and clarity of use. the operator == having different meanings in a language is.. a catastrophe. Look at c now has karma of 1.
  158. blue java could have embraced a totality on objecthood: no small ints
  159. dreamreal ooof, I hate referring to C++ in a channel with karma. That SHOULD be a specific cutout... but damn it, determining that it's actually C++ and not "C, plus karma!" is a pain
  160. nevet ooof, I hate referring to C++ in a channel with karma. That SHOULD be a specific cutout... but damn it, determining that it's actually C now has karma of 1.
  161. blue but it didn't
  162. blue true
  163. dreamreal well, smalltalk showed what a horror THAT was
  164. dreamreal it's been done
  165. blue overloading operators is just about the WORST thing I can think in computer science. it's one of the seemingly brilliant ideas that are just so innately wrong
  166. blue even the fact + is overloaded, is kind of weird. why does it mean addition in ints, but concatenation in strings?
  167. blue why hasn't java or any language implemented + for booleans, meaning logical AND?
  168. dreamreal because java was intended to be used by humans and choices were made. Pascal-style strings were on the table. Ever used them, as in wirth's pascal?
  169. dreamreal because AND has a symbol associated with it and they use that instead?
  170. dreamreal so do OR and NOT and XOR
  171. blue great, you're making my point for me: if it's intended to be used by humans, then new String("foo") == new String("foo")
  172. dreamreal I also pointed out "choices were made."
  173. dreamreal Also worth noting: Scala uses == for string value identity.
  174. blue I think the best criteria for == comparing by contents is reallty, immutability
  175. dreamreal In Java, the strongest argument against it is 28 years of an existing codebase
  176. blue Strings are immutable in java -- GOOD. So the == operator should be clear.
  177. nevet Strings are immutable in java now has karma of -1.
  178. blue yes, and project valhalla could FIX that.
  179. blue but they chose not to
  180. dreamreal *shrug*
  181. blue you could even having a new MyString("foo") object, according tot he proposal, and it could benefit from == by value
  182. blue that's how ridiculous it is
  183. dreamreal in terms of the hills to die on, that one's still pretty shallow
  184. blue so I'm asking chatgpt to give me examples where value-objecting String would be an issue, and so far it's been struggingly badly
  185. blue current example: if you create a map with two keys new String("foo"), its size would shrink from 2 to 1
  186. blue that's, uh.. not a real use case. it's not meaningful to have such a map, there's no use case for it: the key is practically equal in all regards
  187. blue I'm REALLY interested in this, dreamreal; I'm looking for someone/something to step up and SHOW ME a good reason for this
  188. dreamreal um
  189. dreamreal maps store objects as keys, and since objects use equals for value equality, not a thing
  190. dreamreal the rules are simple: object equality uses equals, == is identity
  191. dreamreal you just want strings to have identity, and they don't
  192. blue exactly
  193. blue strings don't have identity
  194. blue yu're arguging MY case!
  195. dreamreal no, they do have identity
  196. blue so show me an actual real use case where this matters
  197. dreamreal new String("A") gives you a reference: #a1726av, new String("A") gives you a DIFFERENT reference, #8127ns, the references are not the same, == is false
  198. dreamreal 1) don't need to, java's already in production 2) the rules are clear; your argument AGAINST String having "+" is actually much stronger
  199. dreamreal but neither argument has an outcome that matters: if I were to agree with you 100% nobody would change a thing anywhere
  200. blue I KNOW how it works. I'm looking for osmeone to explain why valhalla has EXCLUDED strings
  201. dreamreal Here's an idea: email Brian
  202. dreamreal ask him
  203. dreamreal I'm not on the valhalla team, I don't know, anything I came up with would be conjecture
  204. blue then CONJECT; I don't know brian
  205. dreamreal He's publicly accessible!
  206. dreamreal the internet's flat, man
  207. dreamreal I do think you'd find the demand for == for strings to be pretty low
  208. dreamreal but I haven't run a poll... oo, there's an idea for nevet
  209. blue "Synchronization on String objects"
  210. blue if String were a value class, "You cannot synchronize on them at all."
  211. blue AND???
  212. blue this is not a use case
  213. dreamreal I mean, you're talking about them no longer acting like what they are, which is objects
  214. dreamreal objects can be synchronized on, I don't think synchronizing on a string is necessarily a brilliant idea, but it falls out of the design
  215. blue chatgpt's conclusion: "So if we try to find a real, meaningful program that would break, we basically come up empty."
  216. blue "The canonical argument “String cannot be a value class because identity matters” is mostly theoretical."
  217. blue I WIN, again!
  218. dreamreal like i said, you've made a stronger case for removing "+" on strings than anything else
  219. dreamreal ... against an LLM?
  220. blue No, in general
  221. dreamreal ok
  222. blue "It’s not because there’s a meaningful everyday scenario where new String("foo") == new String("foo") being true would break business logic."
  223. blue "It’s because the Java platform historically treats Strings as reference objects, and changing that would alter any code—even obscure ones—that depends on identity in any way whatsoever."
  224. blue "The maintainers are extremely conservative: even theoretical breakage is considered a showstopper."
  225. blue YES, THAT IS WHY WE HAVE MAJOR VERSIONS, TO not BREAK STUFF
  226. blue *sigh*
  227. blue I'm done with humans, that's it
  228. dreamreal java's always been pretty pathological about that, though
  229. dreamreal yes, please, never interact again, yeesh
  230. Chronos Andrew's comments make me even *less* likely to use/trust "Sign in with X" flows, heh.
  231. * dreamreal sighs with relief
  232. blue Chronos: 100%
  233. dreamreal Chronos: should be the opposite, actually, but I get it
  234. Chronos Too much crap and complexity built on too much crap and complexity built on too much crap and complexity. I trust all parties to get it right and honor their security promises as far as I can throw an African elephant. LinkedIn already burned me once — badly — with a similar flow. I have to nope right out of "Sign in with X".
  235. dreamreal Chronos: I'm going to have a PR soon for the dual-path thing
  236. blue Chronos: it's very bad indeed. As I noted before, the worst thing is that you stay logged-in after that. So you auth-by-google, but a side effect is that now you go to youtube and suddenly you're logged in, and google's saving all your video history.
  237. blue There's no reason this should happen, btw. But it happens. oauth says nothing about the state the oauth provider should be in after the flow's done
  238. blue it just says you should be given an auth code
  239. Chronos dreamreal: Woo hoo!
  240. Chronos blue: Yikes.
  241. Chronos When LinkedIn, *somehow*, on the *web*, grabbed and spammed my *entire* Google Contacts list, I knew right then that kind of flow in general is *evil*.
  242. Chronos Never in a thousand years would I have guessed that would have been possible. It was such a deep embarrassment, and violation of privacy.
  243. dreamreal PR reviews requested. DO NOT MERGE, please.
  244. bot [jottinger/bytecode.news] New PR #105: Dual-path auth provision - https://github.com/jottinger/bytecode.news/pull/105
  245. Chronos dreamreal: "Always returns 200 regardless of whether the email matches an account (prevents account enumeration)." -- I thought you were going to return, what was it now... 202?
  246. nevet dreamreal: "Always returns 200 regardless of whether the email matches an account (prevents account enumeration)." now has karma of -1.
  247. Chronos oops. sorry. forgot to use a proper em-dash there.
  248. Chronos dreamreal: "If the email is valid, a 6-digit code is generated with a 5-minute expiry and sent via email." — Did you decide to switch from 5 to 10 back to 5? Which is okay with me, just curious.
  249. dreamreal File comments, damn it! Telling me here is ephemeral. All good observations.
  250. dreamreal Of those, the 202 thing is the one that's bugging me, will fix, the minute thing... meh, I'm working on GDPR requirements right now and that will be bundled in
  251. dreamreal I have no objections to the GDPR in concept but the application requirements are inconsistent and maddening
  252. dreamreal But I have a plan
  253. Chronos You know... I wonder what happens if I use a dash dash in a me... testing...
  254. * Chronos says -- what does this do? -- where does it go?
  255. nevet * Chronos says -- what does this do? now has karma of -1.
  256. Chronos Interesting!
  257. dreamreal ooof
  258. dreamreal gross
  259. dreamreal ew
  260. dreamreal :D
  261. dreamreal emergent systems, yuck :D
  262. * Chronos chuckles
  263. dreamreal sentiment #nevet
  264. nevet Sentiment for irc://libera/%23nevet: +2/10 | Intensity mod | Themes: GitHub auth bikeshedding frustration, Java value classes debate, bot sentiment gaming, Project Valhalla | Summary: Tension from auth discussion frustration has cooled; blue tested sentiment manipulation with sarcasm; dreamreal amused by bot's sarcasm detection; conversation shifted to lighter technical topics | Drivers: blue,dreamreal
  265. dreamreal there's a lot of emergent design in nevet
  266. Chronos Hey, that's... damn good.
  267. dreamreal karma's an utter pain because it fights emergent design pretty regularly
  268. dreamreal what, the sentiment analysis?
  269. dreamreal you wanna know the history there? :D
  270. dreamreal it goes back to SURIAL!
  271. dreamreal he used to get all butthurt when people would say "chill out, you're being pretty negative here" - so I wrote a bayesian emulator trained off of his stuff in #java, and had it generate 300 statements from "him" as represented by bayes, and graded the sentiment from there
  272. dreamreal like, "what would we think of a bot that was *trained* by your content, would we think it was negative"
  273. dreamreal the answer was quite surprising: "God, yes"
  274. Chronos dreamreal: Yes, the sentiment analysis.
  275. Chronos dreamreal: ha! :)
  276. dreamreal I really wish surial hadn't left, but ... man, he cost as much as he provided or more, by being a jerk
  277. dreamreal "Let me provide you a wagyu steak of knowledge, served with a heaping helping of charred kale seasoned by utter contempt, noob."
  278. Chronos I recall the nick but not the personality behind the nick.
  279. dreamreal lombok author
  280. dreamreal tended to be, uh, slightly ascerbic
  281. dreamreal rather opinionated, like someone who goes "I really think this longstanding aspect of java isn't convenient for me, so I HATE JAVA despite being the one person who is actually enraged by this thing"
  282. Chronos Sounds like Zhivago that used to frequent #c
  283. dreamreal OOOO I REMEMBER HIM!
  284. dreamreal yeah
  285. Chronos dreamreal: hahahaha
  286. dreamreal or pudge on #perl
  287. * Chronos hugs blue
  288. dreamreal hey I didn't say it was blue
  289. dreamreal pr dibblego in #scala, may tony morris be forever remembered
  290. dreamreal oh wow, claude KNOWS WHO TONY MORRIS IS
  291. dreamreal hahahaha
  292. dreamreal IMMORTALITY AS AN ASSHOLE!
  293. dreamreal that's... pretty bad, if dibblego was so memorable that the LLMs remember him as being a jerk
  294. dreamreal I mean, he IS pretty memorable: "I am a total asswipe douchenozzle because... hold on, checking the 8 ball... I have autism! No, wait, shaking it again... oh MY BACK IS INJURED"
  295. dreamreal Chronos: new push to the branch, actually fixed the things you pointed out, and thank you as always
  296. dreamreal all this damn GDPR talk... grrr
  297. blue blame timon on that
  298. dreamreal he's not wrong
  299. dreamreal and fixing GDPR issues in the future is a lot harder than fixing them now
  300. blue he's being unnecessarily alarmit and FUDing
  301. blue alarmist*
  302. blue I'm the only one here who lives in Europe, to my knowledge
  303. dreamreal I disagree: we have GDPR issues in another app we work on, and it's a true pain in the rear
  304. blue I RAN a website/business in Europe
  305. blue So I tihnk I can be trusted on this GDPR nonsense
  306. dreamreal you are not, however, the only one who WORKS in Europe :D
  307. blue the GDPR is pretty straightforward. if you collect more than you need to collect, ie collect for the sake of collection, THEN it gets ugly
  308. blue if you collect what you NEED to allow users to be users... it's trivial.
  309. dreamreal the main concern *I* have for GDPR is right to remove and collect; both issues are addressed.
  310. blue what right to collect?
  311. dreamreal user have a right to download their data and contributions
  312. dreamreal IANAL but andrew and I work with some
  313. dreamreal so I added a hook to download posts and comments contributed by the user
  314. blue you don't need to mechanise it. it the user asks, you can provide it
  315. blue as long as no users asks, it's theoretical
  316. blue YAGNI
  317. blue stop listening to timon
  318. dreamreal 1) shut up, don't tell me who to listen to 2) providing the endpoint for THAT was among the easiest aspects of the whole thing
  319. dreamreal that fell out of the data model almost by implication
  320. blue easy doesn't mean good!
  321. blue literally. how can I take a guy seriously who derailed a discussion about a SECURE auth measure into GDPR nonsense?
  322. dreamreal I don't know how to answer that, because I could see it AND it's valuable
  323. Chronos blue: Where in Europe do you live? If you don't mind saying.
  324. Chronos Holy crap. My IRC client is giving me "xxx is typing" messages. Must be from some of the recent IRCv3 updates.
  325. dreamreal which client are you on?
  326. Chronos IRCCloud
  327. Chronos I actually pay for it! (gasp!)
  328. * dreamreal spots the dumbie
  329. dreamreal but that's fascinating. I didn't know libera even tried to do ircv3
  330. Chronos I briefly considered installing TheLounge following their easy 200 step process, and configuring it correctly using another 200 step process, and keeping it up-to-date by following yet another easy 200 step process, but then I paid for IRCCloud.
  331. Chronos dreamreal: Libera.Chat recently (like, within the last 2 weeks, or so) upgraded their IRC servers to a newer version that supports some new IRCv3 features.
  332. * dreamreal just uses weechat like a masculine man who uses masculine manly things like a lumberjack
  333. Chronos Apparently, including typing indicators.
  334. dreamreal I wonder when the other clients are gonna catch up
  335. Chronos Over the years I've switched back and forth between irssi-on-Linux-VPS and IRCCloud.
  336. Chronos When my IRCCloud subscription ends, maybe I'll try WeeChat. Does it have a mobile client that can connect to an instance of WeeChat?
  337. dreamreal I don't think so, it would BE the mobile client, but it DOES have a sort of c/s architecture; I don't know how complete it is.
  338. dreamreal senpai apparently supports ircv3 but it's written in go
  339. dreamreal go doesn't bother me much but senpai looks very twee
  340. dreamreal any further comments on that PR?
  341. dreamreal I'd love to commit it so I can 1) pretend the issue's closed 2) hand it off to other people
  342. Chronos dreamreal: lgtm.
  343. dreamreal Thanks!
  344. dreamreal blue: merged, btw: dual-path, plus docs, all merged. I'm going to set up the prod deployment to support it, although obviously the UI is trailing now.
  345. blue Chronos: Germany
  346. blue do you guys even READ wallops?
  347. blue https://libera.chat/news/new-and-upcoming-features-3
  348. dreamreal no, because I rarely care about those things
  349. blue 17:50 < Chronos> Over the years I've switched back and forth between irssi-on-Linux-VPS and IRCCloud.
  350. dreamreal I use IRC to talk to people, not leverage a protocol
  351. blue I'm irssi-on-vps, RIGHT NOW.
  352. blue I'm not entirely surprised dreamreal is using weechat; weechat is basically the same as irssi, just for morons
  353. blue dreamreal: also, at the cost of being late: LGTM
  354. dreamreal I found irssi to be insufficient; weechat's UI worked better for me.
  355. dreamreal I'm working on the OIDC identification stuff, which will help clear up the API. I figure I'm going to have a deployment structure like this:
  356. dreamreal www.bytecode.news, bytecode.news, nextjs.bytecode.news, primate.bytecode.news - with www. and . pointing to EITHER nextjs or primate
  357. dreamreal and then there's a rest.bytecode.news domain which exposes the backend services via a stable endpoint
  358. dreamreal so nextjs and primate both use https://rest.bytecode.news/api/blog/posts or whatever
  359. blue I'd been thinking about it, and I wonder how much I want to translate the actual back to primate paths. you see, using nextjs/primate is *a bit* of an overkill. they *both* are fullstack frameworks
  360. blue the actual backend*
  361. blue so the level of indirection is significant. you have real backend, then 'fake' backend, then frontend
  362. dreamreal are you talking about primate *replacing* the rest endpoints? talking to the DB directly?
  363. blue I'm not. I'm just thinking where the seams would lie between the real backend and primate (or nextjs, for that matter)
  364. dreamreal *nod*
  365. blue both are backends. primate could even run java -- or kotlin code -- via wasm. although that's somewhat futuristic given >=java 25 and some limitations without a jvm, no idea if your code specifically relies on that
  366. nevet both are backends. primate could even run java -- or kotlin code now has karma of -1.
  367. blue (specifically=reflection)
  368. blue at this point in time, I'm thinking about this: primate generates an openapi client using the spec. then, it exposes those paths directly via a /rest subpath
  369. blue the frontend using primate, whatever it is, talks directly to these subpaths
  370. blue though I'm not entirely convinced yet this is the best way to go about it
  371. dreamreal and THEY redirect content to the actual backend, you mean?
  372. blue yes. it's not even a proper redirect, the request is likely piped 1:1, almost
  373. dreamreal *nod*
  374. dreamreal I mean, that makes sense to me
  375. dreamreal it's a little heavier - it adds a few ms to every interaction, but most interactions should be pretty quick
  376. blue like, I truly need to think about what having an interim backend even means. so one thing it means: we avoid any CORS nonsense. CORS is an absolute nightmare
  377. dreamreal it is, but I'm going to have to address it anyway
  378. dreamreal the backend is already set up to accept CORS requests from different domains
  379. blue by having the interim backend and the frontend on exactly the same domain (or subdomain), you completely eliminate this error category. it is probably worth having only for *that*
  380. dreamreal *nod*
  381. blue but what else? like, what does the interim primate (or nextjs) backend add, exception indirection?
  382. blue except*
  383. dreamreal not a lot, but that's probably a GOOD thing
  384. bot [jottinger/bytecode.news] New issue #107: Unify and reorganize documentation - https://github.com/jottinger/bytecode.news/issues/107
  385. bot [jottinger/bytecode.news] New issue #106: Split baseUrl into API and frontend URLs for OIDC stability - https://github.com/jottinger/bytecode.news/issues/106
  386. bot [jottinger/bytecode.news] New PR #108: More OIDC changes - https://github.com/jottinger/bytecode.news/pull/108
  387. blue well, let's think what nevet *can't* do, at least in its current form & scope
  388. blue it can't do SSR - it's not meant to do that
  389. dreamreal SSR = ?
  390. blue server-side rendering
  391. blue are you familiar with SPA/SSR/hydration, or should I shortly explain?
  392. dreamreal no, I just needed to know what the acronym was, with you now
  393. blue ok. anyway, if you have a pure frontend (say, react) talk to nevet's backend -- which is a possibilities -- you would never get SSR. only SPA. that means your initial request is an empty HTML
  394. nevet ok. anyway, if you have a pure frontend (say, react) talk to nevet's backend -- which is a possibilities now has karma of -1.
  395. blue there's also of course the question of what static server serves those resources, which is yet another layer
  396. blue normally, that would be nginx
  397. blue or apache, for the traditionalists
  398. dreamreal I'm not going to be deploying httpd, it's nginx on my server, caddy's a possibility but ... it's nginx
  399. blue but let's assume for a moment that's a piece of the puzzle. in that case, your first contentful paint would be... not good
  400. dreamreal my thought was that each subdomain was *self-contained*
  401. dreamreal so it's foo.bytecode.news and rest.bytecode.news, and everything is on those two domains for foo.bytecode.news to render
  402. dreamreal the nginx config does the proxy passthrough for both domains, and cert management
  403. blue there's also things like jwt/cookie management, and auth, which need to be address
  404. blue addressed, even
  405. dreamreal well, auth is part of the rest stuff - that's all the 67 stuff we just did, jwt is part of it too (and has been for a while), aad cookies are up to the front end
  406. blue where I can see a primate backend shine is, composing complex operations on top of simple REST queries
  407. dreamreal the back end doesn't use them
  408. blue for example, the login sequence is composed of several API calls, but it might be hidden away under just one path
  409. dreamreal right now, with OTP, we SHOULD be able to deploy *right now* with no OIDC providers set up
  410. dreamreal sure
  411. dreamreal I'm reorganizing the docs, btw
  412. blue this brings me to an organisational point: we need deployment docs. if I am to write a frontend, I need to be able to easily run nevet locally. docker could work, though I'd prefer nspawn (not a purist though -- if you furnish me with a Containerfile, I'll take care of it myself)
  413. blue (why did nevet not pick up my last message as karma?)
  414. blue I guess maybe cutoff limits
  415. dreamreal yep
  416. dreamreal I'm working on the docs, you SHOULD be able to run the backend in a container really easily
  417. blue well, that's the only way to properly test it and come across real implementation issues
  418. dreamreal dpcker compose up db backend # should do it
  419. blue can you provide a Containerfile (or a Dockerfile, same thing really)?
  420. blue also, that'd probably require making the repo public?
  421. dreamreal why would it require making it public? You have access to the repo: you can literally clone it, do `mvnd package`, then run docker
  422. dreamreal (doing the build IN docker is bonkers mad, don't do that)
  423. blue what's mvnd? the idea of a container is to avoid me having to have all these tools locally
  424. dreamreal I get that, but yikes
  425. dreamreal main requirement for nevet is having java 25
  426. dreamreal if you have that, you're done
  427. blue I might have that; BUT, that's something ideally you shouldn't need to have
  428. dreamreal java 25 + the repo: ./mvnw package -DskipTests=true (if you know the repo is in known-good state)
  429. blue iirc the only reason I have java 25 is because I was messing around with wasm :P
  430. dreamreal yes, well, I agree but making the repo public and putting up a public container is a step I'm not ready for
  431. blue tell you waht. can you bake a CP step from, say, ./repo, into the container?
  432. blue that's a good compromise, no?
  433. dreamreal that's literally what teh dockerfile does :D
  434. blue yes but I meant the source code. the rest happens inside the container
  435. dreamreal https://github.com/jottinger/bytecode.news/blob/main/Dockerfile
  436. blue so I can just do `git pull`, then rebuild the image
  437. dreamreal oh, you CAN do that but it's a waste of 15 minutes
  438. blue not for me -- I use nspawn, which gives me essentially native performance
  439. nevet not for me now has karma of -1.
  440. dreamreal it nets you NO win whatsoever
  441. dreamreal I'm not familiar with nspawn, so I don't know - there's no ACTUAL barrier to building in a container outside of the container mechanism sucking
  442. blue all you need to do is install mvnd inside the container and run it, no?
  443. dreamreal it's just very slow and with far less CPU access; mvnd does parallel builds, if you have it installed, so I deploy nevet within about 30 second for a full rebuild, the full build with tests is about 1:40 on my M3
  444. dreamreal only if the container has full thread access
  445. blue bonus is you get assurance the desired mvnd version is used for building
  446. dreamreal it's going to be limited to the container's resources
  447. blue so you get full reproducibility
  448. blue which is perfect
  449. dreamreal ./mvnw gets you that already :D
  450. blue *sigh*
  451. blue fine, I'll do it YOUR way
  452. dreamreal that's the maven wrapper, I *do* lock the maven version, and maven's usually pretty good about it anyway
  453. blue it's not you ever accept a suggestion of mine!
  454. dreamreal well, if any of your suggestions were good... but more seriously, I have a major project that does mvn builds in the container, and that process SUCKS for java
  455. dreamreal and there's literally no win: cp app.jar into the container is the right way to go until we go graalvm. When we do THAT, you'll get your container builds.
  456. blue also chatgpt says there's no difference in speed between running mvn in docker or without
  457. dreamreal (and builds will take 30 min, not 1;40 or 15 minutes.)
  458. blue unless apparently, you're on mac
  459. blue great
  460. dreamreal I'm sure chatgpt does.
  461. dreamreal It's wrong, but hey.
  462. blue you know what? I don't care. I'll take your Containerfile and just edit it to fit MY purposes. It's not like I need to ask you for permission
  463. dreamreal for maven single-threaded, it's probably pretty close; docker's overhead wouldn't matter much. for parallel builds, it's a lot more severe.
  464. dreamreal There you go!
  465. dreamreal just don't commit it to main until I can approve it.
  466. blue ya
  467. jreicher dreamreal: where's the discussion of why Strings aren't value classes? I feel like I've missed something (and I'm a bit curious about what everyone thinks)
  468. dreamreal jreicher: I dunno, I don't live and die on valhalla discussion
  469. dreamreal but now my wife has made dinner and she's a lot prettier than you guys are
  470. jreicher Oh I thought there had been a discussion you had participated in
  471. jreicher That's not fair. You haven't seen me dresesd up.
  472. blue [INFO] BUILD FAILURE
  473. blue [ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: pre-clean, clean, post-clean, validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes,
  474. blue generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy. -> [Help 1]
  475. blue ah, there we go!
  476. jreicher blue: just saw earlier you said new String("foo") == new String("foo"). I'm guessing you think that should be true?
  477. blue jreicher: yes
  478. blue [ERROR] Failed to execute goal io.github.git-commit-id:git-commit-id-maven-plugin:9.0.2:revision (default) on project streampack:
  479. blue [ERROR] The plugin io.github.git-commit-id:git-commit-id-maven-plugin:9.0.2 has unmet prerequisites:
  480. blue [ERROR] Required Java version 11 is not met by current version: 1.8.0_482
  481. jreicher Right. i think that's a useful way to talk about the real problem. Compare with 5 == 5, which is actually true. What's the massive difference between the two expressions?
  482. blue ➜ bytecode.news main ✓ java -version
  483. blue hm, I guess it takes openjdk 8
  484. blue THIS IS WHY I HATE THIS NONSENSE
  485. jreicher I don't know if you're reacting to what I said or the errors you're pasting
  486. blue jreicher: no difference
  487. jreicher There absolutely is a difference. It's obvious, and large.
  488. blue I was reacting to the errors I was pasting
  489. blue what's the difference?
  490. jreicher "new"
  491. blue oh, you're gettign me wrong
  492. blue I also think new Long(1) == new Long(1) should be true
  493. blue which it will be, under valhalla
  494. jreicher The point I'm making is that new... == new... can't mean the same thing as literal == literal
  495. jreicher So even if you made it work the way you want, you have to supply a different meaning to == in the context of new
  496. jreicher Or, put another way, the result of the comparison is not the same thing as the meaning of the comparison.
  497. blue so, to go back to first principles, my position is that immutable variables: long, Long, int, Integer, String, should always parse == as 'by value'
  498. jreicher There's no such thing as an immutable variable. (I know that's horribly pedantic, but I want to tease out what you "really" mean
  499. jreicher Because if I do int x = 5, there's only one variable there
  500. jreicher But if I do Foo x = new Foo(), there could be too, if Foo is mutable
  501. jreicher ^too^two
  502. blue come on. you know what I mean. String s = new String("foo"); you can't change JUST 'f' to 'b'. You can rebind the variable to a new value, you cannot mutate it
  503. jreicher Or more, actually, depending on how many mutable attributes Foo has
  504. jreicher No, I THINK I know what you mean, but I want to make sure I'm right.
  505. blue same for int i = 1; i = 2 is not mutation, but rebinding
  506. jreicher OK, so you're talking about an immutable object there, right?
  507. jreicher new String("foo") constructs an immutable object. That's what you mean?
  508. blue yes. as do new Long, new Integer, or int, or long
  509. jreicher Yep. But if we do int x = 5, there's no construction at all. And that's what matters. Not mutability, but construction. Values aren't constructed.
  510. blue This is where we get into the territory of, to my taste, a distinction without merit. What matters to me is, can you think of a case where two "foo" objects differ in any meaningful (=real) way?
  511. jreicher Yes. At compile time. That's why this matters.
  512. jreicher Compilers can do some value analysis. They can't do any immutable object analysis, becauses the objects don't exist yet.
  513. blue Yes, but you're pulling the cart before the horses here -- you're talkign about how it's technically currently done in the JVM. I'm talking about a use case
  514. nevet Yes, but you're pulling the cart before the horses here now has karma of -1.
  515. blue I would like you to describe a use case where the distinction is important
  516. blue like, a real situation where it's good to have two strings "foo", and be able to compare them by identity -- but not by value
  517. nevet like, a real situation where it's good to have two strings "foo", and be able to compare them by identity now has karma of -1.
  518. jreicher If you already know the strings are "foo" then the scenario begs the question. We need to ask about this distinction where at least one of the strings is unknown.
  519. blue I'll play devil's advocate for you
  520. blue a real 'use case' is if you're writing a compiler in java, and objects are coming in, and you want to track (by identity) if you've already seen an object or not
  521. jreicher OK...
  522. blue the rebuttal to this is: this is *not* a real use case. compilers aren't written this way: it's not effective at all, and you wouldn't be comparing references for that
  523. blue my personal issue is, no one has given me a real use case for comparing strings by identity and not value
  524. blue maybe it's all moot to you, but to me it'd help me understand why the == and .equals distinction makes sense, if it does
  525. jreicher So you're saying because nobody would ever compare with identity, that operation shouldn't even exist?
  526. blue essentially yes: I'm saying, the only meaningful comparison of two strings is by value (=contents). the comparison by identity is not meaningful
  527. blue you would never construct two "foo" Strings and expect them to differ: for what purpose?
  528. blue also, consider the implications of this for project valhalla:
  529. blue value class Point(int x, String y) {}
  530. blue Point p1 = new Point(1, "hi"); Point p2 = new Point(1, "hi"); p1 == p2; // false, string comparison broke it!
  531. blue the bottom line here: comparison by reference *only* makes sense for mutable objects, where the truthiness of the check could vary over time. but the two strings "foo" and "foo" will always be the same
  532. blue iow: the original story of `new String("foo")` is meaningless
  533. blue s/original/origin/
  534. dreamreal no, those would not be uneqial because of string comparison
  535. dreamreal you don't seem to grok references
  536. dreamreal think of them as pointers
  537. blue what are you talking about?
  538. jreicher OK, then for the sake of argument, how would you feel about the Java compiler throwing an error for == used on Strings. Meaning we change the == to being undefined in that case, and you can only use equals()
  539. blue jreicher: THAT would be a huge improvement already!
  540. dreamreal char **c1=malloc(10); char **c2=malloc(10); strncpy(c1, "hello", 6); strncpy(c2, "hello", 6); // are c1 and c2 equal? Why not?
  541. blue dreamreal: dude, you're COMPLETELY missing the point. you're talking about implementation. I'm talking about MEANING
  542. blue java is NOT a low-level manipulate-the-memory-directly language, the point holds not
  543. jreicher blue: but the meaning of String, at least at the moment, is that it's not a value.
  544. dreamreal I disagree, bevause that's literally where == is playing in
  545. blue jreicher: that's the interpretation of the java language, but that's also my criticism
  546. blue for example, it is NOT the interesting of the javascript language
  547. blue s/interesting/interpretation/
  548. jreicher In that case we're not talking about == vs equals(). You're objecting to Java not having a primitive string type.
  549. blue if you want to weave it that way, sure: the argumentation would be that strings are immutable, and as such, inherently primitive (as they are in js)
  550. blue I don't mind shifting my argument there, that's fine by me, it's all the same to me
  551. jreicher immutability does not a value make. I think you need to separate those two things.
  552. jreicher The value is part of the STATIC definition of the type.
  553. blue the point remains that two occurences of the value "foo" (regardless if you do it via new String("foo"), or an idealised string primitive), are one and the same: the distinction here is invalid
  554. jreicher It's immutable as a consequence, but that's not the essential nature of it.
  555. jreicher There's no "foo" value in Java. It doesn't exist.
  556. blue do you mean it would be possible to constract a language where parts of a string are immutable? like c? sure
  557. blue construct*
  558. jreicher No. I'm not talking about immutability at all. It's irrelevant.
  559. jreicher The only question that matters is value vs object
  560. blue jreicher: then that's the criticism. values are much more important than object identity, for strings
  561. jreicher There are no string values in Java.
  562. blue yes, I never claimed there were
  563. jreicher OK. Then maybe we move on to the next part. Do you know why?
  564. blue why it's implemented/done this way?
  565. jreicher Not so much implemented as designed. It's a design decision, not an implementation decision.
  566. blue is the history really relevant here?
  567. jreicher It's not history. The reasons for the decision still apply. If I was designing something like this now I'd probably do the same.
  568. blue OK, what are the reasons?
  569. jreicher My understanding is that they wanted (needed?) all the value types to have a finite, fully determined range of values. That's true of everything "philosophically "considered a value, including enums. Strings are really very, very special in having a range of values constrained only by the memory available at runtime.
  570. blue And strings would be unbounded?
  571. jreicher Strings are currently unbounded AFAIK.
  572. jreicher In principle.
  573. blue That argumentation makes little sense to me, why would you want to impose that kind of restriction?
  574. jreicher Would you be comfortable with an int type that was unbounded?
  575. jreicher (It would be fine if you were; I'm just trying to get to the heart of the issue)
  576. blue Can't say I would, but I can also not say it's relevant to the string discussion
  577. blue (btw: having an unbounded int type such as BigInt in JS is immensely useful!)
  578. jreicher No argument with it being useful. But why would you be uncomfortable with it? That's probably worth teasing out.
  579. blue I guess... I haven't thought about it, but I can't say I would and I can't say I wouldn't, I don't have an opinion on it, to be honest
  580. jreicher OK. Well for the sake of argument we decide that our language is not going to have any unbounded value types, then the notion of string you are advocating is ruled out before we even start thinking about string.
  581. jreicher ...if we decide...
  582. blue Is this not purely theoretical? I mean, JS doesn't have that problem. The ECMAScript standard allows up to 2^53-1 characters, but it's usually memory-bounded/limited by the engine.
  583. jreicher JS has different problems. ;)
  584. blue Yes, but comparing strings by == isn't one of them, that's the crux of the matter
  585. jreicher But seriously I think the only way to make sense of the issue to take the big picture of all the tradeoffs. I'm sure I don't have the full picture, but I know enough to believe that a small view doesn't make sense.
  586. blue To be honest, I can't see downsides. If you compare all strings by value you can easily memoise them and save memory.
  587. jreicher To do what you want you either have to make string a value type, in which case you compromise a more fundamental decision in java, or you have to overload the meaning of == to cater for something which isn't a value type, which again compromises a more fundamental decision.
  588. blue Yes, I'd make it a value type. What fundamental decision I would compromise, the boundedness?
  589. jreicher Yep
  590. jreicher And maybe that's ok
  591. blue Then why allow new Long(1) == new Long(1) => true under valhalla, what's the difference?
  592. jreicher I think so, yes, although I'm not sufficiently familiar with valhalla. I think a better comparison might be with what's in the JDK right now for bool. Just a moment...
  593. jreicher It jumped out at me recently that there's no non-generic version of the functions in java.util.function for boolean. AFAIK stuff like IntConsumer and IntPredicate exist so that if you have an (unboxed) int you don't have to incur the cost of boxing it to pass to e.g. Consumer<Integer> or anything like that. So they're saying that something like Consumer<Boolean> would not be expensive. Why? Because the boxed values are already
  594. jreicher constructed. There's only two of them.
  595. jreicher So anything that can be done without incurring this kind of runtime cost will be allowed
  596. blue There's another aspect I haven't mentioned, jreicher.
  597. jreicher Mm?
  598. blue Consider this method: `public static boolean test(String a, String b) { return a == b }`
  599. blue This method returns true, or false, depending on the *origin* story of the strings. That's a big red flag, in my eyes.
  600. blue test("foo", "foo") => true, test("foo", new String("foo")) => false
  601. blue that's bad: there's no way for me, in the `test` function, to know what the origin story of a and b is
  602. blue so I would *always* use .toEquals, instead
  603. blue or .equals, I mean
  604. blue that means the == operator is *completely* useless for strings
  605. blue to use it properly, I need full knowledge of the origin story of the string: contructed per new String, or per ""
  606. blue that's ridiculously broken, in my eyes
  607. blue in any non trivial codebase, I will never have full knowledge of the origin story of a string
  608. blue it even gets more complex that test("foo", "fo"+"o") will yield true. even dynamically created strings partake of it
  609. blue but now say I've extracted "o" to String o = "o";
  610. blue suddenly, test("foo", "fo"+o) => false
  611. blue generally, extracting a direct value in a language to a variable should not create unintended side-effects; here it does
  612. blue (or better said: in a *high-level* language; if you manage memory yourself as in c, you get value expansions and contractions all the time)
  613. blue incidentally, this is a criticism I have of TypeScript. { foo: "bar" } passed directly to a function would satisify the exact type { foo: "bar" }; extracting this to a variable: const a = { foo: "bar" }; will expand it, resulting in a's type being { foo: string }
  614. blue that makes refactoring a nightmare
  615. blue in my opinion, unless you gave TS a proper type: say, const a: { foo: string } = { foo: "bar" }; it should keep it narrowed, but it doesn't
  616. blue autoexpanding/weird magic is crazily confusing, especially in high-level languages
  617. jreicher blue: why would you not do `return a == b || a.equals(b)`? I think that's using object identity in exactly the way it's somewhat intended; as an optimisation
  618. jreicher (I suspect equals() is implemented this way for String anyway)
  619. blue jreicher: I could, but why should the language force me to do it? The language implies a distinction (== vs equals) without merit
  620. blue if I could just do == for strings, none would be the worse for it
  621. jreicher And I'm suggesting that the language doesn't give two hoots about == vs equals. It just "knows" that it has no notion of strings-as-values and everything else is a consequence that it doesn't care about.
  622. blue We're word-juggling at this stage; you're saying the language has no notion of strings-as-values, and I don't disagree -- that's a reductive form of my criticism
  623. nevet We're word-juggling at this stage; you're saying the language has no notion of strings-as-values, and I don't disagree now has karma of -1.
  624. jreicher blue: because I do indeed thing your criticism reduces to something else. You are criticising the consequence o a decision that was made on unrelated grounds.
  625. jreicher Please note I have never said == for strings working the way you say is a bad idea. This is why.
  626. blue That's quite possible, jreicher. But even with knowledge of the decision's grounds (boundedness), I still think it was the wrong decision. Sure, telling people to just "suck it up and that's how Java does things, and you're a n00b if you don't get it" (dreamreal style), is possible. It's just not very useful.
  627. blue I don't care about being a good or bad Java programmer -- I care about using languages that help me not do crazy nonsense. That's why I use very strict linting rules for JavaScript, because JavaScript has its fair share of brokenness.
  628. nevet I don't care about being a good or bad Java programmer now has karma of -1.
  629. jreicher OK, I'll put in some of my own opinion here. I believe most people expect the runtime of operators to be bounded in any language that does not have operator overloading. (That last bit is important.) So I believe there is an expectation that == should have bounded runtime. You can probably see where I'm going.
  630. jreicher And I have some experience with the flip side of this. The number of corporate application problems I have had to deal with because some idiot dev though string comparisons on a database came for free...
  631. blue So you're talking about runtime optimisations?
  632. jreicher Not optimisations. The fundamental definition of the performance. The predictability of it. The expectation.
  633. blue Well, if such an expectation exists, I certainly cannot see it being used in JS.
  634. jreicher I did say JS has different problems. :)
  635. blue True... for example, I don't use the == operator in JS, at all.
  636. blue The coercion rules are arbitary and an endless source of confusion.
  637. blue I also configure my eslint to only allow boolean expressions in `if`, i.e., no casting. if("foo") would pop up as an error.
  638. jreicher That's why predictability in language is important. And on the flip of the flip side I'm all in favour of having unpredictable performance in contexts where performance is not the primary concern.
  639. jreicher And in those contexts I would be completely on your side about something like the meaning of ==
  640. blue (reason: if ("") "hi" -> undefined; if ("1") "hi" => "hi"
  641. jreicher (probably)
  642. blue (since the real check you want here is probably: if (str !== ""), or better expressed: if(str.length > 0)
  643. blue anyway, yes
  644. blue predictability is superimportant. overloading operators is very confusing
  645. blue dreamreal at least agreed that + for strings is weird... unfortunately, it's become an almost global standard
  646. jreicher Oh interesting. I missed that comment.
  647. jreicher But what I've been saying probably supports that. It's an operator with unbounded performance. Possibly the only one in Java. (I have to think about that)
  648. blue JS is totally weird on that, btw: [] + [] is ""... that's funky
  649. jreicher I guess you could say "new" is in that category also. I think it's an operator.
  650. blue new is definitely an operator
  651. jreicher People who defend string + probably say it implies new
  652. jreicher ...and is right to do so
  653. blue you know, come to think of it, my real pet peeve isn't even `new`. It's just the fact that `String foo = "foo";` is fundamentally different to 'just' "foo"
  654. blue IOW: we can leave the operator new completely out of the discussion. It's not even the crux of the matter, to be honest
  655. jreicher Not sure I'm following, but you have my interest. Can you elaborate?
  656. blue As said, consider my example from earlier:
  657. blue test("foo", "foo") is true
  658. blue test("foo", "fo"+"o") is also true
  659. blue String o = "o"; test("foo", "fo"+o) is false
  660. blue there's no `new` involved anywhere here
  661. blue we've only extracted "o" onto a variable, and broken things with it
  662. blue that's... unpredictable.
  663. blue this class of errors can never happen in JS. It's impossible to extract a value to a variable and break stuff with it.
  664. blue it's a category error that doesn't exist in JS
  665. blue As a programmer, it's important to me to be able to refactor such things with the utter confidence that I'm not breaking anything. Java fails that promise.
  666. blue As a Java programmer, I now need to be *aware* of the implementation detail of `test`, namely that it uses `==`.
  667. blue But I can't always do that -- nor should I. `test` might be coming from somewhere else, or I might not even be able to look into it
  668. nevet But I can't always do that now has karma of -1.
  669. blue oh, shut up! dreamreal fix that nonsense! :P