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.

Where Next?

Popular in Questions Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New

Other popular topics Top

mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 53690 245
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
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52341 488
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

We're in Beta

About us Mission Statement