Crystal?

> echo $whats_crystal

Crystal is a compiled language with a ruby like syntax but with static type checking, compile time error handling, and is much faster.

> echo $background

Originally i started programing in ruby to learn the basics of programing then moved to c/c++ for some collage classes. When i started writing networking based programs i needed something easier and with a much faster dev time than c/c++. So i naturally moved back to ruby.

Once i started needing to write tools with multi-threading ruby was great. it was so easy to use ruby's

Thread.start{ do_job() }

This was fine for simple programs such as webpage scraping and processing or background DNS resolution of multiple domain names.


> echo $problems

Ruby(and python) is still restricted by its Global Interpreter Lock (GIL). This restricts the process to a single "thread". For Ruby(any python as well) it is not realistically possible for true multi-threading. yes i know about cpython and jruby, however those specific tool sets do not allow for fast development of multi-threaded libraries and functions. The "threads" are a form of async operations. ie while an io bound task (networking, disk access, sleep... ) is running. a second task can be performed on the same thread. This is concurrency. not parallelism.

A second problem with ruby(and python) is you land in dependency hell after a while. python is particularly bad at this. The fixes are virtual environments where a program and its dependencies are separated from other programs. this is fine until you need 8 different tools and dropping into venvs every 5 min to run a separate tools is not very kind to your workflow. Python tried to solv this with pipx but i often find pipx to not work (looking at you witnessme).

C/C++ offer true multithreading however speed of development is too slow and libraries can be weird.

> echo $solutions?

I needed a language that was easy to write in that offered multithreading and (Ideally) could be cross platform and used in a ci/cd pipeline

Enter GOLANG!!! it checked all my boxes and is supported by google and has a good community.

I gave go a solid try.... i did. (I still use it for some things...) but the single thing that turned me off of it is the fact that declaring a variable and then not using it, would cause the whole program to not compile. ie while programing if you set a set of variables to intend to use, but need to test your program before using all of them, the whole thing wont work.... this lead to too many errors, slowdowns, forgetting to implement certain items....etc. i just couldnt do it for day to day scripting.

Go programs also downloads dependencies to ~/go. while this is ok and the auto downloading on compile time is nice. in the open source community people dont like to either make a makefile, build.sh script, or a go.mod file. this make it absolutely obnoxious to build other go projects from scratch (cough *goddi*). especially if you are unfamiliar with how golang works.

> echo $crystal

Finally after searching for a compiled ruby option i came across crystal. Now i found crystal several years ago and tried it. However at the time, it was too immature and new. I am very glad that it and its community have matured the language to have much more support and now a windows version(preview for now).

Crystal provided a compiled language, that was type checked, non-nil (good but can be annoying at times), fast, and extremely easy to use language.

One of the other items that is a huge benefit to Crystal is the fact that when building a project, ALL of the dependencies are placed in a lib folder in the project directory. This automatically ensures that you don't have to deal with dependency hell. since the shards (crystals version of gems) are local to the project they don't interfere with other projects, and since crystal is a compiled language, the resulting binary can be statically compiled to automatically run on almost all Linux environments. Thus solving most of my issues.

The Crystal community is also extremely helpful and insightful. I have asked many a question and been met with helpful responses.

Crystal is a fun, easy, and a fantastic language to write in. Much of the community comes from ruby and rails environments, so there are several fantastic web frameworks out there. Kemal and Grip are light weight and easy to spin up. Amber and Athena(harder to get into but the best and most flexible in my opinion) are much more feature rich and offer easy ways to get started and support simple projects as well. Shards can also be searched and found via shards.info or crystalshards.org. I like crystalshards for finding new or shards I'm looking for. shards.info has a fantastic dependency viewer, so if you are looking for examples of a specific shard you can look there.

Like most modern languages Crystal supports "C" interoperability. Shards can be written in C and adapted to crystal if absolutely necessary. C library interoperability is also a very easy thing to do. even in windows(i plan on releasing a post about this as well). so if there is a c tool you like specifically that isn't ported, you can do that super easily.

> echo $caveats

Crystal is still a super young language. Its biggest drawback come primarily from time.

Crystal does not support windows dlls(yet?). There is a git page that will supposedly work but i haven't played with it yet. The Crystal forums also seem to identify that crystal programs are not meant for dll functionality.

Binary data is a little weird to work with and i need to spend more time working with it. I might start implementing some networking protocols to play with these features. This shard is something i have been meaning to play with.

Lastly while there are a ton of features in the standard library and there's tons of shards for various things (see here). Some libraries do not exist yet(opportunities abound here).