hydrolox
nothing against the language but it's a bit suspicious that the top sponsors include "buy Google reviews" and "buy Instagram followers" (if you navigate to the actual Crystal language site)
sedatk
> Oops, looks like its tempfile lib is written in library code in the style of mktemp(3), instead of calling the OS’s mkstemp(3) or equivalent. So it just finds a filename that doesn’t exist and then opens it separately, letting an attacker create a new file which they can read at that location between those two steps. Uh, have fun with your temporary files leading to exploitable race conditions guys.

Good catch. The API should be opening the tempfile atomically (the best option), or at least should use a CSPRNG for its random suffix. It doesn’t, currently.

bhaney
> Can you magically return/break out of iterator functions like you can in Ruby?

Sure can.

    $ cat break.cr
    (1..).each do |x|
      break if x > 2
      puts x
    end
    
    $ crystal break.cr
    1
    2
    
    $
The answer to Crystal questions that end in "like you can in Ruby" is usually "yes." The language really is just Ruby with static typing, warts and all. Most random snippets of Ruby will run just fine when compiled as Crystal.
flats
I work with Ruby every day at work & have always been curious about Crystal. This was a very helpful dive into some overarching concepts & small details. Thanks for sharing!
nobodywasishere
As far as a REPL for Crystal goes, the interpreter is available via "crystal i"
Trasmatta
Crystal is beautiful. I wish I had a use case for it.