[svn:parrot-pdd] r33751 - trunk/docs/pdds/draft

2008-12-10 Thread chromatic
Author: chromatic
Date: Wed Dec 10 00:58:53 2008
New Revision: 33751

Modified:
   trunk/docs/pdds/draft/pdd14_numbers.pod

Log:
[PDD] Reviewed Numbers PDD; minor edits to formatting and phrasing.  Sadly,
IBM's Standard Decimal Arithmetic Standard is no longer available from IBM's
site.  It's unclear how to include this within Parrot as it stands anyway.
This PDD needs more thinking in the next few days.

Modified: trunk/docs/pdds/draft/pdd14_numbers.pod
==
--- trunk/docs/pdds/draft/pdd14_numbers.pod (original)
+++ trunk/docs/pdds/draft/pdd14_numbers.pod Wed Dec 10 00:58:53 2008
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2004, The Perl Foundation.
+# Copyright (C) 2001-2008, The Perl Foundation.
 # $Id$
 
 =head1 NAME
@@ -34,7 +34,6 @@
 integer may be autoboxed as an C PMC, or as an HLL type mapped to
 C.
 
-
 =head2 Floating-point data types
 
 Parrot provides a native floating-point data type, generally known as a "Num".
@@ -50,13 +49,12 @@
 method call, a native float may be autoboxed as a C PMC, or as an HLL
 type mapped to C.
 
-
 =head2 Integer PMC
 
 The C PMC is a high-level integer type, providing the features of a
 integer data type appropriate for use in a high-level language. Some languages
-may be able to use Parrot's C directly as their integer data type,
-others may subclass C to add their own functionality, and others may
+may be able to use Parrot's C directly as their integer data type.
+Others may subclass C to add their own functionality, and others may
 implement their own high-level integer data type.
 
 The C PMC has a single attribute, the integer value.
@@ -65,20 +63,20 @@
 
 =over 4
 
-=item init()
+=item C
 
-Initialize the C to 0.
+Initializes the C to 0.
 
-=item set_pmc(PMC *value) and set_integer_same(PMC* value)
+=item C and C
 
-Set the C to the integer value of the PMC argument.
+Sets the C to the integer value of the PMC argument.
 
-=item set_integer_native(INTVAL value)
+=item C
 
 Set the C to the passed-in integer value.
 
-=item set_number_native(FLOATVAL value), set_bool(INTVAL value),
-  set_bigint_int(INTVAL value), set_string_native(STRING *value)
+=item C, C,
+  C, C
 
 Morphs the C PMC to a C, C, C, or C
 PMC, and sets the value from the passed in value.
@@ -86,99 +84,104 @@
 {{NOTE: the morphing behavior is currently under consideration and may be
 rejected.}}
 
-=item get_integer()
+=item C
 
 Retrieves the integer value of the C.
 
-=item get_bool()
+=item C
 
 Returns the boolean value of the C (false if 0, true otherwise).
 
-=item get_number()
+=item C
 
 Returns the integer value of the C as a floating-point number.
 
-=item get_bignum()
+=item C
 
 Returns the integer value of the C in a new C PMC.
 
-=item get_string() and get_repr()
+{{ NOTE: this vtable entry may be deprecated }}
+
+=item C and C
 
 Returns the integer value of the C as a string.
 
-=item [add|subtract|multiply|divide|floor_divide|modulus|pow]_int(INTVAL b,
-  PMC *dest)
+=item C<[add|subtract|multiply|divide|floor_divide|modulus|pow]_int(INTVAL b,
+  PMC *dest)>
 
-Add/subtract/multiply/divide/modulus/exponent an integer value with the
-C PMC, and return the result as a new PMC (the C parameter is
-unused). Overflow of the native integer storage auto-promotes the result PMC
-to a C.
-
-=item i_[add|subtract|multiply|divide|floor_divide|modulus|pow]_int(INTVAL b)
-
-Add/subtract/multiply/divide/modulus/exponent an integer value with the
-C PMC, and set the C to the resulting value. Overflow of the
-native integer storage auto-promotes the C to a C.
+Adds/subtracts/multiplies/divides/moduluses/exponents an integer value with
+the C PMC, and returns the result as a new PMC.  (The C
+parameter is unused). Overflow of the native integer storage auto-promotes the
+result PMC to a C.  Note that these are multidispatched.
+
+=item C
+
+Adds/subtracts/multiplies/divides/moduluses/exponents an integer value with
+the C PMC, and sets the C to the resulting value. Overflow
+of the native integer storage auto-promotes the C to a C.
+Note that these are multidispatched.
 
 {{NOTE: there is some discussion of having this promotion of storage happen
 purely internally (perhaps by swapping vtables), rather than converting to a
 different PMC type.}}
 
-=item
-   i_[add|subtract|multiply|divide|floor_divide|modulus|pow]_float(INTVAL b)
+=item C
 
-Add/subtract/multiply/divide/modulus/exponent an integer value with the
-C PMC, and set the C to the resulting value, morphing it
-to a C.
+Add/subtract/multiply/divide/modulus/exponent an integer value with the the
+C PMC, and set the C to the resulting value, morphing it to
+a C.  Note that these are multidispatched.
 
-=item increment()
+=item C
 
-Add 1 to the value of the integer.
+Adds 1 to the value of the integer.  This may autopromote the PMC to a
+C.
 
-=item decrement()
+=item C
 
-Subtract 1 from the value of the integer.
+Subtracts 1 from the value of

Re: Files, Directories, Resources, Operating Systems

2008-12-10 Thread Aristotle Pagaltzis
* Charles Bailey <[EMAIL PROTECTED]> [2008-12-10 03:15]:
> It may well be that a fine-grained interface isn't practical,
> but perhaps there are some basics that we could implement, such
> as
>
> - set owner of this thing
> - (maybe) set group of this thing
> - give owner|everyone|?some-group the ability to read
>   from|write to|remove|run this thing
> - tell me whether any of these is possible
> - make the metadata for this thing the same as the metadata for
>   that thing
> - tell me when this thing was created|last updated

There are many problematic suggestions here. Some examples:

• Unix does not track file creation datetime at all.

• The concept of making a file runnable doesn’t even exist on
  Windows: that property is derived from the filename extension.

• Delete permission on a file is a concept that doesn’t exist on
  Unix. To be able to delete a file, you instead need write
  permission on the directory it resides in.

Furthermore, in Win32, files and directories can inherit
permissions, so the fact that a file has certain effective
permissions does not mean that these permissions are set on
the file itself. But if you set them on the file itself, you
dissociate it from the inheritance chain. So reading permissions
and then setting them the same, without changing anything, can
still have unwanted side effects. Or if you try to make the API
smart, and so make it set permissions only when they constitute
a change from the effective permissions, then conversely the user
no longer has a way to dissociate the file from iheritance if
that *is* what they wanted. So the concept of inheritance must
be exposed explicitly.

This is the primary issue I was thinking of when I said that some
differences between Win32 and Unix have such pervasive effects
that it seems impossible to provide even a rudimentary abstract
interface.

Regards,
-- 
Aristotle Pagaltzis // 


[perl #61242] [FTBFS] build fails with --optimize on 64bit linux

2008-12-10 Thread via RT
# New Ticket Created by  Moritz Lenz 
# Please include the string:  [perl #61242]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=61242 >


After a 'make realclean' I ran 'perl Configure --optimize && make'. It
dies like this:

../../parrot -o PGE.pbc --output-pbc PGE.pir
../../parrot ../../runtime/parrot/library/PGE/Perl6Grammar.pir
--output=PGE/bui
ltins_gen.pir PGE/builtins.pg
FixedIntegerArray: Can't resize!
current instr.: 'parrot;P6metaclass;new_class' pc 95
(runtime/parrot/library/P6o
bject.pir:126)
make[1]: *** [PGE.pbc] Error 1
make[1]: Leaving directory `/home/moritz/src/parrot/compilers/pge'
make: *** [compilers.dummy] Error 2


This is the output from Configure.pl:
Parrot Version 0.8.1 Configure 2.0
Copyright (C) 2001-2008, The Perl Foundation.

Hello, I'm Configure. My job is to poke and prod your system to figure out
how to build Parrot. The process is completely automated, unless you
passed in
the `--ask' flag on the command line, in which case I'll prompt you for
a few
pieces of info.

Since you're running this program, you obviously have Perl 5--I'll be
pulling
some defaults from its configuration.

init::manifest -  Check
MANIFEST.done.
init::defaults -  Set Configure's default
values.done.
init::install -   Set up installation
paths..done.
init::hints - Load platform and local hints
filesdone.
init::headers -   Find header files distributed with
Parrot..done.
inter::progs -Determine what C compiler and linker to
usedone.
inter::make - Is make
installed...yes.
inter::lex -  Is lex
installedskipped.
inter::yacc - Is yacc
installed...skipped.
auto::gcc -   Is your C compiler actually
gcc.yes.
auto::glibc - Is GNU libc
installed...yes.
auto::backtrace - Does libc have the backtrace*
functions.yes.
auto::fink -  Determine Fink location on
Darwin...skipped.
auto::macports -  Determine Macports location on
Darwin...skipped.
auto::msvc -  Is your C compiler actually Visual
C++...no.
auto::attributes -Detect compiler
attributes.done.
auto::warnings -  Detect supported compiler warnings..set
for gcc.
init::optimize -  Enable
optimization.yes.
inter::shlibs -   Determine flags for building shared
libraries.-fPIC.
inter::libparrot -Should parrot link against a shared
library.yes.
inter::charset -  Which charset files should be compiled
in..done.
inter::encoding - Which encoding files should be compiled
in.done.
inter::types -What types should Parrot
use...done.
auto::ops -   Which opcode files should be compiled
in...done.
auto::pmc -   Which pmc files should be compiled
in..done.
auto::alignptrs - Determine your minimum pointer alignment 1
byte.
auto::headers -   Probe for C
headersdone.
auto::sizes - Determine some
sizes...done.
auto::byteorder - Compute native byteorder for
wordsize.little-endian.
auto::va_ptr -Test the type of
va_ptrregister.
auto::format -What formats should be used for
sprintfdone.
auto::isreg - Does your C library have a working
S_ISREG..yes.
auto::arch -  Determine CPU architecture and
OS..done.
auto::jit -   Determine JIT
capability.no.
auto::cpu -   Generate CPU specific
stuffdone.
auto::funcptr -   Does compiler support function pointer
casts...done.
auto::cgoto - Does your compiler support computed
gotoyes.
auto::inline -Does your compiler support
inline...yes.
auto::gc -Determine allocator to
use.done.
auto::memalign -  Does your C library support
memalignyes.
auto::signal -Determine some signal
stuffdone.
auto::socklen_t - Determine whether there is
socklen_tyes.
auto::env -   Does your C library have setenv /
unsetenv.both.
auto::aio -   Does your platform support
AIO..yes.
auto::gmp -   Does your platform support
GMP...no.
auto::readline -  Does your platform support
readline..no.
auto::gdbm -  Does your platform support
gdbm..no.
auto::pcre -  Does your platform support
pcre..no.
aut

[perl #61256] examples/library/md5sum.pir is out of date

2008-12-10 Thread Carl Mäsak
# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #61256]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=61256 >


 ./parrot examples/library/md5sum.pir empty_file
 Class 'ParrotIO' not found
 current instr.: '_main' pc 43 (examples/library/md5sum.pir:54)
 what am I doing wrong?
 one or more of your files is out of date
 ParrotIO was removed a couple of days ago.
 ah.
 the PIR file itself references ParrotIO


Re: Files, Directories, Resources, Operating Systems

2008-12-10 Thread Timothy S. Nelson
	I''ve been playing with similar sorts of problems when creating an OO 
model for packaging metadata, that could supposedly represent the data from a 
.rpm or a .deb or whatever.


	The first thing I did was set up a method where if we're outputting 
eg. an RPM, it will mark every piece of metadata it uses, and then afterwards, 
the core system will emit warnings about all the things it didn't use. 
Something similar could possibly be done; we'd simply need to give the user 
control as to where the warnings end up.


	Note that I also agree with the guy who said that we need 
system-specific calls, and then an abstraction layer on top of that.


On Wed, 10 Dec 2008, Aristotle Pagaltzis wrote:


* Charles Bailey <[EMAIL PROTECTED]> [2008-12-10 03:15]:

It may well be that a fine-grained interface isn't practical,
but perhaps there are some basics that we could implement, such
as

- set owner of this thing
- (maybe) set group of this thing
- give owner|everyone|?some-group the ability to read
  from|write to|remove|run this thing
- tell me whether any of these is possible
- make the metadata for this thing the same as the metadata for
  that thing
- tell me when this thing was created|last updated


There are many problematic suggestions here. Some examples:

? Unix does not track file creation datetime at all.


Emit a warning.


? The concept of making a file runnable doesn?t even exist on
 Windows: that property is derived from the filename extension.


	So when they read it, make a guess based on the extension, and when 
they write it, emit an error.



? Delete permission on a file is a concept that doesn?t exist on
 Unix. To be able to delete a file, you instead need write
 permission on the directory it resides in.


	So when they read it, figure it out, and when they write it, emit an 
error.



Furthermore, in Win32, files and directories can inherit
permissions, so the fact that a file has certain effective
permissions does not mean that these permissions are set on
the file itself. But if you set them on the file itself, you
dissociate it from the inheritance chain. So reading permissions
and then setting them the same, without changing anything, can
still have unwanted side effects. Or if you try to make the API
smart, and so make it set permissions only when they constitute
a change from the effective permissions, then conversely the user
no longer has a way to dissociate the file from iheritance if
that *is* what they wanted. So the concept of inheritance must
be exposed explicitly.


	Or, you could pick a consistent model, and then let the user use the 
lower-level interface if they want to be more specific.



This is the primary issue I was thinking of when I said that some
differences between Win32 and Unix have such pervasive effects
that it seems impossible to provide even a rudimentary abstract
interface.


	Try "rudimentary *optional* abstract interface", where the other 
option is system-specific.


:)


-
| Name: Tim Nelson | Because the Creator is,|
| E-mail: [EMAIL PROTECTED]| I am   |
-

BEGIN GEEK CODE BLOCK
Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V- 
PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI D G+ e++> h! y-

-END GEEK CODE BLOCK-