<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Talha Zekeriya Durmuş</title>
    <description>Bir bilgisayar sevdalısı, Ankara Üniversiteli ve genç bir hayalperest.
</description>
    <link>http://talhadurmus.com/</link>
    <atom:link href="http://talhadurmus.com/feed.xml" rel="self" type="application/rss+xml" />
    <pubDate>Wed, 14 Jul 2021 19:43:56 +0000</pubDate>
    <lastBuildDate>Wed, 14 Jul 2021 19:43:56 +0000</lastBuildDate>
    <generator>Jekyll v3.9.0</generator>
    
      <item>
        <title>Sonlanma Problemi</title>
        <description>&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=92WHN-pAFCs&quot;&gt;Proof That Computers Can’t Do Everything&lt;/a&gt; adlı videoda Turing prensibiyle çalışan makinelerin neden her şeyi yapamayacağını güzel bir animasyon eşliğinde anlatıyor. Doğrusu video ilk başta kafa karıştırıcı ancak biraz araştırma yapınca olayın o kadar da karışık gelmediği anlaşılıyor.&lt;/p&gt;

&lt;p&gt;Konuya giriş yapmadan önce bir ispat yöntemi olan &lt;a href=&quot;http://www.bilgisayarkavramlari.com/2008/08/02/burhan-i-mutenakis-proof-by-contradiction-olmayana-ergi/&quot;&gt;proof by contradiction&lt;/a&gt; anlatmayı gerek görüyorum.&lt;/p&gt;

&lt;h3 id=&quot;proof-by-contradiction-1&quot;&gt;Proof by contradiction 1&lt;/h3&gt;

&lt;p&gt;Bir şeyi ispat etmek için, tersinin yanlış olduğunu ispatlayabiliriz.&lt;/p&gt;

&lt;p&gt;Önerme P: 0’dan daha büyük, en küçük değere sahip bir sayı yoktur.&lt;/p&gt;

&lt;p&gt;Bu önermenin tersinin doğru olduğunu varsayıyoruz ve &lt;strong&gt;r&lt;/strong&gt;‘nin 0’dan büyük en küçük değere sahip rasyonel sayı olduğunu varsayıyoruz.&lt;/p&gt;

&lt;p&gt;Varsayım Q: O halde r/2, 0’dan büyük ve r’den daha küçük bir rasyonel sayı olur.&lt;/p&gt;

&lt;p&gt;Fakat Önerme P için en küçük sayının r olabileceğini söylemiştik ancak r/2 nin aslında daha küçük olduğunu gördük. Bu ifade çelişiyor. Demekki Önerme P’nin tersi yanlış. Bu da bize Önerme P’nin doğru olduğunu gösteriyor.&lt;/p&gt;

&lt;h3 id=&quot;proof-by-contradiction-2&quot;&gt;Proof by contradiction 2&lt;/h3&gt;

&lt;p&gt;Bir diğer örnek ise \(\sqrt{2}\) nin irrasyonel olduğunun ispatı.&lt;/p&gt;

&lt;p&gt;Eğer rasyonel sayı olduğunu varsayarsak \(\sqrt{2}\) , \(\frac{a}{b}\) şeklinde ifade edebiliriz. Bu durumda \(a\) ve \(b\) bir tam sayıdır. Ayrıca \(\frac{a}{b}\) kesirinde a ve b’nin en düşük terimler olduğunu varsayarsak a tek sayı olmak zorundadır.&lt;/p&gt;

&lt;p&gt;Eğer \(\sqrt{2} = \frac{a}{b}\) ise \(a^2 = 2b^2\) olur.&lt;/p&gt;

&lt;p&gt;\(a\) eğer tek sayıysa \(a^2\) de tek sayı olur. Ancak \(a^2\) nin \(b^2\) nin iki katı olduğu gözüküyor. Bu durumda \(a^2\) bir çift sayı olmak zorundadır. İşte burada bir çelişki var ve \(\sqrt{2}\) rasyonel olmadığını görüyoruz. Buradan yola çıkarak \(\sqrt{2}\) irrasyonel bir sayı olduğunu ispatlamış oluyoruz.&lt;/p&gt;

&lt;h3 id=&quot;durma-problemi&quot;&gt;Durma Problemi&lt;/h3&gt;

&lt;p&gt;Videodan yola çıkarsak;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;A(x) = toplama işlemi yapan bir makine&lt;/li&gt;
  &lt;li&gt;C(x) = bir sonraki satranç hamlesini veren bir makine&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A ve C farklı girdi (input) değerleri alan birbirinden farklı iki blueprint (teknik devre çizimi).&lt;/p&gt;

&lt;p&gt;Eğer biz A makinesinden bir sonraki satranç hamlesini istersek ya da C makinesinden toplama işlemninin sonucunu istersek program cevabı bulamayacaktır ve makine sıkışacaktır.&lt;/p&gt;

&lt;p&gt;Bunu kontrol edebilmek için H(x, y) adında, makine türü (x) ve input (y) şeklinde bir cihaz olduğunu varsayarsak ve bu makine verilen makine türü ve input için işlemin çalışıp çalışmayacağını döndürdüğünü varsayarsak. Bu makineye:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;H(A, matematiksel işlem) verdiğimizde “not stuck” yani çalışır mesajı döndürür.&lt;/li&gt;
  &lt;li&gt;H(A, satranç tahtası) verdiğimizde ise “stuck” yani makine sıkışır mesajı döndürür.&lt;/li&gt;
  &lt;li&gt;H(C, matematiksel işlem) verdiğimizde “stuck” yani makine sıkışır mesajı döndürür.&lt;/li&gt;
  &lt;li&gt;H(C, satranç tahtası) verdiğimizde “not stuck” yani çalışır mesajı döndürür.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Burada teorem: Turing prensibiyle çalışan bir H makinesinin olamaz.&lt;/p&gt;

&lt;p&gt;Bu teoremin tersinin yanlış olduğunu ispatlarsak teoremin doğru olduğunu ispatlamış oluruz.&lt;/p&gt;

&lt;p&gt;Öyleyse böyle bir H makinesinin olduğunu varsayalım.&lt;/p&gt;

&lt;p&gt;N adında tersini veren(negator) bir makine tanımlayalım:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;N(not stuck) verdiğimizde makine sıkışır.&lt;/li&gt;
  &lt;li&gt;N(stuck) verdiğimizde ise çıktı olarak &lt;strong&gt;:)&lt;/strong&gt; verir.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Kısaca N için, H makinesinin bize verdiği yanıta güvenerek işlemimizi gerçekleştirdiğini varsayalım.&lt;/p&gt;

&lt;p&gt;H makinesine Girdi(Input) olarak kendisini verirsek ne olur?&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;H(H, H) “stuck” döndürür ve N makinesi çıktı olarak &lt;strong&gt;:)&lt;/strong&gt; döndürür.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;H makinesi bize işlemin cevabının “stuck” olduğunu söyledi ancak çıktı olarak &lt;strong&gt;:)&lt;/strong&gt; almamız bize H’nin yanıldığını gösteriyor.&lt;/p&gt;

&lt;p&gt;Diğer bir ihtimal ise&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;H(H, H) “not stuck” döndürür ve bu yanıtı işleyen N makinesi ise sıkışır.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;H makinesi bu durumda işlemin cevabının “not stuck” olduğunu söylemişti ancak N makinesi işlem sonucunda sıkıştı.&lt;/p&gt;

&lt;p&gt;Bu sonuca göre “Turing prensibiyle çalışan bir H makinesinin olamaz” teoreminin doğru olduğunu çıkarıyoruz.&lt;/p&gt;

&lt;p&gt;Yani bir makinenin verilen girdilerle geçerli bir şekilde çalışıp çalışmayacağını bulan bir makine yapılacak olsa, bu makine kendisini sınayamayacaktır. Bu da Turing prensibiyle çalışan böyle bir makine yapılamayacağı anlamına gelmektedir.&lt;/p&gt;

</description>
        <pubDate>Tue, 15 Nov 2016 00:00:00 +0000</pubDate>
        <link>http://talhadurmus.com/bilgisayar-bilimi/sonlanma-problemi</link>
        <guid isPermaLink="true">http://talhadurmus.com/bilgisayar-bilimi/sonlanma-problemi</guid>
        
        
        <category>Bilgisayar-Bilimi</category>
        
      </item>
    
      <item>
        <title>Windows'ta Kablosuz Ağ Oluşturmak</title>
        <description>&lt;p&gt;Program kurmadan aşağıdaki kodu yönetici iznine sahip cmd üzerinden çalıştırarak wifi ağı açmak mümkün.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;netsh wlan start hostednetwork
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Bu kodu çalıştırmadan önce açacağınız wifi ağına parola vermek isterseniz herhalde :)&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;netsh wlan set hostednetwork mode=allow ssid=WIRELESSADI key=PAROLA
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Sonrasında isterseniz kablolu ağınızdaki interneti bu kablosuz ağınıza bağlamanız mümkün. Hatta bilgisayarınızı kablosuz ağınızı genişletmek için de kullanabilirsiniz. Bir kablosuz ağa bağlıyken bir kablosuz ağ yayını yapabilirsiniz.&lt;/p&gt;
</description>
        <pubDate>Wed, 01 Jun 2016 00:00:00 +0000</pubDate>
        <link>http://talhadurmus.com/windows/kablosuz-ag-olusturmak</link>
        <guid isPermaLink="true">http://talhadurmus.com/windows/kablosuz-ag-olusturmak</guid>
        
        
        <category>Windows</category>
        
      </item>
    
      <item>
        <title>VestaCP Üzerine Bir Günce</title>
        <description>&lt;p&gt;Sunucuyu php-7 ye yükseltme denemem başarısız olduktan sonra sunucuyu baştan kurmaya karar verdim. Fakat bir türlü NS ayarlamasını yapamadım. Defalarca denemeden sonra hatanın sadece Ubuntu da olduğunu fark ettim. CentOS denedim fakat VestaCP CentOS üzerinde oldukça verimsiz çalışıyor.
Bunun üzerine Debian’a geçiş yaptım ve şu anda sorunsuz bir şekilde çalışıyor.&lt;/p&gt;

&lt;h3 id=&quot;güle-güle-apache-hoşgeldin-nginx&quot;&gt;Güle güle Apache Hoşgeldin Nginx&lt;/h3&gt;

&lt;p&gt;Eski kurulumda apache ve nginx arasında reverse-proxy vardı.&lt;/p&gt;

&lt;p&gt;Şimdi ise apache artık tamamen ortadan kalktı. Php5-fpm ve nginx ile tek başlarına çalışıyor. Bu sayede daha fazla performans alıyorum ve &lt;strong&gt;setTrustedProxies&lt;/strong&gt; gibi işlemlerle uğraşmaya gerek kalmadı.&lt;/p&gt;

&lt;h3 id=&quot;sftp-chroot-ile-güvenli-ftp-bağlantısı&quot;&gt;SFTP Chroot ile güvenli FTP Bağlantısı&lt;/h3&gt;

&lt;p&gt;Ek olarak &lt;em&gt;SFTP Chroot&lt;/em&gt; paralı eklentisini (18$ ömür boyu kullanım lisansı) satın aldım.
21 portu üzerinden yapılan ftp bağlantıları güvenli değildir. MITM, ARP Poisining gibi tekniklerle şifreyi görebilmek mümkün bunun yerine 22 portu üzerinden açılan sftp bağlantısı ile şifreler bir başkası tarafından yakalanamaz ve eklenti sayesinde kullanıcı sadece kendisine izin verilen dosya ve klasörlere göz atabilme yetkisine sahip oluyor. Kısaca güvenli ftp bağlantısı için oldukça kullanışlı bir eklenti.&lt;/p&gt;

&lt;h3 id=&quot;timezone-seçeneği&quot;&gt;Timezone Seçeneği&lt;/h3&gt;

&lt;p&gt;Ayrıca yeni sürümünde gözüme çarpan detay ayarlar kısmında zaman dilimi seçmemize olanak sağlaması.&lt;/p&gt;

&lt;h3 id=&quot;ücretsiz-ssl&quot;&gt;Ücretsiz SSL&lt;/h3&gt;

&lt;p&gt;İnternet sitelerime ve sunucuma letsencrypt ile ücretsiz SSL kurdum.&lt;/p&gt;

&lt;p&gt;Bu işlem için takip ettiğim adımlar&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
sudo apt-get install build-essential libssl-dev libffi-dev python-dev python-pip
pip install -U cffi
pip install cryptography --upgrade
./letsencrypt-auto --help
./letsencrypt-auto certonly --standalone -d rhodeus.org -d www.rhodeus.org
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Sat, 30 Jan 2016 00:00:00 +0000</pubDate>
        <link>http://talhadurmus.com/sunucu/vestacp-uzerine-bir-gunce</link>
        <guid isPermaLink="true">http://talhadurmus.com/sunucu/vestacp-uzerine-bir-gunce</guid>
        
        
        <category>Sunucu</category>
        
      </item>
    
      <item>
        <title>Kayan Nokta Gösterimi (Floating Point)</title>
        <description>&lt;p&gt;Bilgisayar biliminde &lt;strong&gt;0.15625&lt;/strong&gt; gibi ondalıklı sayılar IEEE 754 standardına göre ikili(binary) olarak kodlanır. Bu gösterimde 32 bitlik bir alan 3 parçadan oluşur ve her parçanın bit alanı aşağıdaki gibidir.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/article_images/2015-12-01-kayan-nokta-gosterimi/floating-point-notation.png&quot; alt=&quot;Kayan Nokta Gösterimi&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;i̇şaret-sign&quot;&gt;İşaret (Sign)&lt;/h4&gt;

&lt;p&gt;Artı sayılar için 0. Eksi sayılar için 1 değerini alır.&lt;/p&gt;

&lt;h4 id=&quot;üst-exponent&quot;&gt;Üst (Exponent)&lt;/h4&gt;

&lt;p&gt;Excess-Notation ile sayının üstel kısmı kodlanır. Sapma payı (bias) olarak &lt;strong&gt;2^8 - 1&lt;/strong&gt; kabul edilir. Üstel sayıya 127 eklenir ve ikili olarak kodlanır.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Üstel Kısım &lt;/th&gt;
      &lt;th style=&quot;text-align: center&quot;&gt;Sapmayla Birlikte&lt;/th&gt;
      &lt;th style=&quot;text-align: right&quot;&gt; İkili(Binary)&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;+1&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;128&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;10000000&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;+10&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;137&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;10001001&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;0&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;127&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;01111111&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;-3&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;124&lt;/td&gt;
      &lt;td style=&quot;text-align: right&quot;&gt;01111100&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;h3 id=&quot;kesir-ya-da-büyüklük-fraction-mantissa&quot;&gt;Kesir ya da Büyüklük (Fraction, Mantissa)&lt;/h3&gt;

&lt;p&gt;Kesirli ifadenin büyüklüğü kodlanır.&lt;/p&gt;

&lt;p&gt;0.15625 ondalıklı sayısını binary olarak kodlarsak eğer;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;0.15625 = 0 * 0.5 + 0 * 0.25 + 1 * 0.125 + 0 * 0.0625 + 1 * 0.03125&lt;/li&gt;
  &lt;li&gt;binary olarak kodladığımızda 0.00101&lt;/li&gt;
  &lt;li&gt;sayıyı kaydırdığımızda ise 1.01 x 2^-3 elde ederiz.&lt;/li&gt;
  &lt;li&gt;fraction 01 olur&lt;/li&gt;
  &lt;li&gt;exponent alanını 127 sapma (bias) eklenir. (-3 + 127 = 124)&lt;/li&gt;
  &lt;li&gt;exponent 01111100 olur&lt;/li&gt;
  &lt;li&gt;sayı artı sayı olduğu için sign 0 olur&lt;/li&gt;
  &lt;li&gt;birleşiminde: 1 01111100 01000000000000000000000&lt;/li&gt;
&lt;/ol&gt;

&lt;div id=&quot;tools&quot; class=&quot;row&quot;&gt;
    &lt;label&gt;Sayı&lt;/label&gt;
    &lt;input value=&quot;0.15625&quot; name=&quot;number&quot; type=&quot;number&quot; id=&quot;number_notation&quot; class=&quot;form-control&quot; /&gt;&lt;br /&gt;
    &lt;label&gt;İkili Gösterimi (Binary Notation)&lt;/label&gt;
    &lt;input name=&quot;binary&quot; type=&quot;text&quot; id=&quot;floating_notation&quot; class=&quot;form-control&quot; /&gt;&lt;br /&gt;
&lt;/div&gt;
</description>
        <pubDate>Tue, 01 Dec 2015 00:00:00 +0000</pubDate>
        <link>http://talhadurmus.com/bilgisayar-bilimi/kayan-nokta-gosterimi</link>
        <guid isPermaLink="true">http://talhadurmus.com/bilgisayar-bilimi/kayan-nokta-gosterimi</guid>
        
        
        <category>Bilgisayar-Bilimi</category>
        
      </item>
    
      <item>
        <title>İşaretli Sayı Gösterimi</title>
        <description>&lt;p&gt;Bilgisayar biliminde 6 gibi bir sayıyı &lt;strong&gt;0000 0110&lt;/strong&gt; şeklinde &lt;abbr title=&quot;iki tabanı&quot;&gt;binary&lt;/abbr&gt; olarak kodlarken negatif hali olan -6 sayısını &lt;abbr title=&quot;iki tabanı&quot;&gt;binary&lt;/abbr&gt; olarak gösterebilmek için çeşitli teknikler oluşturulmuştur. Bu tekniklerin bazıları aşağıdaki gibidir.&lt;/p&gt;

&lt;h3 id=&quot;sign-magnitude&quot;&gt;Sign-Magnitude&lt;/h3&gt;

&lt;p&gt;Pozitif sayılar için &lt;abbr title=&quot;Most Significant Bit (En Önemli Bit)&quot;&gt;MSB&lt;/abbr&gt;’nin değeri 0,
Negatif sayılar için ise &lt;abbr title=&quot;Most Significant Bit (En Önemli Bit)&quot;&gt;MSB&lt;/abbr&gt;’nin değeri 1 olur.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;0000 0110 =&amp;gt; +6
1000 0110 =&amp;gt; -6
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;yani negatif sayıyı ifade edilmek için yukarıdaki gibi en soldaki bit 1 yapılmıştır.&lt;/p&gt;

&lt;p&gt;1 bayt için &lt;abbr title=&quot;İşaretsiz&quot;&gt;unsigned&lt;/abbr&gt; gösterimdeki sayı aralığımız [0, 2^8-1 yani 255] iken sign-magnitude için [-127, 127] olmuştur.&lt;/p&gt;

&lt;p&gt;Fakat bu gösterimle alakalı 2 problem mevcuttur.&lt;/p&gt;

&lt;h4 id=&quot;2-farklı-0-gösterimi&quot;&gt;2 farklı 0 gösterimi&lt;/h4&gt;
&lt;p&gt;-0 ve +0 olmak üzere 2 tane 0 gösterimi vardır.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;0000 0000 =&amp;gt; +0
1000 0000 =&amp;gt; -0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Bu da mantıksal işlemlerde -0 ifadesinin true değerine denk gelmesine sebep olur.&lt;/p&gt;

&lt;h4 id=&quot;toplama-veya-çıkartma-işlemlerinde-karışıklık&quot;&gt;Toplama veya çıkartma işlemlerinde karışıklık&lt;/h4&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;   0000 0110 =&amp;gt;  +6
+  1000 0110 =&amp;gt;  -6
-------------------
   1000 1100 =&amp;gt; -12
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Derleyicinin aritmetiksel işlemleri yapabilmesi için sayının signed veya &lt;abbr title=&quot;İşaretsiz&quot;&gt;unsigned&lt;/abbr&gt; olup olmadığını bilmesi gerekir. Doğrudan toplama veya çıkartma yapıldığında yukarıdaki gibi yanlış sonuç çıkar.&lt;/p&gt;

&lt;h3 id=&quot;ones-complement-birin-tümleyeni&quot;&gt;One’s Complement (Birin Tümleyeni)&lt;/h3&gt;

&lt;p&gt;Bütün bitlerin negatifi alınır yani 1’ler 0, 0’lar ise 1 olur. Bu şekilde &lt;abbr title=&quot;Most Significant Bit (En Önemli Bit)&quot;&gt;MSB&lt;/abbr&gt; değeri 1’e eşit olur ve &lt;abbr title=&quot;Most Significant Bit (En Önemli Bit)&quot;&gt;MSB&lt;/abbr&gt; değeri 1 iken sayının negatif olduğu bilinir.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;0000 0110 =&amp;gt;  +6
1111 1001 =&amp;gt;  -6
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;[-127, +127] aralığındaki sayılar gösterilebilir.&lt;/p&gt;

&lt;p&gt;Bu gösterimde de Sign-Magnitude da bulunan +0 ve -0 gösterimi sorunu mevcuttur.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  0000 0110 =&amp;gt;  +6
+ 1111 1001 =&amp;gt;  -6
-------------------
  1111 1111 =&amp;gt;  -0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Ayrıca &lt;strong&gt;&lt;abbr title=&quot;sondan elde alma&quot;&gt;end-around borrow&lt;/abbr&gt;&lt;/strong&gt; denilen bir durum ortaya çıkar.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  0000 0110 =&amp;gt;  +6
− 0000 1010 =&amp;gt; +10
-------------------
1 1111 1100 =&amp;gt;  -3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;öyle ki artan 1’in sonuçtan çıkartılması gerekir.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;− 0000 0001 =&amp;gt;  +1
-------------------
  1111 1011 =&amp;gt;  -4
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;-4 doğru sonuçtur.&lt;/p&gt;

&lt;h3 id=&quot;twos-complement-i̇kinin-tümleyeni&quot;&gt;Two’s Complement (İkinin Tümleyeni)&lt;/h3&gt;

&lt;p&gt;Bilgisayar biliminde kullanılan en yaygın tekniktir. One’s Complement ile aynı teknik uygulanır yani bütün bitlerin negatifi alınır. Farklı olarak sonuca 1 eklenir.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;0000 0110 =&amp;gt;  +6
1111 1001 =&amp;gt;  -6 (One's Complement)
1111 1010 =&amp;gt;  -6 (Two's Complement)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Bu metod toplama, çıkartma işlemlerinde oldukça kolaylık sağlar.&lt;/p&gt;

&lt;p&gt;2 farklı 0 gösterimi yoktur ve &lt;strong&gt;&lt;abbr title=&quot;sondan elde alma&quot;&gt;end-around borrow&lt;/abbr&gt;&lt;/strong&gt; durumu ortaya çıkmaz. Negatif ve pozitif sayılar rahatlıkla toplanıp çıkartılabilir.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  0000 0110 =&amp;gt;  +6
+ 1111 1010 =&amp;gt;  -6
------------------
1 0000 0000 =&amp;gt;  0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;en soldaki taşan 1 değeri yok sayılır.&lt;/p&gt;

&lt;p&gt;Bu yöntemle aralık [-128, +127] olur.&lt;/p&gt;

&lt;h3 id=&quot;excess-8&quot;&gt;Excess-8&lt;/h3&gt;

&lt;p&gt;Sayılar sayı doğrusunun en sol köşesinden başlar. Yani &lt;strong&gt;0000 0000&lt;/strong&gt; -128 değerini verirken. &lt;strong&gt;1000 0000&lt;/strong&gt; 0 değerini verir.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;0000 0000 =&amp;gt; -128
0000 0001 =&amp;gt; -127
0111 1111 =&amp;gt; -1
1000 0000 =&amp;gt; 0
1000 0001 =&amp;gt; 1
1111 1111 =&amp;gt; 127
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

</description>
        <pubDate>Fri, 02 Oct 2015 00:00:00 +0000</pubDate>
        <link>http://talhadurmus.com/bilgisayar-bilimi/isaretli-sayi-gosterimi</link>
        <guid isPermaLink="true">http://talhadurmus.com/bilgisayar-bilimi/isaretli-sayi-gosterimi</guid>
        
        
        <category>Bilgisayar-Bilimi</category>
        
      </item>
    
      <item>
        <title>Laravel Yavaş Homestead Çözümü</title>
        <description>&lt;p&gt;Laravel Homestead kullananların en büyük sıkıntısı sitenin oldukça yavaş çalışması. Bunun sebebi ise dosyaların paylaşımlı olması ve sunucunun bu dosyalara erişmeye çalışırken oldukça zaman kaybetmesi.&lt;/p&gt;

&lt;p&gt;NFS özelliğini aşağıdaki gibi Homestead.yaml dosyası üzerinde type:”nfs” özelliğini tanımlayarak aktif edebilirsiniz.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;folders:
    - map: ~/Desktop/sites
      to: /home/vagrant/sites
      type: &quot;nfs&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;windows-üzerinde-nfs&quot;&gt;Windows üzerinde NFS&lt;/h3&gt;

&lt;p&gt;Windows işletim sisteminin sadece PRO sürümünde NFS özelliği var. Bu yüzden NFS özelliği vagrant’da Windows kullanıcıları için devre dışı. (bkz https://docs.vagrantup.com/v2/synced-folders/nfs.html)&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Windows users: NFS folders do not work on Windows hosts. Vagrant will ignore your request for NFS synced folders on Windows.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Fakat Vagrant plugin’i olan &lt;a href=&quot;https://github.com/winnfsd/vagrant-winnfsd&quot;&gt;WinNFS&lt;/a&gt;‘yi kullanarak bilgisayara bir NFS sunucusu kurabiliyoruz.&lt;/p&gt;

&lt;p&gt;Bunun için;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ vagrant plugin install vagrant-winnfsd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;GIT Bash üzerinde veya CMD üzerinde yukarıdaki komutu çalıştırarak eklentiyi yükleyin.&lt;/p&gt;

&lt;p&gt;Sonrasında Homestead/scripts/homestead.rb içerisinde&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mount_opts = folder[&quot;mount_opts&quot;] ? folder[&quot;mount_opts&quot;] : ['actimeo=1']
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;satırını bulun ve &lt;strong&gt;actimeo=1&lt;/strong&gt; ifadesini aşağıdaki gibi &lt;strong&gt;nolock,vers=3,udp&lt;/strong&gt; şeklinde değiştirin.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mount_opts = folder[&quot;mount_opts&quot;] ? folder[&quot;mount_opts&quot;] : ['nolock,vers=3,udp']
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Windows 8 üzeri işletim sistemine sahipseniz winnfds.exe üzerinde uyumluluk ayarını yapmanız gerekecektir.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;C:\Users\KULLANICI\.vagrant.d\gems\gems\vagrant-winnfsd-1.1.0\bin
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;winnfds.exe dosyasının uyumluluk ayarını Windows 8 olacak şekilde ayarlayın.&lt;/p&gt;

&lt;h3 id=&quot;i̇şlem-sonucu&quot;&gt;İşlem Sonucu&lt;/h3&gt;

&lt;p&gt;Yukarıdaki işlemleri yaptıktan sonra sitenin hızında aşağıdaki gibi gözle görülür bir artış yakalayacaksınız. NFS’yi aktif etmeden önce boş bir laravel projesi için bile sayfa yüklenme süresi 100ms sürerken artık aşağıdaki gibi 20ms’e kadar düşmüştür.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/article_images/2015-09-26-yavas-homestead-cozumu/sonuc.png&quot; alt=&quot;Sonuç&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;
&lt;p&gt;&lt;strong&gt;Not:&lt;/strong&gt; GIT Bash’i yönetici olarak başlatmanız gerekebilir.&lt;/p&gt;
</description>
        <pubDate>Sat, 26 Sep 2015 00:00:00 +0000</pubDate>
        <link>http://talhadurmus.com/php/laravel/yavas-homestead-cozumu</link>
        <guid isPermaLink="true">http://talhadurmus.com/php/laravel/yavas-homestead-cozumu</guid>
        
        
        <category>PHP</category>
        
        <category>Laravel</category>
        
      </item>
    
      <item>
        <title>PHP'de Türkçe Tarih Sorunu</title>
        <description>&lt;p&gt;DigitalOcean gibi yabancı firmalardan alınan cloud/vps gibi hizmetlerde işletim sisteminde Türkçe locale bulunmayabiliyor.&lt;/p&gt;

&lt;p&gt;Bu da PHP’de &lt;strong&gt;Friday 27 February 2015&lt;/strong&gt; gibi İngilizce tarih almamıza neden olur.&lt;/p&gt;

&lt;p&gt;PHP’de setLocale yapsak bile sonuç değişmeyecektir.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;setlocale(LC_ALL,'tr_TR.utf8');
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Sunucuzda aşağıdaki komutu çalıştırarak mevcut dilleri görebilirsiniz.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;locale -a
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Aşağıdakine benzer bir çıktı verecektir ve içerisinde tr_TR locale i bulunmamaktadır.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;root@rhodeus:~# locale -a
C
C.UTF-8
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZM
en_ZM.utf8
en_ZW.utf8
POSIX
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Sisteme tr_TR’yi &lt;strong&gt;locale-gen tr_TR.UTF-8&lt;/strong&gt; komutu ile yüklediğimizde aşağıdaki gibi bir mesaj alacağız. &lt;sup id=&quot;fnref:1&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:1&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;root@rhodeus:~# sudo locale-gen tr_TR.UTF-8
Generating locales...
  tr_TR.UTF-8... done
Generation complete.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;PHP içerisinde aşağıdaki kodu çalıştırdığınızda &lt;em&gt;Cuma 27 Şubat 2015&lt;/em&gt; şeklinde tarihi Türkçe olarak alacağız.&lt;sup id=&quot;fnref:2&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:2&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;nb&quot;&gt;setlocale&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;LC_ALL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'tr_TR.utf8'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;strftime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;%A %d %B %Y&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;mktime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Bu işlemlerden sonra hâlâ sonuç alamıyorsanız sunucuyu yeniden başlatın.&lt;/p&gt;

&lt;div class=&quot;footnotes&quot; role=&quot;doc-endnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:1&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;İşletim sisteminize göre yükleyeceğiniz locale değişebilir. tr_TR yerine tr-TR veya daha farklı varyasyonlarda bulunabilir. &lt;a href=&quot;#fnref:1&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:2&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;tr_TR.UTF-8 olarak yüklememize rağmen tr_TR.utf8 şeklinde sisteme tanımlandı. Yüklemeden sonra &lt;em&gt;locale -a&lt;/em&gt; komutunu tekrar çalıştırıp kontrol ediniz. &lt;a href=&quot;#fnref:2&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;
</description>
        <pubDate>Fri, 27 Feb 2015 00:00:00 +0000</pubDate>
        <link>http://talhadurmus.com/php/turkce-tarih-sorunu</link>
        <guid isPermaLink="true">http://talhadurmus.com/php/turkce-tarih-sorunu</guid>
        
        
        <category>PHP</category>
        
      </item>
    
      <item>
        <title>Big Endian Little Endian</title>
        <description>&lt;p&gt;Bittorrent kütüphanesini yazarken gönderdiğim verilerin karşı tarafa hatalı bir şekilde ulaştığını fark ettim. Öyle ki ben eş(peer) portunu 1600 olarak gönderirken o 16390 olarak algılıyordu bu işte bir terslik olmalıydı. Sonradan aklıma nasıl ki bizde sağdan sola veya soldan sağa okuma stili varsa işlemcilerde de aynısının olduğu geldi.&lt;/p&gt;

&lt;p&gt;Yani bu şu demek oluyor: 1234 sayısını 2 farklı şekilde okuyabiliriz.&lt;/p&gt;

&lt;p&gt;1234 =&amp;gt; bin iki yüz otuz dört diye soldan sağa okuyabiliriz
1234 =&amp;gt; dört bin üç yüz yirmi bir diye sağdan sola da okuyabiliriz.&lt;/p&gt;

&lt;p&gt;Bunu Arapçanın, Latincenin aksine sağdan sola yazılması olarak da görebiliriz.&lt;/p&gt;

&lt;p&gt;Kullandığımız bu Intel işlemciler little endian düzenini kullanıyor fakat soket işlemlerinde standart olarak Big Endian seçilmiş. Tabi bu little endian kullanamayacağınız anlamına gelmiyor bu konuda özgürsünüz. Neden big endian standart olmuş sorusunun cevabını bilmiyorum fakat 127.0.0.1 ip adresini 4 baytlık integer a çevirdiğimiz zaman 7F 00 00 01 elde ediyoruz ve ip blokları ile baytlar aynı sırada oluyor belki de bunun gibi şeylerin bir etkisi vardır. Ayrıca zaman zaman birbirlerine göre avantajlı oldukları durumlar da olabiliyormuş ama genel yargı aralarında hız anlamında bir fark olmadığı.&lt;/p&gt;

&lt;p&gt;Big Endian&lt;/p&gt;

&lt;p&gt;Büyük bayt başta şeklinde tanımlayabiliriz yani 0x12345678 şeklinde bir adreste en büyük bayt (matematikte onlar yüzler binler basamağı olarak düşünün) &lt;strong&gt;12&lt;/strong&gt; olacaktır ve bu baytlar 12 34 56 78 şekline saklanır. Yani en büyük olan bayt en başta olur bu yüzden buna &lt;strong&gt;Big Endian&lt;/strong&gt; denmiştir. Zaten fark ettiğiniz okuduğumuz sıralamada yazılıyor.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/article_images/2014-05-01-big-endian-little-endian/big-endian.png&quot; alt=&quot;Big Endian&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Little Endian&lt;/p&gt;

&lt;p&gt;Şu an kullandığımız bu intel işlemcili bilgisayarlarda kullanılan little endian da işler değişiyor bütün baytları tersten yazıyoruz bu sefer ve 78 56 34 12 şeklinde bir bayt dizisi elde ediyoruz. Dikkat ederseniz en düşük bayt bu sefer dizinin başına geldi.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/article_images/2014-05-01-big-endian-little-endian/little-endian.png&quot; alt=&quot;Little Endian&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Bu kadar basit görünen bir konu bilinmediği takdirde projenizde bir faciaya yol açabilir ve eğer sistemi debug etme şansınız yoksa bunu hiç anlamayabilirsiniz de. O yüzden kendini “programcı” olarak gören herkesin mutlaka öğrenmesini en azından haberdar olması gereken bir konu olduğunu düşünüyorum.&lt;/p&gt;
</description>
        <pubDate>Thu, 01 May 2014 00:00:00 +0000</pubDate>
        <link>http://talhadurmus.com/bilgisayar-bilimi/big-endian-little-endian</link>
        <guid isPermaLink="true">http://talhadurmus.com/bilgisayar-bilimi/big-endian-little-endian</guid>
        
        
        <category>Bilgisayar-Bilimi</category>
        
      </item>
    
      <item>
        <title>Built-in Fonksiyonlar - Kendi Dilini Tasarla</title>
        <description>&lt;p&gt;Sanırım artık sonuncu “Kendi Dilini Tasarla” yazısına ulaştık. Buraya kadar temel olarak neyin nasıl yapıldığını az çok anlamış olmalısınız ve bundan sonra üzerine birşeyler katıp bir dil geliştirmek sizin elinizde bunun için mevcut dillerin kaynak kodlarına bakıp inceleyebilirsiniz, internette araştırma yapabilirsiniz bu yazılarda sadece bir dil tasarımı için gerekli olan şeyleri yüzeysel olarak gördünüz. Dil yapımı için daha doğrusu kaliteli iyi bir dil yapımı için bu sitede okuduklarınızdan çok daha fazlasına ihtiyacınız olacaktır hatta muhtemelen sizi en çok zorlayacak olan şey veri yönetimi olacaktır her ne kadar D dili bu işlemi bizim yerimize de yapıyor olsa performans için sizin de kendi nesnelerinizi ve onların çöp toplayıcılarını oluşturmanız gerekecek. Ara ara bu dille alakalı tekrar yazılar yazabilirim ama şimdilik bu kadarı yeterli olacaktır. Lafı fazla uzatmadan built-in kısmını da oluşturalım ve yazımızı bitirelim.&lt;/p&gt;

&lt;p&gt;Built-in kısmında programlama dilimiz ile beraber gelen sistem fonksiyonlarını oluşturacağız.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-d&quot; data-lang=&quot;d&quot;&gt;&lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;builtin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;std&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;stdio&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;robject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;std&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;conv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;cm&quot;&gt;/** Bütün parametreleri konsola yazan print fonksiyonumuz. */&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;RObject&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;RObject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parameters&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;foreach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;param&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parameters&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
		&lt;span class=&quot;n&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;param&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;writeln&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;RBoolean&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;cm&quot;&gt;/** String'i, integer'a çeviren int fonksiyonumuz. */&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;RObject&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;RObject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parameters&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;RNumber&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;parameters&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()));&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Yukarıda gördüğünüz şekilde normal D fonksiyonu şekilde tanımlayıp onlara parametreler üzerinden nesnelerimizi göndereceğiz ve geri dönüş değeri olarak da yine bir nesne oluşturacağız. Burada sadece 2 tane fonksiyon tanımladım artık siz istediğiniz gibi fonksiyon tanımlayıp geliştirebilirsiniz hatta bir hobi eğlence projesi olarak bu dili tamamen Türkçe dahi yapabilirsiniz tamamen size kalmış.&lt;/p&gt;

&lt;p&gt;Projenin buraya kadarki kaynak kodunu indirmek için: &lt;a href=&quot;/assets/files/langdev-final.tar.gz&quot;&gt;Make Your Own Language - Final&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Mon, 17 Feb 2014 00:00:00 +0000</pubDate>
        <link>http://talhadurmus.com/kendi-dilini-tasarla/built-in-fonksiyonlar</link>
        <guid isPermaLink="true">http://talhadurmus.com/kendi-dilini-tasarla/built-in-fonksiyonlar</guid>
        
        
        <category>Kendi-Dilini-Tasarla</category>
        
      </item>
    
      <item>
        <title>Sanal Makine - Kendi Dilini Tasarla</title>
        <description>&lt;p&gt;Sanal makine oluşturduğumuz ara dil çıktısını çalıştıracak olan modülümüzdür. Yapacağınız dile göre daha kompleks sanal makine yazmanız gerekebilir. Burada oluşturacağımız sanal makine stack adında nesnelerimizi tutacağımız bir dizi, o an işlediğimiz yani aktif olan nesneyi belirten current ve o anki komutumuzun adresini tutan &lt;strong&gt;IP (Instruction Pointer)&lt;/strong&gt; değişkenlerinden oluşacaktır.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-d&quot; data-lang=&quot;d&quot;&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;VirtualMachine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;execute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;IL&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ilcode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
		&lt;span class=&quot;nb&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tmp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;//Geçici olarak kullanmak üzere bir string&lt;/span&gt;
		&lt;span class=&quot;n&quot;&gt;RObject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;//Nesne dizimiz&lt;/span&gt;
		&lt;span class=&quot;n&quot;&gt;RObject&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;//Aktif nesne&lt;/span&gt;
		&lt;span class=&quot;n&quot;&gt;RObject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;variables&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;//Değişkenlerimiz&lt;/span&gt;
		&lt;span class=&quot;k&quot;&gt;auto&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ilcode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;codes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ptr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;//instruction pointer. O anki il kodunun adresini tutar.&lt;/span&gt;
		&lt;span class=&quot;n&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Yapacağınız dile göre sanal makineyi daha da geliştirebilirisiniz fakat şuanki hali bizim işimizi görecektir.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-d&quot; data-lang=&quot;d&quot;&gt;	&lt;span class=&quot;k&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;RObject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;global&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){&lt;/span&gt;
		&lt;span class=&quot;n&quot;&gt;global&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
			&lt;span class=&quot;s&quot;&gt;&quot;print&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;RFunction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;print&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;builtin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
			&lt;span class=&quot;s&quot;&gt;&quot;int&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;RFunction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;int&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;builtin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Builtin fonksiyonlarımız için de yukarıdaki kodları tanımlayalım.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-d&quot; data-lang=&quot;d&quot;&gt;&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
		&lt;span class=&quot;k&quot;&gt;switch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(*&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;cast&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;il&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;*)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;/// Çalıştırılacak olan il komutuna git.&lt;/span&gt;
			&lt;span class=&quot;cm&quot;&gt;/** Üzerinde işlem yapılacak olan aktif nesneyi değiştirir.  */&lt;/span&gt;
			&lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;il&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;load&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;++;&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;cast&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;RObject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;*)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;*).&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sizeof&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
				&lt;span class=&quot;k&quot;&gt;goto&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;cm&quot;&gt;/** Aktif &quot;variables&quot; hashmap i üzerine değişken adına göre tanımla.  */&lt;/span&gt;
			&lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;il&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;definevar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;++;&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;tmp&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;cast&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;*)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cstr2dstr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;variables&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tmp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tmp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;length&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
				&lt;span class=&quot;k&quot;&gt;goto&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;cm&quot;&gt;/** Değişkeni önce kullanıcı tarafından tanımlananlar arasında ara eğer yoksa
			 *  Global değişkenler arasında ara.
			 */&lt;/span&gt;
			&lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;il&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;loadvar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;++;&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;tmp&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;cast&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;*)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cstr2dstr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
				&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;auto&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tmp&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;variables&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
					&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
				&lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;auto&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tmp&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;global&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
					&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
				&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Exception&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;'%s' değişkeni tanımlanmadı!&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tmp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tmp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;length&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
				&lt;span class=&quot;k&quot;&gt;goto&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;cm&quot;&gt;/** Aktif nesneyi stack'a yaz */&lt;/span&gt;
			&lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;il&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;stack&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;~=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;++;&lt;/span&gt;
				&lt;span class=&quot;k&quot;&gt;goto&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;cm&quot;&gt;/** Aktif nesneyi fonksiyon parametresi olarak stack'a yaz
			 *  Şimdilik yaptığımız işlemler aynı olduğu için kodumuz stack push ile aynı
			 *  ama sistemi daha farklı bir şekilde kullanmak isteyebilirsiniz diye parser'dan
			 *  fonksiyon parametrelerini bu şekilde çıkarttık.
			 */&lt;/span&gt;
			&lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;il&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pushparam&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;stack&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;~=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;++;&lt;/span&gt;
				&lt;span class=&quot;k&quot;&gt;goto&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;cm&quot;&gt;/** - operatörü
			 *  Stack e yüklenen nesneden aktif nesneyi çıkart ve stackdan nesneyi sil.
			 */&lt;/span&gt;
			&lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;il&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sub&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[$-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;stack&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0.&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.$-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;++;&lt;/span&gt;
				&lt;span class=&quot;k&quot;&gt;goto&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;cm&quot;&gt;/** + operatörü
			 *  Stack e yüklenen nesneyle aktif nesneyi topla ve stackdan nesneyi sil.
			 */&lt;/span&gt;
			&lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;il&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[$-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;stack&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0.&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.$-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;++;&lt;/span&gt;
				&lt;span class=&quot;k&quot;&gt;goto&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;cm&quot;&gt;/** / operatörü
			 *  Stack e yüklenen nesneyi aktif nesneye böl ve stackdan nesneyi sil.
			 */&lt;/span&gt;
			&lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;il&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[$-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;stack&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0.&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.$-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;++;&lt;/span&gt;
				&lt;span class=&quot;k&quot;&gt;goto&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;cm&quot;&gt;/** * operatörü
			 *  Stack e yüklenen nesneyle aktif nesneyi çarp ve stackdan nesneyi sil.
			 */&lt;/span&gt;
			&lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;il&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mul&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[$-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;stack&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0.&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.$-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;++;&lt;/span&gt;
				&lt;span class=&quot;k&quot;&gt;goto&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;cm&quot;&gt;/** call işlevi
			 *  Çağırılacak olan fonksiyonun parametrelerini stackdan çek onları bir diziye at ve stacki boşalt.
			 *  Not : Çağırılacak olan fonksiyonun parametre sayısı il çıktısı içerisinde geliyor.
			 */&lt;/span&gt;
			&lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;il&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;call&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;++;&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;current&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;stack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[$-*&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;cast&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;size_t&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;*)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;..$]);&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;stack&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;0.&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.$-*&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;cast&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;size_t&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;*)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
				&lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;size_t&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sizeof&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
				&lt;span class=&quot;k&quot;&gt;goto&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;cm&quot;&gt;/** Makineyi sonlandır. */&lt;/span&gt;
			&lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;il&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;hlt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;k&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
				&lt;span class=&quot;k&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Exception&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Bilinmeyen operand code %s&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(*&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;cast&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;il&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;*)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Evet sanal makinemiz tamamlandı geriye sadece birkaç tane build-in fonksiyonu tanımlamak kaldı. Projenin bitmiş halinin kaynak kodunu bir sonraki yazıda bulabilirsiniz.&lt;/p&gt;
</description>
        <pubDate>Sun, 16 Feb 2014 00:00:00 +0000</pubDate>
        <link>http://talhadurmus.com/kendi-dilini-tasarla/sanal-makine</link>
        <guid isPermaLink="true">http://talhadurmus.com/kendi-dilini-tasarla/sanal-makine</guid>
        
        
        <category>Kendi-Dilini-Tasarla</category>
        
      </item>
    
  </channel>
</rss>
