Is there a standard way to achieve the same result as in Ruby with Array#pack method:
[1,2].pack "LL"
=> "\x01\x00\x00\x00\x02\x00\x00\x00"
Not yet, and most likely, it wont be. The reason is that usually the result of pack
is used to be sent to an IO (do you have any other case in mind?), so instead of allocating the result in memory, we're thinking about providing equivalent methods in the IO itself to send the data directly to the socket, file, etc...
It's not written in stone and still in the design board, but avoiding unnecessary intermediate objects in memory is one of the design principles in Crystal.