Da Dumi Dumi
ADVERTISEMENT

Amsoshin sakonnin masu karatu ta tes da imel

Assalamu alaikum Baban Sadik, barka da warhaka. Ina fatan kana lafiya. Baban Sadik don Allah me ake nufi da TRANSLATOR da COMPILER, da INTERPRETER, a fannin Tsarin Gina Manhajar Kwamfuta (Programming Language)?  Sannan kuma, mene bambancin da ke tsakanin TRANSLATOR da INTERPRETER?  Wassalam: Uncle Bash, Jimeta-Yola: 07037133338

Wa alaikumus salam, a gaida Uncle Bash.  A farko dai, wadannan kalmomi ne masu nasaba ta kut-da-kut da fannin gina manhajar kwamfuta, wato Programming.  Akwai dabarun gina manhajar kwamfuta (Programming Languages) sama da 100 a duniya, tsakanin na zamanin baya da na yanzu.  Mu dawo kan wadannan kalmomi naka. Kalmar TRANSLATOR dai wata manhaja ce ta musamman da ke aikin juya ginanniyar manhajar kwamfuta da aka rubuta da wani harshe (misali, nau’in C, ko C++, ko Jaba), zuwa wani harshe daban (kamar Python misali) don samar da asalin manhajar cikin wani harshe. Kalmar COMPILER kuma manhaja ce da ke aikin sarrafa danyen bayanin da aka gina manhajar kwamfuta da shi da ake kira Source Code, zuwa tsagwaron bayanan da kwamfuta ce kadai ke iya fahimtarsu, wato Machine Language. Misali, asalin bayanan da aka gina mahnajar Microsoft Word da su, duk haruffa ne da lambobi, wadanda duk mai karatu zai iya karantawa idan ya gamsu.  To amma sai aka yi amfani da manhajar COMPILER don “kona” wadannan bayanai, zuwa harshen kwamfuta, don bai wa kwamfuta damar karbar wannan “konannun” bayanai idan mai kwamfutar ya zo loda mata.  Wannan konannen bayanin manhajar kwamfuta shi ake kira Edecutable File.  Idan ka je ka sayi manhajar kwamfuta a cikin DBD ko faifan CD, ko ka saukar daga Intanet, za ka ga jakunkunan bayanai ne masu dauke da wasu irin nau’ukan bayanan da ba a iya karanta su.  Amma da zarar ka matsa, ka fara loda wa kwamfuta, nan take za ta karbe su. Dabarun gina manhajar kwamfuta irin su: C da C++ da JABA, duk suna amfani ne da manhajar COMPILER kafin a dinke su.  Misali, ga wasu danyun bayanan manhajar kwamfuta da ake son ta bayyana wasu lambobi, idan ba ta ci karo da su ba, ta bayyana wani abu daban: A = 30. If A = 30, print “Gaskiya ne” else: print “Karya ce”. Da zarar ka mika wa kwamfuta wannan manhaja, ba za ta fahimce su ba ko kadan, sai ka yi amfani da manhajar COMPILER don juya su zuwa harshen kwamfuta, sannan ka mika mata ta karba.

ADVERTISEMENT

A daya bangaren kuma, INTERPRETER wata manhaja ce da ke iya sarrafa danyun bayanan manhajar kwamfuta, wato Source Code, zuwa hakikanin manhajar, kai-tsaye, ba tare da sai an mayar da su zuwa konannun bayanan da kwamfuta ke iya fahimta kafin a loda mata ba. Daga cikin dabarun gina manhajar kwamfuta masu dauke da manhajar INTERPRETER akwai Perl da Python da kuma Ruby. Misalin da na kawo a sama na harshen Python ne. Idan ka mika wa masarrafar Python wannan misali, nan take za ta ba ka amsa, ba sai ta kona su zuwa wani harshe ba.  Nan take,  take karantawa, ta juya sakon zuwa manhajar da ake bukata.  Galibin gidajen yanar sadarwa na zamani kan yi amfani da wannan manhaja ta INTERPRETER a iyayen garkensu da ke dauke da shafukan yanarsu, don bai wa kwamfutar damar zartar da umarnin da mai ziyara ke bayarwa a shafin, ba tare da bata lokaci ba. Sai dai amfanin wannan manhaja ta INTERPRETER takaitacce ne, domin ba ta iya jure juya danyun bayanan manhajar kwamfuta mai yawa, sai ’yan kanana ko kadan. Da manhajar COMPILER da INTERPRETER duk kusan aiki daya suke yi; bambancinsu shi ne, COMPILER ta fi amfani da juriya wajen aiwatar da ayyuka masu dimbin yawa, kuma manhajojin da aka kona su ta amfani da manhajar COMPILER suna iya mu’amala da dukkan sassan kwamfutar da aka loda mata su, amma na INTERPRETER ba su iya komai, sai dai su bayyana kansu kawai, tsagwaronsu.  Da zarar ka rufe su shi ke nan, sun koma danyunsu.

Sai tambayarka ta karshe kan bambancin da ke tsakanin TRANSLATOR da INTERPRETER. Shi TRANSLATOR aikinsa shi ne juya danyun bayanai daga wani harshe zuwa wani, shi kuma INTERPRETER kamar yadda ka gani, aikinsa shi ne juya danyen manhaja zuwa hakikanin manhaja nan take, ba tare da konawa kafin loda wa kwamfuta ba.  Da fatan ka gamsu.

ADVERTISEMENT