Live data from Hacker News

Using Java 9 Modularization to Ship Zero-Dependency Native Apps

steveperkins.com

21–30 of 117 posts

Re: Using Java 9 Modularization to Ship Zero-Dependency Native Apps

#21
post #5

> A “Hello World” CLI written in Go compiles to around 2 MB. Nitpick but hello-world in Go : package main func main(){ print("Hello World") } is < 1MB on most computers (900KB on windows). No need to import the "fmt" package.

Except that isn't actually portable Go code, because you are using an unsupported function that can be removed at any time.

"The print built-in function formats its arguments in an implementation-specific way and writes the result to standard error. Print is useful for bootstrapping and debugging; it is not guaranteed to stay in the language."

https://golang.org/pkg/builtin/

Re: Using Java 9 Modularization to Ship Zero-Dependency Native Apps

#23
post #14
post #2

Even so, Java is now at a place where you can ship self-contained, zero-dependency applications that are comparable in size to other compiled languages (and superior to web-hybrid options like Electron). For cross-platform desktop GUI apps, I would argue that JavaFX combined with Java 9 modularization is hands-down the best choice available today. Electron is succeeding in the desktop GUI space because it tears down…

Yes, but it's electron. I've honestly seen only one properly written Electron app and it's VSCode. Everything else electron sucks. VSCode is not great either but it's much better than say, Atom or Slack.

Discord is great

Re: Using Java 9 Modularization to Ship Zero-Dependency Native Apps

#24
post #2

Even so, Java is now at a place where you can ship self-contained, zero-dependency applications that are comparable in size to other compiled languages (and superior to web-hybrid options like Electron). For cross-platform desktop GUI apps, I would argue that JavaFX combined with Java 9 modularization is hands-down the best choice available today. Electron is succeeding in the desktop GUI space because it tears down…

>tears down the barriers to desktop app development

Yes, then it replaces them with the barriers to web app development.

Re: Using Java 9 Modularization to Ship Zero-Dependency Native Apps

#26
post #23
post #14

Earlier quoted context omitted.

Yes, but it's electron. I've honestly seen only one properly written Electron app and it's VSCode. Everything else electron sucks. VSCode is not great either but it's much better than say, Atom or Slack.

Discord is great

So is gitkraken.

But I assume these apps have spent a considerable amount of time in optimizing electron, which not everyone can do.

Re: Using Java 9 Modularization to Ship Zero-Dependency Native Apps

#27
post #25

I'm unfamiliar with the state of the art, but could this make it possible to target iOS with a bundled JVM?

iOS tends to favour direct native code, hence the use of Objective C and Swift for iOS development.

Given the already large ecosystem built on these lanuages, its unlikely they'll pivot to a JVM based system.

Re: Using Java 9 Modularization to Ship Zero-Dependency Native Apps

#29
post #13

Earlier quoted context omitted.

You can get under 200KB in Java easily by using proguard or similar to strip unused code from your dependencies.

But that 200KB isn't a standalone executable. The Go example would be a lot smaller if it just distributed some unlinked object code with no runtime.

True. The JVM is big. I've been meaning to try Golang one of these days, I see it as Java's spiritual successor

Re: Using Java 9 Modularization to Ship Zero-Dependency Native Apps

#30
post #21
post #5

> A “Hello World” CLI written in Go compiles to around 2 MB. Nitpick but hello-world in Go : package main func main(){ print("Hello World") } is < 1MB on most computers (900KB on windows). No need to import the "fmt" package.

Except that isn't actually portable Go code, because you are using an unsupported function that can be removed at any time. "The print built-in function formats its arguments in an implementation-specific way and writes the result to standard error. Print is useful for bootstrapping and debugging; it is not guaranteed to stay in the language." https://golang.org/pkg/builtin/

lolrekt. gofaggots are the worst.
Post reply on HN