8 ms·
As a nodejs developer: what is the best compiled server language to learn right now? Is it Java still, or is it better to look at go or rust?
by gentleman11 7y ago
As a nodejs developer: what is the best compiled server language to learn right now? Is it Java still, or is it better to look at go or rust?
- deleted 7y ago[deleted]
- csande17 7y agoPart of me wonders if ASP.NET will make a comeback. A lot of the historical reasons not to use it don't exist anymore (there's an officially-supported Linux port, for example), and a lot of the cool new JavaScript language features like async/await and arrow functions came from C#. Besides, most JavaScript programmers are already dependent on Microsoft products like TypeScript, NPM, and Visual Studio Code. What's one more?
- sk5t 7y agoI imagine nobody knows what "ASP.NET" means nowadays as distinct from C# / .NET Core.
- tluyben2 7y agoASP.NET Core has been running fine on Linux and Mac OS X for years now. I have been building backends in it for those same years using Linux mostly. The ecosystem is nice and stable (been run high traffic APIs in production for years which never have any issues) and code written years ago simply works without issues after updating libs/runtime to the latest version (Even from 2.1 to 3.1 we had barely any work). Unlike RoR or JS projects I maintain which break quite a lot on update.
- Nullabillity 7y agoIt starts, yes, but the experience is still as miserable as on Windows. They just brought the Windows idiocies with them. The debugger (clrdbg) is still artificially restricted from running inside anything else than MS' IDEs. The global certificate store is still a thing. On that note, the cryptography support varies wildly between platforms, because they still insist on using SChannel on Windows. And I guess that means that they have to use SecureTransport on macOS, to avoid appearing to play favourites or something. The action at a distance that it encouragtes would make you think you're in a haunted house. Despite bringing the Windows mentality with them everywhere, there still isn't a competent migration story from Framework, so what's the point? Legacy code is still a pain to port, and you'd be crazy to actually want to write new code in this mess.
- eitland 7y agoI've used it as well and it is really really nice, especially on Linux as it starts extremely much faster there which was important for my work. It is still not in the same league as Java when it comes to dev tools and the Java ecosystem keeps getting better as well, but at the moment I am torn between the two (or rather, I have two excellent options that I can choose depending on circumstances.)
- tluyben2 7y agoI agree: I also work with Java and JVM languages and I was a fulltime Java dev for 10 years before but the first client (a bank) on our product insisted on .NET 7 years ago and we had some .NET expertise already and went all in. .NET Core is nice enough to do very large projects in though so I cannot see many reasons of moving away from it (especially from F# which I mostly use now).
- gentleman11 7y agoIs it open source?
- csande17 7y agoI think so! They have a repo called "ASP.NET Core" on GitHub with an Apache license: https://github.com/dotnet/aspnetcore https://github.com/dotnet/aspnetcore . ("Core" here means that it's the version of .NET that can run on Linux.) The "dotnet" organization also has repositories for the C# compiler and runtime.
- leosarev 7y agoYes! Compiler, sdk, runtime and framework.
- Nullabillity 7y agoKind of? Vital parts are still closed (like the debugger), and the tooling still assumes a closed-source world (for example, with OmniSharp, jump-to-definition to dependencies just gives you a synthetic source file that only contains method signatures). It's also not exactly run like a community project. The issue tracker feels more like a customer support system: "can you try updating to the newest release now?" abound, with no mention of what the actual problem or fix was.
- pjmlp 7y agoComeback? It never went away. From where I am standing it has always been either Java or .NET since the last 20 years, while we keep seeing stuff coming and going every couple of years.
- tehlike 7y agoC# is pretty decent. Has been since the get go.
- wvenable 7y agoBest is highly subjective and entirely dependent on what you want to build. I find a lot of joy in working in C# and the .NET core. It's very pleasant to work in and might be worth a look.
- wildduck 7y agoVery interesting. I have heard that from some people as well. Any tips on how to get started in *nix/FreeBSD/Mac ecosystem? Last I tried was in mono. Any tips appreciated.
- wvenable 7y agoIt's super easy to download and get started on Linux/Mac: https://dotnet.microsoft.com/download/dotnet-core/3.1 https://dotnet.microsoft.com/download/dotnet-core/3.1 I even managed to get it to run on an Android tablet via Termux by downloading the ARM64 binaries.
- jitl 7y agoIt depends on a lot of factors. I’m a typescript Dev and I’m really enjoying working in Kotlin. I certainly enjoy how expressive it is compared to Go, and I picked it up in a couple of days in an existing codebase, so it’s much easier than Rust. I think you can’t undersell how good the JetBrains IDE makes the programming experience with code completion, auto-imports, corrections, or how great it is that Kotlin interfaces with Java seamlessly.
- spockz 7y agoFunnily enough Scala provides the same feature set. However, because it is even more powerful than Kotlin there are also more ways to achieve the same goal. Doing any of the advanced stuff makes it hard to use that Scala code from Java. Using java from scala is easy. And still kotlin appears to be gaining ground on scala.
- mwcampbell 7y agoIn my limited experience, Kotlin seems to have smoother Java interop than Scala. For example, last time I checked, Java getter/setter methods automatically become Kotlin properties, and vice versa, whereas Scala has its own convention for getters and setters. Is that not the case now?
- gaogao 7y agoTo learn for what goal? For education, for enterprise, for speed? To which my shortlist is Haskell, C#, and Rust.
- didibus 7y agoJava is still the largest and most in use server side language at 39%. It is followed by C# at 32%. After that, you have Go at 9%, Kotlin (also a JVM Lang) at 6.6% and Scala (also a JVM Lang) at 4%. Finally, you get Elixir and Clojure both at 1.5% Source: https://insights.stackoverflow.com/survey/2019 https://insights.stackoverflow.com/survey/2019 So yes, I think learning Java and the JVM ecosystem is a good investment, considering Java dominates, and if you tally up JVM langs you get something like 51% of professional developers using a JVM based language for work.
- jimmaswell 7y agoThis up-to-date one seems to be putting PHP in a large lead with C# then Java following: https://w3techs.com/technologies/overview/programming_language https://w3techs.com/technologies/overview/programming_langua... We've drifted from just compiled languages here, but the most important server-side language to know is probably PHP. Personally I've really enjoyed working with Drupal.
- gentleman11 7y agoI always thought php was just a templating language. Any recommended books or resources?
- didibus 7y agoSorry, I assumed parent meant backend and web services, like REST, GraphQL or RPC APIs, and not server side HTML rendering, that's why I excluded certain languages like PHP. I also skipped over interpreted languages like Python and Ruby since they mentioned compiled. Also, that doesn't look like a great metric, since it's just the number of website using a particular technology. That's going to be massively skewed by prefab solutions like WordPress and all. I liked that the StackOverFlow survey asked people what language they used professionally. I feel that's much more relevant.
- jimmaswell 7y agoPHP is used for REST and all that just fine. Why are you excluding it from "backend and web services"?
- _delirium 7y agoMaybe I'm missing the intended distinction, but in normal usage, Java is also a JITted language. It's almost the canonical one... JITs are much older, but HotSpot really popularized the concept in mainstream production.
- kizer 7y agoJava’s bytecode is JITted, which is a subtle distinction since there is an AOT translation step capabale of optimizations etc.
- _delirium 7y agoTechnically yes, but the AOT step in practice does almost no optimizations and is just a direct translation, at least if you're using the mainstream javac. It's there just to simplify the VM/JIT, so the latter can read bytecode instead of textual source code. There have been attempts at AOT compiling Java, but afaict they have very little usage. GCJ, now dead, was the main one for years. There's also a newer experimental compiler jaotc: https://openjdk.java.net/jeps/295 https://openjdk.java.net/jeps/295.
- kizer 7y agoYou seem to have more familiarity than me with Java :). So I guess V8 JITs some kind of p-code then? If V8 allowed full AOT comp. to the internal bytecode, then the perf would theoretically be around Java’s avg perf?
- earenndil 7y agoNope, because java is statically typed.
- laurencerowe 7y agoAvoiding the source parsing step would only provide a startup time performance win. JS engines tend to be faster than Java here already since it's something they've been heavily optimized for. It's difficult for JS engines to match Java's performance without type information to work with. This is only discovered at runtime and the JIT'ed code for a function requires traps in case it is later called by parameters of a different type.
- on_and_off 7y agokotlin is pretty neat to work with. In the end it is all bytecode (so java, or rather both java and kotlin output bytecode), but kt removes a lot of the ceremony, boilerplate, and altogether ideas that have proven to do not be that great in the years since java's inception.
- vips7L 7y agoThis is no longer true. Java has eaten a lot of the features Kotlin once had. The only things not provided by java are nullable reference types and coroutines (coming).
- pjmlp 7y agoSome people on Android bubble keep mistaking Android Java for the real deal.
- on_and_off 7y agomeh, java has indeed eaten a lot of the features that kotlin has (why do you use past tense ??). However, the java version is not necessarily as convenient, concise or powerful than Kotlin. E.G. I strongly prefer data class to records. No named parameters -> no default params -> way more boilerplate
- DethNinja 7y agoIn my experience Go is amazing for webserver development. Very easy to learn and you can build things very quickly. However, I still use C++ for extremely complex networked applications where performance matters, unfortunately Rust doesn’t have battle tested crypto libraries, so I wouldn’t personally use it for networked applications.
- gameswithgo 7y agojust use the c libraries from rust?
- boulos 7y agoOr use rustls, if you just need modern TLS. I found this back and forth of rustls vs native-tls (which picks up openssl/your favorite system ssl) helpful: https://users.rust-lang.org/t/any-reasons-to-prefer-native-tls-over-rustls/37626 https://users.rust-lang.org/t/any-reasons-to-prefer-native-t...
- ilammy 7y agoThere a few wrapper libraries that provide safe Rust interface for a limited feature set on top of system's crypto libraries like OpenSSL, so the applications can benefit from decades of testing and get security updates without timely rebuilds. I'm maintaining one, for example, which has Rust bindings among 12 other platforms.
- eatonphil 7y agoGo's lack of generics makes it better for write-once, run-forever systems like proxies. It's not as ideal for application servers that will otherwise need a lot of code duplication via code generation (to be type safe) or nil interfaces (to throw away static typing). Code generation isn't so bad. Even JOOQ (Java's awesome ORM) will suggest you do it. And similarly, Java's generics aren't that great themselves. But you come to expect more from a newer language with so much history to learn from and they missed the ball on generics. (In contrast they got right: gofmt, go test, cross platform builds, go get, etc.)
- Skunkleton 7y agoIf you are are looking for a mature high performance language to keep in your back pocket for the cases where you can't use node, Java seems like a fair bet. Go would also be useful. Neither are too much fun IMO, but that would fit the bill. There are newer languages that are more interesting, but picking one of those is more about either attempting to anticipate where the industry is going, or just plain wanting a more fun language. Rust is an example here. Personally I think rust is worth learning, and has a fair shot at taking over a large chunk of software development that would have previously gone to C or C++. Learning rust might make you a better programmer because lots of poor-programming-hygiene type things are compiler errors in rust. If you just want a way to wring maximum performance out of a piece of hardware, then I would caution you to consider your choice carefully. Writing high performance code requires a complete understanding of the stack underneath you. If you want to see my point in practice go check out the programming languages shootout. Specifically notice that there are benchmarks implemented in "fast" languages that are outperformed by better optimized code written in "slow" languages. I would recommend against C++ unless you are planning on devoting a very large amount of time to learning it well. I also don't personally like C++. Too many footguns.
- saagarjha 7y agoJava has a JIT too…
- pjmlp 7y agoAnd AOT as well.
- acqq 7y ago> notice that there are benchmarks implemented in "fast" languages that are outperformed by better optimized code written in "slow" languages. I haven't observed that, at least not where one can't write a "better optimized" code in the "fast" language too. Can you give any specific examples?
- Skunkleton 7y agoSorry, I wasn’t clear. On shootout they have multiple implementation of each benchmark in the same language. The fastest implementations are always fast languages, but there are lots of implementations in fast languages that are bested by better implementations in slow languages[1]. The point I was trying to make is that picking a fast language isn’t enough to write truly fast programs. 1. https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/mandelbrot.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- smabie 7y agoI would say Scala, or maybe F#.
- fulafel 7y agoJS is also frequently a compiled language these days. What makes you qualify the question this way?
- sideeffffect 7y agoCheck out Scala! It has modern features and the tooling around it is mature. If you like books, this should be a good intro: https://underscore.io/books/essential-scala/ https://underscore.io/books/essential-scala/ (you should use IntelliJ IDEA instead of Eclipse, though) And you can also use it for frontend development: https://www.scala-js.org/doc/sjs-for-js/es6-to-scala-part1.html https://www.scala-js.org/doc/sjs-for-js/es6-to-scala-part1.h... (having one language for both backend and frontend leads to great synergy)