{"id":2863,"date":"2013-08-14T13:01:37","date_gmt":"2013-08-14T04:01:37","guid":{"rendered":"http:\/\/peta.okechan.net\/blog\/?p=2863"},"modified":"2013-08-14T13:01:37","modified_gmt":"2013-08-14T04:01:37","slug":"1-2-%e7%b0%a1%e5%8d%98%e3%81%aa%e8%a8%80%e8%aa%9e","status":"publish","type":"post","link":"https:\/\/peta.okechan.net\/blog\/archives\/2863","title":{"rendered":"1.2. \u7c21\u5358\u306a\u8a00\u8a9e"},"content":{"rendered":"<p><a href=\"https:\/\/peta.okechan.net\/blog\/archives\/2836\" title=\"LLVM\u306b\u3088\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306e\u5b9f\u88c5\">LLVM\u306b\u3088\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306e\u5b9f\u88c5\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u65e5\u672c\u8a9e\u8a33<\/a><br \/>\n\u7b2c1\u7ae0 \u4e07\u83ef\u93e1: \u307e\u3048\u304c\u304d\u3068\u5b57\u53e5\u89e3\u6790\u5668<br \/>\n<a href=\"http:\/\/llvm.org\/docs\/tutorial\/LangImpl01.html#the-basic-language\" target=\"_blank\">\u7b2c2\u7bc0 \u7c21\u5358\u306a\u8a00\u8a9e<\/a><\/p>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001&#8221;\u4e07\u83ef\u93e1\uff08Kaleidoscope\uff09&#8221;\uff08\u7f8e\u3057\u3044\u30fb\u69cb\u9020\u30fb\u898b\u901a\u3057\u3068\u3044\u3046\u610f\u5473\u3092\u8fbc\u3081\u3066\u547d\u540d\uff09\u3068\u3044\u3046\u304a\u904a\u3073\u8a00\u8a9e\uff08toy language\uff09\u3092\u7528\u3044\u3066\u8aac\u660e\u3057\u3066\u3044\u304f\u3002<br \/>\n\u4e07\u83ef\u93e1\u306f\u624b\u7d9a\u304d\u578b\u8a00\u8a9e\u3067\u3042\u308a\u3001\u95a2\u6570\u306e\u5b9a\u7fa9\u3001\u6761\u4ef6\u5206\u5c90\u3001\u6570\u5b66\u7684\u306a\u3082\u306e\u7b49\u3005\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3092\u8003\u616e\u306b\u5165\u308c\u305f\u3082\u306e\u3067\u3042\u308b\u3002<br \/>\n\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u901a\u3057\u3066\u3001if\/then\/else\u5236\u5fa1\u69cb\u9020\u3084for\u30eb\u30fc\u30d7\u3001\u30e6\u30fc\u30b6\u5b9a\u7fa9\u6f14\u7b97\u5b50\u3001\u7c21\u5358\u306a\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u3088\u308bJIT\u30b3\u30f3\u30d1\u30a4\u30eb\u7b49\u3005\u306e\u6a5f\u80fd\u3092\u4e07\u83ef\u93e1\u306b\u5bfe\u3057\u3066\u8ffd\u52a0\u3057\u3066\u3044\u304f\u3002<br \/>\n<em>\u8a33\u6ce8: \u3053\u3053\u3067\u306f\u624b\u7d9a\u304d\u578b\u8a00\u8a9e\u3068\u660e\u8a18\u3055\u308c\u3066\u308b\u304c\u305d\u308c\u306f8\u7ae0\u5168\u3066\u7d42\u4e86\u3057\u305f\u6642\u70b9\u306b\u304a\u3051\u308b\u8a71\u3067\u3042\u308a\u3001\u9014\u4e2d\u306e6\u7ae0\u307e\u3067\u306f\u95a2\u6570\u578b\u8a00\u8a9e\u7684\u3067\u3042\u308b\u3002<\/em><\/p>\n<p>\u7269\u4e8b\u3092\u30b7\u30f3\u30d7\u30eb\u306b\u4fdd\u3061\u305f\u3044\u306e\u3067\u3001\u4e07\u83ef\u93e1\u306b\u304a\u3051\u308b\u30c7\u30fc\u30bf\u578b\u306f64\u30d3\u30c3\u30c8\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\uff08C\u3067\u8a00\u3046\u3068\u3053\u308d\u306edouble\uff09\u306e\u307f\u3068\u3059\u308b\u3002<br \/>\n\u3064\u307e\u308a\u3001\u5168\u3066\u306e\u5024\u306f\u6697\u306b\u500d\u7cbe\u5ea6\u3067\u3042\u308a\u3001\u305d\u3057\u3066\u8a00\u8a9e\u306f\u30c7\u30fc\u30bf\u578b\u306e\u5b9a\u7fa9\u3092\u5fc5\u8981\u3068\u3057\u306a\u3044\u3002<br \/>\n\u3053\u308c\u306b\u3088\u3063\u3066\u8a00\u8a9e\u3092\u7d20\u6674\u3089\u3057\u304f\u305d\u3057\u3066\u30b7\u30f3\u30d7\u30eb\u306a\u69cb\u6587\u306b\u3059\u308b\u3002<br \/>\n\u4f8b\u3048\u3070\u3001\u6b21\u306e\u7c21\u5358\u306a\u4f8b\u306f\u30d5\u30a3\u30dc\u30ca\u30c3\u30c1\u6570\u3092\u8a08\u7b97\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\"># x\u756a\u76ee\u306e\u30d5\u30a3\u30dc\u30ca\u30c3\u30c1\u6570\u3092\u8a08\u7b97\u3059\u308b\r\ndef fib(x)\r\n  if x &lt; 3 then\r\n    1\r\n  else\r\n    fib(x-1)+fib(x-2)\r\n\r\n# \u6b21\u306e\u5f0f\u306f40\u756a\u76ee\u306e\u756a\u53f7\u3092\u8a08\u7b97\u3059\u308b\r\nfib(40)<\/pre>\n<p>\u4e07\u83ef\u93e1\u306f\u307e\u305f\u3001\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u95a2\u6570\u306e\u547c\u3073\u51fa\u3057\u3082\u53ef\u80fd\u3068\u3059\u308b\u3002\uff08LLVM JIT\u3067\u3053\u308c\u3092\u3084\u308b\u306e\u306f\u3068\u3066\u3082\u7c21\u5358\u3067\u3042\u308b\u3002\uff09<br \/>\n\u3053\u308c\u306f\u3001\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u95a2\u6570\u3092\u4f7f\u3046\u524d\u306bextern\u30ad\u30fc\u30ef\u30fc\u30c9\u306b\u3088\u3063\u3066\u95a2\u6570\u3092\u5b9a\u7fa9\u51fa\u6765\u308b\u4e8b\u3092\u610f\u5473\u3059\u308b\u3002<br \/>\n\uff08\u3053\u308c\u306f\u4e92\u3044\u306b\u518d\u5e30\u7684\u306a\u95a2\u6570\u306b\u304a\u3044\u3066\u3082\u4fbf\u5229\u3067\u3042\u308b\u3002\uff09<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">extern sin(arg);\r\nextern cos(arg);\r\nextern atan2(arg1 arg2);\r\n\r\natan2(sin(.4), cos(42))<\/pre>\n<p>\u3053\u308c\u3088\u308a\u3082\u3063\u3068\u9762\u767d\u3044\u4f8b\u3068\u3057\u3066\u3001\u8272\u3093\u306a\u62e1\u5927\u7387\u3067\u30de\u30f3\u30c7\u30eb\u30d6\u30ed\u96c6\u5408\u3092\u8868\u793a\u3059\u308b\u5c0f\u3055\u3044\u4e07\u83ef\u93e1\u30a2\u30d7\u30ea\u304c\u3001\u7b2c6\u7ae0\u306b\u3042\u308b\u3002<br \/>\n\u3055\u3041\u3053\u306e\u8a00\u8a9e\u306e\u5b9f\u88c5\u306b\u3068\u308a\u304b\u304b\u3063\u3066\u3044\u3053\u3046\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p><a href=\"https:\/\/peta.okechan.net\/blog\/archives\/2836\" title=\"LLVM\u306b\u3088\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306e\u5b9f\u88c5\">LLVM\u306b\u3088\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306e\u5b9f\u88c5\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u65e5\u672c\u8a9e\u8a33<\/a><br \/>\n\u7b2c1\u7ae0 \u4e07\u83ef\u93e1: \u307e\u3048\u304c\u304d\u3068\u5b57\u53e5\u89e3\u6790\u5668<br \/>\n<a href=\"http:\/\/llvm.org\/docs\/tutorial\/LangImpl01.html#the-basic-language\" target=\"_blank\">\u7b2c2\u7bc0 \u7c21\u5358\u306a\u8a00\u8a9e<\/a><\/p>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001&#8221;\u4e07\u83ef\u93e1\uff08Kaleidoscope\uff09&#8221;\uff08\u7f8e\u3057\u3044\u30fb\u69cb\u9020\u30fb\u898b\u901a\u3057\u3068\u3044\u3046\u610f\u5473\u3092\u8fbc\u3081\u3066\u547d\u540d\uff09\u3068\u3044\u3046\u304a\u904a\u3073\u8a00\u8a9e\uff08toy language\uff09\u3092\u7528\u3044\u3066\u8aac\u660e\u3057\u3066\u3044\u304f\u3002<br \/>\n\u4e07\u83ef\u93e1\u306f\u624b\u7d9a\u304d\u578b\u8a00\u8a9e\u3067\u3042\u308a\u3001\u95a2\u6570\u306e\u5b9a\u7fa9\u3001\u6761\u4ef6\u5206\u5c90\u3001\u6570\u5b66\u7684\u306a\u3082\u306e\u7b49\u3005\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3092\u8003\u616e\u306b\u5165\u308c\u305f\u3082\u306e\u3067\u3042\u308b\u3002<br \/>\n\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u901a\u3057\u3066\u3001if\/then\/else\u5236\u5fa1\u69cb\u9020\u3084for\u30eb\u30fc\u30d7\u3001\u30e6\u30fc\u30b6\u5b9a\u7fa9\u6f14\u7b97\u5b50\u3001\u7c21\u5358\u306a\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u3088\u308bJIT\u30b3\u30f3\u30d1\u30a4\u30eb\u7b49\u3005\u306e\u6a5f\u80fd\u3092\u4e07\u83ef\u93e1\u306b\u5bfe\u3057\u3066\u8ffd\u52a0\u3057\u3066\u3044\u304f\u3002<br \/>\n<em>\u8a33\u6ce8: \u3053\u3053\u3067\u306f\u624b\u7d9a\u304d\u578b\u8a00\u8a9e\u3068\u660e\u8a18\u3055\u308c\u3066\u308b\u304c\u305d\u308c\u306f8\u7ae0\u5168\u3066\u7d42\u4e86\u3057\u305f\u6642\u70b9\u306b\u304a\u3051\u308b\u8a71\u3067\u3042\u308a\u3001\u9014\u4e2d\u306e6\u7ae0\u307e\u3067\u306f\u95a2\u6570\u578b\u8a00\u8a9e\u7684\u3067\u3042\u308b\u3002<\/em><\/p>\n<p>\u7269\u4e8b\u3092\u30b7\u30f3\u30d7\u30eb\u306b\u4fdd\u3061\u305f\u3044\u306e\u3067\u3001\u4e07\u83ef\u93e1\u306b\u304a\u3051\u308b\u30c7\u30fc\u30bf\u578b\u306f64\u30d3\u30c3\u30c8\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\uff08C\u3067\u8a00\u3046\u3068\u3053\u308d\u306edouble\uff09\u306e\u307f\u3068\u3059\u308b\u3002<br \/>\n\u3064\u307e\u308a\u3001\u5168\u3066\u306e\u5024\u306f\u6697\u306b\u500d\u7cbe\u5ea6\u3067\u3042\u308a\u3001\u305d\u3057\u3066\u8a00\u8a9e\u306f\u30c7\u30fc\u30bf\u578b\u306e\u5b9a\u7fa9\u3092\u5fc5\u8981\u3068\u3057\u306a\u3044\u3002<br \/>\n\u3053\u308c\u306b\u3088\u3063\u3066\u8a00\u8a9e\u3092\u7d20\u6674\u3089\u3057\u304f\u305d\u3057\u3066\u30b7\u30f3\u30d7\u30eb\u306a\u69cb\u6587\u306b\u3059\u308b\u3002<br \/>\n\u4f8b\u3048\u3070\u3001\u6b21\u306e\u7c21\u5358\u306a\u4f8b\u306f\u30d5\u30a3\u30dc\u30ca\u30c3\u30c1\u6570\u3092\u8a08\u7b97\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\"># x\u756a\u76ee\u306e\u30d5\u30a3\u30dc\u30ca\u30c3\u30c1\u6570\u3092\u8a08\u7b97\u3059\u308b\r\ndef fib(x)\r\n  if x &lt; 3 then\r\n    1\r\n  else\r\n    fib(x-1)+fib(x-2)\r\n\r\n# \u6b21\u306e\u5f0f\u306f40\u756a\u76ee\u306e\u756a\u53f7\u3092\u8a08\u7b97\u3059\u308b\r\nfib(40)<\/pre>\n<p>\u4e07\u83ef\u93e1\u306f\u307e\u305f\u3001\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u95a2\u6570\u306e\u547c\u3073\u51fa\u3057\u3082\u53ef\u80fd\u3068\u3059\u308b\u3002\uff08LLVM JIT\u3067\u3053\u308c\u3092\u3084\u308b\u306e\u306f\u3068\u3066\u3082\u7c21\u5358\u3067\u3042\u308b\u3002\uff09<br \/>\n\u3053\u308c\u306f\u3001\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u95a2\u6570\u3092\u4f7f\u3046\u524d\u306bextern\u30ad\u30fc\u30ef\u30fc\u30c9\u306b\u3088\u3063\u3066\u95a2\u6570\u3092\u5b9a\u7fa9\u51fa\u6765\u308b\u4e8b\u3092\u610f\u5473\u3059\u308b\u3002<br \/>\n\uff08\u3053\u308c\u306f\u4e92\u3044\u306b\u518d\u5e30\u7684\u306a\u95a2\u6570\u306b\u304a\u3044\u3066\u3082\u4fbf\u5229\u3067\u3042\u308b\u3002\uff09<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">extern sin(arg);\r\nextern cos(arg);\r\nextern atan2(arg1 arg2);\r\n\r\natan2(sin(.4), cos(42))<\/pre>\n<p>\u3053\u308c\u3088\u308a\u3082\u3063\u3068\u9762\u767d\u3044\u4f8b\u3068\u3057\u3066\u3001\u8272\u3093\u306a\u62e1\u5927\u7387\u3067\u30de\u30f3\u30c7\u30eb\u30d6\u30ed\u96c6\u5408\u3092\u8868\u793a\u3059\u308b\u5c0f\u3055\u3044\u4e07\u83ef\u93e1\u30a2\u30d7\u30ea\u304c\u3001\u7b2c6\u7ae0\u306b\u3042\u308b\u3002<br \/>\n\u3055\u3041\u3053\u306e\u8a00\u8a9e\u306e\u5b9f\u88c5\u306b\u3068\u308a\u304b\u304b\u3063\u3066\u3044\u3053\u3046\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[466,467],"class_list":["post-2863","post","type-post","status-publish","format-standard","hentry","category-tech","tag-kaleidoscope","tag-llvm"],"_links":{"self":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts\/2863","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/comments?post=2863"}],"version-history":[{"count":0,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts\/2863\/revisions"}],"wp:attachment":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/media?parent=2863"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/categories?post=2863"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/tags?post=2863"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}