ByteCode.News
Submit RSS Atom Sign in

Back to the channels

#java

  1. dreamreal https://bytecode.news/posts/2026/04/performance-whack-a-mole
  2. javabot dreamreal's title: "Performance Whack-a-Mole | bytecode.news"
  3. mawk I'm trying to implement elliptic curves in my javacard applet
  4. mawk it takes something like 60 seconds to generate a RSA 4096 key pair
  5. mawk and 212ms to generate a key pair for 320 bit elliptic curve
  6. Para Sounds about right.
  7. dreamreal https://bytecode.news/posts/2026/04/gitbutler-an-approach-to-git-branch-management
  8. mawk the memory management is still weird to me
  9. mawk if you use 'new' the data is actually stored in NVRAM, it survives resets
  10. mawk and if you use the special API functions to allocate transient objects they're not deleted on reset, just zero-ed out
  11. mawk it seems that by calling the GC after each command processing I don't have memory leaking by repeatedly allocating transient objects
  12. metalmaniac hello there, I was wondering if someone could help me out with something I don't know how to debug within eclipse IDE. fresh installation of eclipse and maven, JDK21 for a project, imported it correctly, no errors, maven update within eclipse through ALT+F5 then seems facets nature for java fell back to jdk1.8 , the project has no 1.8 jdk defined anywhere and its pom has java version for source and
  13. metalmaniac target. If back to facets and put jdk21 , errors go away, but update maven and again on the very same errors. I think maven configuration, somewhere, defines a default JDK , I have no settings.xml on my m2 but I do have a toolchain.xml for another projects. Any lead? sorry to bother and thanks in advance!
  14. Chronos mawk: Does your JVM not perform GCs unless you explicitly call the GC?
  15. mawk yeah
  16. mawk and the gc is an optional feature I shouldn't use it if I want to be portable
  17. DoofusCanadensis JavaCard operates in some tight spaces
  18. mawk there's about 180KiB of flash and 4KiB of NVRAM, shared among all the applets
  19. mawk it's easy to go over the limit especially with the NVRAM
  20. mawk the language itself is pretty limited, no strings, most often no ints
  21. mawk but I compile with JDK 17 so I have all the static language feature
  22. mawk these are all the library functions available and nothing else: https://docs.oracle.com/cd/E59935_01/api/index.html
  23. nevet Java Card API, Classic Edition
  24. mawk there's a couple private/extra APIs specific to card management or using private vendor crypto APIs but that's it; and also you need to sign your soul away for a NDA for most of them
  25. mawk I tried, NXP politely replied "no"
  26. dreamreal ~maven version
  27. javabot To set the targeted java version (for instance java 21), add the following to your pom file: <properties><maven.compiler.release>21</maven.compiler.release></properties>
  28. dreamreal metalmaniac: ^^^
  29. dreamreal javacard's been around for a long long long time :D
  30. mawk it's running on a tiny 8-bit secure microcontroller in my case
  31. mawk and from java I even have 32-bit integers which is luxurious
  32. Chronos As someone that started on 8-bit microcomputers, yep, 32-bit ints are luxurious :)
  33. * dreamreal is so tempted by the commodore 64 ultimate...
  34. dreamreal my foolish wife actually sort of gave me the thumbs up on getting one, too. I was annoyed: she was supposed to be helping me NOT get one!
  35. DoofusCanadensis heh
  36. mawk I started my career with 32 bit stuff directly
  37. mawk nobody should be using 8-bit micros anymore unless you're a chinese cheap toy company with razor thin margins
  38. mawk or you have special requirements like radiation hardening or security
  39. Chronos dreamreal: There's also the VICE emulator for the Commodore 64. You know, I bet a really minimal Java could run on the Commodore 64...
  40. dreamreal or you have nostalgia poisoning! The c64u isn't actually 8bit anyway
  41. metalmaniac thank dreamreal but I tried those suggestions without any luck. I realise someone added some executions to the maven-compiler-plugin, if the release version is not specified there too, it always falls back to 1.8 , that seems to be its default behaviour. Thanks!
  42. dreamreal Chronos: hey, the javalin processor is a real thing
  43. Chronos mawk: Except if you enjoy retrocomputing!
  44. mawk yeah
  45. mawk 32 bit is retro now maybe
  46. DoofusCanadensis totally is
  47. dreamreal the c64 was my second real computer. The Timex/Sinclair 1000 was my first.
  48. dreamreal and THAT thing was a piece of... work
  49. Chronos dreamreal: Similar to me. My first was a TRS-80 Color Computer, my second was a Commodore 64.
  50. DoofusCanadensis Radio Shack/Tandy Color Computer II was my first
  51. dreamreal I never had a Coco - I sold them, but never owned one. It was, however, fun to run OS/9 on the things!
  52. DoofusCanadensis it's out in the garage for want of an RCA-HDMI adapter
  53. dreamreal We used OS/9 to keep the kids confused :D
  54. DoofusCanadensis OS/9, eh?
  55. dreamreal DoofusCanadensis: look at commodore.net - they have such things, I think
  56. mawk the first thing I touched was a windows 95 gateway desktop computer when I was 4-5
  57. mawk around 2000
  58. DoofusCanadensis it was your gateway, eh
  59. mawk then I broke it by flipping the little red switch on the power supply
  60. dreamreal DoofusCanadensis: yes, os/9!
  61. dreamreal it was awesome for its time :D
  62. Chronos mawk: You make me feel positively fossilized
  63. mawk lol
  64. cheeser but does the Ultimate come with joysticks that are easily broken and have to be glued back together?
  65. dreamreal hmm, no, they have s-video to composite, not HDMI output
  66. Chronos These days, all the cool kids will tell you that you're old if you program in Java ;)
  67. dreamreal cheeser: no, you have to buy tougher things. But you can USE those old joysticks, as I understand it
  68. mawk I just write C usually, but this time I had to pick up java
  69. DoofusCanadensis dreamreal: it could handle maybe three concurrent users‽ that's amazing
  70. dreamreal DoofusCanadensis: os/9? Pffft, on that machine, you were lucky to run rogue :D
  71. DoofusCanadensis hahahaha
  72. dreamreal ... which is what I typically did on it
  73. DoofusCanadensis I mean, that's what the Wikipedia entry says it was theoretically capable of
  74. mawk speaking of concurrent users I convinced my javacard distributor to enable logical channels on the card, so now I can have 4 concurrent connections (or even 5 if I use both the contact and the contactless interface at the same time)
  75. mawk I have to find a way to safely store transient state specific to one logical channel
  76. dreamreal We never tried, but we also never hooked it up to multiple-session-capable systems
  77. dreamreal we also ran xenix on the RS/6000 and the 80386 machines we had in the office
  78. dreamreal I actually LIKED xenix back then
  79. Chronos mawk: What is your project? Like the 10,000 foot (or 10,000 kilometer) view?
  80. dreamreal those damn 6000s were ... really kinda surprisingly good. You could literally upgrade a TRS/80 Model I to a 6000 and it'd be GREAT
  81. mawk I'm trying to design a cheap and removable secure element for managing certificates or secret keys
  82. mawk like for IoT stuff
  83. mawk with the new cyber security regulations in the EU a lot of companies will have to start doing something and I can maybe become rich
  84. Chronos QNX > Xenix :)
  85. Chronos mawk: Oh, very interesting
  86. dreamreal QNX postdated xenix by a bit, though, and didn't have SCO at the end
  87. Chronos dreamreal: Xenix predates QNX?! I had no idea
  88. dreamreal I was using XENIX in 1987
  89. mawk I could also easily turn this into a yubikey-like product for consumer authentication but the market is saturated
  90. mawk and companies have more money
  91. mawk basically trying to become their concurrent: https://www.smartcard-hsm.com/
  92. dreamreal oooo QNX might have been ahead of Xenix
  93. dreamreal INTERESTING.
  94. Chronos dreamreal: I think you're right. It looks like Xenix may predate QNX by around 2 years.
  95. dreamreal Xenix and QNX had different userbases, though: QNX was RTOS, yeah?
  96. mawk in an embedded device all they need is a USART (like UART with a clock signal) and a SIM slot, maybe a transistor to turn it off when unused, and they can talk to it
  97. Chronos dreamreal: Yes
  98. dreamreal Xenis was ... not. :D
  99. dreamreal and then SCO poisoned the name altogether
  100. * Chronos mumbles something about the JNode operating system
  101. dreamreal bwahaha
  102. dreamreal JINI could have done it but Sun never could figure out how to market
  103. tilerendering hi - i need a spring boot project serving as reference (best practices with boilerplate code, ready to use and "copy" or "follow", open source etc., state of the art, you know what i mean, something like the "pet store for ejbs 20yrs ago, but shining and excellent and best-of) for spring boot with java 21. any ideas?
  104. dreamreal tilerendering: err... that's a pretty broad request
  105. tilerendering ejbs -> jee
  106. tilerendering dreamreal, I actually wouldnt ask here if I hadnt stumbled upon such rereference projects a week or 2 ago
  107. tilerendering but youre right
  108. dreamreal I mean... spring's ecosystem is GIANT. What aspects of app development are you looking for? What kind of requirements?
  109. tilerendering basically I d like some references. with the maturity of spring boot and java (and java EE), there must be quite a comprehensive list of projects to serve as "state of the art" somewhere
  110. DoofusCanadensis have you tried the spring tutorials?
  111. dreamreal or looking on github, for that matter. There may be a spring recipes thing too
  112. tilerendering dreamreal, basically a backend with oauth2 keycloak connection postgresql JPA persistence layer, behind it, able to harness java 21 optimizations (even though most will stay under the hood), along with payment integration (stripe) - there s something like that for ruby on rails and it s called "draftkit"
  113. tilerendering DoofusCanadensis, well tutorials server another purpose than references
  114. tilerendering server=serve
  115. dreamreal look for draftkit on spring, I guess. I don't do stripe or keycloak or else I'd point you to nevet :D
  116. tilerendering dreamreal, I m currently having an AI research exactly that for me, on github, among others.
  117. tilerendering I just thought maybe I d find some useful info here
  118. dreamreal sure, you probably still can, at least you've NOW given people something to consider as a comparison point :D
  119. tilerendering like some "duh - everybody knows - look HERE!"
  120. tilerendering got you
  121. tilerendering dreamreal, arent you Mr. Lombok?
  122. dreamreal err... no?
  123. tilerendering ah, he used to hang out here.
  124. dreamreal that'd be surial, but surial hasn't been here for a long time
  125. tilerendering see? surial, surreal, dreamreal...
  126. tilerendering AI-reel, look-n-feel, oneill.
  127. tilerendering The original Wiener Schnitzel is based on veil!
  128. dreamreal I actually don't know if I have any projects that use lombok any more
  129. dreamreal $work sort of does but they'e migrating away
  130. tilerendering lombok conflicted in quite some projects with other stuff - I think it was mapstruct or something else.
  131. tilerendering so I basically just switched to IDE-driven generation
  132. dreamreal I switched mostly to records and data classes in kotlin
  133. [twisti] mapstruct was historically a problematic combo, but that was fixed a very long time ago, many years certainly
  134. [twisti] ive always been sad how much flack lombok caught, at work too. we have a new dev who pushed to convert some of my old projects to drop lombok, and since i no longer work on them i gave my okay, i mean, hes the one who has to maintain them. so far, the code base has gone up ~700% with purely generated, copy/pasted code, and whats worse; because lombok allowed some fine tuning, 99% of that shit is copy/paste, but 1% is not. good luck noticing those
  135. [twisti] differences in the future amongst those thousands of pages of generated, identical looking code 🤷🏼‍♂️
  136. [twisti] i try not to care, letting go is healthy, but still
  137. dreamreal [twisti]: some people want to have their fingers in every pie, yeah :(
  138. dreamreal I mean, I migrate away from lombok structurally - if records make sense, there we are, same for other types. But if there's not a reason to move away... why?
  139. [twisti] well, its their project, so i want them to feel like they can make decisions like that - they are sort of junior, not completely, but definitely compared to me. so i try not to bully my opinion when they are the ones having to do the maintenance in the future
  140. dreamreal Oh, you're doing the right thing
  141. [twisti] of course they 'had problems getting it to work with lombok', which i know youre a sucker for, but in my experience, there hasnt been anything that couldnt be solved with literally five minutes of google in almost a decade in regards to lombok, so that doesnt feel like a good reason to me
  142. dreamreal what?
  143. dreamreal I am missing something, I think
  144. dreamreal I'm a sucker for "had problems getting it to work with lombok?" What does that mean, and what makes you say it?
  145. tilerendering dreamreal, [twisti] : a little aspect there, another annotation there, some more annotations, some more aspects, precompile, runtime, postbla, and in the end, nobody knows whats going on anymore!
  146. tilerendering :)
  147. [twisti] dreamreal: thats one of the arguments you used to bring up, and jump on when people came here that had a problem with that, basically saying 'thats why i dislike lombok'
  148. [twisti] its fine, you werent wrong
  149. dreamreal what?
  150. dreamreal I mean, my argument against lombok isn't that it doesn't WORK, it's that it's not entirely necessary, but what it does it does really well
  151. [twisti] lombok causing problems for peoples build process, ides, code checkers/analyzers, due to how lombok hooked into javac in a non-sanctioned way
  152. dreamreal builders in lombok are great, the rest is less necessary than it was, and the AST dependency is a concern
  153. tilerendering can we all agree to some more diversity here? @Getters @Setters @Whatsoevers?
  154. tilerendering btw what is AST again
  155. dreamreal but that's a maintenance problem: how much do you trust surial, etc., and should you? Generally the answer is "yes" but it's STILL a trust issue
  156. [twisti] granted, that was back when they used to do a lot more illegal black magic, before their kind of magic was properly supported by java/javac
  157. dreamreal ~ast
  158. javabot An AST (or "Abstract Syntax Tree") is a reference to a structure generated from an input. A sentence, then, might have an "AST" of a subject, verb, and a predicate, where the predicate is optional and all three parts might be constructed with different complexity. Program source is normally conversted to an AST before generating executable code.
  159. tilerendering ah AST, the tree recursively worked on by a parser for instance
  160. tilerendering didnt know it was called ast
  161. dreamreal tilerendering: lombok works by hooking into some javac internals, there's not a published API they use, so it has to be ported for every iteration of javac; it's fairly constant so they can track it really closely, but even so
  162. dreamreal and they're *really* good coders
  163. [twisti] ive been sadly out of touch with java for years by now; does java have first class support for @Delegate these days ? `class SomeListWrapper implements List<T> { @Delegate private final ArrayList ... }` would just delegate all non-overridden calls to interface methods to the, well, delegate
  164. [twisti] we made such nice code with that
  165. dreamreal I don't quite know what [twisti] is talking about. I don't tell people "you should use lombok!" but apparently that means I'm anti-lombok now
  166. [twisti] composition > inheritance
  167. [twisti] dude, you used to have a real chip on your shoulder about lombok
  168. dreamreal not that I know of yet
  169. dreamreal I'm trying to remember having such a chip, esp when I was the person who first put lombok in print
  170. dreamreal hell, I remember asking surial if that was okay *here* (well, on freenode, but still)
  171. [twisti] i feel like we used to get into arguments about it all the time
  172. dreamreal I think you argue with me a lot more than I argue with you, TBH
  173. dreamreal you keep saying I have chips on my shoulders about things you like, or whatever, and I'm pretty much always slightly lost, and I don't really enjoy not understanding WTF is going on much
  174. dreamreal and since I keep wondering what you're talking about, that actually creates a low-grade conflict, because I really don't know what you're talking about when it comes to me very much
  175. [twisti] to be fair, from my perspective it feels like the exact opposite - like you retroactively change how/what you remember a lot
  176. tilerendering I dont like the term "coding" btw.
  177. dreamreal maybe it's because I don't actually take hard positions very often, as a professional behavior
  178. dreamreal I can push back on almost all positions, and I push back on absolute statements habitually because absolutism is almost always wrong
  179. dreamreal on reddit: "Spring sucks!" No, it kinda doesn't. "Spring lover!" ... meanwhile I wrote articles saying why Spring wasn't necessary and it's still not necessary. "Oh, you love Jakarta EE huh?!?!" No, I write Spring apps pretty much every day.
  180. [twisti] ive stopped collecting logs, and on some level i suspect as rational as it feels, going through decade old logs to win an argument is somehow neither fair nor productive, but in this instance i would love to go back and see what really happened. my memory is terrible, but usually in the 'i dont remember' way, not the 'i made up fake memories' way
  181. dreamreal Well, it *sounds like* you have an impression that either got reinforced or did NOT get opposed and it calcified
  182. dreamreal but you have your own life and your own impressions, and that's fine
  183. dreamreal I stopped suggesting lombok and stopped using it in my own code, for actual reasons that I find rational and justifiable, but if someone uses it, I don't *care*
  184. dreamreal The number of projects I utterly reject is really pretty low: siteminder, vignette storyserver, dynamodb
  185. dreamreal after that... don't really care
  186. dreamreal if $work were to say "let's front storyserver with siteminder, and use dynamo as a backend" I'd quit within about five minutes, as soon as I stopped screeching in rage at them
  187. dreamreal thankfully they're not stupid so none of those will infect our codebase
  188. [twisti] ive been shoved into the world of outdated php and react, so who am i to talk
  189. dreamreal It's kinda funny: at work they'll mention technology X, and I'm constantly going "oh, I know that guy" :D
  190. Swayze psychologist prob
  191. Swayze or try #php
  192. jbosmans regarding lombok, to me that's a case of choosing between pretty clear upsides and downsides
  193. jbosmans aka a tradeoff i guess
  194. jbosmans and/or "trade off"
  195. jbosmans i remember thinking when a saw an early talk a long time ago (i think javapolis days) that it was a lot of generated code that removed a lot of boilerplate, which was nice
  196. jbosmans but then, besides coding i also had to put out a lot of production fires, where generated code doesn't help per se
  197. jbosmans in any case i think it is and always was a very clever project, with attached pro's and cons as always
  198. cheeser mostly cons
  199. jbosmans for me same
  200. jbosmans ~4 hours until artemis 2 reentry
  201. javabot jbosmans, what does that even *mean*?
  202. cheeser i'm worried about that heat shield.
  203. jbosmans yeah, read same :s
  204. jbosmans i'm sure it'll be fine
  205. cheeser what's the worst that could happen? ¯\_(ツ)_/¯
  206. jbosmans yeah :s
  207. jbosmans i'm not religious, but (choose to) have faith in nasa's attention to detail
  208. Para I'm annoyed that it's still not reusable boosters.
  209. Para Other than that, space is cool. Stuff.
  210. cheeser faith isn't exclusive to religion. replacing logic with it (almost) is. :)
  211. jbosmans okay, i agree :)
  212. jbosmans afaik no logical reasons to assume the worst tho
  213. jbosmans also, afaik, there'd be a backup plan, and then x more
  214. jbosmans regarding lombok again, the only generated code i know of in use is for 1 project, where the code in question were once classes and now records, and said code is generated by manually written java code and compiled as part of the standard classpath
  215. jbosmans basically a (whole) bunch of DTOs
  216. jbosmans defined by a non-java ERP for that matter
  217. Para ~immutables
  218. javabot Para, immutables is an annotation processor capable of producing fully immutable objects with many configurable features from a simple interface or abstract class definition. See https://immutables.github.io
  219. Para It was that time again.
  220. jbosmans how so?
  221. jbosmans (crazy view watching artemis approach the earth)
  222. Para People tend to revolve around the whole lombok or not to lombok thing, while the true answer is "immutables until withers" (:
  223. jbosmans I tend to agree, unless mistaken "until withers" is superfluous tho ;)