{"id":12377,"date":"2013-09-11T11:18:25","date_gmt":"2013-09-11T02:18:25","guid":{"rendered":"http:\/\/www.softantenna.com\/wp\/?p=12377"},"modified":"2013-09-11T11:18:25","modified_gmt":"2013-09-11T02:18:25","slug":"crystal-language","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/crystal-language\/","title":{"rendered":"Ruby\u3063\u307d\u3044\u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u304c\u4f7f\u3048\u308b\u30b3\u30f3\u30d1\u30a4\u30e9\u8a00\u8a9e\u300cCrystal\u300d"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2013\/09\/blogcrystal.png\" alt=\"Crystal\" title=\"crystal.png\" border=\"0\" width=\"560\" height=\"288\" \/><\/p>\n<p>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u300c<a href=\"http:\/\/crystal-lang.org\/\">Crystal<\/a>\u300d\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002\u3053\u306e\u8a00\u8a9e\u306fRuby\u98a8\u306e\u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u304c\u4f7f\u3048\u308b\u3053\u3068\u304c\u58f2\u308a\u306e\u30b3\u30f3\u30d1\u30a4\u30e9\u8a00\u8a9e\u3067\u3001\u4ee5\u4e0b\u306e\u30b4\u30fc\u30eb\u3092\u76ee\u6a19\u306b\u958b\u767a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>Ruby\u306b\u30a4\u30f3\u30b9\u30d1\u30a4\u30a2\u3055\u308c\u305f\u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u3002\n<li>\u5909\u6570\u307e\u305f\u306f\u30e1\u30bd\u30c3\u30c9\u5f15\u6570\u306e\u578b\u3092\u660e\u793a\u3057\u306a\u3044\u3002\n<li>Crystal\u3067\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3092\u66f8\u3051\u3070C\u306e\u30b3\u30fc\u30c9\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u3002\n<li>\u5b9a\u578b\u30b3\u30fc\u30c9\u3092\u3055\u3051\u308b\u305f\u3081\u306b\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u8a55\u4fa1\u3068\u30b3\u30fc\u30c9\u751f\u6210\u3092\u6301\u3064\u3002\n<li>\u52b9\u7387\u7684\u306a\u30cd\u30a4\u30c6\u30a3\u30d6\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3059\u308b\u3002\n<\/ul>\n<p>\u52d5\u4f5c\u74b0\u5883\u306f(\u4eca\u306e\u3068\u3053\u308d)Mac\/Linux\u3002<br \/>\n<!--more--><\/p>\n<h3>\u30b5\u30f3\u30d7\u30eb<\/h3>\n<p>Crystal\u3067\u7d20\u6570\u3092\u6c42\u3081\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><code class=\"ruby\"># Compute prime numbers up to 100 with the Sieve of Eratosthenes\nmax = 100\n\nsieve = Array.new(max, true)\nsieve[0] = false\n\n(2...max).each do |i|\n  if sieve[i]\n    (2 * i).step(max - 1, i) do |j|\n      sieve[j] = false\n    end\n  end\nend\n\nsieve.each_with_index do |prime, number|\n  puts number if prime\nend<\/code><\/pre>\n<p>\u3059\u3054\u304f\u2026Ruby\u3063\u307d\u3044\u3067\u3059\u306d\u3002<\/p>\n<h3>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p><a href=\"https:\/\/github.com\/manastech\/crystal\/wiki\/Introduction\">Introduction<\/a>\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u306a\u3069\u8a73\u7d30\u304c\u8a18\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Ruby 1.9\u4ee5\u4e0a\u3001LLVM 3.3\u304c\u5fc5\u8981\u3002Mac\u306e\u5834\u5408brew\u3067\u7c21\u5358\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u305d\u3046\u3067\u3059(Linux\u3082\u3044\u3051\u308b\u306f\u305a\u3068\u306e\u8aac\u660e\u3042\u308a\u3002Windows\u5bfe\u5fdc\u306f\u307e\u3060\u306a\u3057)\u3002<\/p>\n<ul>\n<li>brew install llvm33 --with-clang\n<li>git clone git:\/\/github.com\/manastech\/crystal.git\n<li>cd \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30eb\u30fc\u30c8\n<li>bundle\n<li>bin\/crystal -e 'puts \"Hello!\"'\n<\/ul>\n<h3>\u307e\u3068\u3081<\/h3>\n<p>Ruby\u597d\u304d\u3067\u304b\u3064\u30cd\u30a4\u30c6\u30a3\u30d6\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u305f\u3044\u3068\u3044\u3046\u7528\u9014\u306a\u3089\u7d50\u69cb\u4f7f\u3048\u308b\u8a00\u8a9e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u307e\u3060<a href=\"http:\/\/crystal-lang.org\/2013\/09\/04\/happy-birthday-crystal.html\">\u958b\u767a\u958b\u59cb\u3055\u308c\u3066\u304b\u30891\u5e74<\/a>\u3057\u304b\u305f\u3063\u3066\u3044\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u306a\u306e\u3067\u3001\u4eca\u5f8c\u306e\u767a\u5c55\u306b\u3082\u671f\u5f85\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u300cCrystal\u300d\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002\u3053\u306e\u8a00\u8a9e\u306fRuby\u98a8\u306e\u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u304c\u4f7f\u3048\u308b\u3053\u3068\u304c\u58f2\u308a\u306e\u30b3\u30f3\u30d1\u30a4\u30e9\u8a00\u8a9e\u3067\u3001\u4ee5\u4e0b\u306e\u30b4\u30fc\u30eb\u3092\u76ee\u6a19\u306b\u958b\u767a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 Ruby\u306b\u30a4\u30f3\u30b9\u30d1\u30a4\u30a2\u3055\u308c\u305f\u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u3002 \u5909\u6570\u307e\u305f\u306f\u30e1\u30bd [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":12376,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[75],"tags":[1485,154],"class_list":["post-12377","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-crystal","tag-ruby"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/12377","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=12377"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/12377\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/12376"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=12377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=12377"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=12377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}