{"id":432,"date":"2017-04-28T12:45:20","date_gmt":"2017-04-28T12:45:20","guid":{"rendered":"http:\/\/ta.onionmixer.net\/wordpress\/?p=432"},"modified":"2017-04-28T12:45:20","modified_gmt":"2017-04-28T12:45:20","slug":"opensmalltalk-vm-%ea%b0%9c%ec%9a%94overview-%ec%b4%88%eb%b2%8c%eb%b2%88%ec%97%ad","status":"publish","type":"post","link":"http:\/\/ta.onionmixer.net\/wordpress\/?p=432","title":{"rendered":"opensmalltalk-vm \uac1c\uc694(overview) \ucd08\ubc8c\ubc88\uc5ed"},"content":{"rendered":"<p><strong>OVERVIEW<\/strong><br \/>\n<strong>\uac1c\uc694<\/strong><\/p>\n<p>Cog is an evolution of the Squeak Back-to-the-future Smalltalk virtual machine that provides a number of different Smalltalk virtual machines.<\/p>\n<p>Gog \ub294 \uc5ec\ub7ec\uac00\uc9c0 \ud615\ud0dc\ub85c \uacf5\uae09\ub418\uace0 \uc788\ub358 \uc11c\ub85c \ub2e4\ub978 Smalltalk \uac00\uc0c1\uba38\uc2e0\uc758 \ubbf8\ub798\ub97c \uc704\ud55c \ud601\uba85\uc785\ub2c8\ub2e4.<\/p>\n<p>&nbsp;<\/p>\n<p>The VMs are developed in Smalltalk, using all the dynamic and reflective facilities of the Squeak\/Pharo Smalltalk system.<\/p>\n<p>VM \ub4e4\uc740 Smalltalk \uc73c\ub85c \uac1c\ubc1c\ub418\uc5c8\uc73c\uba70 Squeak\/Pharo Smalltalk \uc2dc\uc2a4\ud15c\uc5d0 \ub3d9\uc801(dynamic) \uadf8\ub9ac\uace0 \ubc18\uc601(reflective-\ub7f0\ud0c0\uc784 \uc2dc\uc810\uc5d0\uc11c \uc2a4\uc2a4\ub85c\ub97c \uad00\ub9ac \ubc0f \uc218\uc815) \uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \ud3b8\uc758\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4.<br \/>\nAs such, developing in Cog is a delight. The Smalltalk framework comprising the various Cog VMs is translated into C by its Slang component to produce VM source that is combined with platform-specific support sources and compiled via a C compiler to obtain a fast production VM.<\/p>\n<p>\ub530\ub77c\uc11c Cog \uc5d0\uc11c \uac1c\ubc1c\ud55c\ub2e4\ub294\uac74 \uc990\uac70\uc6b4 \uc77c\uc785\ub2c8\ub2e4. \ub2e4\uc591\ud55c CogVM \uc5d0\uc11c \uad6c\uc131\ub41c smalltalk \ud504\ub808\uc784\uc6cc\ud06c\ub294 Slang \ucef4\ud3ec\ub10c\ud2b8\uc5d0 \uc758\ud574 C \ub85c \ubcc0\ud658\ub418\uba70 \ud50c\ub7ab\ud3fc \uace0\uc720\uc758 \uc9c0\uc6d0\uc18c\uc2a4(support source) \uc640 \uacb0\ud569\ub41c VM \uc18c\uc2a4\ub97c \uc0dd\uc131\ud558\uba70 \uc774\ub294 C \ucef4\ud30c\uc77c\ub7ec\ub97c \ud1b5\ud574 production VM \uc744 \ube60\ub974\uac8c \ucef4\ud30c\uc77c \ud569\ub2c8\ub2e4.<br \/>\nThis directory tree includes the output of Slang for various configurations of &#8220;Cog VM&#8221; and the associated platform support code, plus build directories that can be used to produce production VMs.<\/p>\n<p>\uc774 \ub514\ub809\ud1a0\ub9ac\uc5d0\ub294 \ud2b8\ub9ac\uc5d0\ub294 \ub2e4\uc591\ud55c &#8220;Cog VM&#8221; \uad6c\uc131 \ubc0f \uad00\ub828\ub41c \ud50c\ub7ab\ud3fc \uc9c0\uc6d0\ucf54\ub4dc\uc6a9 Slang \ucd9c\ub825 \ubc0f production VM \uc744 \uc0dd\uc131\ud558\ub294\ub370 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \ube4c\ub4dc \ub514\ub809\ud1a0\ub9ac\ub97c \ud3ec\ud568\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>&nbsp;<\/p>\n<p>This directory tree also includes an instance of the Smalltalk Cog development system, suitable for developing the VM in Smalltalk, and for generating new VM sources.<\/p>\n<p>\uc774 \ub514\ub809\ud1a0\ub9ac \ud2b8\ub9ac\ub294 Smalltalk Cog \uac1c\ubc1c \uc2dc\uc2a4\ud15c\uc758 \uc778\uc2a4\ud134\uc2a4\ub97c \ud3ec\ud568\ud558\uace0 \uc788\uc73c\uba70 Smalltalk \uc5d0\uc11c VM \uc744 \uac1c\ubc1c\ud558\uace0 \uc0c8\ub85c\uc6b4 VM \uc18c\uc2a4\ub97c \uc0dd\uc131\ud574\ub0b4\ub294\ub370 \uc801\ud569\ud569\ub2c8\ub2e4.<\/p>\n<p>&nbsp;<\/p>\n<p>The &#8220;Cog VM&#8221; comes in a bewildering variety of forms. The first distinction is between Squeak\/Croquet VMs that run Squeak, Pharo, Cuis, Croquet images and their ilk, and between Newspeak VMs that run Newspeak.<\/p>\n<p>&#8220;Cog VM&#8221; \uc740 \uace0\ub974\uae30 \ud798\ub4e4 \uc815\ub3c4\uc758 \ub2e4\uc591\ud55c \ud615\ud0dc\ub85c \uc81c\uacf5\ub429\ub2c8\ub2e4. \uccab\ubc88\uc9f8 \ucc28\uc774\uc810\uc740 Squeak, Pharo, Cuis, Croquet \uc774\ubbf8\uc9c0 \ubc0f \uac19\uc740 \uc885\ub958\ub97c \uc2e4\ud589\ud558\ub294 Squeak \/ Croquet VM \uacfc Newspeak \uc744 \uc2e4\ud589\ud558\ub294 Newspeak VM \uc5d0 \uc788\uc2b5\ub2c8\ub2e4.(\uc5ed\uc790\uc8fc: http:\/\/newspeaklanguage.org\/ \uc740 Self \ubc0f Smalltalk \uc744 \ubc14\ud0d5\uc73c\ub85c\ud558\ub294 \uc0c8\ub85c\uc6b4 \uc5b8\uc5b4\ub77c\uace0 \ud558\ub294\uad70\uc694)<\/p>\n<p>&nbsp;<\/p>\n<p>Another distinction is between Stack, Cog and Sista VMs.<\/p>\n<p>VM \uc0ac\uc774\uc758 \ub610 \ub2e4\ub978 \ucc28\uc774\uc810\uc73c\ub85c\ub294 Stack Cog \ubc0f Sista VM \ub4e4 \uc785\ub2c8\ub2e4.(Sista VM \uc758 \uacbd\uc6b0\ub294 http:\/\/www.mirandabanda.org\/cogblog\/about-cog\/ \uc5d0\uc11c \uc5b8\uae09\ub418\uace0 \uc788\uc2b5\ub2c8\ub2e4\ub9cc&#8230;. \uc77c\ub2e8 \uc18d\ub3c4\uac00 \ube60\ub978\uac78 \uc7a5\uc810\uc73c\ub85c \uaf3d\uace0 \uc788\ub124\uc694)<\/p>\n<p>&nbsp;<\/p>\n<p>Stack VMs are those with context-to-stack mapping that optimise message sending by keeping method activations on a stack instead of in contexts.<\/p>\n<p>Stack VM \uc740 context \uac00 \uc544\ub2cc Stack \uc5d0\uc11c \uba54\uc11c\ub4dc \ud65c\uc131\ud654(activation)\uc744 \uc720\uc9c0\ud568\uc73c\ub85c\uc11c (smalltalk \uc5d0\uc11c\uc758) \uba54\uc2dc\uc9c0 \uc804\uc1a1\uc744 \ucd5c\uc801\ud654 \ud558\ub294 context-to-stack \ub9e4\ud551\uc744 \ud569\ub2c8\ub2e4.<\/p>\n<p>&nbsp;<\/p>\n<p>These are pure interpreters but are significantly faster than the standard context-based Interpreter VM.<\/p>\n<p>\uc774\ub7ec\ud55c VM \ub4e4\uc740 \uc21c\uc218\ud55c \uc778\ud130\ud504\ub9ac\ud130 \uae30\ubc18\uc774\uc9c0\ub9cc \ud45c\uc900 context \uae30\ubc18\uc758 \uc778\ud130\ud504\ub9ac\ud130 VM \ubcf4\ub2e4 \ud6e8\uc52c \ube60\ub985\ub2c8\ub2e4.<br \/>\nCog VMs add a JIT to the mix, compiling methods used more than once to machine code on the fly.<\/p>\n<p>Cog VM\uc740 JIT \ub97c \uac19\uc774 \uc81c\uacf5\ud569\ub2c8\ub2e4, \uc774\ub294 \ub450\ubc88\uc774\uc0c1 \uc0ac\uc6a9\ub418\ub294 \uacbd\uc6b0 \ucef4\ud30c\uc77c\ub41c \uba54\uc11c\ub4dc\ub97c \uc81c\uacf5\ud568\uc73c\ub85c\uc11c \ucf54\ub4dc\ub97c \ucef4\ud30c\uc77c \uc791\uc5c5\uc744 \uac70\uc9c0\uce58 \uc54a\uace0 \uc989\uc2dc \ucc98\ub9ac\ub418\uac8c \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>&nbsp;<\/p>\n<p>Sista VMs, as yet unrealised and in development, add support for adaptive optimization that does speculative inlining at the bytecode-to-bytecode level.<\/p>\n<p>\uc544\uc9c1 \uac1c\ubc1c\ub2e8\uacc4\uc778 Sista VM \uc740 bytecode-to-bytecode \uc218\uc900(level)\uc758 \ucd94\ub860\uc801 \uc9c1\ub82c\uc744 \uc218\ud589\ud558\ub294 &#8220;\uc801\uc751\ud615 \ucd5c\uc801\ud654 \uc9c0\uc6d0&#8221;\uc744 \ucd94\uac00\ud569\ub2c8\ub2e4.<\/p>\n<p>&nbsp;<\/p>\n<p>These are under development and targeted for release in 2015.<\/p>\n<p>\uc774\ub7f0\uac83\ub4e4\uc740 \uc544\uc9c1 \uac1c\ubc1c\uc911\uc774\uba70 2015\ub144\uc5d0 \ucd9c\uc2dc\ub420 \uc608\uc815\uc785\ub2c8\ub2e4(\uc9c0\uae08\uc740 2017\ub144\uc774\uc8e0 :D)<br \/>\nAnother distinction is between &#8220;v3&#8221; VMs and Spur VMs.<\/p>\n<p>\ub610 \ub2e4\ub978 \ucc28\uc774\uc810\uc740 &#8220;v3&#8221; VM \uacfc Spur VM \uc785\ub2c8\ub2e4.(&#8230;\uc774\uc81c\ub294 vm \uc758 \ud3ec\ub9f7\ub3c4 \ucd5c\uc801\ud654\ub97c \uc704\ud574 \ubc14\ub00c\ub294 \ubaa8\uc591\uc785\ub2c8\ub2e4)<\/p>\n<p>&nbsp;<\/p>\n<p>&#8220;v3&#8221; is the original object representation for Squeak as described in the back-to-the-future paper.<\/p>\n<p>&#8220;v3&#8221; \ub294 back-to-the-future \ubb38\uc11c\uc5d0 \uc124\uba85\ub41c\ub300\ub85c Squeak \uc758 \uc6d0\ubcf8 \uac1d\uccb4 \ud45c\ud604\uc785\ub2c8\ub2e4.<\/p>\n<p>&nbsp;<\/p>\n<p>Spur, as described on the www.mirandabanda.org blog, is a faster object representation which uses generation scavenging, lazy forwarding for fast become, a single object header format common to 32 and 64 bit versions, and a segmented heap that can grow and shrink, releasing memory back to the host OS.<\/p>\n<p>www.mirandabanda.org \ube14\ub85c\uadf8\uc5d0 \uc124\uba85 \ub41c \ubc14\uc640 \uac19\uc774 Spur \ub294 \uac1d\uccb4\uc758 \ube60\ub978 \uc0dd\uc131 \ubc0f \uc18c\uac70, \ube60\ub978 \ub3d9\uc791\uc744 \uc704\ud55c \uc9c0\uc5f0 \uc804\uc1a1, 32 \ube44\ud2b8 \ubc0f 64 \ube44\ud2b8 \ubc84\uc804\uc5d0 \uacf5\ud1b5\uc801 \uc778 \ub2e8\uc77c \uac1d\uccb4 \ud5e4\ub354 \ud615\uc2dd, \uadf8\ub9ac\uace0 \ud655\uc7a5 \ub610\ub294 \ucd95\uc18c \uac00\ub2a5\ud55c \ubd84\ud560(segmented) \ud799, \uba54\ubaa8\ub9ac\ub97c HOST OS \ub85c \ub2e4\uc2dc \ud574\uc81c(releasing) \ubc18\ud658\ud560 \uc218 \uc788\ub3c4\ub85d \ub9cc\ub4e4\uc5b4\uc838 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>&nbsp;<\/p>\n<p>Newspeak, Squeak 5.0 and Pharo 5 use Spur.<\/p>\n<p>Newspeak, Squeak 5.0 \uacfc Pharo 5 \ub294 Supr \ub97c \uc0ac\uc6a9\ud569\ub2c8\ub2e4.<\/p>\n<p>&nbsp;<\/p>\n<p>Another distinction is between normal single-threaded VMs that schedule &#8220;green&#8221; Smalltalk light-weight processes above a single-threaded VM, and multi-threaded VMs that share the VM between any number of native threads such that only one native thread owns the VM at any one time, switching between threads on FFI calls and callbacks or on Smalltalk process switches when Smalltalk processes are owned by threads.<\/p>\n<p>\ub610 \ub2e4\ub978 \ucc28\uc774\uc810\uc73c\ub85c\ub294 \ub2e8\uc77c \uc2a4\ub808\ub4dc VM \uc5d0\uc11c &#8220;green&#8221; Smalltalk \uacbd\ub7c9(light-weight) \ud504\ub85c\uc138\uc2a4\ub97c \uc2a4\ucf00\uc904\ub9c1 \ud558\ub294 \uc77c\ubc18 \ub2e8\uc77c\uc2a4\ub808\ub4dc VM \uc774\uba70, \ub610\ud55c \ud55c\ubc88\uc5d0 \ud558\ub098\uc758 \uae30\ubcf8 \uc2a4\ub808\ub4dc\ub9cc VM\uc744 \uc18c\uc720\ud558\ub3c4\ub85d \ud558\uba70 VM\uc744 \uacf5\uc720\ud558\ub294 \ubaa8\ub4e0 \uae30\ubcf8 \uc2a4\ub808\ub4dc \uac04\uc5d0 VM\uc744 \uacf5\uc720\ud558\ub294 VM, Smalltalk \ud504\ub85c\uc138\uc2a4\uac00 \uc2a4\ub808\ub4dc\uc5d0 \uc758\ud574 \uc18c\uc720 \ub420 \ub54c FFI \ud638\ucd9c\uacfc \ucf5c\ubc31 \ub610\ub294 Smalltalk \ud504\ub85c\uc138\uc2a4 \uc2a4\uc704\uce58\uc758 \uc2a4\ub808\ub4dc \uac04 \uc804\ud658 \ub4f1\uc774 \uc788\uc2b5\ub2c8\ub2e4.<br \/>\nThis architecture offers non-blocking FFI calls and interoperability with multiple native threads, but does \/not\/ provide true concurrency.<\/p>\n<p>\uc774 \uad6c\uc870\ub294 \ub10c\ube14\ub7ed\ud0b9 FFI \ud638\ucd9c\uacfc \uc5ec\ub7ec \uc6d0\uc2dc \uc2a4\ub808\ub4dc\uc640\uc758 \uc0c1\ud638 \uc6b4\uc6a9\uc131\uc744 \uc81c\uacf5\ud558\uc9c0\ub9cc \uc9c4\uc815\ud55c \ub3d9\uc2dc\uc131\uc744 \uc81c\uacf5\ud558\ub294 \uac83\uc740 \uc544\ub2d9\ub2c8\ub2e4.<\/p>\n<p>&nbsp;<\/p>\n<p>This multi-threaded support is as yet experimental.<\/p>\n<p>\uc9c4\uc815\ud55c \ub3d9\uc2dc\uc131\uc744 \uc81c\uacf5\ud558\ub294 \uba40\ud2f0 \uc2a4\ub808\ub4dc\ub294 \uc544\uc9c1 \uc2e4\ud5d8\uc801\uc785\ub2c8\ub2e4.<br \/>\nnscogsrc\/vm- Newspeak Cog V3<br \/>\nnsspursrc\/vm- Newspeak Cog Spur<br \/>\nnsspurstacksrc\/vm- Newspeak Stack Spur<br \/>\nnsstacksrc\/vm- Newspeak Stack V3<br \/>\nsistasrc\/vm- Smalltalk Sista V3<br \/>\nspursistasrc\/vm- Smalltalk Sista Spur<br \/>\nspursrc\/vm- Smalltalk Cog Spur<br \/>\nspur64src\/vm- Smalltalk Cog Spur 64-bit<br \/>\nspurstacksrc\/vm- Smalltalk Stack Spur<br \/>\nspurstack64src\/vm- Smalltalk Stack Spur 64-bit<br \/>\nsrc\/vm- Smalltalk Cog V3<br \/>\nstacksrc\/vm- Smalltalk Stack V3<\/p>\n","protected":false},"excerpt":{"rendered":"<p>OVERVIEW \uac1c\uc694 Cog is an evolution of the Squeak Back-to-the-future Smalltalk virtual machine that provides a number of different Smalltalk virtual machines. Gog \ub294 \uc5ec\ub7ec\uac00\uc9c0 \ud615\ud0dc\ub85c \uacf5\uae09\ub418\uace0 \uc788\ub358 \uc11c\ub85c \ub2e4\ub978 Smalltalk \uac00\uc0c1\uba38\uc2e0\uc758 \ubbf8\ub798\ub97c \uc704\ud55c \ud601\uba85\uc785\ub2c8\ub2e4. &nbsp; The VMs are developed in Smalltalk, using all the dynamic and reflective facilities of the Squeak\/Pharo Smalltalk system. VM [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,10,9],"tags":[16,98,78,99],"_links":{"self":[{"href":"http:\/\/ta.onionmixer.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/432"}],"collection":[{"href":"http:\/\/ta.onionmixer.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ta.onionmixer.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ta.onionmixer.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/ta.onionmixer.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=432"}],"version-history":[{"count":1,"href":"http:\/\/ta.onionmixer.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/432\/revisions"}],"predecessor-version":[{"id":433,"href":"http:\/\/ta.onionmixer.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/432\/revisions\/433"}],"wp:attachment":[{"href":"http:\/\/ta.onionmixer.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ta.onionmixer.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=432"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ta.onionmixer.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}