ByteCode.News
Submit RSS Atom Sign in

Back to the channels

#java

  1. enoq regarding value classes: they are copied when returned from a method, correct?
  2. enoq or is there some kind of optimization that uses pointers once it goes beyond a certain size?
  3. dreamreal value classes in what context?
  4. dreamreal This got brought up on reddit recently, is why I ask, where a professor apparently is arguing the wrong thing
  5. enoq ah, not referencing reddit
  6. dreamreal that's fine, the question remains
  7. dreamreal I was explaining why I was asking
  8. enoq correct me if I'm wrong, but my impression is that value classes are allocated entirely on the stack
  9. enoq so if I create a big one holding a lot of ints and what not, it's going to perform a lot of copies
  10. dreamreal again, what do you mean by "value class"
  11. dreamreal a record, an immutable?
  12. enoq project valhalla
  13. dreamreal okay, that's what I was looking for
  14. dreamreal I do not know your answer
  15. enoq maybe memcopy is so fast when your memory is nicely laid out that it doesn't matter unless you hit a really big chunk
  16. dreamreal my guess is that a bag of ints is a bad candidate for a value class, but like I said, I do not know
  17. dreamreal ~pbv
  18. javabot In Java, all parameters are passed by value. For a simple explanation see here https://bit.ly/2B1KVuo [cheeser's blog] or a more technical explanation see https://bit.ly/2VaGXGR.
  19. nevet javabot mentioned urls: https://bit.ly/2B1KVuo ("Java References for Newcomers — antwerkz") and https://bit.ly/2VaGXGR ("Java: What to Know About Passing by Value")
  20. enoq pointers are copied I guess since they're cheap and primitives are also copied
  21. dreamreal enoq: the pbv thing was for me, I was curious what the bot had on it
  22. dreamreal wasn't trying to inform you :) I figured you knew already
  23. enoq ah, thanks :)
  24. dreamreal in the reddit thing, a professor is confusing copies of references with "pass by reference," which is unfortunate for a professor
  25. enoq to be fair there are a lot of different ways to pass stuff
  26. dreamreal Of course
  27. dreamreal but java's is well-known and has been consistent for literal decades - it wouldn't have occurred to me to wonder if valhalla changes that, but what do I know
  28. Para re: pass by value, for the _logical_ behavior better description would be pass value by reference, but in that specific corner of the CS domain that doesn't make sense... :)
  29. Para I've long ago settled on it works logically and without suprise.
  30. dreamreal I'd say it was pass references by value, you dumbie!
  31. Para ...yes
  32. Para Also could I be a dumble instead, it's delicious (it's a chocolate+taffy candy)
  33. Para Or Dumle? Damn, maybe I _am_ a dumbie.
  34. dreamreal no, but dumble amps are *fantastic*
  35. dreamreal ~karma eclipse
  36. javabot eclipse has a karma level of -694, dreamreal
  37. dreamreal ~karma idea
  38. javabot idea has a karma level of 179, dreamreal
  39. dreamreal Chronos: ^^
  40. Chronos dreamreal: hahahaha good point :)
  41. Chronos (Even if I don't necessarily agree with those results)
  42. dreamreal I think it's a little unfair to eclipse, which is why nevet's karma works like it does :D
  43. dreamreal in nevet, for eclipse to KEEP that karma it would have to be CONSTANTLY maintained at that level
  44. gas51627 hi all. Could you please advise a java playground that can run java code and also allows sharing the link to the runnable code?
  45. gas51627 the standard java playground does not allow sharing the links unfortunately: https://dev.java/playground/
  46. javabot gas51627's title: "The Java Playground - Dev.java"
  47. dreamreal ~ideone
  48. javabot dreamreal, ideone is http://ideone.com/
  49. gas51627 thank you
  50. dreamreal ~glot.io
  51. javabot dreamreal, what does that even *mean*?
  52. dreamreal hmm, hold on
  53. dreamreal ~glot.io is <reply>https://glot.io/new/java is an online Java pastebin that can run code similar to ~ideone.
  54. javabot OK, dreamreal.
  55. dreamreal ~ideone is <reply>https://ideone.com is a simple online java platform that can run code. See also ~glot.io
  56. javabot I already have a factoid named 'ideone', dreamreal
  57. dreamreal ~no, ideone is <reply>https://ideone.com is a simple online java platform that can run code. See also ~glot.io
  58. javabot OK, dreamreal.
  59. dreamreal man, now I'm all disappointed we don't already have a URL to look at.
  60. gas51627 https://glot.io/snippets/hfuzhn4xs2
  61. nevet gas51627 mentioned url: https://glot.io/snippets/hfuzhn4xs2 ("Untitled")
  62. gas51627 please
  63. gas51627 Ok, maybe this is more clear: https://glot.io/snippets/hfuzmmmdtb
  64. nevet gas51627 mentioned url: https://glot.io/snippets/hfuzmmmdtb ("Untitled")
  65. dreamreal okay, you prrrrrrrobaby want to actually present a problem statement
  66. gas51627 i am bragging
  67. dreamreal because otherwise we're looking at going "oh look it's code"
  68. dreamreal okay, oh look it's code :D
  69. gas51627 it statically checks that Duck sort of implements my interface.
  70. gas51627 With this code I can define an interface and than check that Duck sort of implements it.
  71. gas51627 If Duck does not implement it, then the compilation fails.
  72. gas51627 (sort of implements it)
  73. dreamreal Okay. How is this USEFUL, though? I mean, I guess you're forcing the compiler to validate it... but you're binding a lot of bits of the compilation unit together, which doesn't scale well
  74. gas51627 it's for hibernate stuff and it wants methods with the same name on the interface as on the class.
  75. dreamreal not to harsh on anyone's mellow
  76. gas51627 "you're binding a lot of bits of the compilation unit together" what do you mean?
  77. dreamreal well, you have the interface, which has to know about the entity, and the interface then can say "I'm going to require the open extension fulfill this requirement"
  78. gas51627 what is the "open extension" in this case?
  79. gas51627 the class right?
  80. gas51627 the Duck
  81. dreamreal yeah
  82. dreamreal it has to be extensible, which fits, honestly, given the scope you're talking about
  83. gas51627 yes indeed the Duck must be open
  84. gas51627 that is, it must be extendable, otherwise I couldn't create that "check extension".
  85. dreamreal yes
  86. dreamreal and given HIBERNATE, that makes sense
  87. gas51627 indeed, the extended class the Duck must be extendable. Extension can be open or closed.
  88. gas51627 basically, the thing is, that in spring -jpa, I can provide projection interface to project my entity, with some of the properties from the entity. With this, I can declare the projection and then statically check that MyProjection will work with this entity.
  89. gas51627 so I just wanted to send my colleague a link to that snippet, but couldn't find how to send it. So thanks a lot.
  90. dreamreal Of course, and good work!
  91. gas51627 thank you
  92. NeXeN what's up
  93. Para CPU prices, GPU prices, RAM prices, and how HDD prices.
  94. Para *now
  95. Para I also somehow broke my page up.
  96. yamada java dies
  97. yamada ram prices :D
  98. Para Average Electron app takes more RAM than an average Java webapp these days.
  99. yamada electron rescues java
  100. Para Some sort of JavaFX Electron shim thingamajig would actually probably be pretty nice.
  101. dreamreal hmm, i haven't needed to buy ram recently at all
  102. dreamreal why would you need java/electron though?
  103. Para Well, it's now ridiculously expensive so better hope such need doesn't arise.
  104. Para AI ate all the hardware.
  105. * dreamreal is on mac so there
  106. dreamreal all the ram that went away is on others' hardware
  107. Para That's the grand plan.
  108. Para Don't sell hardware to people anymore, make them rent everything.
  109. NeXeN Para: javafx has a chromium based webview, and there's also jcef
  110. NeXeN wait, is it chromium or webkit based ? i forget now
  111. NeXeN i would like to build jcef apps, use java as the surrounding buttons and inside the webview, so i can built FE apps normally. dukescript lets you go between. i've done it before but for a simple uh like in-house app that was to track something silly but pertinent
  112. NeXeN AOT can get your footprint smaller, but javafx unfortunately uses a lot of reflection, though it will work with gluon and stuff, it's a pita to manually do