118 points · by MrBuddyCasino · 1y ago · 271 comments
Can I tell you about live debugging of an app server and hot reloads? Pretty wonderful stuff really.
I can't believe how much knowledge, tooling and experience was thrown in the dumpster when Java was abandoned en masse by the younger generation of devs due to the rise of node.js. And if it weren't for Typescript the tooling would still likely suck.
It’s easy to say “because they’re hipsters following trends” but I dipped my toe in the Java world years ago and found it immensely frustrating. Eclipse was awful compared to the lightweight editors I was using at the time. The language got in my way more often than it helped me.
I’m sure that’s not the case these days (indeed I’ve done a little Android-adjacent stuff and found it to be fine) but the idea that there were no downsides to Java at the time strikes me as unlikely.
Since Java was developed the world has shifted to accommodate a lot more rapid development and code you throw away rather than maintain. But experienced developers also know how often "prototypes" are still around decades later.
Java is also not perfect, and a lot of new languages are conscious of its faults. But the reason it's still around is that it's core principles are oriented to code that sticks around.
I wasn't fond of JavaScript (In particular, I never liked dynamic typing), but when I had the opportunity to work in node.js instead of Java I took it immediately, just to avoid the pain and suffering that the Java toolchain inflicted on me.
And talk not to me about lightweight. I'm currently on Day 4 of setting up a Python environment in VsCode that doesn't suck. I'm nearly there though it's still a bit inferior to a 20 year old JBuilder install for Java but I guess it needs a few more years to get there. Oh and as I said, I'm on a long quest here to pave the road for my devs but it looks like this hodgepodge of extensions still won't deliver the experience I had decades ago.
Java today looks like a fine platform, though.
I've grown up a bit since then, and so has Java. These days I work in Java for my day job, and it's perfectly fine. I don't even mind all the boilerplate, I can look at a page of code and just see blonde, brunette, redhead.
But I still love Common Lisp and Scheme much more.
The second thing however is that fronted is better off in non-java languages, you can afford to do small backend in typescript and what not. And larger enterprise projects were done in java the whole time.
Got in the way how? By insisting that things have types and one cannot blindly add an object to an array [] + {} and expect it to behave? Never mind that in Javascript adding an array to an object {} + [] gives a different result.
ETA: for bonus points, what does {} + {} return?
I hear Java has gotten a lot better. But then again there is C#, which is pretty much just better Java. Still too enterprisy for the tastes of most HN types though
Last I checked If I change a signature or something in Java, I am not guaranteed the whole thing "checks". If I add a new exception to a function, how do I know what else is effected?
I give it five years until Typescript and peers adds checked exceptions.
.NET has also had all these features for just as long, and is less prone (though definitely not immune) to AbstractFactoryProxyBean nonsense.
We tried. Java was fine, JBuilder was fine. When they instead started pushing J2EE, EJB and all the other acronyms I've forgotten, this 'youngster' realised he'd never be smart enough to be a Java developer and bailed back to C, Perl and Python.
Had they focused on Java and making Java a great language in its own right, it no doubt would have gone a lot better. But all the 'hype' and marketing around Java was focused entirely on these huge frameworks and enterprise 'solution' architectures which most 'youngsters' just didn't understand and didn't see the need for.
If someone makes it clear their product isn't for you and that they don't care about solving your problems, is it strange they abandon you?
do you mean rmi/javabeans or something else ?
beside that, I left java long ago, and believed in simpler REST stuff but now I realize that it's indeed rediscovering stuff people dealt with long ago
As for rmi, when Java was in its heyday the most popular protocol for remote api handling was SOAP. But when RESTful era arrived Java tooling adapted very quickly and it made little difference what you were using to call outside the app server.
And that's the exact reason I'm done with it.
Typescript is somehow becoming a laguage that supports writing extremely performant high throughput and very scalable server code? That seems unlikely. So no worries, it can't become Java.
I haven't used it for a long time, but it's still alive: https://www.gwtproject.org/
I feel like there's an adjacent universe where the JVM lives in every browser and JS was a weird failed experiment. But it turned out that the browser was the universal UI everyone had waited for, and Java didn't connect to it while JS entrenched itself there.
GWT was a glimpse of trying to send us to that universe, via a twisty back door. But it was never gonna happen.
I thought JS was bad at the time, but node.js was a breath of fresh air for API development, and client side JS has been fine for like 10 years (assuming you care about UI development).
I'd never go back to Java except for maybe some backend service away from the UI.
I like to say that the main value of GraphQL was never really in the dynamic queries (in many ways an anti-feature) but rather in having a nice typed spec that lets you generate typed clients.
https://oxide-and-friends.transistor.fm/episodes/the-fronten...
Only extra step is running a tool to download the swagger and produce auto-generated typescript definitions, otherwise the workflow is the same as shared code (Some projects are typescript on both ends but C# gives a ton of other benefits for backends).
Like mentioned, our regular pipe is C# producer (server) and TS consumer (client). Consuming services authored in Java,etc is usually not a problem either but the TS system definetly has a bunch of more cases that aren't easily mapped.
Alternatively you could go the openAPI route and declare your API as a spec with types for a client to consume and the endpoint to return. This works cross-language and gives you docs first. (Start from the docs, convert that to types, then implement).
I also thing that the tooling hasn’t kept the same pace as it has with graphql, where it’s easy to document your schema and the inspector makes it super easy to play with.
I have found that the tooling tends to have the problem of not knowing how to catch edge cases like webhooks, websockets, complex auth and additional logic beyond just an HTTP request. Many tools add layers of configuration and extension to work around these, but i feel it misses the mark.
I'm building Borea.dev to solve this pain by keeping the source of truth in your OpenAPI doc and allowing for custom code implementations. We support Python rn, are building out generators for multiple other languages and we're open source :P hope it helps
While I haven't gone too deep down this particular rabbit hole, if you build a Rust backend you can use function signatures and annotations to automatically build an OpenAPI specification for it. You can then consume that specification to automatically build a typescript client library, giving you an automatically updating Typescript interface to your Rust backend.
Similarly, there are multiple projects to automatically provide python type hints for your Rust python extensions. None of them really production-ready yet, but this is something people are actively working on for quite a while
There are tons of generators that can create a client with types from an OpenAPI spec. Not only to/from TS but also tons of other languages.
Have you ever seen Scala.js? Same language on the frontend and backend, in a way that actually feels first-class and real. Type system that's as powerful as Typescript but also sound. Full IDE functionality if you need it.
I have worked at 2 of those named companies where people made conscious decisions of moving away from TS backend because JS is an awful language to be used for system critical things.
I've been writing backend TypeScript for 8 years and it's more than fine.
It's not my favorite language but it's a great compromise, and I would never choose a Lisp, Haskell, Java or C over it (the other languages I know).
It was originally designed for writing throwaway frontend code, but people liked it so much that they started using it to build their system architecture—only to realize it doesn’t work well for anything beyond glorified RPC backends.
The type system is wishy-washy, and TypeScript needs a massive type space to compensate for it. Python is also dynamically typed, but it has a strongly typed system that saves you from runtime blowups. JavaScript doesn’t even properly blow up at runtime—you just get [object Object] or some random undefined error. TypeScript is a fantastic piece of engineering from the C# guy, but even they couldn’t fix all of JavaScript’s language-level blunders.
Few people want to build mission-critical backends on a weakly typed language.
The ecosystem is a mess, and things randomly break after a few days. My Python and Go apps from 2018 still work exactly as they did on day one. Go’s gorm and Python’s SQLAlchemy are the default ORMs that pretty much everyone uses. And how many ORMs does the JS ecosystem have?
And let’s not even start with frontend frameworks—no one loves them two days later.
The Next.js project I built yesterday is already showing 69 vulnerabilities. This sorry excuse of a language, coupled with terrible design and an indecisively childish community, makes it difficult to take seriously.
We built some stuff with Go and then went with full .Net. Its like fresh air after years of Js.
It seems like in almost all cases, you want to evolve in a forward compatible manner, with a very slow deprecation process.
Except for a nod to WASM, all the examples are about the JavaScript toolchain.
Besides Bun is not Rust even though Deno and some tools are. The JS crowd generally does not care about coding Rust, though would welcome faster tools which are sometimes rust based. Also Go based and even Zig based.
For example, you’ll still write your React components, but the React framework itself might be written in Rust and compiled down to WASM to make everything snappier (e.g. DOM diffing).
I personally really love this pattern because it strikes a balance between speed and DX. Not everything has to maximize performance, and not everything has to maximize productivity.
UV is a year and a day old. It's not surprising that there isn't huge industry adoption yet.
I sort of have the impression that Ruff does have a reasonable degree of industry adoption. Certainly linting does.
There mypy alternative doesn't yet exist in a usable state
I'm not seeing anything worrying here?
To add to the issue, a huge amount of Python in public repositories is untyped and unversioned- which means that LLMs are pretty bad at getting typing correcting in Python, so the debt is growing much faster than the solutions.
I honestly think that the most viable solution at this point for typing is a typescript-adjacent solution for Python. I’m kind of surprised Microsoft hasn’t put one out yet
Eg. My webpack builds in 35 seconds. The i try esbuild and it does the same job in 35ms. Insane! Ok now lets try rust, now i get 20ms. Wow!
Do i care about 35ms -> 20ms? Nope, not one bit. I just want it to compile under 1second.
It talks about projects like Rome as if they're current when Rome was archived a year and a half ago: https://github.com/rome/tools
I think it used to have one but it was lost in a site redesign a few months ago: https://github.com/leerob/site/pull/727/files#diff-888ddb306...
Why must we rehash this type of post every few months?
was between (js) and (go/C/rust)
See the problem to me is that this comparison isn't nice. Javascript comes with a lot of its problems , so of course people would want go / C / rust
but Now the author thus concluding that people want "the fastest" out of go/C/rust is just wrong.
I love golang.
People like fast software but hate abandoned software even more . Yes there are rustaceans who would love the project but now hand anybody genuinely interested to contribute a rust project and ask them to learn rust and they would come hating at you.
And now ask them to learn go. They can actually much easily do that.
I stand with this opinion that go code can be read / written by anybody. There is very rare bad go code but rust code feels "magic" to people.
Admire simplicity. That being said , I use archlinux with paru instead of yay , I use a lot of rust tools as well.
To be honest , to me it doesn't matter that much , what matters is if its being maintained stable / has active community. It could be written in any language just make it easy to embed / provide bindings for major languages like python node golang etc. Or though this might come overkill but I wish if there was some sort of glue code which can bridge languages , most of these glue code libraries end up having so many use cases. so I like the idea of wasm but its just not that performant. If we can have insanely performant wasm ...
it's of course very subjective, but for me golang feels more magic, especially with importing GitHub repositories like local files.
The easiest language is of course the one you already know.
i would also argue that it's easier to write bad go code (I personally wrote some of it while learning) in rust usually if it compile and your are not using unsafe, it's at least ok quality and clippy is great with guiding you how to improve your code.
to be fair JavaScript also is weird and different than OOP languages but from some time it tries to feel more traditional with classes and this handling.
wasm is already fairly performant in comparison to native code, it might lack in come cases like simd (there are extensions already, but I'm not sure about adoption) but generally it's only about 20% slower than native binary.
I'm not sure how much wasi is practical for cli tools, but using was for plugins to allow any language someone might be comfortable with seems like no-brainer to me (also isolation will allow you to control potential memory leaks and crashes so your application will not get corrupted or anonymously destabilised)
That would be nice. Instead we’re seeing all these JS/Python tools written in Rust - a complex language whose complexity comes providing memory safety without garbage collection.
Their authors are deliberately choosing to take on that complexity for programs where it’s unnecessary - programs which would work equally well with a GC.
Here on HN there is plenty of announces of new things “like X but in Rust” - even when X would be fine in Python or Bash.
The reason Rust and Go tooling is getting popular is because they are appropriate for the job.
C and C++ are riddled with footguns and non-ideal for this kind of tooling, Ruby and Python provide only disadvantages compared to current JS tools, Haskell and OCaml are good but too niche. And so on.
And the reason Rust and Go are getting usage in WASM is because they have a good WASM story. They are static, compiled and born at the right time. Other than C and C++, they're the only ones that put the effort.
The reason people are making projects in Rust and Go is because they are accessible to those people. For me both hit a sweet spot that none of the languages above do.
Fashion and hype has always played a big role in software and our industry has at times unwisely abandoned good technology in favor of the 'New hotness'. We gyrate between local apps and cloud apps, thin and thick clients, static and dynamic typing, micro-services and monoliths, relational databases and keyval stores. Our industry is not very rational and the best tools don't always win. Marketing and market effects (winners keep winning) play a big role.
Recognizing the role hype plays in our industry is not myopia.
The things people are shipping in Rust are stuff Rust is good for. As far as JS goes: mostly tooling.
Notice how virtually nobody is shipping websites in Rust. Sure there's frameworks and async, but we're not there yet.
The fact people are building libraries for servers, websites, gamedev, etc, in it is something that is required for experimentation.
People don't deserve the disrespect shown here for exercising their curiosity and trying to advance the field.
It is no different than those folks, now 20 years later, that adopt Typescript, but really the only thing they do is to rename the file extension, and keep writing plain old JavaScript as always.
JVM is like the Cologne Cathedral of the software world.
And supposing you took start time out of it, how long would an equivalent Java program take to run?
Memory isn't as much of an issue, but all other things being equal users do prefer the program that consumes less memory.
There is probably no language in existence that "ticks all the boxes". And this is good.
It has been the Most Loved/Most Admired language on Stack Overflow’s developer survey for 9 years in a row. I know that’s a relatively short amount of time for a programming language, but to me it seems like it has some serious staying power.
The DOM API is defined as a JavaScript API. The browser, JavaScript, and the DOM API have been evolving in parallel for over 20 years. If you want to interact with the DOM from WASM, what you can do is write a function in JavaScript that interacts with the DOM, and then import that function into your WASM module.
At least for now.
The existing workarounds for this glue the JS DOM API to the guest language through glue on both sides, but this means that you have to pay the penalty of marshalling through JS for every single call you make.
There's a solution in the works to make direct interaction possible, but it's proven to be quite challenging to finalise: essentially, you need a high-level ABI that can provide a safe and fast interface between the host and whatever guest language, and defining that in a way that makes everyone happy is non-trivial.
For more information, see the Component Model [0] and WIT [1]; the idea is that you will eventually be able to compile your WASM to WASM Components, which can then interface with the host (or other WASM components) through the WIT IDL, including interacting with the browser's DOM.
[0]: https://github.com/WebAssembly/component-model [1]: https://github.com/WebAssembly/component-model/blob/main/des...
No, not even that (the second thing, passing pointers)! WASM has a different address space (starting from 0), effectively indexing into the WASM module's linear memory. A pointer/reference from the outside env can not be dereferenced from within the WASM bytecode.
The multiple linear memory proposal can circumvent this (allowing you to build something somewhat similar to a simple MMU/address translation engine), but language support for that feature is sparse (AFAIK, Rust does not expose any way to access a different than the default linear memory for example).
There is various hacks around it, but sharing memory block-wise between WASM and outside env is involved already.
It's defined via WebIDL (https://webidl.spec.whatwg.org/) which is theoretically language agnostic, but practically speaking the primary implementation target is JavaScript.
Definitely leading the way in segfaults.
That doesn’t mean I’m under the delusion that JS is going away anytime soon; at least from the FE. But its monopoly on the web took a big hit—and rightfully so.
JS is a terrible language, and people who only know that one language will fight tooth and nail with anyone who opposes them.
This gave birth to the awful trend of using JS in the backend. I understand that sometimes JS is the only option for frontend work, but keep that junk out of my sysarch. There are better languages your backend can benefit from—Go, Rust, Zig, Kotlin, Python—anything but JS/TS.
I’m glad the industry has learned from its mistakes. I’m seeing far fewer Node.js backend jobs and a lot more Python, Go, Rust, and C# roles.
I’m also seeing a ton of Java, C#, and Go jobs in London. At my workplace, Wolt/DoorDash, all new services are being spun up in Go, where Node.js used to be the default.
Plus, LLMs have gotten really good at Node.js and Python, driving backend salaries down quite a bit. In this age, being a one-trick pony just won’t cut it anymore.
As for LLM's, from what I see the languages that LLM's are most often used for are those with the lower barrier to entry / and those that UNI's and bootcamps teach, which would very much also include Java. However, what I see is actually my salary going up as the average candidate quality has been also decreasing, almost in correlation with the usage of LLM's. So while maybe the junior/mid-level salary goes down, the senior salary, in my observations, has not. And I keep hearing from companies how finding actually capable developers has become harder and harder, so I expect my salary to only go up.
Now, of course, being a one trick pony has never been a good thing, I agree on that (did you assume that I'm a just JS dev?), but I was just answering to your original comment.
Right, famous developer Ryan Dahl who knows only one language.
Come everyone. C is dead, Javascript is dying.
Also it is used by the bigdiks, like facebook who can't make a proper comment system, yet they market react as another shiny thing. And Apple who always turn your bluetooth back on after update. And google, who act like inbred mutants thanks to the incest that is going on there. A W S, the three letter magic thing also uses it. Plus cloud!
And the list goes on! Plus it has fugly syntax, but who cares, it is memory safe!
Jump onboard, this is the future!