The gift for the Rubyist diving into Crystal

the motivation for create this git repo, is original from my another post Emacs-crystal-mode maintain is not active, though i am a heavy emacs user for years, but, my emacs lisp level is really really bad, compare to ruby, bash etc, it probably too hard for maintain it.

i create a help wanted Request to @dgutov, the author of famous emacs company-mode and emacs builtin ruby-mode official maintainer, request him if can maintain emacs-crystal-mode, more discuss can check on this help request issue, because discuss there, i create this repo, write many sample code which valid for Crystal compiler, but invalid for ruby interpreter, with comment.

When i am writing, i suddenly realized, this probably a good getting starte toturial for those like me, come from ruby community.


For explain what the code is:

  • src/ruby_invalid.cr,
    in this file, i write many example which i known, those code snippets is valid Crystal source code, but, when run with ruby, raise exception.
    it include many part, use ------------- seperated, you can play with it individually.

  • src/crystal_invalid.cr
    a few sample code which valid in Ruby but invalid in Crystal.

so, i am very happy someone newcomer can get help from this repo, and sure, point the error out or supplement on missing part always welcome.

BTW, as describe before, those example only for the different syntax unit of Ruby and Crystal, more suitable for Ruby programmer, and not a complete references.

please official book(Welcome - Crystal) for more details.

3 Likes

Your examples seem like they would be a good addition to something like Crystal for Rubyists · crystal-lang/crystal Wiki · GitHub, along with explanations for why they don’t work and maybe how to makr your examples work (or requests for help).

2 Likes