Need advice about which tool to choose?Ask the StackShare community!

Crystal

339
350
+ 1
286
Elixir

3.4K
3.2K
+ 1
1.3K
Add tool

Crystal vs Elixir: What are the differences?

<Write Introduction here>
  1. Syntax: Crystal has a syntax that closely resembles Ruby, offering familiarity to Ruby developers, while Elixir has a syntax inspired by Erlang, providing a functional programming style that may be new to some developers.

  2. Concurrent Programming Model: Elixir uses the actor model for concurrent programming, allowing lightweight processes to communicate via message passing, while Crystal utilizes green threads for concurrency, enabling parallel execution of tasks within the same process.

  3. Compilation: Crystal code is compiled ahead of time to machine code, providing high performance similar to compiled languages like C, while Elixir is compiled to bytecode which runs on the Erlang Virtual Machine (BEAM), emphasizing fault tolerance and distributed computing.

  4. Metaprogramming: Crystal offers powerful metaprogramming capabilities, allowing developers to generate code at compile time, while Elixir supports metaprogramming through macros, providing flexibility in code transformation.

  5. Static Typing: Crystal is statically typed, enabling compile-time type checking for additional safety and optimization, while Elixir is dynamically typed, offering more flexibility but reduced compile-time guarantees.

  6. Community and Ecosystem: Elixir has a larger community and ecosystem due to its roots in Erlang and long-term support from companies like WhatsApp, offering extensive libraries and resources, while Crystal has a smaller but growing community with a focus on performance and simplicity.

In Summary, Crystal and Elixir differ in syntax, concurrent programming model, compilation, metaprogramming, static typing, and community support.
Decisions about Crystal and Elixir

#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

See more
Timm Stelzer
VP Of Engineering at Flexperto GmbH · | 18 upvotes · 634.3K views

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.

See more
Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of Crystal
Pros of Elixir
  • 38
    Compiles to efficient native code
  • 36
    Ruby inspired syntax
  • 32
    Performance oriented - C-like speeds
  • 23
    Gem-like packages, called Shards
  • 20
    Can call C code using Crystal bindings
  • 18
    Super Fast
  • 18
    Typed Ruby <3
  • 17
    Open Source
  • 14
    Minimal Runtime
  • 11
    Cute
  • 9
    Clean code
  • 9
    Concurrent
  • 9
    Productive
  • 4
    Great community
  • 2
    Powerful
  • 2
    Program compiled into a single binary
  • 2
    Simplicity
  • 2
    Meta-Programming (via Macros)
  • 2
    Feels like duck types, safe like static types
  • 2
    Null Safety
  • 2
    Type inference
  • 1
    Has builtin LLVM support library
  • 1
    Statically linked binaries that are simple to deploy
  • 1
    Fun to write
  • 1
    High-performance
  • 1
    Simple, minimal syntax
  • 1
    Compile time statically safe macros
  • 1
    Concise
  • 1
    Statically Safe Monkey Patching
  • 1
    Fibers
  • 1
    Spawn
  • 1
    Meta-programming
  • 1
    Productivity
  • 1
    Elegant
  • 1
    Cross-platform
  • 173
    Concurrency
  • 161
    Functional
  • 133
    Erlang vm
  • 112
    Great documentation
  • 105
    Great tooling
  • 86
    Immutable data structures
  • 81
    Open source
  • 77
    Pattern-matching
  • 62
    Easy to get started
  • 59
    Actor library
  • 32
    Functional with a neat syntax
  • 29
    Ruby inspired
  • 25
    Erlang evolved
  • 24
    Homoiconic
  • 22
    Beauty of Ruby, Speed of Erlang/C
  • 17
    Fault Tolerant
  • 14
    Simple
  • 13
    High Performance
  • 11
    Pipe Operator
  • 11
    Good lang
  • 11
    Doc as first class citizen
  • 9
    Fun to write
  • 9
    Stinkin' fast, no memory leaks, easy on the eyes
  • 8
    Resilient to failure
  • 8
    OTP
  • 6
    GenServer takes the guesswork out of background work
  • 4
    Idempotence
  • 4
    Pattern matching
  • 4
    Not Swift
  • 4
    Fast, Concurrent with clean error messages
  • 3
    Easy to use
  • 2
    Error isolation
  • 2
    Dynamic Typing

Sign up to add or upvote prosMake informed product decisions

Cons of Crystal
Cons of Elixir
  • 13
    Small community
  • 3
    No windows support
  • 1
    No Oracle lib
  • 11
    Fewer jobs for Elixir experts
  • 7
    Smaller userbase than other mainstream languages
  • 5
    Elixir's dot notation less readable ("object": 1st arg)
  • 4
    Dynamic typing
  • 2
    Difficult to understand
  • 1
    Not a lot of learning books available

Sign up to add or upvote consMake informed product decisions

What is Crystal?

Crystal is a programming language that resembles Ruby but compiles to native code and tries to be much more efficient, at the cost of disallowing certain dynamic aspects of Ruby.

What is Elixir?

Elixir leverages the Erlang VM, known for running low-latency, distributed and fault-tolerant systems, while also being successfully used in web development and the embedded software domain.

Need advice about which tool to choose?Ask the StackShare community!

What companies use Crystal?
What companies use Elixir?
Manage your open source components, licenses, and vulnerabilities
Learn More

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with Crystal?
What tools integrate with Elixir?

Sign up to get full access to all the tool integrationsMake informed product decisions

Blog Posts

Oct 24 2019 at 7:43PM

AppSignal

JavaScriptNode.jsJava+8
5
978
What are some alternatives to Crystal and Elixir?
JavaScript
JavaScript is most known as the scripting language for Web pages, but used in many non-browser environments as well such as node.js or Apache CouchDB. It is a prototype-based, multi-paradigm scripting language that is dynamic,and supports object-oriented, imperative, and functional programming styles.
Git
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
GitHub
GitHub is the best place to share code with friends, co-workers, classmates, and complete strangers. Over three million people use GitHub to build amazing things together.
Python
Python is a general purpose programming language created by Guido Van Rossum. Python is most praised for its elegant syntax and readable code, if you are just beginning your programming career python suits you best.
jQuery
jQuery is a cross-platform JavaScript library designed to simplify the client-side scripting of HTML.
See all alternatives