Need advice about which tool to choose?Ask the StackShare community!
Elixir vs Kotlin vs Scala Native: What are the differences?
**Introduction:**
When comparing Elixir, Kotlin, and Scala Native, there are some key differences that developers should consider before choosing a language for their project.
1. **Concurrency Model**: Elixir, being built on the Erlang virtual machine, uses lightweight processes, known as actors, for concurrency, which communicate through message passing. Kotlin relies on coroutines for handling concurrency, allowing developers to write asynchronous code in a more sequential manner. Scala Native, on the other hand, offers a more traditional threading model based on POSIX threads for concurrency.
2. **Type System**: Elixir is a dynamically typed language where types are inferred at runtime, offering flexibility but potentially leading to runtime errors. In contrast, Kotlin is statically typed, providing type safety at compile time to catch errors earlier in the development process. Scala Native also uses a statically typed system similar to Kotlin, enhancing code robustness and readability.
3. **Tooling and Ecosystem**: Elixir has a strong focus on developer productivity with its mix tool for building, testing, and managing projects, along with a rich ecosystem of libraries and frameworks like Phoenix for web development. Kotlin has solid tooling support in the form of the IntelliJ IDEA IDE and Android Studio, making it a popular choice for Android app development. Scala Native, while offering good interoperability with C libraries, may have a more limited ecosystem compared to Elixir and Kotlin.
4. **Performance**: Elixir's performance is optimized for highly concurrent, distributed systems, thanks to the Erlang VM's capabilities. Kotlin, with its emphasis on being a general-purpose language, offers good performance for a wide range of applications. Scala Native aims to deliver high-performance applications by compiling directly to machine code, allowing for efficient memory usage and faster execution.
5. **Learning Curve**: Elixir's syntax, inspired by Ruby, is known for its readability and expressiveness, making it beginner-friendly for developers familiar with Ruby or functional programming. Kotlin, offering a blend of functional and object-oriented programming paradigms, provides an easy transition for Java developers due to its Java interoperability. Scala Native, based on Scala, can have a steeper learning curve for developers new to functional programming or the Scala language.
6. **Community Support**: Elixir has a vibrant community centered around the functional programming paradigm, offering numerous resources, meetups, and conferences for developers to engage with. Kotlin benefits from the extensive support of the larger Java ecosystem, providing access to a wide range of libraries and tools. Scala Native, being a newer technology, may have a smaller community compared to Elixir and Kotlin, resulting in potentially fewer resources and community-driven projects.
In Summary, the key differences between Elixir, Kotlin, and Scala Native lie in their concurrency models, type systems, tooling ecosystems, performance optimizations, learning curves, and community support.
I was thinking about adding a new technology to my current stack (Ruby and JavaScript). But, I want a compiled language, mainly for speed and scalability reasons compared to interpreted languages. I have tried each one (Rust, Java, and Kotlin). I loved them, and I don't know which one can offer me more opportunities for the future (I'm in my first year of software engineering at university).
Which language should I choose?
I will highly recommend Kotlin. I have worked with all three intensely and so far the development speed and simplicity is the best with Kotlin. Kotlin supports coroutines out of the box. Now, it isn't something that can't be implemented in other languages but Kotlin makes it super easy to work with them. Kotlin has a bit of learning curve, so, by the time you can actually use it idiomatically chances are that you will get proficient in Java too. But once you get it, you get it, then there is no other language ;) Kotlin is backed by Google and Jetbrains team so you can expect latest programming features and good community support.
It depends on which level and use cases you prefer to work at. Close to the machine? Rust is great but if you need to find more job opportunities, then take C/C++. Java has many job positions but I suggest Kotlin over it. Think about it as a better Java, but fewer job positions. Do you want to do your own projects? So a productive language like Ruby is way better. Like to program front-end apps? Take JS. Find your passion.
As you certainly know, there are languages that compile in meta-code for Virtual Machines (Java, C#, Kotlin) and languages that compile in Machine Language (Go, Rust). Apart specific domains (blockchain, IoT embedded software, AI, cloud) almost no-one uses languages that compile in machine language, for a series of reason, most of all security and portability. So, if you are going to learn for business go with Kotlin - Java is a bit ancien regime. If you seriously need to learn a language that compiles in ML - for example you will code for IoT - go with Go - or Rust - but keep in mind that Rust is much less used than Go. PS: Kotlin also compiles in ML, but I would choose a language designed for that, instead of one that compiles "also" in ML. PPS: Some Virtual Machines - ie: GraalVM - allow you to compile Java in ML. The world of IT is beautiful.
If you want a compiled language then go for Rust. It takes a certain mindset to get your head around its memory management system and the way it handles "borrowed" memory. However, it will generate blindingly fast code that you can cross-compile for other platforms. As a systems programming language I highly recommend it. Take time and learn it.
Java is only compiled to bytecode, not to machine code. So it executes in the Java Virtual Machine. DOn't think that its not fast, because the latest incarnation are very fast indeed. For most practical purposes, users of your code won't notice any difference. There are a heck of a lot of features in Java that you either have to import via crates in Rust, or write yoursef. So productivity-wise, Java may well beat Rust.
Kotlin is a Java-lookalike. It's a nice, and succinct version of Java and is totally interoperable. But its a bit niche, and for me it fails because my dev environment of choice (Spring Tool Suite) doesn't really play well with Kotlin. To use it you would be well advised to use iDeaj. I have used kotlin, and I like it, but not enough to ditch all my Java code.
Other contenders, depending on your platform of choice are Golang, C, C++, and C# (available as Mono on Linux systems).
I use Rust and Java and if you need a compiled language I recommend Rust.
I'd say Rust's knowledge will be more valuable in comparison. You can work in Blockchain development, compile to WASM (WebAssembly). There is a new JavaScript/TypeScript runtime named Deno (by the creator of Node.js) that has its backend in Rust.
I would go with Kotlin. It is pretty hyped currently.
You can use Kotlin for a lot of application types. To name some:
- Kotlin Multiplatform with Gradle
- Ktor (https://ktor.io)
- Spring Boot
- Kotlin JS (as you already know Javascript, you might like this one)
The code is also really concise, readable and modern. It also provides many features that you will find in many other programming languages.
I'd recommend you to take a look at Java and Kotlin, the first due to the number of companies that actively use it in your products. Kotlin is gaining adept since it is fully compatibly with the Java ecosystem but usually requires less code to do the same (ignoring other benefits of the language). Another benefits of the Kotlin is that it is in fact multiplatform, where you could use the same syntax to code for mobile, web and backend applications. The drawback of Kotlin, is the number of open jobs that exists currently compared to Java, but I pretty sure that it will change in the near future.
All those are nice languages, but Rust is harder to learn properly and has a smaller ecosystem. If you want to work in system programming (like hardware drivers) Rust is probably your choice. Otherwise, Java/Kotlin ecosystem is much larger and gives much more possibilities (maybe excluding low-level system programming).
When talking about Kotlin and Java, both are good. But Kotlin, again, gives much more opportunities. Kotlin-JS gives you browser applications, Kotlin-Native allows to compile to native application (and interop with them). Kotlin-WASM will be available shortly. Rust is better than Kotlin-Native for native development tight now, but not by far and it makes sense only if you are focusing only on native development.
Hi there. I want to expand my coding toolset. So I want to learn a second backend language besides Kotlin. Kotlin is fantastic. I love it in every aspect, and I think I can never return to Java. And also why should I? It is 100% interoperable with java and can co-exist in every project.
So my question here is. Which language do you think will bring me more joy? I think F#; it is more like Kotlin. Then C# (it's more or like 100% java). But, let's say I learn F#. Is it 100% interoperable like Kotlin? can they live side by side? Can I, then, apply to .NET jr jobs after a while, for example, or is C# the holy cow? I would like to learn .Net.
If it is the worst and only C# is acceptable, then which language should I learn? Dart? Go?
Exceptional decision to go with Kotlin. For the other story, go full with C#. "is C# the holy cow? Yes it is.". Specially now when netCore is crossplatform and you can build asp.net core applications on Windows, Linux and macOS via Visual Studio Code which is also multiplatform. Nothing will beat C# in the near future. Also, at the end of 2021 Microsoft will release Net 6.0 which will include MAUI.
"For those new to .NET MAUI (standing for .NET Multi-platform App UI), Microsoft says it's "the evolution of Xamarin.Forms extended from mobile to desktop scenarios with UI controls rebuilt from the ground up for performance and extensibility."
So, C# all the way sire!
animefanx1,
First let's get your questions sorted: Which language do you think will bring me more joy?
This you will have to decide for yourself, I am a long time C# developer and have seen it grow into a very compelling platform. The language and I'd compare it more to Kotlin than Java (by a long margin). More on .NET in a bit.
say I learn F#. Is it 100% interoperable like Kotlin?
You can have 100% interop with a caveat, your F# libraries have to implement certain guidance in order to be referenced from C#. Some (dare I say most) of the differences between F# and C# are predicated on language constructs that are not available in C#. For instance F# functions that return Unit.
can they live side by side?
Yes.
Can I, then, apply to .NET jr jobs after a while, for example, or is C# the holy cow?
I don't know if I take your meaning, but let me say this: Learning either C# or F# will likely force you to understand concepts such as garbage collection, primitive types, etc. which apply to all .NET languages, thus a lot of the effort you put into .NET is bound to pay off regardless of your choice.
If it is the worst and only C# is acceptable, then which language should I learn? Dart? Go? You can't go wrong with any of these and I venture to say whether you select C#, F#, Dart or Go as your next adventure, your willingness to learn will take you to try other languages, some which mey not even exist yet!
PS1: .NET is an end to end environment now. With the introduction of Blazor and Razor pages one does not need JavaScript or other browser scripting languages, it even interops with JavaScript. PS2. Microsoft is working on unifying .NET. Soon there will be only one version: .NET 5! Caveat: Some features such as WinForms will still be specific to the windows environment but all of those are likely things you don't need in Mac or Linux
I think you can learn go instead C#. C# is cool, but Golang also cool. It can run on any OS without specific software. C# can run on linux too but it's only the .NET Core as I know. But golang is flexible. So try it and decide what do you think about Golang
Can anyone help me decide what's best for app development or even android Oreo development? I'm in a state dilemma at the moment. I want to do Android programming, not necessarily web development. I have heard a lot of people recommend one of these, and it seems that both the tools can do the job. Which language would you choose?
I assume that you mean Flutter by Dart. I have over 6 years experience programming in Android SDK, but about 1,5 month in Flutter. So far I think that Flutter is the future for mobile development. Flutter SDK is much better designed. Ecosystem of libraries seems having much higher quality. I would even say that android opensource libs are having really poor quality. Many times I am wondering how can garbage like that have so many stars at GitHub. Android SDK is hard to compose so you reinvent even basic things on and on, which is totally different story at Flutter. Lolcycle? Both are having good documentation. I quess apps in Flutter can be done in 1/3 of time compared to develop AndroidSDK and iOS, its design is that much better and contemporary. As of language comparison - Kotlin is better, but the difference is not that important. Go from one language to other is no problem. Dart is being updated with new features.
I've selected Flutter and Dart for my side projects and never regretted. Dart learning curve is easy after any OOP language . Flutter as a framework is also has a low entry threshold. I've already started development after a week of learning. Pros for me: code can be build for Android and IOS devices (for ios you need mac or VM), apps written in Dart have great performance on each of these platforms, flexibility. Cons: if you want to build a product as a business and want to hire a new Flutter Developer in the future it can be a problem as the framework and language is not popular for the moment.
It depends on what is the purpose of your app development. Do you want to make one app that shares the codebase for both iOS and Android? If yes, then Dart is the way to go. Does your app include interacting with hardware features like camera, Bluetooth, if yes, then go for native Android for better performance? Dart is good for simpler UI apps where you just do basic crud operations over the network and show data but if you need richer UI experience go with native.
I have worked in mobile development since 2010. I have experienced myself on various techs including Native SDK (Android), React Native (from 2016) and Flutter (2018). Almost the apps nowadays can be built using cross-platforms frameworks like React Native or Flutter. I suggest you start with Flutter. Flutter SDK is designed well to speed up your development and it still keeps the quality for your apps. If you're familiar with OOP languages (Java, C#...), switching to Dart is really quick and easy. Of course, sometimes you will need to dive deep into native parts but almost the cases you don't need. Good luck!
#rust #elixir So am creating a messenger with voice call capabilities app which the user signs up using phone number and so at first i wanted to use Actix so i learned Rust so i thought to myself because well its first i felt its a bit immature to use actix web even though some companies are using Rust but we cant really say the full potential of Rust in a full scale app for example in Discord both Elixir and Rust are used meaning there is equal need for them but for Elixir so many companies use it from Whatsapp, Wechat, etc and this means something for Rust is not ready to go full scale we cant assume all this possibilities when it come Rust. So i decided to go the Erlang way after alot of Thinking so Do you think i made the right decision?Am 19 year programmer so i assume am not experienced as you so your answer or comment would really valuable to me
We have a lot of experience in JavaScript, writing our services in NodeJS allows developers to transition to the back end without any friction, without having to learn a new language. There is also the option to write services in TypeScript, which adds an expressive type layer. The semi-shared ecosystem between front and back end is nice as well, though specifically NodeJS libraries sometimes suffer in quality, compared to other major languages.
As for why we didn't pick the other languages, most of it comes down to "personal preference" and historically grown code bases, but let's do some post-hoc deduction:
Go is a practical choice, reasonably easy to learn, but until we find performance issues with our NodeJS stack, there is simply no reason to switch. The benefits of using NodeJS so far outweigh those of picking Go. This might change in the future.
PHP is a language we're still using in big parts of our system, and are still sometimes writing new code in. Modern PHP has fixed some of its issues, and probably has the fastest development cycle time, but it suffers around modelling complex asynchronous tasks, and (on a personal note) lack of support for writing in a functional style.
We don't use Python, Elixir or Ruby, mostly because of personal preference and for historic reasons.
Rust, though I personally love and use it in my projects, would require us to specifically hire for that, as the learning curve is quite steep. Its web ecosystem is OK by now (see https://www.arewewebyet.org/), but in my opinion, it is still no where near that of the other web languages. In other words, we are not willing to pay the price for playing this innovation card.
Haskell, as with Rust, I personally adore, but is simply too esoteric for us. There are problem domains where it shines, ours is not one of them.
After writing a project in Julia we decided to stick with Kotlin. Julia is a nice language and has superb REPL support, but poor tooling and the lack of reproducibility of the program runs makes it too expensive to work with. Kotlin on the other hand now has nice Jupyter support, which mostly covers REPL requirements.
From cross platform development point of view: Using kotlin multiplatform is more convenient than java for implementing cross platform code, since it can be converted to be used in iOS (swift) projects, and it can be easily learned if you already know swift. It still an experimental feature but it helped so far to unify a lot of the common code between our iOS and Android projects. And it is more future proof than java regarding support and maintain multiplatform converting.
I work at Stream and I'm immensely proud of what our team is working on here at the company. Most recently, we announced our Android SDK accompanied by an extensive tutorial for Java and Kotlin. The tutorial covers just about everything you need to know when it comes to using our Android SDK for Stream Chat. The Android SDK touches many features offered by Stream Chat – more specifically, typing status, read state, file uploads, threads, reactions, editing messages, and commands. Head over to https://getstream.io/tutorials/android-chat/ and give it a whirl!
Pros of Elixir
- Concurrency174
- Functional162
- Erlang vm133
- Great documentation113
- Great tooling105
- Immutable data structures87
- Open source81
- Pattern-matching77
- Easy to get started62
- Actor library59
- Functional with a neat syntax32
- Ruby inspired29
- Erlang evolved25
- Homoiconic24
- Beauty of Ruby, Speed of Erlang/C22
- Fault Tolerant17
- Simple14
- High Performance13
- Doc as first class citizen11
- Good lang11
- Pipe Operator11
- Stinkin' fast, no memory leaks, easy on the eyes9
- Fun to write9
- OTP8
- Resilient to failure8
- GenServer takes the guesswork out of background work6
- Pattern matching4
- Not Swift4
- Idempotence4
- Fast, Concurrent with clean error messages4
- Easy to use3
- Dynamic Typing2
- Error isolation2
Pros of Kotlin
- Interoperable with Java73
- Functional Programming support55
- Null Safety50
- Official Android support46
- Backed by JetBrains44
- Concise37
- Modern Multiplatform Applications36
- Expressive Syntax28
- Target to JVM27
- Coroutines26
- Open Source24
- Statically Typed19
- Practical elegance19
- Android support17
- Type Inference17
- Readable code14
- Powerful as Scala, simple as Python, plus coroutines <313
- Better Java12
- Pragmatic10
- Lambda9
- Better language for android8
- Expressive DSLs8
- Target to JavaScript8
- Used for Android6
- Less boilerplate code6
- Fast Programming language5
- Less code5
- Native4
- Less boiler plate code4
- Friendly community4
- Functional Programming Language4
- Spring3
- Official Google Support3
- Latest version of Java2
- Well-compromised featured Java alternative1
Pros of Scala Native
- Scala is just much easier to program in than Rust1
- Interop with C libraries1
- Scala Native is fast and lightweight1
Sign up to add or upvote prosMake informed product decisions
Cons of Elixir
- Fewer jobs for Elixir experts11
- Smaller userbase than other mainstream languages7
- Elixir's dot notation less readable ("object": 1st arg)5
- Dynamic typing4
- Difficult to understand2
- Not a lot of learning books available1
Cons of Kotlin
- Java interop makes users write Java in Kotlin7
- Frequent use of {} keys4
- Hard to make teams adopt the Kotlin style2
- Nonullpointer Exception2
- Friendly community1
- Slow compiler1
- No boiler plate code1