finanalyst

Intro to Sixy Perl

Jan 18th, 2016
568
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.14 KB | None | 0 0
  1. Introduction to Sixy Perl
  2.  
  3. Sixy (6'y) Perl promotes a broad world view about language, software and development. Newcomers to the Sixy community often assume Perl6 is an ordinary IT product - an upgrade of Perl (it is, and it isn't) or a new product added to computer science's menagerie of exotic entities (it is, and it isn't). So we get repeated questions that are based on assumptions that Sixy Perl is like something else. The answers to these questions are also often "it is and it isn't", which is confusing as hell, and can irritate some delicate psyches to the point of heated huffiness.
  4.  
  5. This is a short introduction to the Sixiest computer language in the world, and why things are the way they are.
  6.  
  7. The Ideal and the Real.
  8.  
  9. Previous incarnations of Perl (1-5) were defined by the software (compiler / interpreter) that took a script as input and did things. When at one point in time it seemed the software might fork (for Windows and Unix), Larry Wall (Perl's inventor/guru/prophet/king) insisted on a single implementation. The language was defined by the implementation.
  10.  
  11. This was good because any Perl script / program would run identically on any OS, if the OS was good enough. Learn Perl in Linux, and use it in Windows, or Apple OS. (Multi-platform systems are now ubiquitous, but Perl was the first to show the way.)
  12.  
  13. Because the implementation defined the language, what worked is what the language should do. So if a programmer thought something should happen after reading the documentation, and it didn't happen that way, then the result was a feature, not a bug, of the interpreter and the documentation was ambiguous.
  14.  
  15. In this sense, the ideal Perl (what we think should happen after reading the documentation) and the real Perl (what the interpreter does) were/are the same.
  16.  
  17. But identifying the definition of the language with its implementation was not good because there was no way to test other ways of achieving the same goals in the interpreter as it was difficult to define what 'the same' meant. In addition, smart things at one point in the evolution of the language turned into hacks, and then into kludges. And the kludges began to slow down growth.
  18.  
  19. Deciding whether a language is an abstract thing or its instantisation is a dilemma computer scientists have faced from the appearance of the first high-level languages. A natural answer is to separate the ideal from the real: a definition of the language (written in some formal, legalistic way) and an implementation (eg., a compiler). If the compiler does not do what the language designer said it should do, then the compiler is wrong.
  20.  
  21. Except ...
  22. Not everything that a designer thinks of can be done (eg., too slow, too much memory, unsupported by current hardware);
  23. Not everything that a designer thinks of should be done (eg., subtle conflicts with other parts of the language, implicitly assumes a halting problem solution);
  24. Not everything that an implementation does was defined by the designer;
  25. Not everything that is possible was thought of by the designer;
  26. Not everything that can be designed can easily be expressed in words.
  27.  
  28. Experience in software development has shown that there has to be a process of iteration between design and implimentation. And pragmatically, mallable design wins out in speed an popularity over elegant design.
  29.  
  30. Plain words can explain most things, but not everything. It is possible to show something happens without being able to describe it unambiguously (try describing a sine wave in words as opposed to a graph). A code example and the expected result is better than a legalistic, or even a mathematical, description.
  31.  
  32. Suppose too that the documentation is ambiguous at some point, and two implementations do subtly different things, each of which is consistent with the documentation. Which is correct? Or are both correct? Something else, some benchmark, is needed to break the deadlock.
  33.  
  34. Sixy Perl deals with all of these issues by having an ideal, a real, and a benchmark.
  35.  
  36. The "ideal" is a definition of the language, which is called "Perl6". Since evolution is inevitable, there will be re-births of Perl6, which will be labelled using letters. In fact Perl6 has gone through several iterations of design change and implementation before a version was considered stable enough to let loose upon the world. And because for YEARS everybody wanted (pleaded/implored/demanded) to know when Perl6 would be released, the designers said 'Before Christmas'. So the first release is called Perl6.c and was released around Christmas 2015.
  37.  
  38. The "real" is the implementation. The first fully working implementation is Rakudo. There were previous implementations, a notable early one being PUGS. There are other implementations. The implementers of Rakudo are not finished working on the software. It needs to be faster, smaller, more complete, etc etc. Implementers can use a numbering system consistent with their idiosyncracies (PUGS updates were labelled with an increasingly precise pi).
  39.  
  40. The "benchmark" is the test suite or roast. If an implementation can process all of the pieces of code in the test suite and produce the results defined in the test suite, then it has been roasted. And a roasted implementation is a true implementation of Perl6.
  41.  
  42. Suppose two true (roasted) implementations of Perl6.c (for example) process some arcane code but produce different results? In the Sixy world, both can claim to be true implementations. That is, unless or until the Perl6 designers decide on the results that code *should* produce and include a snippet into the test suite. The suite is updated (not necessarily the language definition), and all implementations have then to conform.
  43.  
  44. And that is why in the Sixy world, we have Perl6.x, Rakudo.yyyy.mm, and a Roast suite.
  45.  
  46. In terms of speed of evolution, time will tell, but it might be expected that changes will be:
  47. - slow for Perl6
  48. - moderate to fast for Roast (initially, slowing quickly)
  49. - rapid for Rakudo.
  50.  
  51. The implications of changes in Rakudo for software that sticks to code tested in Roast will be zero in terms of results, but should be positive in terms of speed (faster) and footprint (smaller).
  52.  
  53. Welcome to the Sixy World of Perl.
Add Comment
Please, Sign In to add comment