Rich_Morin

Rich_Morin

Using Crystal for NIFs, etc?

I’d like to know if anyone has tried using Crystal for NIFs, etc. If so, any caveats and/or comments?

-r

Most Liked

OvermindDL1

OvermindDL1

Eh, I doubt it would work well. Crystal has a couple immediate things going highly against it to start with:

  • Garbage Collector: This will significantly conflict with Erlang’s GC, especially as Erlang may not give it much time to run until it decides to in some callback.

  • Global Lock: This means Crystal can’t run parallel code, and the BEAM assumes it can run NIF’s in parallel, thus effectively freezing those BEAM threads until they all serially return.

If you want a native-style ruby’ish language, look at Nim, not Crystal, it would get closer to working well.

12
Post #2
DevotionGeo

DevotionGeo

Still the main problem is garbage collector. Crystal like Go isn’t a good fit for Erlang NIFs.

DevotionGeo

DevotionGeo

It’s OK! :slight_smile: Elixir community is so open to everything. In fact, almost half of the Elixir developers were previously Ruby developers including Jose and Chris, and the other half were Erlang developers. Those Ruby developers came to Elixir for the power of BEAM and the Erlang developers came to it for its expressiveness.

If they find something more expressive than Elixir, and more powerful and battle tested than BEAM, they’ll happily prefer it over Elixir.

In fact, DevTalk is a child forum of this forum, where we Elixir developers discuss everything, from LISP and Smalltak to OCaml and Zig, and there are some very talented members who are great at several languages.

Crystal is, of course, a very capable language. It’s statically typed, fast, and if you know Ruby, you already know Crystal. There are also some great web frameworks for Crystal like Lucky.

randito

randito

(forgive me… about to talk about Crystal on an Elixir forum)

Crystal has such potential. I feel like it needs a “killer app” to help it get the attention it needs.

Where Next?

Popular in Questions Top

sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
sacepums
Hey guys. I'm new to elixir and im really stocked about it. But I ran into a bit of problem - I need to convert a date sting, for examp...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
gonzofish
I’m currently trying to understand how to join three tables using Ecto. All the examples I’ve seen use 2, so maybe I’m just missing somet...
New
Codball
Mix format works fine if run from the cmd. I’ve followed this to facilitate the implementation into VSC which involves downloading an ext...
New
wernerlaude
In AR this is so simple @articles = current_user.articles How to do in Ecto? def index(conn, _params) do current_user = conn.assig...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Other popular topics Top

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
William
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

We're in Beta

About us Mission Statement