Chat Logs

  1. * youfoundwaldo joined #java
  2. * marcel joined #java
  3. * Betal joined #java
  4. * ErikT joined #java
  5. * youfoundwaldo joined #java
  6. * youfoundwaldo left #java
  7. * youfoundwaldo joined #java
  8. * metalmaniac joined #java
  9. * kcomhnall joined #java
  10. * pengu1nx3 joined #java
  11. dreamrealhttps://bytecode.news/posts/2026/03/json-toon-yaml-and-more-considering-data-serialization-formats
  12. Tenchidreamreal: so did you upgrade to v3 or not ?
  13. * cptaffe joined #java
  14. * x1bncwn joined #java
  15. dreamrealyes
  16. dreamrealI did not migrate away from JSON anywhere
  17. dreamrealbut jackson 3 was implemented, everywhere except in one place
  18. dreamrealbut that's a separate article
  19. cheeseryaml is the best data transport format.
  20. DoofusCanadensislook, you
  21. cheeserif you're looking to fight me, i'll add you to the list. i think i have this right. it's a yaml doc so ...
  22. cheeserhey, copilot, i'm getting an NPE because in the code you generated, you're not passing a parameter so the default value of null gets used. fix it, please. "oh, i see what's wrong. I need to pass 'context = null' as an argument so the default value of null doesn't get applied to that parameter."
  23. DoofusCanadensisgeez
  24. * MonsterAbyss joined #java
  25. * agnivn joined #java
  26. * jjj333_p joined #java
  27. * stewi joined #java
  28. * deavmi joined #java
  29. * deavmi joined #java
  30. * kcomhnall joined #java
  31. * waz joined #java
  32. * LtHummus joined #java
  33. * pengu1nx1 joined #java
  34. pengu1nx1Memory pooling is used for storing many Objects of the same type with short lifespans, right? I don't quite understand the reasoning, does the garbage collector immediately remove free space? Or why is memory allocation so bad?
  35. * zorone joined #java
  36. deebonote sure what you mean with "memory pooling", generic object pooling can be used for situations where the objects are reusable/borrowable and take a "long" time to initialize, like http or database connections
  37. * dinomug joined #java
  38. pengu1nx1I meant that, my bad
  39. deebooutside of the well known uses, probably not worth it, atleast not without validating a bottleneck that could be helped with a pool
  40. * jreicher joined #java
  41. * Aedil joined #java
  42. dmlloydhttps://openjdk.org/jeps/8357464 looks nice
  43. javabotdmlloyd's title: "JEP draft: Enhanced Local Variable Declarations (Preview)"
  44. nevetJEP draft: Enhanced Local Variable Declarations (Preview)
  45. ParaOh I'm loving that.
  46. * MonsterAbyss joined #java
  47. deebohmm, is there something blocking typescript type destructuring like {location: {int x, int y}, double radius} = myCircle;, that Circle(Point(...), ...) looks wordy
  48. ParaThat's more of a TypeScript's quirk though, as its emulating types on top of duck-typed objects.
  49. * MonsterAbyss joined #java
  50. ParaIf that lands proper, IDEA's going to have some kind of smart refactoring thing available for picking values anyway so I'm not that worried :)
  51. deeboyeah then you try to indent it and it swaps half your file with ai slop
  52. ParaThere probably is one step more in squeezing that, but it would look a bit noisy IMHO. Like, either use vars instead of object names. Java already kinda has parsed meaning for ((()()) so it wouldn't be that easy to handle in backwards compatible manner, but as it's a draft, maybe they'll come up with something extra.
  53. ParaLike for example if it's a sealed class, the matching is exhaustiva -> allow some shorthand.
  54. deebogreat feature though, i'll just end up hating the verboseness and lisp level of () in deep nesting
  55. ParaUse proper lisps and it'll be ridinculously simpler :)
  56. ParaDestructuring in Clojure is very dense and feature rich.
  57. Para(that family also includes Fennel and jank)
  58. * henbruas joined #java
  59. kcomhnallheh, so that jep preview is something that's clearly already existed in other languages? Rust.. Python.. Typscript as you guys already mentioned and others.
  60. kcomhnallyeah..."nice"
  61. kcomhnallor am I missing something?
  62. * ForeverDreaming joined #java
  63. * kcomhnall suddenly feels like writing in C#
  64. dmlloydyeah the language team is very careful about adding stuff
  65. dmlloydother languages are a bit more aggressive about it
  66. kcomhnallby the language team I assume you're talking about project amber?
  67. ParaJava the language, JVM the runtime/platform. They're two very distinct things, but obviously interlinked.
  68. * MikeBux joined #java
  69. ParaJVM is bleeding edge, Java is conservative. It has always been like this on purpose.
  70. dmlloydamber is only one of several projects related to enhancing the language
  71. kcomhnallbleeding edge? huh.. interesting take on a mature runtime env
  72. kcomhnallthe maturity is the whole reason I enjoy using Java... hardened and w.o.r.a are important for my projects.
  73. kcomhnall"JVM"
  74. MikeBuxi still wan to learn a compiled language like go, rust or c/c++ though,
  75. * TomyWork joined #java
  76. dmlloydthat's also a poor distinction, as java is compiled at run time, and can optionally be pre compiled to a native executable by projects such as graalvm
  77. ParaMaturity and bleeding edge are not exclusive either; that's why e.g. that draft is available through feature flag as preview.
  78. MikeBuxyes but the usual way is to compile the bytecode at runtime, which means, every time you want to run a program, it needs to be compiled
  79. kcomhnall~karma Para
  80. javabotpara has a karma level of 24, kcomhnall
  81. kcomhnallhmm
  82. dreamrealjep 8357464
  83. nevetjep 8357464: draft: Enhanced Local Variable Declarations (Preview) (https://openjdk.org/jeps/8357464)
  84. * ne555 joined #java
  85. * stfstfm joined #java
  86. dreamrealpengu1nx1: that's a very complex subject; java's memory model is largely pluggable and therefore there's not a great answer to it that is actually correct for all cases
  87. dmlloydthe upside of jit compilation is that you get compiled cods tailored for your cpu's features every time, which isn't always possible or practical with precompilation
  88. Paralook also: linux kernels
  89. dreamrealyeah, sometimes there's a question of whether you need it or not: tradeoffs everywhere
  90. dmlloydcode, not cods ๐ŸŸ
  91. dreamrealI don't mind go but I've failed to be impressed with it
  92. Paravibe cod
  93. dreamrealI do mind rust but OTOH it HAS impressed me
  94. dreamrealhttps://bytecode.news/posts/2026/03/enhanced-local-variable-declarations-in-java
  95. * MonsterAbyss joined #java
  96. * agnivn joined #java
  97. * odinsbane joined #java
  98. * simon816 joined #java
  99. * x1bncwn joined #java
  100. * odinsbane joined #java
  101. nimajedmlloyd: well for that you could also change the system to compile to some IR, distribute that and on install optimise it for the target cpu (afaik android does that)
  102. dreamrealnimaje: it's doable, yes
  103. * yano joined #java
  104. dmlloydwell, java bytecode _is_ an IR
  105. dreamrealI have a project that runs on an embedded device that's, well, Intel, sort of... we COULD theoretically AOT it externally but that's a lot
  106. dreamreal(It is intel but we don't know the exact cpu profile)
  107. ParaIA-32
  108. nimajea jit can additionally optimise on concrete runtime values, especially if it knows that it will be loaded once and then stay the same
  109. dreamrealyes, we're aware :D
  110. ParaThat sounds like AI to me!
  111. dreamrealyou know, as time goes by I hate the "AI" label more and more
  112. dreamrealI mean, AI is... a whole series of algorithms, an LLM is just one variant and an expensive one
  113. nimajeabout everything is AI, be more specific
  114. * acidjnk joined #java
  115. cheeserdmlloyd: so that JEP is destructuring, basically
  116. dmlloydyeah basically, at least for the local variable case
  117. dmlloydit will be very helpful for cases where you have to interrupt/split an otherwise trivial conditional to introduce a local variable
  118. * CodeGeek!~codegeek@about/java/CodeGeek changed the topic to: Welcome! || Read Channel Rules at https://javachannel.org/ before participating. || Paste limit is two lines; ~pastebin lists options. || No applets, please. || Minecraft, Android, and Javascript all have their own channel. || You are being logged.
  119. * nevet joined #java
  120. dreamrealHow expensive is that, though
  121. dreamreal(interrupting/splitting an otherwise trivial conditional...)
  122. dmlloydthe only cost would be at compile time; the bytecode is the same
  123. dmlloydoh, the cost there is reduced readability
  124. dmlloydin other words, the language enhancement will enable better readability
  125. dreamreal... will it? I mean, it might - and destructuring CAN be useful in some languages, but the places where it'd really matter would be really limited. Simple expressions might benefit but I really do wonder how many people are desperate for deconstructed declarations like that.
  126. dreamrealI've been using Java since 1998, and I've yet go to "dang, I sure wish java let me do deconstructed declarations," not that it might be the best thing java's seen since sliced bread or whatever
  127. * sa02irc joined #java
  128. * agnivn joined #java
  129. ChronosWhat's an example of a deconstructed declaration?
  130. dreamrealPredicate(subject, predicate, value) = p.rdf; // do something with subject
  131. Chronosdreamreal: Thanks.
  132. * Chronos is mildly skeptical of the value of that particular syntactic sugar.
  133. ChronosIt looks like Java 21 has something called "Record Patterns" which has some kind of deconstruction.
  134. ChronosIf I'm understanding this correctly...
  135. ChronosFor example: Object obj = new Person("Alice", 30); if (obj instanceof Person(String name, int age)) { ... }
  136. dreamrealyes
  137. dreamrealbut that's a different level of deconstruction
  138. ChronosOh, it looks like JavaScript has had this feature since ES6
  139. Chronosdreamreal: Ah.
  140. Bombedreamreal, eh, I feel the same about pattern matching.
  141. BombeIt always feels like Iโ€™ve failed to properly utilize OOP when I suddenly need to know the type of an object.
  142. ChronosOK, I can see how this syntactic sugar could be nice :)
  143. cheeseri've wanted destructuring plenty of times in java but kotlin kinda ruined me in that regard.
  144. cheeserpattern based destructuring will be fine, i guess, but not as convenient as kotlin's syntax.
  145. * dragonmaster left #java (WeeChat 3.6)
  146. * jamezp joined #java
  147. * kcomhnall joined #java
  148. dreamrealthat's kind of the problem: kotlin has it, other languages have it, does java NEED it?
  149. dreamrealI mean, it's possible; it might be a simple extension of the switch/case stuff
  150. sbalmosdepends on whether you see continued viability of the ecosystem as Java-centric, or JVM-centric
  151. dreamrealThat's a good point - I guess I see it as jvm-centric so it's kinda meh for me to worry about destructured stuff
  152. * agnivn joined #java
  153. * waz joined #java
  154. * sa02irc joined #java
  155. * Exagone313 joined #java
  156. * waz joined #java
  157. * meyou joined #java
  158. * Aedil joined #java
  159. * dinomug joined #java
  160. * CodeGeek!~codegeek@about/java/CodeGeek changed the topic to: Welcome! || Read Channel Rules at https://javachannel.org/ before participating. || Paste limit is two lines; ~pastebin lists options. || No applets, please. || Minecraft, Android, and Javascript all have their own channel. || You are being logged.
  161. * nevet joined #java
  162. * mindCrime joined #java
  163. * kcomhnall joined #java
  164. * stfstfm_ joined #java
  165. * kcomhnall joined #java
  166. * magla joined #java
  167. * waz joined #java
  168. * schan99 joined #java
  169. * Candle joined #java
  170. * ne555 joined #java
  171. * ForeverDreaming joined #java
  172. * graves joined #java
  173. * stewi joined #java
  174. * dinomug joined #java
  175. * jaskarth joined #java
  176. * MikeBux joined #java
  177. * mindCrime joined #java
  178. * polarian joined #java
  179. * kathadris joined #java
  180. * kathadris joined #java
  181. * stfstfm joined #java
  182. * Ragnor joined #java
  183. * waz joined #java
  184. * ferdna joined #java
  185. * zorone joined #java