- عنوان کتاب: ++Building Programming Language Interpreters -A bottom-up approach to runtimes, execution, and implementation in C
- نویسنده: Daniel Ruoso
- حوزه: ساخت مفسر
- سال انتشار: 2026
- تعداد صفحه: 372
- زبان اصلی: انگلیسی
- نوع فایل: pdf
- حجم فایل: 6.39 مگابایت
من با تجربه کار با زبان برنامهنویسی بیسیک روی یک کامپیوتر MSX در برزیل بزرگ شدم. آن زمان کامپیوترها با یک دفترچه راهنمای چاپشده که شامل بازیها و تمرینهای کوچکی با فهرست کدها بود، عرضه میشدند و برای فهمیدن نتیجه باید آن را تایپ میکردید. وقتی خانوادهام یک کامپیوتر ۴۸۶ خریدند، من به QBASIC روی آوردم. هنوز اولین باری را که یک بازی کامل با انیمیشنها و همه چیز را از ابتدا ساختم، به یاد دارم.
بعدها، به دلفی روی آوردم، جایی که به برادر بزرگترم در برخی از پروژههایش کمک میکردم و در نهایت یک برنامه آموزشی کوچک را در مدرسهام ارائه دادم که با یکی از همکارانم برای کشف جدول تناوبی ساخته بودم. در آن زمان، من نیز در حال گذار به استفاده از گنو/لینوکس و کاوش با برنامهنویسی C بودم.
من فقط زمانی که پرل را یاد گرفتم، یک توسعهدهنده نرمافزار «واقعی» شدم. این سال ۱۹۹۸ بود و برادر بزرگترم کتابهای «یادگیری پرل» و «برنامهنویسی پرل» را خرید. من هنوز «پرل کوچک» صحبت میکردم، همانطور که لری وال میگفت، و چند سال طول کشید تا به اندازه کافی اعتماد به نفس پیدا کنم تا اولین ماژول خود را به CPAN ارسال کنم. من به یک مدافع مشتاق زبان پرل تبدیل شدم و شروع به انتشار ماژولهای مختلف CPAN و شرکت در کنفرانسها کردم. تمام ساعتهایی را که در perlmonks.org گذراندم، و لحظهای را که بالاخره نامم در صفحه Saints in Our Book ظاهر شد، به یاد دارم.
اما در حالی که در آغاز قرن، پرل “نوار چسبی اینترنت” بود، در آغاز دهه ۲۰۱۰، احساسات بسیار شدیدی علیه آن در صنعت وجود داشت. مجبور شدم بپذیرم که نمیتوانم فقط یک توسعهدهنده پرل باشم؛ باید “توسعهدهنده هر چیزی” باشم.
این باعث شد که هنگام نگاه به زبان برنامهنویسی و طراحی مفسر، دیدگاه بسیار متفاوتی داشته باشم. فراتر از چیستی را ببینم و شروع به پرسیدن چرایی کنم. چرا پایتون تصمیم گرفت از قفل مفسر سراسری استفاده کند؟ چرا پرل رویکردی بدون اشتراک برای چند رشتهای داشت؟ چرا زبان C++ سیستمهای کاملاً متفاوتی برای برنامهنویسی و متا-برنامهنویسی دارد؟
در همین حال، تحصیلات رسمی من در علوم اجتماعی بود که باعث شد به همه اینها از منظر انسانشناسی نگاه کنم. در نهایت، ما در مورد ارتباطات انسانی صحبت میکنیم؛ هیچ معیاری وجود ندارد که بتوانیم با آن بفهمیم یک زبان از زبان دیگر بهتر است. شما زبانهای مختلف و افرادی با سطوح مختلف تسلط دارید. شما اکوسیستمها و جوامعی دارید که فرهنگ خاصی را پیرامون آن زبانها میسازند.
با این دیدگاه است که من به فرضیه این کتاب رسیدم، یعنی اینکه ما هرگز از ایجاد زبانهای برنامهنویسی جدید دست نخواهیم کشید، تا زمانی که مجبور به نوشتن کد باشیم. اما این لزوماً نباید فقط به خاطر سلیقه زیباییشناسی باشد. برخی از مشکلات خاص نیاز به راهحلهای خاص دارند و ساخت مفسرهای زبان برنامهنویسی راهی برای معرفی راهحلهای جدید برای مشکلات موجود است.
در عین حال، یک زبان برنامهنویسی به شدت تحت تأثیر محیط زمان اجرایی است که هدف قرار میدهد، اما میتوان محیطهای زمان اجرایی سفارشی نیز ساخت که یک زبان برنامهنویسی خاص را هدف قرار دهند.
ادبیات موجود تمایل دارد که با این حوزهها به عنوان اساساً مستقل رفتار کند، در حالی که من احساس میکنم با در نظر نگرفتن طراحی و پیادهسازی زبان برنامهنویسی و محیط زمان اجرایی که هدف قرار میدهد به عنوان یک مجموعه منسجم، چیزهای زیادی از قلم افتاده است. به همین دلیل است که برای من مهم بود که هنگام کار روی این کتاب، رویکردی از پایین به بالا را انتخاب کنم. میخواهم شما به کل مسئلهی طراحی و پیادهسازی زبان برنامهنویسی و مفسر به عنوان یک واحد واحد نگاه کنید.
امیدوارم در پایان این کتاب، شما هم مانند من مجذوب تمام جنبههای فنی و غیرفنی مرتبط با طراحی و پیادهسازی زبان برنامهنویسی و مفسر شوید.
این کتاب برای توسعهدهندگان نرمافزار سطح متوسط تا پیشرفته، به ویژه کسانی که به طراحی و پیادهسازی زبان علاقهمند هستند، مناسب است. این کتاب برای برنامهنویسانی که به دنبال گسترش مجموعه مهارتهای خود و مقابلهی کارآمد با مشکلات پیچیده هستند، ایدهآل است. متخصصانی که در نقشهایی مانند مهندسان نرمافزار، طراحان زبان یا معماران سیستم کار میکنند، از بینشهای عملی و تجربهی عملی ارائه شده در این کتاب بهرهمند خواهند شد. درک خوب از برنامهنویسی ++C و درک اولیه از مفاهیم طراحی زبان برای درک کامل محتوا توصیه میشود.
I grew up experimenting with BASIC on an MSX computer in Brazil. That was a time when the computer would come with a printed manual that had little games and exercises with the code listings, and you would have to type it out to see what happened. When my family got a 486 PC, I transitioned to QBASIC. I still remember the first time I built an entire game with animations and everything from scratch.
Later, I transitioned to Delphi, where I would help my older brother in some of his projects, and eventually presented a small educational application at my school that I built with a colleague to explore the periodic table. At that time, I was also transitioning to using GNU/Linux and exploring with C programming.
I only became a “real” software developer once I learned Perl. This was 1998, and my older brother bought the Learning Perl and Programming Perl books. I still spoke “baby Perl,” as Larry Wall would say, and it would be a few years until I was confident enough to ship my first module to CPAN.
I became an avid advocate for the Perl language and started publishing various CPAN modules and participating in conferences. I remember all the hours I spent on perlmonks.org, and the moment my name finally showed up on the Saints in Our Book page.
But while at the turn of the century, Perl was “the duct tape of the internet,” by the turn of the 2010s, there was a very strong sentiment against it in the industry. I had to accept that I couldn’t just be a Perl developer; I had to be an “anything developer.”
This has led me to take a very different perspective when looking at programming language and interpreter design. To look beyond the what and start asking the why. Why did Python choose to use a Global Interpreter Lock? Why did Perl have a share-nothing approach for multi-threading? Why does the C++ language have entirely different systems for programming and meta-programming?
Meanwhile, my formal education was in social sciences, which made me look at all of this from an anthropological perspective. At the end of the day, we’re talking about human communication; there’s no stick we can use to measure whether one language is better than another. You have different languages and people with different levels of fluency. You have ecosystems and communities that build a specific culture around those languages.
It is with this perspective that I arrived at the premise of this book, which is that we will never stop creating new programming languages, for as long as we have to write code. But this doesn’t need to be just a matter of aesthetic preference. Some niche problems require niche solutions, and building programming language interpreters is a way to introduce novel solutions to existing problems.
At the same time, a programming language is heavily influenced by the runtime environment it targets, but it’s also possible to build custom runtime environments that target a specific programming language.
The existing literature tends to treat those areas as fundamentally independent, while I feel that there is a lot left behind by not considering the design and implementation of the programming language and of the runtime environment it targets as a coherent set.
That is why it was important to me to choose a bottom-up approach when working on this book. I want you to look at the entire problem of both programming language and interpreter design and implementation as a single unit.
By the end of this book, I hope that you find yourself as fascinated as I am by all the technical and non-technical aspects that are connected to programming language and interpreter design and implementation.
This book is tailored for intermediate to advanced software developers, particularly those interested in language design and implementation. It’s ideal for programmers seeking to expand their skill set and tackle complex problems efficiently. Professionals working in roles such as software engineers, language designers, or system architects will benefit from the practical insights and hands-on experience provided in the book. A good understanding of C++ programming and a basic grasp of language design concepts are recommended to fully grasp the content.
این کتاب را میتوانید از لینک زیر بصورت رایگان دانلود کنید:





نظرات کاربران