News for hackers. Stuff that matters.
Re:The End of IKVM.NET by skrowl on Saturday April 22, 2017 @07:21PM (#14175456)
As a .NET developer, I only use wrappers for unmanaged code as a last resort. Having to introduce a dependency on something as slow and security-bug-rich as Java would be a hard sell in most .NET shops.
Re:The End of IKVM.NET by MichaelGG on Saturday April 22, 2017 @08:24PM (#14175695)
Can you name a few specific examples of where you are using .NET/CLR that Java would have introduced security holes? Basically all the high profile ones that people think of are code-loading issues, similar to XBAP and other .NET tech's bugs. In other words, the "Java insecure" meme applies to very little actual Java dev.
Re:The End of IKVM.NET by mpeg on Sunday April 23, 2017 @07:39PM (#14181045)
Hey I have a real world example, it's not a problem with the JVM but with the way JVM interop would work for a .NET shop.

A company I was working at was using a java library to do one specific thing related to file uploads, despite all their code being .NET. The library became a bit of a black box and no one bothered to keep up with updating it as it was essentially a binary blob that sit outside the normal update mechanisms (visual studio references)

Turns out the library had patched a RCE vulnerability a while back, spent a fun afternoon making a PoC exploit for it (tricky because we had some other file validation in place) to win the unofficial office competition to find a security hole in our product.

I would agree with your point in general, but the moral of the story is that adding complexity is not good considering most people are too lazy/incompetent to understand the full implication of something like "I'll just use a third party binary / library here" to their ongoing maintenance.

Re:The End of IKVM.NET by cm2187 on Sunday April 23, 2017 @01:17AM (#14176646)
I don't know about security but the fact that the java installer tries to install crapware or change my browser settings doesn't do much for its reputation.
Re:The End of IKVM.NET by skrowl on Saturday April 22, 2017 @11:38PM (#14176348)
You have to install a whole extra runtime on all of your servers, including production internet-facing servers to use Java. If you can't see that would add to your potential attack surface, I can't help you.
Re:The End of IKVM.NET by MichaelGG on Sunday April 23, 2017 @12:51PM (#14178944)
Please list a few remote access vulnerabilities caused by the JVM and not app.
Re:The End of IKVM.NET by merb on Sunday April 23, 2017 @06:04AM (#14177437)
you also need to install the .net runtime on all of your servers.
Re:The End of IKVM.NET by johncolanduoni on Saturday April 22, 2017 @07:48PM (#14175567)
That's not what IKVM does. It transpiles JVM bytecode to .NET CIL so you only need one virtual machine.
Re:The End of IKVM.NET by rsynnott on Saturday April 22, 2017 @10:07PM (#14176037)
Java code is, of course, managed. In any case, this isn't a wrapper for Java code running in a JVM; it's an implementation of Java for the CLR.

Not sure what makes you think Oracle's JVM is slower than the CLR, in any case...

Re:The End of IKVM.NET by maxxxxx on Saturday April 22, 2017 @07:49PM (#14175577)
It depends on what you are doing but there are a ton of libraries in Java that have no equivalent in .NET. For a lot of projects it would be very useful to use Java libraries.
Re:The End of IKVM.NET by cm2187 on Sunday April 23, 2017 @01:18AM (#14176657)
Out of curiosity would you mind providing a few examples?
Re:The End of IKVM.NET by shouldbworking on Sunday April 23, 2017 @02:25AM (#14176849)
Since Java is the most similar language and what I'm familiar with, here's some things where no C# equivalent exists:

Lucene, Guava, Apache Commons, Redis driver, Postgres driver, Cassandra driver, Kafka driver, gRPC, Http2 support(on all platforms, not just windows 10)

Notice I said "equivalent". C# ports exist for some of these but they're unofficial, unmaintained, or both. The most heinous thing I've seen MS do recently is only support Http2 on newer versions of Windows. Http2 is a high level protocol and there's absolutely no reason for this. In Java you can use Http2 on any platform using Jetty, Netty, or soon built into Java 9.

Re:The End of IKVM.NET by voltagex_ on Sunday April 23, 2017 @04:29AM (#14177157)
I think you're being a bit unfair.

I am not properly familiar with Guava, but aren't most things available in .NET's collections classes?

A lot of what's in Commons is available in the .NET BCL.

https://redis.io/clients#c looks fine to me (I'd probably pick the StackExchange client)

NPgSQL seems to be the recommended library for Postgres.

https://www.nuget.org/packages/CassandraCSharpDriver/ was updated in February.

https://github.com/Microsoft/CSharpClient-for-Kafka starts to show some of the issues you're talking about - Microsoft aren't supporting this one anymore, but they point to https://github.com/confluentinc/confluent-kafka-dotnet which wraps librdkafka - seems sensible

I'll definitely give you a point for the HTTP2/IIS issue - although there might be more technical reasons than you think for that. From what I recall, a lot of NET and Windows HTTP stuff is implemented in http.sys or WinHTTP which is a low level component. They're not going to ship a large update to anything before Win10, so that's probably why it's missing. In this case I'd just run nginx in front of IIS if you needed to, but I'd hope that most people running IIS in production can afford to update to Windows Server 2012 or 2016.

Re:The End of IKVM.NET by shouldbworking on Sunday April 23, 2017 @05:39AM (#14177368)
Guava/Commons contains a lot more than collections. The standard class library in .NET has maybe a third of what's in Guava. Keep in mind that Java's built in library is probably just as big as C#. I won't bore everyone going over the list but check out the summary https://github.com/google/guava/wiki

Things I've used recently include Guavas automatic argument tester, in memory caches/queues, high speed hashing algorithms, and Bloom filter. None of that stuff has real equivalents in C#.

That redis client looks solid, so I may got a bit carried trying to prove a point. The Postgres driver looks good too, but is not officially maintain by the PG team so it could evaporate some day. The Java equivalent IS an official Postgres driver. I see this with C# frequently, it's treated as second class by a lot of OSS projects.

You didn't make a counterpoint to Lucene, I assume because there was really no equal out there for C#.

These days tying your language to Windows, visual studio, and IIS is unforgivable. MS is trying to undo this with .NET core but for the time being I find it rediculous to need to pay for all these licenses. If my employer wasn't paying for my enterprise edition of VS and copies of IIS, Windows Server, and SQL Server I wouldn't be touching C# at all.

At home I use OpenJDK with eclipse and Dropwizard running on Linux with Postgres. The quality of the tech is the same and everything is free and open source.

Re:The End of IKVM.NET by maxxxxx on Sunday April 23, 2017 @09:26AM (#14178061)
That's the thing. With .NET and windows you are second class citizen for a lot of open source stuff. A lot of the latest and best stuff is done on Linux and often on Java.
Re:The End of IKVM.NET by maxxxxx on Sunday April 23, 2017 @09:22AM (#14178052)
I did a project around full text search and the amount of libraries in Java was just staggering whereas with .NET you often only had some half baked port that was way out of date. I don't think too many researchers do their stuff in .NET. It's Java or something like Python.
Re:The End of IKVM.NET by kuschku on Saturday April 22, 2017 @07:54PM (#14175595)
I’m sorry, could you expand on that?

I’m not sure if I’m understanding you correctly, that you’re saying Java is slower than .NET, and the JVM more vulnerable than the CLR?

Re:The End of IKVM.NET by Pharylon on Saturday April 22, 2017 @08:56PM (#14175809)
Lat time I played with Java was in 2015. It seemed like there was a new JVM zero-day every month, and every time I upgraded, the Java installer tried to install the Ask toolbar.

After that, I started joking that installing malware one way or the other was Oracle's primary goal.

Re:The End of IKVM.NET by rat87 on Sunday April 23, 2017 @05:34AM (#14177350)
a JVM browser plugin zero day, totally unrelated to java for server programming
Re:The End of IKVM.NET by maxxxxx on Saturday April 22, 2017 @10:06PM (#14176030)
Considering that Java runs on many more servers than .NET it can't be that bad.
Re:The End of IKVM.NET by tracker1 on Sunday April 23, 2017 @12:08AM (#14176439)
Compared to most of today's more recent frameworks, that doesn't mean it's actually great. And while I appreciate the direction of .Net (Core), I am hoping the integrated tooling story gets a bit better (outside VS for windows). Code is okay, but not great, and other editors are mostly non-starters. Installing VS for Mac was a horrible experience that had to be done via manual steps for all the dependencies, etc.

My understanding is Java tooling has gotten better, but being able to setup a hello world application in Java, or any established application without a ton of weird dependencies to discover always seemed painful, and "Enterprise" .Net applications didn't feel much better.

Today, my world tends to mostly center around Node.js and git... I've dipped my feet into some new .Net bits, and a little bit of go, and that's about it. I find the learning curve steep, but the actual implementation WTFs are nearly non existent. With Java/.Net it's always been a relatively steep learning curve (worse with Java) and a lot of WTFs along the way.

Re:The End of IKVM.NET by kuschku on Sunday April 23, 2017 @04:20AM (#14177139)
Eh, lol?

Setting up new applications in Java or .NET is by far easier than Node.JS.

It's Node.JS where you need 400 dependencies just to use the latest version of the language.

That said, there's many easy to use and simple frameworks for Java, and you can try also other JVM languages such as Kotlin, Clojure, Scala or Eta.

The JVM hosts the most powerful and fastest managed languages at the moment (via eta and clojure also allowing haskell and lisp on the JVM).

.NET is nice, but there's quite a few reasons why Java is used everywhere.

Re:The End of IKVM.NET by dagw on Sunday April 23, 2017 @06:28AM (#14177522)
Setting up new applications in Java or .NET is by far easier than Node.JS

I'm far from a node fan, but that is simply not true. When it comes to going from zero to a "Hello World" webapp (super simple rest api that grabs data from db and returns as JSON) nothing really beats node in my opinion.

Install npm, npm install express (or restify), npm install database-driver (and there are drivers for everything), type a dozen lines of code into a single file and you're done. Sure npm is probably doing some crazy things with dependencies in the background, but you don't have to worry about it to just get started. Doing the same with Java or C# is much more involved.

Of course going from there to a large complete application is far from equally trivial and I definitely prefer working in something else in most cases, but node has the whole getting started experience down pat and that's probably the reason it's become so popular.

Re:The End of IKVM.NET by kuschku on Sunday April 23, 2017 @10:32AM (#14178300)
Much more involved? With Java and co it’s literally the same.

You add two dependencies to your gradle, write a dozen lines of code, and you’re done.

Even if you go full enterprise it’s not much more. Let’s go full Java Enterprise:

    // Enterprisify everything!
    compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: '1.5.0.RELEASE'
    compile group: 'org.springframework.data', name: 'spring-data-jpa', version: '1.11.0.RELEASE'
    compile group: 'org.springframework.data', name: 'spring-data-commons', version: '1.13.0.RELEASE'

    // persistence framework
    compile group: 'org.hibernate.javax.persistence', name: 'hibernate-jpa-2.1-api', version: '1.0.0.Final'

    // database driver
    compile group: 'org.postgresql', name: 'postgresql', version: '9.4.1212'

    // to auto-generate getters, setters etc.
    compileOnly "org.projectlombok:lombok:1.16.16"
Now we’ve imported spring, our database driver and an ORM. Let’s write the code.

First, let’s config:

    // application config
    spring.application.name=ourapp
    server.port=8090

    // database config
    spring.datasource.url=<our database url>
    spring.datasource.username=<username>
    spring.datasource.password=<password>
    spring.datasource.driver-class-name=org.postgresql.Driver
Then add the database layer, defining our model:

    @Entity @Table // To auto-generate mapping for the ORM
    @Getter @Setter // To auto-generate getters and setters
    public class Book {
      @Id
      private long id;

      @Column
      private String name;

      @Column
      private String description;
    }
And our access layer:

    public interface BookRepository extends CrudRepository<Book, Long> {
      Optional<Book> findById(long id);
    }
And our application:

    @RestController
    @SpringBootApplication
    @EnableJpaRepositories
    public class OurApplication {

      @Autowired private BookRepository books;

      @RequestMapping(path = "/{id}")
      public Optional<Book> getBookById(@PathVariable long id) {
        return books.findById(id);
      }

      public static void main(String[] args) {
        SpringApplication.run(OurApplication.class, args);
      }
    }
So. This is if you go full insanely Java Enterprise, want full Spring, and everything. If you choose sanely, it’s obviously far less code.

Notice how I don’t have to use any transpilers, etc, and still get typing and the latest language features.

Re:The End of IKVM.NET by kuschku on Monday April 24, 2017 @05:43AM (#14182995)
You can downvote this, sure, it’s now so far down that most users can’t see it anymore.

But that doesn’t change the facts. Good luck getting modern JavaScript or TypeScript, without using any templates, in equal or less LOC, and easier to understand for a newbie, than my Java Spring Enterprise example below.

JavaScript is easy if you want to do tiny things, but as soon as it gets to larger projects, it has the same issues as PHP and other similar languages. Every language has some things it can do better, and some it does worse. Until JavaScript development slows down, and the compilation pipelines standardize, and there’s simpler ways to handle that, setting up a node.JS project will always be more work than a language where that has already happened.

Re:The End of IKVM.NET by tracker1 on Tuesday April 25, 2017 @04:38PM (#14197738)
I've done some relatively large projects in Node... though I tend to break things down into discrete components either based on deployable assets, or reusable assets.

Node pipelines are pretty nice, not quite as nice as go's channels, but nice none the less. There are different options depending on libraries. I don't find it to be significantly more cumbersome than C#/.Net (which I have more experience than with Java). Also, your "example" has a LOT of assumed knowledge, more than a relatively simple express app, that's for certain.

It really depends on the approach.

Re:The End of IKVM.NET by kuschku on Tuesday April 25, 2017 @06:25PM (#14198703)
Well, I don’t think so.

I had never worked with Spring or Java Enterprise, and could write the example after 1 hour of reading docs.

After years of working with vanilla JS, and weeks of reading docs, I still can’t get a typescript compilation and CSS/SCSS compilation and minification pipeline right. Seriously, I still can’t get it working.

Re:The End of IKVM.NET by tracker1 on Wednesday April 26, 2017 @03:24AM (#14201116)
I've had better luck with flow over typescript, though frankly, I don't use either... I used flow instead of typescript for an angular 2 project a while ago. Not sure if the webpack story for typescript has improved.

I've managed to get webpack + babel + sass working pretty readily, in about the same time you mention above.

Re:The End of IKVM.NET by emodendroket on Saturday April 22, 2017 @09:55PM (#14176001)
I don't think Java is really much slower than .NET code.
Re:The End of IKVM.NET by shouldbworking on Sunday April 23, 2017 @01:30AM (#14176695)
It's faster. The JVM is almost always faster than the CLR, look at the techempower framework shootouts. .NET core is fast but regular .NET get destroyed by multiple Java frameworks.
Re:The End of IKVM.NET by Haldir on Sunday April 23, 2017 @01:57AM (#14176778)
The techempower Benchmarks are related to ASP.NET core, that one you can use on Desktop too.

The coreclr is only maybe 10-15% faster than Desktop, but not a magnitude or more compared to old ASP.net.

I don't think that the clr is slower than the jvm, but quite a few basic frameworks are compared to their Java counterparts

Re:The End of IKVM.NET by shouldbworking on Sunday April 23, 2017 @02:16AM (#14176832)
Look at the older techempower benchmarks where they include the regular .NET framework. It's slow as hell compared to java.

And yes that's the problem. The CLR itself probably isn't slower than JVM but most of the .NET stack is. It just wasn't written with performance in mind.

Re:The End of IKVM.NET by emodendroket on Sunday April 23, 2017 @06:20AM (#14177499)
> The CLR itself probably isn't slower than JVM but most of the .NET stack is. It just wasn't written with performance in mind.

I don't really think that's true.

Re:The End of IKVM.NET by venture_lol on Saturday April 22, 2017 @11:02PM (#14176229)
What makes you think it is even slower? Care to show real numbers?
Re:The End of IKVM.NET by emodendroket on Sunday April 23, 2017 @06:20AM (#14177497)
I don't.
Re:The End of IKVM.NET by venture_lol on Saturday April 22, 2017 @11:03PM (#14176231)
Yeah, because as a .NET developer, you would not of course know all about Java :)

Right, tell me the ecosystem of .NET vs Java and deployment statistics...