DÜŞÜK SEVİYELİ SANAL MAKİNE PROJESİ İLE DERLEYİCİ TASARIM ÖRNEĞİNİN GERÇEKLEMESİ


Creative Commons License

Gedik Y., Solak S.

5th INTERNATIONAL MARMARA SCIENCES CONGRESS IMASCON 2020 AUTUMN, Kocaeli, Türkiye, 4 - 05 Aralık 2020, ss.478-485

  • Yayın Türü: Bildiri / Tam Metin Bildiri
  • Basıldığı Şehir: Kocaeli
  • Basıldığı Ülke: Türkiye
  • Sayfa Sayıları: ss.478-485
  • Kocaeli Üniversitesi Adresli: Evet

Özet

Bilgi ve iletişim teknolojilerinin yaygınlaşmasıyla beraber kullanılan akıllı cihaz ve kullanıcı sayısı her geçen gün artmaktadır. Bu cihazları akıllı yapan üzerinde kullanılan yazılımlardır. Yazılımlar bilgisayar programcıları tarafından genellikle konuşma diline yakın ifadelerle yazılmaktadır. Yazılan bu programların bilgisayarlar veya akıllı cihazlar tarafından anlaşılması için düşük seviyeli bilgisayar koduna çevirmek amacıyla Derleyiciler kullanılmaktadır. Derleyiciler, geçmişten günümüze kadar çok fazla güncelleme geçirmiş ve yeni özellikler eklenmiştir. Bu özellikler sayesinde, insan hatalarını düzeltebilen ve ilgili platforma ait bilgisayar kodlarını optimize ederek hızlandıran uygulamalar haline gelmiştir. Derleyiciler, geliştirildiği programlama diline ait sınırları zorladığından çok fazla soyutlama katmanı gerektiren uygulamalardır. Bu katmanlar derleyicinin parçalara ayrılmasını sağlayarak karmaşayı azaltmayı hedeflemektedir. Bu kapsamda, derleyici tasarımında oluşacak sorunları çözmeyi amaçlayan düşük seviyeli sanal makine (Low Level Virtual Machine - LLVM) derleyici alt yapı projesi geliştirilmiştir. LLVM projesi sayesinde, geliştirilen derleyicilerin her platform ve işletim sistemi için tekrar yazılma gereksinimi ortadan kaldırılmıştır. LLVM projesi kullanılarak gerçekleştirilen derleyicilerde, ara derleme sunucusu bulunmaktadır. Derleyici, bu ara derleme sunucusu sayesinde istenilen işletim sistemi ve platformda çalıştırılabilir ve yüksek seviyeli programlama dillerine göre analizi kolay olduğundan çok daha fazla optimizasyon işlemi gerçekleştirmektedir. LLVM projesi ile gerçekleştirilen derleyiciler, JIT (Just in Time) mantığı ile çalıştığından hızlı çalışabilen programlar oluşturmayı sağlamaktadır. Çalışmada, LLVM projesi ile derleyici tasarım örneği gerçekleştirilmiş olup elde edilen deneyimler sunulmaktadır. Sonuç olarak, derleyici tasarımı için hızlı, soyutlama olanağı iyi olan ve yüksek seviyeli, C++, C# veya Java gibi bir dil kullanmak gerekmektedir. Ayrıca, söz dizimi analizinde Flex, Bison ve ANTLR gibi gelişmiş araçlar kullanmak derleyicinin davranışını tahmin edebilmek için önem arz etmektedir.

The number of smart devices and users used is increasing day by day with the spread of information and communication technologies. It is the software used on these devices that make them smart. Software are computer programs that enable us to use the hardware features of computers or smart devices effectively. Programs are usually made by computer programmers with expressions close to spoken language. The compilers are used to convert these written programs into low-level computer code so that they can be understood by computers or smart devices. The compilers have had a lot of updates and new features in recent years. Thanks to these features, they have become applications that can correct programmers’ errors and speed up the computer codes of the relevant platform by optimizing them. The compilers are applications that contain a lot of abstraction layers that aim to reduce clutter by allowing the compiler to be divided into parts. In this context, The Low Level Virtual Machine (LLVM) compiler infrastructure project has been developed, which aims to solve problems that may arise in compiler design.Thanks to this project, the developed compilers don’t need to be rewritten for each platform and operating system. The compilers implemented using the LLVM project have an intermediate compiler server. The compiler can be run on any operating system and platform thanks to this intermediate compiler server, and it performs much more optimization processes as it is easy to analyze compared to high-level programming languages. The compilers realized with the LLVM project allow to create programs that can run quickly because they work as Just in Time (JIT). In this paper, the example of compiler design has been realized with the LLVM project and experimental results are presented. As a result, it is necessary to use a fast, abstractionable and high-level language such as C ++, C # or Java for compiler design. It is also important to use advanced tools such as Flex, Bison, and ANTLR to predict compiler behavior in syntax analysis.