Hacker News new | ask | show | jobs
by ecshafer 828 days ago
It isn't a "Sexy" PL change, but a full foreign function interface will be a huge change. In my experience, relying on the old java JNI based libraries seems to be one of the biggest things that break in upgrades. So I am hoping this will reduce the maintenance burden of Java.
1 comments

Boring changes like these are what keeps Java interesting.

New and shiny syntax sugar becomes stale real quick.

As a modern language Java is still quite feature deficient. But you can use compiler plugins like the manifold project[1] to level up.

1. https://github.com/manifold-systems/manifold

I see Manifold as a huge leap past previous tools Immutables or Lombok. I understand there's a use case where you want to add these language features to an existing code base. But for the most part if you want the language features on the JVM, you should probably just use Scala. That gives you a set of established patterns, best practices, libraries, and a community of users.

If you want type safe SQL in particular, you can pry JOOQ out of my cold dead hands.

> just use Scala

Scala is a dying language, anyone boarding that ship is making a mistake. Anyhow, I prefer Java supplemented with powerful features Scala doesn't have, such as type-safe SQL.

> If you want type safe SQL in particular, you can pry JOOQ out of my cold dead hands.

Jooq isn't bad, but it's not SQL, it's Java trying to be SQL. Manifold lets you write type-safe, native _SQL_ of any complexity directly in your code.

I have never seen anyone use manifold. Are you saying that I should use something like that in a serious production environment over Scala, that is a huge language with people that actually know it?

Especially that you call it a dying language, when it just got reborn, and better than ever with Scala 3.

> Jooq isn't bad, but it's not SQL, it's Java trying to be SQL.

Can you elaborate on this? I have been using JOOQ for years (with Kotlin), and I have never had any issues with it "trying to be SQL".

once you write jvm language you can't really be dying language. how can yoy die if you can use all jvm tech stack. Its just all about syntax. You can write powerful state of the art software even in brainfuck as long as it compiles to jvm bytecode
> powerful features Scala doesn't have, such as type-safe SQL.

What? This site is getting worse by the day.

I'm not 100% sold. I like some of it's features (e.g. the mentioned typed SQL safety) but adding all of it seems super heavy-weight. Lombok took a good time to become widely accepted and I don't think this will ever appeal to more than just a niche audience.

At the very least, I prefer not to have any surprises in my codebase because it looks like Java but isn't quite so really.

> I'm not 100% sold.

The vast majority of people that use it aren't, but that's a feature :)

Manifold isn't an all-or-nothing proposition. It's architecture is modularized so that you can select the parts you want à la carte as separate dependencies in your build.

> At the very least, I prefer not to have any surprises in my codebase

But manifold surprises are pleasant ones :) As with any library or framework, it's a design decision: does it provide enough productivity and opportunities to offset its presence in your project? It's not a panacea.

> Manifold isn't an all-or-nothing proposition. It's architecture is modularized so that you can select the parts you want à la carte as separate dependencies in your build.

Oh that's neat! Didn't sound like it when I was skimming over it. I'll keep it in head next time a pet project comes along :-)

Manifold isn't Java.