TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Java 12

324 点作者 kalimatas大约 6 年前

16 条评论

MarkMc大约 6 年前
I&#x27;m so glad I was taught Java at Macquarie University back in 1998. For the past 20 years I&#x27;ve had a career built on a solid API that doesn&#x27;t change every 2 years like some flavour-of-the-month Javascript framework.<p>Even on the client where Java has lost to Javascript, I&#x27;m finding it more enjoyable to add features to my 15-year-old SWT app [0] rather than dealing with the multiple layers of abstractions that is Javascript+CSS+DOM (+ maybe Electron). Personally I think it&#x27;s a shame Sun dropped the ball with client Java - if they had chosen SWT over Swing and provided a minimal JVM then maybe Java Web Start would have beaten Javascript web apps. It&#x27;s also a shame Sun sold Java to Oracle - Google would have been a better steward, and probably would have been willing to pay more for the Java parts of Sun.<p>I&#x27;m now trying Dart to develop a few Flutter apps. It&#x27;s no doubt a better language, but not <i>that much</i> better - I think Flutter would have been more successful if it was built on Java.<p>[0] <a href="https:&#x2F;&#x2F;www.solaraccounts.co.uk" rel="nofollow">https:&#x2F;&#x2F;www.solaraccounts.co.uk</a>
评论 #19439726 未加载
评论 #19437912 未加载
评论 #19439739 未加载
评论 #19437885 未加载
评论 #19440685 未加载
评论 #19439264 未加载
评论 #19451648 未加载
评论 #19438455 未加载
azhenley大约 6 年前
The most interesting new feature I think is the Shenandoah GC. The summary from [1]:<p>&quot;Add a new garbage collection (GC) algorithm named Shenandoah which reduces GC pause times by doing evacuation work concurrently with the running Java threads. Pause times with Shenandoah are independent of heap size, meaning you will have the same consistent pause times whether your heap is 200 MB or 200 GB.&quot;<p>The original algorithm was published in 2016 [2]. It consists of 4 phases: initial marking, concurrent marking, final marking, and concurrent compaction.<p>[1] <a href="http:&#x2F;&#x2F;openjdk.java.net&#x2F;jeps&#x2F;189" rel="nofollow">http:&#x2F;&#x2F;openjdk.java.net&#x2F;jeps&#x2F;189</a><p>[2] <a href="https:&#x2F;&#x2F;dl.acm.org&#x2F;citation.cfm?id=2972210" rel="nofollow">https:&#x2F;&#x2F;dl.acm.org&#x2F;citation.cfm?id=2972210</a>
评论 #19436241 未加载
评论 #19436800 未加载
评论 #19442195 未加载
评论 #19438287 未加载
评论 #19437839 未加载
评论 #19436596 未加载
评论 #19439023 未加载
评论 #19436253 未加载
hyperpallium大约 6 年前
Switch expressions prepare the way for pattern matching (<a href="https:&#x2F;&#x2F;openjdk.java.net&#x2F;jeps&#x2F;305" rel="nofollow">https:&#x2F;&#x2F;openjdk.java.net&#x2F;jeps&#x2F;305</a>), instead of `instanceof` checks and casts.<p>But (in my naive opinion) double dispatch seems a more elegant and java-ry solution, i.e. polymorphism on argument classes, so different methods are invoked for different object <i>runtime</i> classes (instead of using the <i>compiletime</i> type of the variable).<p>The switching could be optimised, as ordinary polymorphism is in the JVM.<p>Sure, you&#x27;d wreck legacy code if you just introduced it, but there&#x27;s surely a backcompatible way to do it that isn&#x27;t too awkward.<p>BONUS: goodbye visitor pattern!
评论 #19437665 未加载
评论 #19437886 未加载
darksaints大约 6 年前
Anybody know how the graal project ties in with all of this? Is oracle effectively developing 3 different JVMs (OpenJDK, Oracle JDK, GraalVM)? Or is there some sort of convergence plan?<p>From what I understand, graal has made a lot of headway with language interop, as well as a handful of specific memory optimizations and native compilation, but overall is lagging in pure throughput&#x2F;latency performance behind hotspot. It would be really cool if we could get the best of both worlds.
评论 #19436089 未加载
评论 #19436576 未加载
评论 #19436185 未加载
评论 #19436648 未加载
stygiansonic大约 6 年前
Included is JEP 230, a Microbenchmark Suite. It&#x27;s based off of JMH. Nice to see this included!<p><a href="http:&#x2F;&#x2F;openjdk.java.net&#x2F;jeps&#x2F;230" rel="nofollow">http:&#x2F;&#x2F;openjdk.java.net&#x2F;jeps&#x2F;230</a><p><a href="http:&#x2F;&#x2F;openjdk.java.net&#x2F;projects&#x2F;jdk&#x2F;12&#x2F;" rel="nofollow">http:&#x2F;&#x2F;openjdk.java.net&#x2F;projects&#x2F;jdk&#x2F;12&#x2F;</a>
geophile大约 6 年前
Are they <i>ever</i> going to release value types?
评论 #19436473 未加载
评论 #19436774 未加载
评论 #19437016 未加载
评论 #19439761 未加载
评论 #19437989 未加载
评论 #19436472 未加载
评论 #19436818 未加载
crooked-v大约 6 年前
Still nothing to handle checked exceptions in streams properly... sigh.
评论 #19436149 未加载
评论 #19436028 未加载
评论 #19436002 未加载
评论 #19435936 未加载
评论 #19436925 未加载
评论 #19438000 未加载
评论 #19438914 未加载
connorlwilkes大约 6 年前
The new switch feature looks nice, the way it previously used to work was so unwieldy.
评论 #19435868 未加载
ocdtrekkie大约 6 年前
Meanwhile, most enterprise apps still seem to only work with JRE 8. And those which I know of have elected to replace Java rather than upgrade.
评论 #19436229 未加载
评论 #19440697 未加载
评论 #19437059 未加载
评论 #19436135 未加载
评论 #19436153 未加载
评论 #19440257 未加载
评论 #19436287 未加载
评论 #19437031 未加载
otisg大约 6 年前
Great to see Java 12 (and the shorter release cycles) but how quickly do people actually move to newer Java? Here&#x27;s a poll with some results: <a href="https:&#x2F;&#x2F;twitter.com&#x2F;otisg&#x2F;status&#x2F;1108093046397247488" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;otisg&#x2F;status&#x2F;1108093046397247488</a> (still open, please vote so there is more data)
imhelpingu大约 6 年前
I wonder if they might condescend to utilize the JVM so I don&#x27;t have to compile JMC myself for another 5 months, or maybe at least they&#x27;ll remove their circular links that infuriatingly obscure the fact JMC binaries don&#x27;t currently exist. For the past 5 months.
wink大约 6 年前
I wonder if they&#x27;ll fix the performance again. I&#x27;m mostly peripheral to clojure-land and 8 still seems to be the best choice.
vbuwivbiu大约 6 年前
presumably there&#x27;s still primitives and boxing ?
java-man大约 6 年前
I wish they did not decouple JavaFX...
评论 #19436813 未加载
评论 #19436658 未加载
hestefisk大约 6 年前
I’m missing the TL;DR on what language features may be introduced. Any ideas?
评论 #19438313 未加载
ilovecaching大约 6 年前
I understand why Java has to keep on chugging along, but I feel bad for the people that have to be a part of it. It&#x27;s like watching people keep coal trains going while people are moving to cars.<p>Why? Besides being owned by Oracle, which is enough of a reason to never use Java ever again, it&#x27;s also lost the niches that brought it into existence. Java no longer runs everywhere. Java on the web is dead, and you can now write ubiquitous apps in basically every language. There&#x27;s no reason to deal with the JVM and it&#x27;s domain knowledge when you can write a nimble Go app for your backend and a Javascript app that will run on mobile, web, or desktop. A VM language? You mean v8 sandboxing and web workers; WASM which lets me write C, C++, and Rust all of which can talk to Javascript APIs. All of my services are stateless and ephemeral. Crashing is expected, and I can use host monitoring tools instead of introspecting the JDK. On the cloud it gets even worse for Java. Why use a meaty framework like Spring when I want to just spin up a bunch of micro services, or have an API gateway kickoff a bunch of lambda jobs.<p>Java also took OO in so many terrible directions. OO defined by it&#x27;s creator looks nothing like the enterprise OO that big business sold to commoditize programming, which now only exists as a ball and chain on legacy systems.<p>One day Java will be like Cobol. There&#x27;s probably a lot of money for Java developers for many more decades, but god I do not envy anyone that has to do it.
评论 #19436299 未加载
评论 #19437169 未加载
评论 #19436294 未加载
评论 #19436446 未加载
评论 #19436541 未加载
评论 #19436880 未加载
评论 #19436408 未加载
评论 #19437550 未加载
评论 #19436381 未加载
评论 #19436478 未加载
评论 #19436320 未加载
评论 #19437745 未加载
评论 #19436406 未加载
评论 #19436407 未加载
评论 #19436601 未加载
评论 #19437274 未加载
评论 #19436841 未加载
评论 #19436653 未加载
评论 #19437786 未加载
评论 #19436512 未加载
评论 #19436983 未加载
评论 #19437532 未加载
评论 #19436363 未加载
评论 #19436687 未加载
评论 #19436318 未加载