⬆️ ⬇️

Interview with Audrey Tan, Part 1





Audrey Tan is primarily known as the creator and developer of Pugs , the Perl 6 User's Golfing System, a Perl 6 implementation on Haskell, which appeared on February 1, 2005 and was the most actively developed and most complete implementation at that time.



The questions and answers in this document are distributed under the CC0 license and are in the public domain.



Biography



Did you start learning Perl when you were 12?

')

I met Randal Schwartz's Perl from The Lama Book when I was 13. I followed the development of the OnePerl project during development 5.004-5.005, helped create communities such as the Usenet group tw.bbs.comp.lang.perl and learned a lot from the nascent CPAN community.



Was he your first language?



My first computer languages, at the age of 8, were GW-BASIC and Logo (LISP variant). I programmed in different languages ​​(LPC for LPMud, etc.) before the web appeared in 1994.



In addition to Pugs, you have many modules for Perl 5 published on CPAN since 2001. How was your life connected to Perl before Perl 6?



After the advent of the web, Perl practically covered all my programming needs for the next 10 years. In 1999-2000, I migrated from EFNet to IRCNet to the new Rhizomatic server (also known as MAGNet, later irc.perl.org), where I learned about Perl Monger global initiative and more careless initiatives Perl Golf .



At that time, we translated the third edition of the Book with Lama into traditional Chinese , so it seemed logical to form the Taipei.pm group and join the wider community of CPAN. I mainly worked on CPANPLUS, the CPAN smoke test framework, Module :: Signature, as well as the PAR / pp package building tool.



When and why did you decide to work on Perl 6?



I visited OSCON 2003 to give a master class on PAR.pm - although I spent most of the flight preparing a blitz report that was very warmly received by the community. The last blitz in the same session was Allison's Restaurant , with such particularly inspiring words:

You know, if one person, just one person, does this, they might think that he is sick, and put him in an insane asylum. And if the two do it, in unison, they might think both are crazy and hide both. And if the three do it! Can you imagine - three people enter, sing a line from “Perl 6 Development” and exit? They may think that this is an organization! Can you imagine fifty people a day? I told FIFTY people a day ... incoming, singing line from "Perl 6 Development" and leaving? Then, friends, they may think that it is a MOVEMENT, and so it is: ANTI-WAR, CODE CLEANING, POSSIBLE WARMING, LOVING PARROT MOVING PERL 6 PERFORMANCE! .. and you all should join us and sing next time.
That's when I decided to work on Perl 6.



Before Pugs, you were actively involved in the Parrot project. What exactly did you do there?



I participated with Dan Kogai in the discussion about the internationalization infrastructure at Parrot on the perl6-internals mailing list.



In addition, I just tried new builds from time to time and reported problems with the build process; I was not actively involved in Parrot in the early years when Simon Cozens and Dan Sugalsky were leading the project.



When you started this, did you think of creating both a compiler and an interpreter?

Yes. 26.02.2005 in Pugs Apocrypha it was already mentioned about compilation in Haskell, Parrot and Perl 5.



-Ofun



You are the author of the meme "-Ofun", or "Optimizing for fun" ("Optimization for fun"). What does this mean for you and what was it for the rest of the team?



There is a set of slides explaining what it meant to me:



For community members, this meant a culture of warm reception, regular updates, attention to detail, personal feedback, the formation of a ladder of skills and help each other.



For software hackers, the culture “-Ofun” focuses on using distributed versioning, encouraging forks, preferring ideas to general agreement, hugging trolls and sketching ideas with code.



What could be the path of the project, choose the opposite motto, for example, “There is no premature optimization”?



“-Ofun” really means the same thing as “No premature optimization”, because premature optimization would limit the possibilities of research, and thereby reduce the pleasure.



In the case of the logical opposite, that is, if I chose “Optimization for boredom” or “Optimization for suffering”, I think we would reach a local maximum very quickly, having completed a definite way - specifically, heading towards ⊥. :-)



But seriously, compiling and testing early versions of Pugs took literally hours. What did you do to speed it up?



We waited until Moore's law was tightened, and it worked well. In addition, we refactored large, monolithic modules into smaller parts, which made incremental compilation and testing much faster.



For Pugs releases, you used the π approximation as the version numbers. Is that part of -Ofun too?

Sure. This doubles the fun of the TeX versioning system .



The TeX versioning system implies that no major changes will be made in future versions. In Perl 6, you had several steps. How closely did you follow this list?

6.0: Initial Release

6.2: Basic I / O and flow controls; variable variables; assignment

6.28: Classes and Types

6.283: Rules and Grammar

6.2831: Type system and layout

6.28318: Macros

6.283185: Port Perug 6 Pugs if needed



Pretty close. In the Pugs, the first two stages were implemented according to the Synopsis, and we have advanced quite a bit towards the third stage. The early implementers of step 6.28 eventually launched the Moose project, bringing the Perl 6 object system to the Perl 5 and JavaScript communities.



Regarding the following three steps: although Pugs helped start the design discussion of these aspects, it took much longer for the Synopsis for grammar systems, types, and macros to crystallize, with the help of subsequent implementers Perlito, Niecza and Rakudo.



Haskell



Quoting your post announcing Pugs, it was “an attempt to write a Haskell Perl 6 interpreter”. Why Haskell?



At that time, I was learning Haskell on the Haskell channel irc.freenode.net:



Pugs was my second Haskell program, originally written as an exercise for the book Types and Programming Languages ​​(page 82 of the slides above).



Haskell is a purely functional programming language, whereas Perl 6 is not. What parts of the implementation have become easier thanks to this choice, and for which Haskell is not very suitable?



This was useful in that it is much easier to talk about the semantics of Perl 6, making all the ambiguities in the specification explicit, because Haskell does not prefer one semantics over another.



As for the shortcomings, in my article of 2010 there is a list. The Haskell community was still young when we started the Pugs, and I'm glad to see that cross-pollination has moved both communities forward.



You often mentioned monads in your blog posts; what did you do with them in pugs?



The interpreter is a monad of this type:



runEvalT :: ContT (EvalResult Val) (ReaderT Env SIO) (EvalResult a) -> Eval a

-- data SIO a = MkSTM !(STM a) | MkIO !(IO a) | MkSIO !a





This clearly expresses the continuation semantics, the type of result, the lexical environment of the execution time, and distinguishes the states of the software transactional memory, the I / O effects, as well as the clean code.



A parser is another monad that includes an interpreter monad, allowing BEGIN blocks to change the parsing logic during compilation.



Has Haskell's nature helped to implement the async and start keywords and all the possibilities for parallel and competitive things in Perl 6?



Definitely. When Perl 6 explored designs on concurrency and competitiveness, the Haskell community also dealt with the operational semantics of their underlying abstractions, such as streams, events, limited sequels, and so on. It was very appropriate to use advanced design to check whether the advanced design was good.



What about the object-oriented features of Perl 6, including how to resolve methods?



The resolution of multimethods, as well as interactions with associations (junctions), were among the first things that Pugs helped clarify in the design of Perl 6. We also influenced the adoption in Perl 5 of the plug-in resolution order method: Pugs as his inspiration, thanks to Stevan Little, who did the initial C3 prototyping .



Your quote : "The twenty-minute hack paid off in full: in 33 lines we received a quick implementation of support for the basic rules of Perl 6 on pure Haskell." It sounds amazing, can you explain how this is possible, and how Haskell (or, apparently, some libraries) works inside with grammars and Perl rules?



Here we are talking about Text.Parser.Rule.parseGrammar , PGE port by Patrick Michaud on Parser Arrows Haskell. Internally, the abstraction of the arrow made the effects accumulated during the parsing much more pronounced. Later, Adrian D. Thorston (independently) fully investigated the idea of ​​parsing engines with built-in return / cancellation rules, resulting in the Colm programming language.



You also contributed to Haskell itself. Specifically, you worked at Haskell '(Haskell Prime) project on upgrading Haskell standards. What was your role there, and did the work on Pugs change your Haskell vision and how it should evolve? Or, in short, did Perl 6 affect Haskell?



I worked on Unicode-related language suggestions, such as SourceEncodingDetection ; In addition, I considered and discussed other proposals. Pugs was an early follower of GADT, Delimited Continuations, QuasiQuotation, etc., and we gave feedback on the GHC to make these features more consistent.



Our main influence on Haskell, however, was attracting people to the study of Haskell among the mostly online community, instead of its original academic installation Powered by PhDs. People who met Haskell through the Pugs — such as Edward Kmett — continued to revitalize the Haskell community with the same spirit of intense collaborative development.



In the same 2005, you began to study Erlang. Did you find it possible to write a Perl 6 compiler in this language? Would it be different from a Haskell implementation?



Definitely possible. The main difference is that Haskell — because of its ability to make all effects explicit — helped clarify the set of Perl 6 semantics “native” to Perl 6, which made it unique among other functional languages ​​at the time.



If not Haskell or Erlang, what other functional languages ​​might be candidates for creating a Perl 6 compiler or interpreter?



OCaml would also be a sensible choice, with its emphasis on runtime performance and good support for multi-stage programming.



Among contemporaries, Perl 6, Scala, Clojure, and C # 3.0+ (on which Niecza is built) are excellent functional languages ​​for implementing Perl 6.



Compiling a Haskell project required not only patience, but also the existence of dependencies such as GHC, the Haskell compiler. This could stop those who just wanted to play around with Perl 6. What did you recommend to such an audience?



Yes: I recommended Perl 6 test servers, deb-like packages such as the Haskell Platform and MinGHC , and Perl 6 IRC bot.



Team



Within a few weeks after Pugs was launched, the project had half a dozen contributors, and a year later there were more than 200. How did it happen that the project in a language completely different from Perl (I mean Haskell, not Perl 6 :-)) attracted so many people ?



There was already considerable community interest in Perl 6, and Pugs benefited from the community's generosity. For example, Scott Walters, who wrote the book Perl 6 Now in 2004, kindly donated to the public domain Perl 6 code snippets, which were among the earliest materials in the Pugs repository.



In fact, relatively few people worked on the Haskell codebase. Because of the strong “first test” culture from the very start, most people on IRC contributed to writing Perl 6 code — examples, tests, modules — so the language barrier was not so constraining.



How many active contributors were?



There were 131 active committers during the first year, and 395 people in all contain a list in the perl6 / mu repository.



How many of them stayed long?



Many committers either stayed in the # perl6 channel, or subscribed to Perl 6-related news and blogs, but the degree of involvement is difficult to assess.



However, since after 2007 there were more committers in Perl 6 than there were in 2005-2006, it is clear that the Perl 6 community has successfully booted.



You are known as a project coordinator who easily distributes commits rights. What did you do when someone committed something completely different from your vision for developing a project?



Usually I changed my vision accordingly - and consulted with the designers of the language in order to change their vision accordingly. In this regard, the IRC channel was an effective tool for combining the vision of different people.



Do you have any rules for developers?



The only requirement is that you know how to treat very different people (and a certain number of years later, butterflies ), or learn to treat well, or at least you want to learn how to treat well. As Larry says :

You still do not want to be good, but perhaps you want to want. Perhaps we can help with that. If the acceleration remains positive, over time the speed and position will also catch up.


Probably not every member of the Pugs team was familiar with Haskell? Was it easy for them to work on the project?

As mentioned above, most contributors to IRC contributed by writing Perl 6 code.



For those who wanted to gain Haskell knowledge, we prepared the READTHEM and READTOO files especially for this. Learning Haskell was not particularly simple - for those who already had experience with imperative programming, we had to unlearn many habits - but we did everything we could to make this process enjoyable and appropriately energized .



Can you name a few team members who have made the greatest contribution, and tell them what was their merit?



Pugs was a fully collaborative project . If I list those I remember, along with their significant contributions, the answer to this question will be longer than the rest of the interview!



However, I would say that this consistency would not have come so quickly if it were not for the existing infrastructure of the online community in the form of use Perl; , Perl Monks , Perl Mailing Lists , FreeNode IRC and OpenFoundry Project Hosting — these spaces, with their underlying technologies and operators, made this kind of interaction possible in principle.



To be continued...

Source: https://habr.com/ru/post/268911/



All Articles