Is it beneficial for a programmer to learn how to build a compiler?

前端 未结 17 1334
难免孤独
难免孤独 2021-02-07 01:10

There is a lot of variety when it comes to the different types of programmers. In general, is beneficial for a programmer to learn how to build a compiler? In what cases would

17条回答
  •  轮回少年
    2021-02-07 01:44

    In todays' industry, if you can do a compiler, then your like a 3 y/o kid thats' learning how to count (that being the upper limit of my intelligence gives me an IQ of about 18 as far as the field is concerned); and its just as essential too: as quoted in the dragon book, every application with a user interface defines a programming language.

    Furthermore, new programming languages, such as zonnon and composita, use syntax directed protocols for communication between live objects. They define protocol types which specify the interface to a server thread as an EBNF grammar. That makes it impossible to code the message handlers if you havent' written a compiler!

    Syntax directed protocols are the best way to deal with things like web servers that use text-based protocols; so its very possible that this will become the method of choice. However, both languages restrict the protocols to LL(1) grammars (for very obvious reason), and this may prove to be too restrictive.

    While the current implementation of zonnon is still a bit on the glitchy side; and the language definition doesnt' seem to be complete yet either; i will nevertheless be so bold as to venture that zonnon (or something similar) will put C# in the garbage bin where it belongs, if they can get these issues ironed out.

    Composita is an intriguing language; but in the real world, its prolly undesirable to require every object to tbe a live thread and every function call to be a message, since the designers of composita had to override the OS to make it run fast enough.

    That having been said, ill close by repeating myself: if programming server applications does go the way of EBNF protocol types, then you had best learn how to write a compiler.

提交回复
热议问题