News for hackers. Stuff that matters.
Re:A JVM Does That? (2011) [pdf] by vvanders on Thursday July 07, 2016 @06:24PM (#12052457)
The amount of contortions you need to do with your "adult" language arguably negates a lot of advantages of using it. Just because you don't have pointers doesn't mean that all bugs are now eliminated.

Take Android for instance, getting solid performance out of the JVM there is a huge bear because the language is just not suited to low latency operations. I won't claim that C is a perfect language but I hate it when I see people throwing around that you're committing some sin for each line of C code you write.

If you want cache friendly operations and predictable performance you're not going to find it in any JVM or language that has a GC.

Re:A JVM Does That? (2011) [pdf] by chollida1 on Thursday July 07, 2016 @07:55PM (#12052818)
> If you want cache friendly operations and predictable performance you're not going to find it in any JVM or language that has a GC.

I don't know you and it's always dangerous to argue with people on HN due to who might be reading but I'd very strongly disagree with your above quote.

Predictable performance can be obtained on a very low latency, I've seen it:)

Cache friendly can be tougher and I won't argue the point as I think it will end up being a "no true Scotsman" argument where I claim Java can be cache efficient and you counter that C can do better so therefor Java isn't truly cache efficient

Re:A JVM Does That? (2011) [pdf] by vvanders on Thursday July 07, 2016 @08:51PM (#12053017)
That's true, I'm very familiar with tuning Java to be cache aware. I've played around with FlatBuffers[1] in my spare time to good effect which seems to be the only sane way of doing cache aware layout in Java.

That said the amount of restrictions you have makes it really painful(needing to use pre-allocated wrappers if you want to read more than intrinsic types, not being able to grow/shrink anything). There's sun.misc.Unsafe, but that isn't available on every JVM implementation.

A GC is going to by nature introduce pauses if since at some point it's going to need to do work on the memory you hold. There's a set of tunable tradeoffs but it will impact latency.

I guess my meta point is if throughput and latency are paramount to you then you should really consider a language suited for it. For me today that would be Rust or C++ depending on how risk-adverse the organization you're working with is.

[1] https://google.github.io/flatbuffers/

Re:A JVM Does That? (2011) [pdf] by Gibbon1 on Friday July 08, 2016 @01:53AM (#12053777)
There was an article on HN talking about the improvements go has made to their gc over the last few releases.

Umm... here

https://blog.twitch.tv/gos-march-to-low-latency-gc-a6fa96f06...

It sort of looks like language developers are finally getting the point that while you can easily deal with a throughput problem by just throwing faster processors, more processors, and or memory at at it, working around long gc pauses is just pain all around.

Re:A JVM Does That? (2011) [pdf] by eggy on Friday July 08, 2016 @12:16AM (#12053549)
Personally, I am looking to Rust or Pony, but both are too young, and the tooling is quite there, not to mention recruitment potential. Erlang/LFE/Elixir are great for certain distributed HFT tasks, but not the core for speed and latency.

The JVM is in HFT in because of sheer inertia; it has been worked on for so many years to shoehorn it in, and some smart people have made it work. The tooling is mature, and there are alternative syntaxes close to it like Kotlin that remove a lot of the noise for code review and maintenance.

The JVM is the reason I stayed away from Clojure, even though I like Lisp/Scheme syntax and the semantics. Where is Clojure-clr nowadays?

Re:A JVM Does That? (2011) [pdf] by desdiv on Thursday July 07, 2016 @09:14PM (#12053075)
>There's sun.misc.Unsafe, but that isn't available on every JVM implementation.

There's also talk about the possible removal of sun.misc.Unsafe in Java 9¹.

¹ http://blog.dripstat.com/removal-of-sun-misc-unsafe-a-disast...

Re:A JVM Does That? (2011) [pdf] by stickfigure on Friday July 08, 2016 @02:08AM (#12053830)
Jeeezus... I've been writing Java since before many HNers were born, and somehow I never noticed that class.

The Oracle people are right about this one. Rip it out and sterilize the wound with fire.

Re:A JVM Does That? (2011) [pdf] by needusername on Friday July 08, 2016 @06:52AM (#12054630)
Oracle backpedaled from that pretty quickly.
Re:A JVM Does That? (2011) [pdf] by joncrocks on Friday July 08, 2016 @04:02AM (#12054143)

  Take Android for instance
Android <> the JVM. There was a recent, fairly well publicised legal battle around this fact.
Re:A JVM Does That? (2011) [pdf] by PaulHoule on Thursday July 07, 2016 @06:55PM (#12052626)
I just think the people who make Android are high on drugs or something.

For instance the subjective experience of using Android is that you can never close any app that you've opened other than by uninstalling it. Even after you turn your machine off and turn it back on you still see windows for every f--king app.

Then they run a bunch of articles about what an idiot you are if you try to close these because it won't save your phone's battery.

Well I admit I do have some cognitive limitations and it is --hard-- to scroll through 30 apps just to switch from (say) the web browser to the PDF viewer, but I guess Google thinks it is great this way because you always have a Google Plus window open.

Then there are all the articles about the fancy power management they are going to have someday that doesn't face up to the fact that an android device may or may not charge if you plug it into a charger, might turn itself off when it is running, and that the most reliable way to turn it on is to do a hard reset... And this isn't any old piece of junk, this is a nexus device.

Re:A JVM Does That? (2011) [pdf] by Zigurd on Friday July 08, 2016 @01:34AM (#12053712)
> For instance the subjective experience of using Android is that you can never close any app that you've opened other than by uninstalling it

Is there a reason the user should explicitly terminate an app rather than just stop using it? Why not have a GC button, too? "Closing" and "file system" are meaningless to anyone who hasn't got a grasp of implementation. Don't show that stuff to the user.

Re:A JVM Does That? (2011) [pdf] by vvanders on Thursday July 07, 2016 @07:02PM (#12052654)
Those are just screenshots captured from the app you're seeing. If you switch to any OpenGL based app you'll see it restart.

FWIW Force Stop from the settings->app section will stop an app unless it's forced to be sticky because another service depends on it.

Re:A JVM Does That? (2011) [pdf] by BinaryIdiot on Thursday July 07, 2016 @08:32PM (#12052946)
> Those are just screenshots captured from the app you're seeing.

That's not entirely accurate. Many of the apps can and will stay in memory (it doesn't suspend all of them). Not that that's necessarily a bad thing.

Re:A JVM Does That? (2011) [pdf] by vvanders on Thursday July 07, 2016 @08:40PM (#12052977)
If you want to get really pedantic those are screenshots in the app drawer that are swapped with an application's surface in SurfaceFlinger just as it comes fullscreen.

But yeah, Android doesn't kill apps outright when you switch away, that would be a pretty poor experience to restart each time you opened a link in Twitter and came back from it for instance.

Re:A JVM Does That? (2011) [pdf] by BinaryIdiot on Thursday July 07, 2016 @08:46PM (#12052999)
> if you want to get really pedantic those are screenshots in the app drawer that are swapped with an application's surface in SurfaceFlinger just as it comes fullscreen.

Oh I know I was just being specific since you said they were "just" screenshots. Wanted to make sure it was clear some of those apps may in fact still be in memory. ️

Re:A JVM Does That? (2011) [pdf] by nitrogen on Thursday July 07, 2016 @07:28PM (#12052745)
I'll admit my Nexus 6P has been endlessly frustrating, but it is possible to "close" apps by swiping sideways on their tiles after pushing the square button.
Re:A JVM Does That? (2011) [pdf] by sigcode on Thursday July 07, 2016 @11:08PM (#12053380)
This is a great comment.

You should not close apps because you may interfere with tracking your location and other data collection.

Data collection is necessary to enrich your "user experience". When we know what you want we can fulfill your every wish! Just say "OK, Google". It will be great!

The developers behind this crap do not hear from satisfied users. Because the truth is no one really cares about this stuff. They care about things like reception and battery life...

except for some nerds like the ones who comment on HN who can easily point out all the stupidity of these "business" models.

When users are like puppets on a string, helplessly dependent. When there are no alternatives, no competition. Is that a business? And I suppose shooting fish in a barrel is game of skill.

Oddly enough, Googlers read HN comments and frequently defend the company, speaking only for themselves of course. Why should they care that anyone sees Android for what it really is? Whining nerds do not count, right? So why pay attention to what they think?

If developers of Android and iOS had any respect, if they had a conscience, then they would not be usurping people's computing resources for their own ends. Sure, users will be oblivious to what is going on and they will not complain. That does not mean it's OK to do these things.

Re:A JVM Does That? (2011) [pdf] by taneq on Friday July 08, 2016 @04:18AM (#12054195)
Wow, it's interesting how much HN dislikes your comment given the number of privacy and cryptography experts here.

(Edit: Probably the repeated pejorative usage of 'nerd', I guess.)

Re:A JVM Does That? (2011) [pdf] by viraptor on Friday July 08, 2016 @06:59AM (#12054647)
Well, it was a rant rather than information. And I disagree with it from the beginning:

> You should not close apps because you may interfere with tracking your location and other data collection.

That's bullshit reason - you'd write a background service, not try to stop users from closing the app. For any single application I'm using I'm happy for it to be cached rather than restarting every time. This is just arguing against a cache layer, because <made up reason>.

Re:A JVM Does That? (2011) [pdf] by taneq on Friday July 08, 2016 @08:02AM (#12054873)
Going offtopic from the rant to an Android development question, if I may - I thought background services were shut down brutally at random times, and hard to keep running reliably unless some app which uses them is open? I'm a newbie to Android dev, but I have an app which (attempts to) maintain an always-on connection, and I've gone with a foreground service because that doesn't get killed (as often).
Re:A JVM Does That? (2011) [pdf] by viraptor on Friday July 08, 2016 @08:57AM (#12055132)
That seems to go against the documentation: (https://developer.android.com/guide/components/services.html)

> A started service must manage its own lifecycle. That is, the system does not stop or destroy the service unless it must recover system memory and the service continues to run after onStartCommand() returns.

A started service shouldn't be killed randomly - after all, that's how the downloads are handled - you don't see those disappearing without a reason.

Re:A JVM Does That? (2011) [pdf] by taneq on Friday July 08, 2016 @09:11AM (#12055215)
Downloads are generally handled via foreground services (one significant difference is that foreground services show up as an icon in your notification area, notice downloads or Play Store updates appear there?). Background services are more like OLE in the sense of they let you set your app up so another app can ask it for stuff.
Re:A JVM Does That? (2011) [pdf] by sigcode on Friday July 08, 2016 @09:42AM (#12055388)
Nothing perjorative at all about the term "nerd".

The issue is not simply privacy, it's control of the hardware.

Re:A JVM Does That? (2011) [pdf] by taneq on Friday July 08, 2016 @10:02AM (#12055531)
This is why I didn't get to it until the edit. If I could be sure I wouldn't offend my clients, one of the first questions I'd ask is "are you a nerd?" As it is I have to couch it as "what's your background? are you technical?" and risk getting pinned as a condescending asshole when all I'm asking is "do you want me to tell you what the opcodes are doing to the transistors or do you want to tell me how the machine is 'feeling'?

The real question, I guess, is "do you have the knack"?

Re:A JVM Does That? (2011) [pdf] by BinaryIdiot on Thursday July 07, 2016 @08:29PM (#12052933)
I think your comment comes off a bit harsh or crass for the HN crowd but I'll admit much of it is accurate. It's amazing how much I've had Nexus, Motorola and other flagship android devices(including my Nexus 6P) simply restart out of nowhere or where my Nexus 6P doesn't charge (happened 3 times now; really screwed up my mornings).

I love android but it feels like every iteration has plenty of huge bugs never really addressed. iOS always seems more reliable but far more limited with some of the things I want to do with a phone.