I've been working with a Javascript (+ TypeScript) + Java + SQL stack for the last 10 years.
For 2024 I'd like to learn a new programming language, just for fun. I don't have any particular goals in mind, I just want to learn something new. If I can use it later professionally that'd be cool, but if not that's okay too.
Requirements:
Runs on linux
Not interested in languages created by Google or Apple
No "joke languages", please
Thank you very much!
EDIT: I ended up ordering the paperback version of the Rust book. Maybe one day I'll contribute to the Lemmy code base or something :P Thank you all for the replies!!!
I have a couple of suggestions based on what you want!
Ocaml: A good intro into functional programming
The languages you've used seem to be primarily imperative style. Ocaml is not commonly used in the industry (with some exceptions), but it has a vibrant small community, and more importantly, because it's a functional language, it will be different enough from what you know. Even if you don't use it in industry, it will teach you a lot that would be hard to learn using non-functional languages.
Ocaml is a compiled language, with a very fast compiler and very good type system.
Scala: the only semi-mainstream language that blends OOP and proper functional programming well.
Although scala is mostly a functional language, it still has most of the gestures of imperative OOP languages like Java. It is also far more mainstream than ocaml and has used in industry.
Scala also runs in JVM like Java, and thus gives you access to most JVM libraries.
Rust
Intro into low level programming
Other answers spoke enough about Rust so I won't dive here
Zig
similar to Rust in low-levelness, but less mainstream, better C interop, and other interesting differences
Raku: the result of 15 years of programming language design
Raku, formerly perl 6, was almost redesigned from the ground up to resolve complaints of perl 5. It has a very interesting design, with a gradual type system, a blend of functional and OOP paradigms, plus interesting syntax features like sigils and grammars.
There are many interesting languages out there. I could talk forever about this, but I'll leave you with the above. I personally would recommend ocaml if you're interested in functional programming or care about performance. Otherwise, Raku, since its very interesting but doesn't perform well (Raku's VM is still immature and under development).
I can recommend Rust - I'm training a few people on it.
And a pure functional programming language like Haskell or Scheme, if you don't know what functional programming is, or are not comfortable with it. Functional programming needs a different mental approach to traditional (imperative) programming paradigm. Some of the more modern languages like Rust, JS and Python incorporate a lot of functional programming constructs. So it makes sense to learn them.
And a lisp - Common Lisp's popularity is a public secret. Scheme is also fine. This family is homoiconic (program and data are treated more less the same). The syntax is actually very close to its AST. This gives Lisp unparalleled metaprogramming capabilities - mostly through macros. Macros in traditional languages are nowhere near Lisp Macros.
If it interests you, study a stack based language like Forth or Factor. Though they feel very different from Lisps, they have similar underlying properties. And you get more or less the same advantages.
No jokes: pick a language that is in the market, but has a different design philosophy than your background.
Your background includes compiled static, and loose scripting, with strong library tooling, so you have diversity there, so a language in which you have to think differently is the right choice.
I recommend:
Rust if you want something safe but that makes you work differently from java
Go if you want a real mental challenge (the coding approach is very different from java)
Lua if you want really see functional programming as a philosophy
Python if you want scripting, and are tired of the web
It's a modern variant of lisp that runs on the JVM and has deep interoperability with Java, so you can leverage your existing knowledge of Java libraries.
But as it's a lisp, it will have you thinking about problems in a very different way.
Personally, the language that's taught me the most to learn has been Haskell. It has a lot of very interesting ideas and a learning curve that plateaus after most other languages. There are several ideas that have trickled down from Haskell to other parts of the programming world and learning about them in the context Haskell is in my opinion better because you'll learn about them in a context where they fit in with the rest of the language very well instead of being late additions that offer an alternate way of doing things.
Coming from Java and JS, Haskell has a very different approach to a lot of things so you'll have to re-learn a lot before you get productive in it. This can be frustrating for some but you'll learn more if you get over that hump on the other hand.
Haskell doesn't see very much industry use and arguably isn't very well suited for industrial application (I haven't used it professionally so I don't know personally) so it might not directly help you land any new jobs but it is in my opinion it's a very good way to develop as a programmer.
In short, it's ruined my expectations of languages. It's a functional language, like the style of Haskell, and transpiles to html or js (its meant for web). There's very little that it allows for going wrong, and for things that could fail, it either tells you to port that out to JS and bring it back when you're done, or you have to handle a Result type or Maybe type.
It sounds strict, yes, but not having to deal with issues later is so nice.
I’m a huge fan of Haskell and (for pragmatic purposes) Purescript. Purescript is hard to find much in the way of documentation but it is so similar to Haskell in that the steep learning curve is worth it, IMO. I rarely find a project that I couldn’t accomplish with one or the other or both.
I’ll suggest Elixir. It’s a language that runs on the same virtual machine as Erlang, which has proven to be great for ultra-reliable and excellent at managing many, MANY concurrent processes.
Elixir itself builds upon this great foundation with a syntax similar to Ruby, but entirely functional. It’s a delightful language to read and write.
In particular I'd recommend a Game Boy game, because GBDK uses SDCC and is fairly low-bullshit. With scanline interrupts, you have a surprising amount of time to do clever visual effects, flexing the machines one-and-a-half background layers. The machine is sufficiently explained in about forty-five minutes via the Ultimate Game Boy Talk.
(NES is also an option, but - don't. I say this with my NES homebrew project open in the other monitor. It's a miracle this thing ever caught on. You need a decent understanding of the hardware, C, and 6502 assembly, just to put stuff onscreen efficiently. And then the fillrate still blows. The Game Boy can blast the whole tilemap in a fraction of a frame if you cheat hard enough.)
If you want more power, the GBA supports C and C++, and that little fucker runs Doom. It's intended as a super-flexible sprites-and-tilemaps affair, like an SNES with an upgraded graphics chip. (And a downgraded sound chip.) You can scale and rotate dozens of sprites at 60 Hz, atop two scaled-and-rotated backgrounds. Or use fullscreen bitmaps in 8-bit or 16-bit color. (Well, 15-bit.) The homebrew scene for the GBA started before the console even launched, because it has a pretty standard ARM chip and will do anything the Genesis could without breaking a sweat. There was nearly a voxel heightmap version of Banjo Pilot that looked pretty damn close to Diddy Kong Racing on N64.
I recommend C and retro consoles because they're suited to one another - and they offer control. You are in command of every single byte on these machines. C is the ideal language for that. It offers familiar high-level structures. It supports familiar syntax. But it runs very close to the metal, and if you want to get even closer, it will let you.
I recently picked up Rust, still a beginner, but it's very nice.
And the compiler errors and tips are top.
Since I used only Python before, Rust is my first compiled language and I'm glad it was Rust.
Options and Result's are also something I appreciate tbh. Other than for AI, simple stuff and maybe prototypes, I would use Rust over Python. Definitely recommend it. The borrow checker is a pain in the ass though.
I'll also be using it later for embedded systems when I become more fluent with it. I am also currently making a big project with Rust that I haven't been able to do with Python.
Kotlin is the language to beat imo. Very expressive and full interop with Java. Structured concurrency so multithreading Is a breeze. Build mobile apps easily with it for Android (and in theory iOS but that's still alpha). Desktop apps too!
I see you mentioned JS, but not TS. If you haven't tried TypeScript, you 100% should! It helps a lot at scale.
Also, I really do recommend Rust. It's pretty awesome having the errors actually make sense, and it's not as complicated as the hype makes it out to be (until you get into async rust lol).
Odin is quite a fun new language I just started learning. It is meant as a C replacement and comes with a decent standard library and third party library so there is a lot already built that you can use. It also is fully compatible with C and can use C libraries.
Just be warned that documentation is lacking and you will have to read the source code of the standard library from time to time or seek help from their discord.
Go. It'll be just different enough from what you have experience with to make you think about things differently (in a good way!) from now on. And it's also a fantastically well-designed language that's great for getting real work done. And it's lightning fast as languages go, and compiles to an actual executable. Really a pleasure to work with. It's my (no pun intended) go-to language for every new project I start. (Excluding what I write specifically for a paycheck. I don't have a choice there.)
I'm gonna be the weirdo recommending Ruby. I really like it as a language, and it's pretty fun to write. Plus it's got a lot of libraries so you can do fun projects like Discord chat bots.
DotNet is closest to Java, but hang on to your hat: the state of C# is at least half a decade ahead of Java, if not a full decade. It’s sophistication will make Java use feel like banging rocks together. DotNet Core can now run on all three primary platforms, and with some careful work, you can write a single program that can compile down to each platform and carry along its own required binaries, no pre-install of any framework needed.
My second recommendation would be Rust. Stupidly steep learning curve, but an absolutely game-changing one where safety and security is concerned. It’s my next objective, personally speaking.
Any other language I could recommend starts getting into speciality purposes, which makes general use more difficult or even wholly inappropriate.
For example, if you are dropping into DotNet for business applications, I would also recommend diving into F# for that functional goodness for building complex business rules and data handling. But building an entire app in F# can be jamming a round peg into a square hole under many circumstances, it’s appropriateness envelope does not cover as many cases as C# does. You want to use C# for boilerplate/frameworks, F# for the core bits where it is going to shine.
While it's related to your job and not very new compared to your current stack, it's very worth it to learn typescript. It has a cool type system and makes frontend development sane.
I say that you should find some interesting project, possibly something related to some desktop environment like Gnome, KDE, sway, cosmic and so on. There are multiple fun/interesting projects around them. Then pick a small and manageable task, use that to learn the language that project uses.
I find Cosmic to be a very interesting desktop project, and they use Rust if that would be of interest.
It's incredible and elegant and defies some common categorization.
I've put some of my favorite resources in the sidebar of https://programming.dev/c/concatenative and I'm happy to walk through any particular challenges/examples -- I've done about the first week of Advent of Code with it this year, and the most recent handful of Perl Weekly Challenges, and some basic Euler problems.
Ada particularly the SPARK subset. It's approach is quite different than most languages, focusing on minimising errors and correctness. It's fairly difficult but I like to use it to teach people to actually understand the problem and how to solve it before they ever write the code.
multi-paradigm, you can explore many ways of doing something, within one codebase - arguably the most complex language, if you want, but doesn't have to be: start simply, later scales robustly
compiles and interoperates with JS, JVM, native
Scala3 dropped brackets - easily readable like python
great tooling (recently) - compiler infers so much -> less puzzles / testing
developed mainly in europe, not controlled by big-tech
Since you already know Java, you could jump straight to C++ with Bjarne's book "Programming - Principles and Practice Using C++": https://www.stroustrup.com/programming.html
In parallel also watch the "Back to Basics" video series by CppCon (see their YouTube channel: https://www.youtube.com/@CppCon , just type "back to basics" in that channel's search bar).
Learning proper C++ should give you a much better understanding of the hardware while the syntax still remains elegant, and you get to add a new skill that's in very high demand.
C# is good. I use Visual Studio on Windows, so I'm not familiar with the tooling in VS Code in Linux, but I've heard good things. .NET is a nice environment to work in, the runtime works on all the OSs, and you can even package it into a self-contained binary with a little finagling.
I tried to get into Python, but always found it boring. Ruby was more my speed because it was inspired by Perl and that's the first language I learned. But Python will likely get you more job opportunities.
Controversial opinion, but I think Python, Java, VB, and others will become legacy languages. They'll be around for 30-60 years, just like Cobol, but I expect things to settle around other languages.
It's a much much nicer language than Java or JavaScript and unlike some of the latest languages (which are, arguably, even nicer) PHP has a massive library of third party packages that you can either use or just learn from.
And unlike Python, which is a general purpose language, PHP is purpose built for exactly the type of work you're doing.
Most PHP websites are wordpress, which deserves all of the crap people ditch on it, but all of that crap is wordpress not PHP, and there are other options. Start with this: https://phptherightway.com/pages/The-Basics.html