Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Ad icon
Sell your Land, House on idamata.lk for FREE
sajith.xp.pk
Updated:
Thursday at 9:03 AM
Handmade Character Soft Toys
anil1961
Updated:
Tuesday at 2:11 PM
Bodim.lk out now !
Manoj Suranga Bandara
Updated:
Sunday at 3:05 AM
Power Lifting Lever Belt
SkullVamp
Updated:
Jun 13, 2026
Ad icon
port.lk Domain for sale
Lankan-Tech
Updated:
Jun 13, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
Education
ElaKiri Programmer's Club
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="DJvodka" data-source="post: 15896664" data-attributes="member: 186185"><p><span style="font-size: 12px"><strong>Compilers vs Interpreters vs Virtual machines</strong></span></p><p><span style="font-size: 12px"></span></p><p><span style="font-size: 12px">මේ වචන ඕන කෙනෙක් අහල ඇතිනෙ. ඒක නිසා මේ ගැන විස්තර ටිකක් කතා කරමු. ගොඩක් traditional languages වැඩ කරන්නෙ source code එක ලියනව, compile කරනව, ඊට පස්සෙ run කරනව විදියට. මුලින්ම බලන්නෙ ඕනෙ ඇයි compilation කියන පියවර ඕන වෙන්නෙ කියල. </span></p><p><span style="font-size: 12px"></span></p><p><span style="font-size: 12px">අපි දන්නවනෙ CPU එකට English බෑ කියල. ඒක නිසා ඒකට තේරෙන බාසාවෙන් ඕන කතා කරල වැඩ ගන්න. අපි ලියන commands ටික ඒකට තේරෙන බාශාවට පරිවර්තනය කිරීම තමයි compilation එකෙන් කරන්නෙ. දැන් මේ හැදෙන file එකට කියන්නෙ binary file එක කියල. මේ binary file එක compatible වෙන්නෙ target OS (vm based languages are exceptions) එක මත විතරයි. ඒක නිසා තමයි Ubuntu වල ලියන කෝඩ් Windows වල වැඩ නොකරන්නෙ. ඉතින් අපි Ubuntu වල ලියන software එක windows වල වැඩ කරවන්න කරන්නෙ තනි කරම සිස්ටම් එක Windows compatible විදියට convert කරනව. මේකට තමයි port කරනව කියල කියන්නෙ. Software එකේ කෝඩ් 99%ක්ම ආපහු ලියන්න වෙනව. </span></p><p><span style="font-size: 12px"></span></p><p><span style="font-size: 12px">මේක ගොඩක් time consuming ක්රි්යාවලියක් නිසා මේකට විසදුමක් විදියට interpreted languages එනව (Eg<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick out tongue :p" loading="lazy" data-shortname=":p" />hp, python). මෙවායෙන් ලියන කෝඩ් වැඩ කරන්න interpreter එකක් ඕන වෙනව. Interpreters වලින් කරන්නෙ අපි ලියපු source code එක කෙලින්ම compile කරන් නැතුව runtime, line by line machine code execute වෙන එක. හැම OS එකටම අදාල interpreters හදල තියෙන නිසා එකම කොඩ් එක වෙනස් වීමක් නොකර run කිරීමේ හැකියාව තියෙනව. ඇත්තටම සමහර විට run time compile වීමක් සිදුවෙන්න පුලුවන්. ඒක depend වෙන්නෙ interpreter එක මත. නමුත් code එක ටිකක් විතර slow. (Eg: php, python හැබැයි සමහරු කියනව වගේ “ෆට්ට ස්ලෝව් නෑ“ <img src="/styles/default/xenforo/smilies/default/P.gif" class="smilie" loading="lazy" alt=":P" title=":P :P" data-shortname=":P" /> ) </span></p><p><span style="font-size: 12px"></span></p><p><span style="font-size: 12px">ඊට පස්සෙ මේක තවත් ටිකක් දියුනු වෙලා හයිබ්රිඩ් විදියට වැඩ කරන ක්රමයක් එනව. මේක ටිකක් C compilation වගේ තමයි. වෙනස තියෙන්නෙ compile කරහම කෙලින්ම os compatible binary එකක් වෙනුවට vm compatible binay එකක් හැදෙන්නෙ. මේ හැදෙන ෆයිල් එකට කියනව byte code/object code එක නැත්තම් Intermediate Language code එක කියල. (Eg: Java – bytecode , .Net - Common Intermediate Language (CIL)). Python\PHP වලට වඩා මේක වේගවත්ව කෝඩ් එක run වෙනව. මොකද compilers වලින් code optimization කියල දෙයක් කරන නිසා. මේනිසා Java bytecode එක ඕනම platform(windows/linux/solaris) එකක run කරගන්න පුලුවන් code එකේ කිසිම වෙනසක්, කම්පයිල් කිරීමක් සිදු නොකර. මේ නිසා තමයි Write once run anywhere කියල කියන්නෙ.</span></p><p><span style="font-size: 12px"></span></p></blockquote><p></p>
[QUOTE="DJvodka, post: 15896664, member: 186185"] [SIZE="3"][B]Compilers vs Interpreters vs Virtual machines[/B] මේ වචන ඕන කෙනෙක් අහල ඇතිනෙ. ඒක නිසා මේ ගැන විස්තර ටිකක් කතා කරමු. ගොඩක් traditional languages වැඩ කරන්නෙ source code එක ලියනව, compile කරනව, ඊට පස්සෙ run කරනව විදියට. මුලින්ම බලන්නෙ ඕනෙ ඇයි compilation කියන පියවර ඕන වෙන්නෙ කියල. අපි දන්නවනෙ CPU එකට English බෑ කියල. ඒක නිසා ඒකට තේරෙන බාසාවෙන් ඕන කතා කරල වැඩ ගන්න. අපි ලියන commands ටික ඒකට තේරෙන බාශාවට පරිවර්තනය කිරීම තමයි compilation එකෙන් කරන්නෙ. දැන් මේ හැදෙන file එකට කියන්නෙ binary file එක කියල. මේ binary file එක compatible වෙන්නෙ target OS (vm based languages are exceptions) එක මත විතරයි. ඒක නිසා තමයි Ubuntu වල ලියන කෝඩ් Windows වල වැඩ නොකරන්නෙ. ඉතින් අපි Ubuntu වල ලියන software එක windows වල වැඩ කරවන්න කරන්නෙ තනි කරම සිස්ටම් එක Windows compatible විදියට convert කරනව. මේකට තමයි port කරනව කියල කියන්නෙ. Software එකේ කෝඩ් 99%ක්ම ආපහු ලියන්න වෙනව. මේක ගොඩක් time consuming ක්රි්යාවලියක් නිසා මේකට විසදුමක් විදියට interpreted languages එනව (Eg:php, python). මෙවායෙන් ලියන කෝඩ් වැඩ කරන්න interpreter එකක් ඕන වෙනව. Interpreters වලින් කරන්නෙ අපි ලියපු source code එක කෙලින්ම compile කරන් නැතුව runtime, line by line machine code execute වෙන එක. හැම OS එකටම අදාල interpreters හදල තියෙන නිසා එකම කොඩ් එක වෙනස් වීමක් නොකර run කිරීමේ හැකියාව තියෙනව. ඇත්තටම සමහර විට run time compile වීමක් සිදුවෙන්න පුලුවන්. ඒක depend වෙන්නෙ interpreter එක මත. නමුත් code එක ටිකක් විතර slow. (Eg: php, python හැබැයි සමහරු කියනව වගේ “ෆට්ට ස්ලෝව් නෑ“ :P ) ඊට පස්සෙ මේක තවත් ටිකක් දියුනු වෙලා හයිබ්රිඩ් විදියට වැඩ කරන ක්රමයක් එනව. මේක ටිකක් C compilation වගේ තමයි. වෙනස තියෙන්නෙ compile කරහම කෙලින්ම os compatible binary එකක් වෙනුවට vm compatible binay එකක් හැදෙන්නෙ. මේ හැදෙන ෆයිල් එකට කියනව byte code/object code එක නැත්තම් Intermediate Language code එක කියල. (Eg: Java – bytecode , .Net - Common Intermediate Language (CIL)). Python\PHP වලට වඩා මේක වේගවත්ව කෝඩ් එක run වෙනව. මොකද compilers වලින් code optimization කියල දෙයක් කරන නිසා. මේනිසා Java bytecode එක ඕනම platform(windows/linux/solaris) එකක run කරගන්න පුලුවන් code එකේ කිසිම වෙනසක්, කම්පයිල් කිරීමක් සිදු නොකර. මේ නිසා තමයි Write once run anywhere කියල කියන්නෙ. [/SIZE] [/QUOTE]
Insert quotes…
Verification
Payakata winadi keeyak tibeda?
Post reply
Top
Bottom