Replies: 15 comments 21 replies
-
Perhaps it would be a good idea to first do a survey of prior art on CPAN and create a type of feature matrix so that we can at least promote compatibility? |
Beta Was this translation helpful? Give feedback.
-
It seems to me that Oshun is purposefully trying to not be an actual type system, but instead be another thing that overlaps in functionality. It is expressly stated in the README. This distinction is most notable in Oshun being associated with named variable assignments only rather than values, as a real type system would associate with the values themselves and follow them through their lifetime. So Oshun is functionally more like declarative assertions that apply in limited circumstances. Also Oshun is generalized for arbitrary user-defined types, I think, rather than things that specifically hew closely to machine native types. They serve somewhat different purposes. That being said, I do believe that Oshun should be designed in such a way that it is possible for Perl to accommodate having a real type system, that can associate with values for their lifetime and supports hewing to machine native types, as an extension. |
Beta Was this translation helpful? Give feedback.
-
@wbraswell wrote:
Please do not inject conspiracy theories here. Oshun's goals are different from RPerl's goals. It's that simple. I previously didn't want to link your talk on types in Perl because some of the language was dismissive and I didn't want to bring in controversy. But you keep referring to "real types," so this needs to be addressed. In fact, about 4m40s into your video, you sigh and refer to "funny, smelly, fake types systems." You go on to say this:
You say all the above while showing a picture of Elon Musk smoking marijuana, with the words "this type system smells funny." This is setting the stage very clearly. I don't think mocking those who have different goals than yourself is helpful. Telling us that we employ "fake types" to "feel cool" is not helpful. I wouldn't even bring this up, but you keep referring to real types, claiming that we're wrongly ignoring the "real type system", or worse, insinuating that we may be doing this on purpose. So a response is needed. Professor Benjamin Pierce has become an ACM fellow for "contributions to the theory and practice of programming languages and their type systems." He's one of the world's top experts in this area. His book, Types and Programming Languages, is widely used as a textbook in graduate courses in type theory and is considered one of the finest books in this area. In this book, he provides a concise definition of types:
So what behavior are you trying to prove the absence of? Slowness? That's vague. Otherwise, you provide a handful of data constraints (not saying type to avoid overloading the word) which map to the kinds of data that C handles, and you provide some container constraints (arrayref, hashref), but that's it. Your "type system" is there primarily to squeeze our CPU performance and frankly, I think that's a fantastic goal. If we could find a way to approach both your goals and Oshun goals, that would be fantastic and I'm willing to try, but we must start as a good faith effort. If either starts from the position of "I'm right and what you offer has no value," this is going to be a very short conversation. So I'm saying it publicly: if you explore the possibility that other's goals might also be worthwhile, we can try to find a way forward. As for types, you might also wants to read what to know before debating type systems. There are type systems which guarantee you cannot have an SQL injection attack (I saw that one in Haskell). There's another which gaurantees a database is in third-normal form. Perl, in fact, as more than one type system. One of Perl's type systems is largely based around containers: my $stuff = \@other_stuff;
say $stuff->{'some_key'}; In the above, you're going to get a runtime failure when you try to access an array reference as a hash reference. Here, we get a compile-time failure (assuming my @stuff = (1,2,3);
pring $stuff{'some_key'}; Another example of a type system in Perl is taint mode. When enabled, it tries to ensure that data from outside the program isn't used inside the program until it's "untainted." It's not perfect (or popular), but it's a really interesting idea. If anyone argues we should use taint mode in Perl, they're arguing for an additional type system to be activated in the language because they value those goals (I note that RPerl does not allow taint mode). Now consider the following: my $average_temp = ( $fahrenheit + $celsius ) / 2;
say "The average temperate is $average_temp°" Anyone can glance at that and know it's wrong. Your system only allow a With Oshun, we can do this: check Celsius :isa(OBJ[Temperature::Celsius]);
check Fahrenheit :isa(OBJ[Temperature::Fahrenheit]); Later on, we can use those checks on our variables. With that, you could add operator overloading and make Note that this was not the design goal of Oshun. It's a bonus that naturally falls out of a design which allow semantic information to be attached. In your talk you explain some benefits of type annotations:
We're also going for performance, but we're first focusing developer performance, not CPU performance. We're also going for correctness, but we're allowing richer semantic information to be supplied for user-defined types, making it even safer than simply saying "this thing is a number." There's a similar problem in SQL here: So if I want to calculate average temperature, I can start with this: my ARRAY[Celsius] $temps = get_temps($location); With the above, I know I only have celsius temperatures. Further, it's self-documenting and thus more readable and maintainable. With RPerl (as I understand it): my integer_arrayref $temps = get_temps($location);
However, you've gained something with RPerl: fantastic performance benefits. I don't believe that the two are mutually exclusive, but each camp should acknowledge that the goals of the other camp are worthwhile. We can't start with "fake types" (I have no idea what those are) and "real types." You also point out in your talk that "fake types" are often "ad hoc versus engineered." You are 100% correct about this. That's why the Oshun system of checks is modeled after the well-understood—and very successful—checks done in Moo/se and So I see value in both camps. Can we accept that and find a way to address each? |
Beta Was this translation helpful? Give feedback.
-
Unless @wbraswell is willing to continue the discussion, I will close this soon. |
Beta Was this translation helpful? Give feedback.
-
Don't worry, this discussion is far from over, we have been planning the best way to approach this issue and will provide a full technical reply soon. |
Beta Was this translation helpful? Give feedback.
-
Curtis, Per your request, we carefully read through all of Chris Smith's article "What To Know Before Debating Type Systems". He certainly has a good deal of experience on the topic, although he also makes several very concerning assertions. Before we reply to the various other comments in this discussion thread, we will first address the concerns with Mr. Smith's article, including a number of major points of inapplicability to Perl. https://blogs.perl.org/users/ovid/2010/08/what-to-know-before-debating-type-systems.html For example, in the "Fallacies..." section, Mr. Smith claims "the average skill level of programmers who know Ruby is higher than those who know Java". Although there is probably some scientific way to measure this, it seems incredibly subjective without any data provided to back it up, and we're sure there are lots of Java programmers who would strongly disagree and stop reading right there. Chris Smith begins his discussion by discouraging the use of the words "strong" or "weak", due to the subjective nature of this terminology: "Strong typing: A type system that I like and feel comfortable with Unfortunately, Mr. Smith never actually attempts to give any real definition for these terms. Later, he seems to contradict his own advice by providing the subjective labeling of "poor" to type systems with which he himself is uncomfortable, and for which there are plenty of language features to foment disagreement over his claim that "C++ and Java have relatively poor static type systems". It is quite possible to argue that C++ has a relatively useful and functional type system. (I am not familiar enough with Java to give my professional assessment.) Mr. Smith's first casualty in the "Benefits of Static Types" section is runtime performance, which he eviscerates as the "least important" benefit and a "problem of two decades ago", which is now over three decades. "Performance is the gigantic red herring of all type system debates. The knowledge of the compiler in a statically typed language can be used in a number of ways, and improving performance is one of them. It's one of the least important, though, and one of the least interesting. Yes, this is absolutely our corner of the type system debate! Mr. Smith's argument may be true for languages like Python (which has had RPython and PyPy for years) and C++ (which has always been fast), but it is FAR FROM TRUE for our own language Perl, which consistently ranks at or near THE VERY BOTTOM of common language speed rankings. Currently, Perl only makes it onto 2 of the 4 all-language comparison charts, and is at the bottom in both cases. https://benchmarksgame-team.pages.debian.net/benchmarksgame/box-plot-summary-charts.html Currently, Perl averages between 10x to 100x slower than the equivalent Javascript, and is about the same when compared to other dynamic languages. https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/perl.html As you can clearly see, the Perl community somehow conveniently forgot to solve the performance problem over 30 years ago, so now the Perl interpreter is way behind the language performance curve. This deficiency of the Perl interpreter was the primary reason for the creation of the Perl compiler in 2011, so Mr. Smith's performance-is-not-important claim simply does not apply to our still-sorely-out-of-date Perl language. Mr. Smith's next target is code documentation AKA code readability. Oddly, he starts out by giving a totally correct (if apparently sarcastic) explanation of why static typing helps code documentation. "Documentation is an important aspect of software, and static typing can help. But he was actually just kidding, because "everyone knows" this is just "the boring view" and what we really want is "self-documenting code". I have built my Perl career upon the precept of writing the most expressive source code possible, so I am all in favor of code that provides some amount of self-documenting information. That being said, Perl is not by nature a self-documenting language (are there any?), so the best practice is to both write expressive source code and also include plenty of comments anywhere an explanation may possibly be of value at any time in the future. When in doubt, add more documentation (and tests)! Mr. Smith goes on to say precisely why he believes that data types (and comments?) are really not needed at all. "Conveniently enough, most languages with interesting static type systems have type inference, which is directly analogous to self-documenting code. Information about the correct way to use a piece of code is extracted from the code itself (i.e., it's self-documenting), but then verified and presented in a convenient format. It's documentation that doesn't need to be maintained or even written, but is available on demand even without reading the source code." While it is true that a number of data introspection mechanisms exist for Perl, such as Devel::Peek and PadWalker, I would hardly categorize any such Perl solution as either "presented in a convenient format" or "available on demand without reading the source code". Perhaps some day in the future, the Perl interpreter will have a greatly expanded toolset which includes user-friendly data type inference; but in reality that day will probably be several years hence, if ever. https://metacpan.org/pod/PadWalker https://metacpan.org/pod/Devel::Peek In the "Correctness" and "Dynamic Typing Returns" sections, Mr. Smith states that static type systems are related to code correctness proofs, and "establish a lower bound on correctness" by means of the automated type checker disallowing type-related incorrectness based on user-provided type information. Similarly, he states that dynamic type systems are related to code testing, and "establish an upper bound on correctness" by means of the automated test suite disallowing various incorrectness based on user-provided test cases. "Of course", he says, "we care far more about lower bounds than upper bounds." I agree! As the old saying goes, "an ounce of prevention is worth a pound of cure", meaning it is pretty much always better to catch a potential issue early or even prevent it entirely, rather than wait for it to become a problem. Static typing catches lots of bugs during compile time, before our software even runs, which allows us to write fewer test cases and focus our tests on the unique functionality of our software rather than catching mundane type-mismatch bugs, etc. Another test-driven development (TDD) way to think about it is that static typing provides a built-in low-level test suite, so you only need to implement the high-level test cases. TDD tells us to start with tests first, so that means we should always start with declaring our data types first. The basic variable names and data types of the data you will be handling should probably be the very first lines of code you write for any new software project. In the "What is a Type?" section, Chris Smith implies a potentially-useful definition of a data type as "a set of values" along with a corresponding "set of operations" which can work with the values. From a practical point of view, this is as good a definition as any other. A data type can, indeed, be thought of as the combination of a set or range of valid values, and a set of operations to create or modify those values. For example, an integer data type can be described as whole real numbers which can be manipulated using arithmetic (and other numeric) operations. A string data type can be described as alpha-numeric text which can be manipulated with operations such as searching, replacing, and deleting one or more text characters. A compound data structure comprised of multiple individual data types, such as an array or hash, is itself a special kind of data type with one or more sets of valid values and specialized operations. Likewise, a user-defined OO class such as Animal::Dog is also a data type, with sets of valid values for individual object properties such as the dog's name and numeric age (in dog years, of course), and specialized operations like feed() or walk() or play_fetch() which we call object methods. Mr. Smith goes on to promote Benjamin Pierce's academic definition: "A type system is a tractable syntactic method for proving the absence of certain program behaviors by classifying phrases according to the kinds of values they compute." Although this is a cumbersome and unwieldy definition which requires several paragraphs of explanation from Mr. Smith, nevertheless it is the stated preferred definition of the Oshun team so we will oblige. The key point of this definition, according to Mr. Smith, is that "each type system comes with a definition of the behaviors it aims to prevent". He gives the example of a simple program to calculate "5 + 3", which is able to infer that the input values and addition operator and output value are all of the integer data type, and thereby "it's proven the absence of program behaviors (such as adding an integer to a string) by working up from the basic elements of program syntax." Mr. Smith correctly points out the "other missing component is that a type is part of a type system." Later, in the "True Meaning of Type" section, he claims the "only true definition is this: a type is a label used by a type system to prove some property of the program's behavior." Per your request, we will utilize both of the above definitions of data type, as well as Pierce's definition of type system, in the ongoing discussion of Perl type systems. Chris Smith finishes his article by defining a "trade-off" between static and dynamic typing: "[A] static type system is a conservative estimate. If it accepts a program, then we know the program has the properties proven by that type checker. If it fails... then we don't know anything. Possibly the program doesn't have that property, or possibly the type checker just doesn't know how to prove it. ... Building a type checker that doesn't reject any correct programs isn't just difficult; it's impossible. That, then, is the trade-off. We get assurance that the program is correct (in the properties checked by this type checker), but in turn we must reject some interesting programs. ... With testing, we are assured that we'll never fail a correct program. The trade-off is that for any program with an infinite number of possible inputs (in other words, any interesting program), a test suite may still accept programs that are not correct..." Finally, Mr. Smith proposes the "battleground on which [the static vs dynamic debate] is fought out is framed by eight questions, four for each side. ... If you knew the answer to those eight questions, you could tell us all, once and for all, where and how we ought to use static and dynamic typing for our programming tasks." So let's try to answer each of these 8 questions... for Perl!
Easy answer! We already built the Perl static type system based on all the battle-tested, tried-and-true semantic properties of the C(++) type system, including but not limited to:
These semantic properties lead directly to the specific static data types for Perl, including but not limited to:
If you believe the above list is incomplete, please review the "including but not limited to" and "user-defined" lines again. If you still believe the above list of type system properties is incomplete, then yes it is possible (although not easy) to extend both the Perl internals and/or the C(++) type system to accommodate especially bizarre or unique type constraints. This is practical only in the cases where a new type needs to be made a so-called "first-class citizen" of the language, such as the addition of the GNU Multi-Precision project's arbitrary-precision integer type ("mpz_t" in C), which is already implemented as such in the Perl compiler as "gmp_integer". The array and hash data structures are composable, meaning the data types themselves can be combined using the Perl scope '::' delimiter in order to describe typed and/or nested data structures, such as 'integer::arrayref' or 'FooClass::hashref::arrayref', etc.
Easy answer again! We are very close to the ideal, as long as we follow the same tried-and-true C(++) type system semantics mentioned in answer # 1 above. The best approach to a hugely difficult problem like type system semantics is to copy somebody else's homework wholesale, when at all possible. Because of the similarities between the Perl and C(++) type systems, as well as the fact that the Perl interpreter is written in C, we are therefore able to take unique advantage of the situation. The C(++) community has already spent an immeasurably huge effort to ensure the static type system works correctly, so we do not want to reinvent the wheel.
Easy answer, yet again! It is very easy using the Perl compiler, even if you don't know how to program in Perl or any other language.
We honestly have no idea, because we've never had it happen! "That's the boring view. As everyone knows, though, it's better to have" a real answer about debugging a type system. But seriously, if the Perl type system did reject a correct computer program for some reason, then we'd need to debug the type system to figure out why. As with any other non-trivial system software bug, the time cost of fixing it could easily range from just a few hours, all the way up to several long years of painful and expensive programming. (There is no way to accurately predict the cost of fixing a software bug before you start debugging, and even then the best you can hope for is an educated guess, so asking about the "cost associated" with incorrect software behavior seems like a bit of a trick question.) When I say "we've never had it happen" above, of course what I really mean is we've never had it happen in production. During development, we encounter every kind of bug you can imagine, because we're writing new code for the Perl type system itself. We've written over 4.6K test cases for the Perl compiler, and several independent applications, all of which utilize the Perl type system. A majority of the test cases are designed to detect purposeful type mismatch failures, thereby helping ensure the Perl type system itself is functioning correctly and rejecting incorrect Perl programs. As long as you follow the tried-and-true C(++) type system semantics mentioned in answer # 1, which we do with the Perl static type system, then you should't ever have any problems.
Good news! The Perl interpreter already has a dynamic type system implemented internally, which can be utilized in a manner that is compatible with the same tried-and-true C(++) static type semantics we keep referencing from answer # 1 above. This similar-and-compatible nature of the C(++) and Perl type systems is not surprising, because Larry Wall was influenced by C and he chose to write the Perl interpreter in C. Most importantly, this type system similarity is the basis upon which we built the Perl static type system. The Perl interpreter implements a number of very flexible and powerful high-magic dynamic data types, including:
As mentioned in answer # 4 above, there are over 4.6K test cases for the Perl compiler. The primary goal of the Perl compiler is performance, and the static type system is much faster than the dynamic type system, therefore most of the test cases are currently focused on testing the Perl static type system. However, there are a smaller yet significant number of those same test cases which are designed to test the Perl interpreter's dynamic type system. So, we will continue to expand the number of test cases for the Perl dynamic type system, designed to utilize the overlapping functionality between the often-mentioned C(++) static type semantics and the Perl interpreter's dynamic type semantics. (Before we released the Perl compiler, most of the Perl interpreter's dynamic type semantics were hidden from Perl programmers, and required special tools to see them, such as Devel::Peek mentioned above.) Eventually, we will have all the same test cases implemented for both the Perl static and dynamic type systems, as expounded upon in answer # 6 below.
We can come very close! But first, more explanation... In addition to the dichotomy between the Perl interpreter's dynamic type system (described in answer # 5) and the equivalent C(++) static type system used by the Perl compiler (described in the first 4 answers), there is a similar dichotomy between Perl operations and C(++) operations. When you use Perl operations to operate upon Perl data types, then what you have is normal interpreted Perl. This Perl run mode is called PERLOPS_PERLTYPES and is most often achieved by simply running the Perl interpreter, although it is the same run mode as the pre-parsed optree generated by the When you use C(++) operations on Perl data types, then you have a form of compiled Perl which kind of looks like perlguts and XS. This Perl run mode is called CPPOPS_PERLTYPES and is available through the Perl compiler. CPPOPS_PERLTYPES is a static/dynamic hybrid AKA medium-magic Perl run mode, and therefore is a medium-speed mode which generally executes in the range of 5x to 10x the speed of normal PERLOPS_PERLTYPES run mode. It doesn't make sense to use Perl operations on C(++) data types, because if you've already got your data inside fast static data types then you might as well go ahead and use fast C(++) operations at that point. Thus, there are no plans to ever implement a PERLOPS_CPPTYPES run mode. When you use C(++) operations on C(++) data types, but you are still using your source code to implement Perl software, then you have a form of compiled Perl which looks like a somewhat Perl'ish C++. This Perl run mode is called CPPOPS_CPPTYPES and is available through the Perl compiler. CPPOPS_CPPTYPES is the most static AKA low-magic Perl run mode, and therefore is also the most high-speed. This run mode is the crown jewel of the Perl compiler, and is the gold standard which all Perl developers should work toward utilizing. Thus, you can see we actually have three Perl run modes being tested by the 4.6K tests of the Perl compiler:
Even though we already have a lot of tests for the Perl compiler, we still need to implement many more before we can feel reasonably confident that we are not "accepting any broken programs". Furthermore, most of the existing tests are focused on making sure PERLOPS_PERLTYPES and CPPOPS_CPPTYPES behave exactly the same as one another, since they are considered the two most important run modes. We can easily imagine the possibility of implementing 50K tests (or more) for each of these two run modes, and eventually the same number for CPPOPS_PERLTYPES as well. We plan to use our new Perl-powered Navi AI to automatically and exhaustively generate a huge number of brute force test cases, for coverage of every possible combination of every Perl data type semantic and language syntax construct with every other Perl data type and language construct. Navi should eventually be able to generate several million or billion test cases, to help us prove that we are "never accepting a broken program".
It is pretty easy, because Perl has a good testing infrastructure which can be used to write tests for Perl programs that use the Perl type system. The test cases are implemented in essentially the same way as normal Perl test cases, with an optional outer loop that iterates through 2 or 3 of the Perl run modes. By doing so, all the same test cases are run for PERLOPS_PERLTYPES, then optionally again for CPPOPS_PERLTYPES, and then once again for CPPOPS_CPPTYPES. The observed test behavior must be exactly the same for all tested run modes, in order to prove that the Perl type system itself is implemented correctly. https://metacpan.org/release/WBRASWELL/RPerl-7.000000/source/t/04_type_scalar.t#L56 Remember the ERRORs we saw in answer # 3 above? That behavior is already inherent in CPPOPS_CPPTYPES, and is tested for all 3 run modes as well: https://metacpan.org/release/WBRASWELL/RPerl-7.000000/source/t/04_type_scalar.t#L289 Additionally, for Perl source code which is ready to be compiled, tests can be created to check if the compiled versions look and act correctly. We have tests to compare the output of the Perl compiler with pre-compiled source code for all three Perl run modes, for example with sample algorithms: https://metacpan.org/release/WBRASWELL/RPerl-7.000000/source/lib/RPerl/Algorithm/Sort/Bubble.pm All the above tests are part of the Perl compiler and/or Perl type system. Developers who write their own Perl software using data types can also write their own test cases the same as normal non-typed Perl. The Perl compiler provides a reusable "interpret_execute.t" file which searches a Perl distribution for ".pm" and ".pl" files marked with testing preprocessor data, then either interprets and/or executes them to detect success and failure values. https://metacpan.org/release/WBRASWELL/RPerl-7.000000/source/t/09_interpret_execute.t
As with answer # 4 above, the cost of accepting an incorrect program can range from a few hours to several years and thousands of dollars. In some mission-critical systems, the cost could potentially be measured in human casualties or even (God forbid) fatalities. In Perl, it is almost always considered to be very important to have a thorough test suite which does not allow incorrect software to pass. Once again, as long as you follow the tried-and-true C(++) type system semantics, then you will ultimately become richer, smarter, or (at the very least) an all-around better Perl programmer with lower costs associated with your Perl code. |
Beta Was this translation helpful? Give feedback.
-
I want to thank you two for your excellent example of restraint even when discussing very different opinions. You both have provided some very well-thought-out, fascinating points, and I feel like there's a great deal of merit to both views and typing/check systems, and perhaps both could coexist in some way. Great work from both of you, and your hard work on your respective projects is appreciated. |
Beta Was this translation helpful? Give feedback.
-
The questions have not been answered and the conversation has stalled. Had this been discussion of the existing Oshun semantics or syntax, this would be normal. However, this is a proposal to take Oshun into a completely different direction, guided by completely different goals. Unless a compromise can be found, this discussion will soon be closed. |
Beta Was this translation helpful? Give feedback.
-
@Ovid |
Beta Was this translation helpful? Give feedback.
-
Yes, I am the chairman of the Perl::Types Committee. |
Beta Was this translation helpful? Give feedback.
-
Hello @Ovid, I am also one of the members of the Perl::Types Committee. I've been following the capabilities in Fundamentally, my interests are much more aligned with making it easier to access the underlying data types implemented by the Perl interpreter; from a high level (pure Perl) view, all the way down to the nitty gritty details required when dealing with the Perl API. (For example, when one is creating compiled code interfaces using As I said in the beginning, the existing capabilities and goals of
The list goes on. I am sure the Oshun project is of interest to a number of people, and I am absolutely convinced the |
Beta Was this translation helpful? Give feedback.
-
I do think there is value in looking at how Oshun could work hand-in-hand with a lower-level type system. Something like this: my $var :of(PositiveInt) = 42; Could be implemented entirely in run-time checks, but a future version of Perl could see that declaration, recognize that That should absolutely not be part of the MVP. |
Beta Was this translation helpful? Give feedback.
-
On Wed, 9 Aug 2023 at 15:26, Toby Inkster ***@***.***> wrote:
I do think there is value in looking at how Oshun could work hand-in-hand
with a lower-level type system. Something like this:
my $var :of(PositiveInt) = 42;
Could be implemented entirely in run-time checks, but a future version of
Perl could see that declaration, recognize that PositiveInt is a subtype
of Int, and and replace $var's internal representation with a smaller,
faster native int instead of using a full SV structure.
Without wanting to be argumentative I just wanted to say that a "smaller,
faster native int" is very unlikely to happen. First of all UV/IV's are
stored as bodyless SV's in modern perls. They only have a head
structure, the body is faked up, so they are already as small as they can
be. Second, SV's are refcounted data types, so there needs to be room in
the basic structure to hold the refcount. Third, the various flags that
live in a SV head need to exist regardless as that is how we deal
with IV/UV distinctions, and how we track readonlyness and stuff like that.
Furthermore, we can't really optimize operations on a type like this, we
need to be able to upgrade the IV into a PVIV and related structures as
people do operations like:
print $var; # upgrades IV to PVIV
my $blessed = bless \$var, $class; # upgrades IV to PVMG (iirc)
Also we need to deal with the case that you do
$var += $very_large_number_that_causes_var_to_be_converted_to_a_float; #
upgrades IV to NV
and similar such steps. The only way to do a "smaller faster int" is to not
use an SV and not have SV semantics, which IMO would preclude using SV's
directly in operations involving this new non-sv type.
cheers,
Yves
…--
perl -Mre=debug -e "/just|another|perl|hacker/"
|
Beta Was this translation helpful? Give feedback.
-
Given @demerphq's unanswered concerns from three days ago, which is the technical explanation of my unanswered concerns from two weeks ago, I'm closing this discussion as stalled. It can be reopened or recreated when/if there is a way to explain how we can make developer checks work seamlessly with the low-level checks proposed here. |
Beta Was this translation helpful? Give feedback.
-
@Ovid maybe its for another thread and maybe this is addressed somewhere but it would be great if there was a document that wasn't deep in the weeds technology but just an overview of the tops goals we have for adding types to Perl that way we can always refer back to that document as type of guiding light helping drive choices when they are hard to make. |
Beta Was this translation helpful? Give feedback.
-
It appears the Oshun project is wrongly (or even purposefully) ignoring the fact that Perl has already had a real type system for many years, which is currently part of the Perl compiler and is in the process of being refactored out into a stand-alone distribution:
https://metacpan.org/dist/RPerl
https://metacpan.org/dist/Perl-Types
Some documentation here:
https://metacpan.org/pod/RPerl::Learning#CHAPTER-2:-SCALAR-VALUES-&-VARIABLES-(NUMBERS-&-TEXT)
More info about real vs fake type systems in Perl:
https://www.youtube.com/embed/3BYlObnzuKQ
Also, the real Perl type system already provides both runtime (for interpreted code) and compile time (for compiled code) type checking.
As stated, we are refactoring to create Perl::Types... Meanwhile, interested parties should use the Perl compiler v5.2 via Docker:
$ docker run -it wbraswell/rperl_cpan
Beta Was this translation helpful? Give feedback.
All reactions