Chat Logs

  1. Parahttps://news.ycombinator.com/item?id=49119063
  2. nevetJEP 401: Value Objects (Preview) merged to OpenJDK master | Hacker News
  3. javabotPara's title: "JEP 401: Value Objects (Preview) merged to OpenJDK master | Hacker News"
  4. NeXeNman i can't wait
  5. jreicherNeXeN: Para: what do you intend to use that for? I also have a use for it, but it's unlikely to be the same as yours
  6. jreicher~jep401
  7. javabot'JEP 401: Value Objects (Preview)' can be found at http://openjdk.java.net/jeps/401
  8. nevetJEP 401: Value Objects (Preview)
  9. NeXeNi'm building a library to help devs to leverage various ways of limiting scope and creating value objects seamlessly without worrying about implementing edge cases themselves
  10. NeXeNsince you lose identity there are some things there that have sharp corners, and so it'll just guarantee things like immutability and being able to do a thing and leverage it without so much work. mostly dx
  11. NeXeNmight not be something one would use, but it's at least something one can look at and learn about the various strategies in implementing value objects
  12. NeXeNnot every implementation needs value objects, but i'd like to at least have it for myself so i don't have to worry as much and i can just stay in the flow
  13. jreicherNeXeN: do the objects get created "in isolation", or do you have something to create data structures?
  14. hassoon'morning
  15. Parajreicher: I don't intend to do anything special with that, it's more that the basis of Valhalla is in there and that will bring a lot of other things as well.
  16. ParaI'll be surprised if something doesn't break because of that.
  17. NeXeNjreicher: i dunno i'm just surmising
  18. NeXeNmy plan is to simply implement various things that lend themselves to value objects, like Vector2D, Point3D, etc then complex numbers which will make them like primitives.....and say monetary amounts, timeseries timestamps, tensors, etc.
  19. NeXeNjreicher: i found a neat trick with the try-with-resources statement that i'll use to limit scope. i'll use static global (with a scope object in the try statement) to change whatever strategy, like identity safe, primitive-packed ...you know...and during that scope block between the squirrely brackets you can do like Vector2D position = MyLib.vector2D(100.5, 200.25); or some such and it'll automagically produce that type of object but as a value object
  20. NeXeN instead of a standard one
  21. NeXeNtechnically anything implementing AutoCloseable can be scoped with a t-w-r block
  22. NeXeNbecause at times you do want identity and at times you don't. so you could change it at any time procedurally within the block by passing an enum to a static method
  23. NeXeNi could also use a lambda, hrmm with them being incredibly cheap that would eliminate typing try statement
  24. NeXeNwait no, now that i think of it. using a lambda will allocate closure objects if you happen to reference local variables outside scope. in a large collection that would probably defeat the purpose. would have to document it