Running the Crystal compiler on your Ruby code is like asking a second doctor for their opinion. When it comes to your health, you don’t hesitate to get a second opinion. Doctors don’t always agree, and a second doctor’s appointment is always time well spent when it comes to staying healthy. But what about your code? A code review is similar to going to see a doctor: Someone examines your code, lo
Writing assembly language is something best left for the experts. To write code that runs directly on your microprocessor you need to know how memory segmentation works, what the intended use of each register is, how codes executes in real and protected modes and much, much more. And, of course, modern compilers will usually produce faster, more optimized code than you ever could, without making a
こんにちは、Crystal界のわるいオタクです。 Crystalみたいな低レイヤを直に触れる言語だとちょくちょくインラインアセンブラを触りたくなることもあるかと思いますが、 OutputOperands に複数指定しようとするとなんだか構文エラーになってしまいます。 % crystal inlineasm.cr Syntax error in inlineasm.cr:5: expecting token ')', not ':' : "={eax}"(low), "={edx}"(high) % cat /proc/version Linux version 3.10.0-229.14.1.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #
この記事は、 Crystal Advent Calendar 2016 の1日目の記事です。 先日、Crystal言語の勉強会を開催しました。Crystal言語が好き過ぎて、勢いに乗って開催まで進んだ形です。参加された方、準備を手伝ってくださった方、みなさんどうもありがとうございました。 crystal.connpass.com 準備完了です! #crystaljp pic.twitter.com/ZBQSYRGCzm— at_grandpa (@at_grandpa) November 29, 2016 内容紹介 自分のイントロダクションの発表から始まり、Talk枠2つ、LT枠4つという内容です。 connpassの資料一覧 に全て載っていますが、こちらでも簡単にご紹介します。 イントロダクション 東京 Crystal 勉強会 #4 in 渋谷 - イントロダクション from at
終了 2016/11/29(火) 19:00〜 東京 Crystal 勉強会 #4 in 渋谷 Ruby 風シンタックスな静的言語 Crystal の勉強会 at_grandpa 他 東京都渋谷区道玄坂1-21-1 渋谷ソラスタ15F
22:00 終了 22:00 ~ 懇親会 (同会場) ・順番は前後する可能性があります。 ・LT参加枠は5名となっていますが、飛び込みも大歓迎です。 ・時間はあくまで予定です。 ・一段落つき次第、懇親会に移行します。 懇親会について 勉強会終了後、同会場にて懇親会を実施いたします。 懇親会参加希望の方は、申込時のアンケートで 「 懇親会参加希望 」 をご選択ください。 参加費は軽食・飲料代で 1,000 円程度を予定しています。当日受付にて集金いたします。 SNS Twitter ハッシュタグとして 「 #crystaljp 」 をお使いください。 Crystal 情報交換用 チャットルーム 日本語で Crystal の情報交換を行うチャットルームです。ご自由にお入りください。 Slack: https://crystal-jp.slack.com Gitter: https://gitt
For most of the developers, performance is one of the most reasons why they choose a programming language. But how do they know the performance of a programming language? Usually, they test it by sorting an array because sorting is the most basic, classic and the most important algorithm in the world. That is what I did these days. After several tests, I found that Array#sort is usually faster tha
いろいろと得るものが多かったので、やったことと感想をまとめます。 長くなってしまったので、お時間ある時にどうぞ。 TL;DR Crystal言語(ja) で、isucon5-qualifier-standaloneのWebAppを実装 新しい言語の勉強をする際、isuconを題材にすると良さそう 実装するものが決まっているので余計なことは考えずコーディングに集中できる 参考にできる他言語の実装がすぐそばにある ライブラリのコードを読むことに抵抗がなくなった ライブラリのリポジトリにPRを送りたくなった リポジトリ Crystal言語 で、isucon5-qualifier-standaloneのWebAppを実装しました。 github.com 目次 TL;DR リポジトリ 目次 発端 実際にやったことのピックアップ DBライブラリからの返り値が壮大なUnion型になっていてつらい マルチ
まずは環境。 ( ՞ਊ ՞) :~/dev/crystal $ crystal --version Crystal 0.19.4 [7f82f79] (2016-10-07) ( ՞ਊ ՞) :~/dev/crystal $ cat /etc/issue Ubuntu 16.10 \n \l ( ՞ਊ ՞) :~/dev/crystal $ cat /proc/version Linux version 4.8.0-26-generic (buildd@lgw01-58) (gcc version 6.2.0 20161005 (Ubuntu 6.2.0-5ubuntu12) ) #28-Ubuntu SMP Tue Oct 18 14:39:52 UTC 2016 こういう雑なコードを書く。 arr = [] of Int32 (0..1e7).each do |i| arr << i
text = `find ~/proj/ -name *my*` text.split("\n").each do |row| if row =~ /(my.*)/ puts $1 end end 上記は、Ruby(ruby test1.cr)でもCrystal(crystal test1.cr)でも全く同じに動く。合格 Rubyとは違うところ(空配列) https://praveenatc42.wordpress.com/2016/01/09/crystal-for-rubyists/ を見るにRubyとCrystalは色々と違うらしい。例えば以下のように、型推定ができないので空配列は無理がある。 Compilation:- compiler error introduction array = [] array << "hello" #=> CRASH in crystal array
An Introduction to Crystal: Fast as C, Slick as Ruby I'm a Rubyist. I love Ruby, the community, the productivity, and so many other things about it. For more than four years now, I've written Ruby professionally, and I'd really like to keep it that way. But I'm also aware that languages and tools are destined to be replaced. Ruby is awesome, but it is not necessarily known for its speed. Sometimes
From this post, Crystal appears to have some of the things many people have been lusting after in Rust: sophisticated metaprogramming, fewer sigils, a bigger standard library, fibers/coroutines/whatever-they're-called-now.But it still has a GC :(. Rust has completely spoiled me with making it easy to minimize dynamic memory allocation and copies, and to know (almost always) deterministically when
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く