Chat Logs

  1. dreamrealhttps://bytecode.news/posts/2026/03/json-toon-yaml-and-more-considering-data-serialization-formats
  2. Tenchidreamreal: so did you upgrade to v3 or not ?
  3. dreamrealyes
  4. dreamrealI did not migrate away from JSON anywhere
  5. dreamrealbut jackson 3 was implemented, everywhere except in one place
  6. dreamrealbut that's a separate article
  7. cheeseryaml is the best data transport format.
  8. DoofusCanadensislook, you
  9. 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 ...
  10. 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."
  11. DoofusCanadensisgeez
  12. 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?
  13. 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
  14. pengu1nx1I meant that, my bad
  15. deebooutside of the well known uses, probably not worth it, atleast not without validating a bottleneck that could be helped with a pool
  16. dmlloydhttps://openjdk.org/jeps/8357464 looks nice
  17. javabotdmlloyd's title: "JEP draft: Enhanced Local Variable Declarations (Preview)"
  18. nevetJEP draft: Enhanced Local Variable Declarations (Preview)
  19. ParaOh I'm loving that.
  20. deebohmm, is there something blocking typescript type destructuring like {location: {int x, int y}, double radius} = myCircle;, that Circle(Point(...), ...) looks wordy
  21. ParaThat's more of a TypeScript's quirk though, as its emulating types on top of duck-typed objects.
  22. 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 :)
  23. deeboyeah then you try to indent it and it swaps half your file with ai slop
  24. 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.
  25. ParaLike for example if it's a sealed class, the matching is exhaustiva -> allow some shorthand.
  26. deebogreat feature though, i'll just end up hating the verboseness and lisp level of () in deep nesting
  27. ParaUse proper lisps and it'll be ridinculously simpler :)
  28. ParaDestructuring in Clojure is very dense and feature rich.
  29. Para(that family also includes Fennel and jank)
  30. 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.
  31. kcomhnallyeah..."nice"
  32. kcomhnallor am I missing something?
  33. * kcomhnall suddenly feels like writing in C#
  34. dmlloydyeah the language team is very careful about adding stuff
  35. dmlloydother languages are a bit more aggressive about it
  36. kcomhnallby the language team I assume you're talking about project amber?
  37. ParaJava the language, JVM the runtime/platform. They're two very distinct things, but obviously interlinked.
  38. ParaJVM is bleeding edge, Java is conservative. It has always been like this on purpose.
  39. dmlloydamber is only one of several projects related to enhancing the language
  40. kcomhnallbleeding edge? huh.. interesting take on a mature runtime env
  41. kcomhnallthe maturity is the whole reason I enjoy using Java... hardened and w.o.r.a are important for my projects.
  42. kcomhnall"JVM"
  43. MikeBuxi still wan to learn a compiled language like go, rust or c/c++ though,
  44. 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
  45. ParaMaturity and bleeding edge are not exclusive either; that's why e.g. that draft is available through feature flag as preview.
  46. 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
  47. kcomhnall~karma Para
  48. javabotpara has a karma level of 24, kcomhnall
  49. kcomhnallhmm
  50. dreamrealjep 8357464
  51. nevetjep 8357464: draft: Enhanced Local Variable Declarations (Preview) (https://openjdk.org/jeps/8357464)
  52. 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
  53. 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
  54. Paralook also: linux kernels
  55. dreamrealyeah, sometimes there's a question of whether you need it or not: tradeoffs everywhere
  56. dmlloydcode, not cods ๐ŸŸ
  57. dreamrealI don't mind go but I've failed to be impressed with it
  58. Paravibe cod
  59. dreamrealI do mind rust but OTOH it HAS impressed me
  60. dreamrealhttps://bytecode.news/posts/2026/03/enhanced-local-variable-declarations-in-java
  61. 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)
  62. dreamrealnimaje: it's doable, yes
  63. dmlloydwell, java bytecode _is_ an IR
  64. 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
  65. dreamreal(It is intel but we don't know the exact cpu profile)
  66. ParaIA-32
  67. nimajea jit can additionally optimise on concrete runtime values, especially if it knows that it will be loaded once and then stay the same
  68. dreamrealyes, we're aware :D
  69. ParaThat sounds like AI to me!
  70. dreamrealyou know, as time goes by I hate the "AI" label more and more
  71. dreamrealI mean, AI is... a whole series of algorithms, an LLM is just one variant and an expensive one
  72. nimajeabout everything is AI, be more specific
  73. cheeserdmlloyd: so that JEP is destructuring, basically
  74. dmlloydyeah basically, at least for the local variable case
  75. dmlloydit will be very helpful for cases where you have to interrupt/split an otherwise trivial conditional to introduce a local variable
  76. dreamrealHow expensive is that, though
  77. dreamreal(interrupting/splitting an otherwise trivial conditional...)
  78. dmlloydthe only cost would be at compile time; the bytecode is the same
  79. dmlloydoh, the cost there is reduced readability
  80. dmlloydin other words, the language enhancement will enable better readability
  81. 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.
  82. 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
  83. ChronosWhat's an example of a deconstructed declaration?
  84. dreamrealPredicate(subject, predicate, value) = p.rdf; // do something with subject
  85. Chronosdreamreal: Thanks.
  86. * Chronos is mildly skeptical of the value of that particular syntactic sugar.
  87. ChronosIt looks like Java 21 has something called "Record Patterns" which has some kind of deconstruction.
  88. ChronosIf I'm understanding this correctly...
  89. ChronosFor example: Object obj = new Person("Alice", 30); if (obj instanceof Person(String name, int age)) { ... }
  90. dreamrealyes
  91. dreamrealbut that's a different level of deconstruction
  92. ChronosOh, it looks like JavaScript has had this feature since ES6
  93. Chronosdreamreal: Ah.
  94. Bombedreamreal, eh, I feel the same about pattern matching.
  95. BombeIt always feels like Iโ€™ve failed to properly utilize OOP when I suddenly need to know the type of an object.
  96. ChronosOK, I can see how this syntactic sugar could be nice :)
  97. cheeseri've wanted destructuring plenty of times in java but kotlin kinda ruined me in that regard.
  98. cheeserpattern based destructuring will be fine, i guess, but not as convenient as kotlin's syntax.
  99. dreamrealthat's kind of the problem: kotlin has it, other languages have it, does java NEED it?
  100. dreamrealI mean, it's possible; it might be a simple extension of the switch/case stuff
  101. sbalmosdepends on whether you see continued viability of the ecosystem as Java-centric, or JVM-centric
  102. 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