News for hackers. Stuff that matters.

sdfsdufihwfuhdf

Re:Java 8: New features in ConcurrentHashMap on Wednesday January 18, 2017 @02:40PM (#13429610)
Underneath they're still divisible. AoT is always native machine code. JIT/VM/Bytecode is VM, basically machine code on demand.

Then there's interpreted code which has worked the same way for forever

Re:Dismissing Python Garbage Collection at Instagram on Wednesday January 18, 2017 @02:18PM (#13429392)
because it doesn't. What they're doing is borderline crazy. Similar to turning off the GC in the JVM... once you reach that point why not just use a more suitable language?

Java/Golang/Rust/C++/C# are all about 100X faster than Python. Wouldn't it be more reasonable to use one of those than mess with the runtome to squeeze out 20% more performance?

Re:Java 8: New features in ConcurrentHashMap on Wednesday January 18, 2017 @12:03PM (#13427936)
There are many. One really useful one is that final variables will be pulled out along with their dead code branches. Say I have a library which allows different "sizes" of a list. The fastest way to sort that list depends on the number of max entries.

With JIT you can set the size when you create the object, and if JVM knows that value can't change it will pull out all the branches for different sizes and run only the one for selected size.

There's no way to know which sizes will be selected at compile time if the lists can be dynamically created, so a static compiler can never pull out all the checks the list size.

This is a simple example but the JIT is very smart and makes a big speed difference in practice. It's the main reason Java is faster than C in some benchmarks

Re:Java 8: New features in ConcurrentHashMap on Wednesday January 18, 2017 @11:12AM (#13427385)
You must not have used eclipse for a while :) . I use Visual Studio at work and Eclipse at home and they're comparable these days. I agree that years ago Eclipse was awful.

- Every language has switch-case and enums? I don't get what you're trying to say there.

- Generics are fine?

- Every language supports null on objects?

- Nearly every language treats null and primitive types differently for performance reasons

- Java has three popular JSON parsers and they're all faster than .NET's builtin serialization. To get similar performance you need to use Newtonsoft which isn't builtin to C# either :).

- You don't need an IDE, it's just stupid to develop without one because they're so helpful. Nothing is stopping you from running javac on the command line.

You can't do a LOT of things java can do in C# because third party library support pales in comparison. A lot of databases and open source software don't have c# clients. If you're dealing with big data or ML you'll find almost nothing in C# land.

I feel like you haven't used Java in a long time. Things are much better than Java 6 days

Re:Java 8: New features in ConcurrentHashMap on Wednesday January 18, 2017 @10:23AM (#13426927)
I use C# at work, the syntax is better than Java but there's one huge issue: good luck getting it to work without Windows and Visual Studio.

.NET core is still very immature, we had to back out every time we tried to use it in production. Maybe in a few years it will be good.

Java on the other hand has support for many IDE's, package managers, web servers, JVM's, OS's. You can swap out pretty much everything, no vendor lock in issues at all. The open source community is far stronger as well. So many times I wanted to use a cool database and found out there's no official C# client

Re:Java 8: New features in ConcurrentHashMap on Wednesday January 18, 2017 @10:06AM (#13426768)
I'm messing with running Jersey on Jetty right now so I can get HTTP/2 before java 9. Netty and Jetty have both supported it for a while :)

There's still a lot of innovation going on in the Java community you just don't hear about it.

Re:Java 8: New features in ConcurrentHashMap on Wednesday January 18, 2017 @09:59AM (#13426710)
I tend to group languages into machine-code, VM, and interpreted. This tend to lead to similar tradeoffs within the group...with the exceptions of Golang.

in my mind: interpreted = why would you ever use a language like this? VM = fast, safe, but going to use a lot of memory machine code = fastest, low level HW access, usually unsafe