Re: PMC and object creation

2006-03-24 Thread Roger Browne
> standardized name) also works with class integer IDs (and class name > strings, when implemented). It saves plenty of time on the class > lookup, when called with integer IDs. Sounds very good to me. Regards, Roger Browne

Re: Namespace roundup

2006-03-10 Thread Roger Browne
My Amber compiler is currently adding a few extra subs to some of the standard parrot PMCs, and I won't be able to do this if I'm in the Amber namespace as soon as I emit '.HLL "amber"'. It's not a big deal though, I have other ways I can achieve what I need. Regards, Roger Browne

Announcing "Amber for Parrot 0.4.2 (Argument)"

2006-02-28 Thread Roger Browne
are broken ('regexp' issues some warnings, and 'amber-square' raises an exception). I'm not sure yet if these bugs are on the Amber side or Parrot side. - Estimated progress towards release 1.0: language constructs 47%, libraries 6%, documentation 4%, robustness 6% Roger Browne

Re: Param count checks

2006-02-06 Thread Roger Browne
Chip Salzenberg wrote: > I'm struggling with good PIR syntax for it > though ... Void calls will be common, so it'd be nice to express > them easily. How about a 'void' keyword: void foo(bar, baz) Roger

Re: Param count checks

2006-02-05 Thread Roger Browne
that return something ... which would probably make life easier for implementors of many languages, but I'm hoping to retain the option to use the strictest checking (which will make life easier for me). Regards, Roger Browne

Re: Param count checks

2006-02-05 Thread Roger Browne
make a clear distinction between queries (which return something) and commands (which return nothing). If possible, please make the "little less strict" checking of function calls be optional, so that fully-strict checking of the return count is still possible. Regards, Roger Browne

Re: argument count mismatch

2006-01-16 Thread Roger Browne
is throws an exception for the above sample code. > > Should we just use this syntax? It works for me. Thanks! Regards, Roger Browne

argument count mismatch

2006-01-13 Thread Roger Browne
es the case where the called sub has zero .params: .sub 'main' :main errorson 0x0C foo(5) .end .sub foo print "Not OK\n" .end > 885/4851 subtests failing, 81,76% okay. Wow, that's a lot of tests affected by this one thing. Regards, Roger Browne

Re: [PROPOSAL] named arguments

2006-01-13 Thread Roger Browne
K". Any chance of making the above change first? Or at least making argument count mismatch detection work with '.param'? (We're always being told that compilers should emit PIR not PASM, and - although it's not a big deal - I'll need a second pass through my argument lists to generate the 'get_params' version). Regards, Roger Browne

Re: Conversion of string to int (in PIR)

2006-01-06 Thread Roger Browne
On Fri, 2006-01-06 at 17:15 +0100, Leopold Toetsch wrote: > Yup - fixed in r10938. Thanks for testing. OK, then please ignore that patch that I just sent. Thanks for the quick work! Regards, Roger Browne

Conversion of string to int (in PIR)

2006-01-06 Thread Roger Browne
.end produces this output: -4 0 -4 I think the last line should be "0", but if anyone thinks that "-4" is correct please say so before I report it as a bug... Thanks. Regards, Roger Browne

Re: Problem with string operations

2006-01-05 Thread Roger Browne
the PMCs without a statically linked parrot? (might be a clue to my other problem). Regards, Roger Browne

Problem with string operations

2006-01-05 Thread Roger Browne
inging etc) If anyone wants to try running the pir, it's here: http://xamber.org/temp/string_operations.pir (first build the pmcs: cd languages/amber && make all) but really I'd be grateful for any tips about how to locate the problem. Regards, Roger Browne

Announcing "Amber for Parrot 0.4.0 (Induction)"

2005-12-20 Thread Roger Browne
n now accepts multiple Expressions in When_part - New test for the Inspect_instruction - Various bug fixes and tweaks - Estimated progress towards release 1.0: language constructs 46%, libraries 6%, documentation 4%, robustness 5% Roger Browne

Re: Use of num instead of float

2005-12-20 Thread Roger Browne
cimal arithmetic and 'float'/'real'/'double' implies binary arithmetic. Regards, Roger Browne

Re: Variables, Aliasing, and Undefined-ness

2005-12-15 Thread Roger Browne
rom the PIR. It seems to me that's what the 'defined' opcode is supposed to be for. But I haven't done it this way myself so I might be talking through my hat here. Regards, Roger Browne

Re: [perl #37940] substr and memory issues

2005-12-14 Thread Roger Browne
Leopold Toetsch wrote: > We will need tr///, if we want that benchmark complete in reasonable time. Better still, we could add some new opcodes, each of which performs one entire shootout benchmark :-) Regards, Roger Browne

Re: Bug or feature? Probably bug with macros

2005-12-12 Thread Roger Browne
the closing right-parenthesis. So we can have: .IfDebug(stuff1, stuff2) or .IfDebug(1, multi,line stuff,with,commas , stuff_with_{braces} stuff(with)parentheses ) With this convention, there's no need for extra syntax such as braces. Regards, Roger Browne

Re: Parrot Shootout

2005-12-10 Thread Roger Browne
that it can be improved, because I can already see plenty! I've shown just the 'ack' method, but the compiler also puts some library code into the PIR file. Regards, Roger Browne -- ack(m, n) -- do -- result := if m = 0 then -- n + 1

Re: Parrot Shootout

2005-12-10 Thread Roger Browne
d code use PMC Integers or native ints? (I'm using PMCs). Regards, Roger Browne

Re: Parrot Shootout

2005-12-08 Thread Roger Browne
ond. I'm sure that this result reflects poor PIR generation by the Amber compiler, rather than the performance of the Parrot VM. I'm happy enough, at this stage, that the program prints the correct result. Regards, Roger Browne

Re: Parrot Shootout

2005-12-08 Thread Roger Browne
be raised in the future? Regards, Roger Browne PS: I have appended the source code in case anyone is interested: -- Computes the value of Ack(3,n), which is 2^(n+3)-3 -- Specify 'n' on the command line (defaults to 1). -- As used in the "Computer Language Shootout" be

Re: Multidimensional Arrays

2005-12-05 Thread Roger Browne
o I don't know what this message is trying to tell me. Maybe multidimensional array access using PMC indexes isn't supposed to be working yet. Regards, Roger Browne

Re: Multidimensional Arrays

2005-12-05 Thread Roger Browne
new String("3") print x[pmc1, pmc2] ... I think the HLL has to build the key structure from the PMCs that it has available to it, and let the aggregate complain if it gets some kind of key that it can't cope with. > If you really need a PMC for the key, you > have to create a Key PMC yourself. That's what I'll do. Thanks for your help! Regards, Roger Browne

Multidimensional Arrays

2005-12-05 Thread Roger Browne
$S0 = array[$P0; $P1] # [1] print $S0 print "\n" .end The above code aborts with "build_key: wrong register set" at [1]. Can I use multi-dimensional PMC keys from PIR? There are opcodes like "new_key" and "set_key" in pdd06, but they don't appear to be implemented. Or should I be building the key myself by using the ".Key" PMC? Regards, Roger Browne

Re: Namespaces (At Long Last)

2005-12-05 Thread Roger Browne
dd_var' for everything and let the receiving HLL cope as best it can. > Remaining for me is the distiction between a variable and a function > symbol: > > - python: no (all names are just names) This is an orthogonal issue, no? Python can't have a variable and a sub both named "foo", but that's unrelated to whether it knows if some particular "foo" is a variable or a sub. Regards, Roger Browne

Re: some goals for the next release

2005-12-04 Thread Roger Browne
> Something else? I would be pleased to have a design decision made regarding inheritance of attributes in Parrot objects. See the last few comments here: https://rt.perl.org/rt3/Ticket/Display.html?id=36411 for the design questions that arose. Regards, Roger Browne

Re: Namespaces (At Long Last)

2005-12-03 Thread Roger Browne
quot; as a way for the source HLL to tell the target HLL whether to treat each name as a sub, namespace, variable or method. Regards, Roger Browne

Namespaces: 'import_into'

2005-12-02 Thread Roger Browne
by - the source: source_namespace.export_into(target_namespace, options...) Regards, Roger Browne

Namespaces: HLL Private namespaces

2005-12-02 Thread Roger Browne
ts private stuff. In that case, the HLL is responsible for keeping its own private stuff private, and there is no need for the spec to refer to unenforced private namespaces. Regards, Roger Browne

Re: Namespaces (At Long Last)

2005-12-02 Thread Roger Browne
annot force (3) to be all-lowercase unless we force the others to be all-lowercase too. 5. THE FINAL EXAMPLE In the final example, what is the purpose of this line: add_namespace ["perl5"; "Some"; "Module"], $P1 As far as I can tell, the intent of the following

Re: Namespaces (At Long Last)

2005-12-02 Thread Roger Browne
s that they are competent to use. If a certain tool doesn't play nicely with the namespaces that it touches, then people will simply stop using that tool. Regards, Roger Browne

Re: HLL & autoboxing

2005-12-02 Thread Roger Browne
> I take inspiration in code of Tcl and Amber. My inspiration for the Amber PMCs was from the PMCs of Lua and Tcl :-) Roger.

Re: Namespaces (At Long Last)

2005-12-02 Thread Roger Browne
of view? I understand that most HLLs will want to use their own conventions, and some will want a unique namespace prefix, but should this be forced by Parrot? Regards, Roger Browne

Re: PIR methods and local variables occupy the same 'namespace'

2005-12-02 Thread Roger Browne
then PIR can't tell whether the right-hand-side of a = "b" is a string constant or a .param named b. Perhaps a prefix of "@" would work. That's what dotNET uses to make identifier names interoperable between HLLs (to avoid clashes with keywords). Regards, Roger Browne

Re: pdd03 (calling conventions) revised; get_params vs. READONLY

2005-11-30 Thread Roger Browne
Chip Salzenberg wrote: > Most importantly, I've proposed (but not mandated) a get_params flag > called "READONLY", which automatically creates a read-only wrapper > around a PMC parameter. I'd use READONLY if it existed, though I can get by without it. Regards, Roger Browne

Re: Solving '=' confusion: ':=' for aliasing

2005-11-30 Thread Roger Browne
Salzenberg wrote: > ... any language using ":=" for assignment is doomed > to obscurity.[*] It's a law of nature. :-) > (Ah, language design. :-)) No choice will satisfy everyone. So we each say our piece, then we happily accept whatever the designer decides. No

Re: exception handlers & calling conventions

2005-11-29 Thread Roger Browne
> > >If so, why do we specify S0 here?) > > > > Just for convenience. In most places, I don't use the string. I'd rather just get the PMC. Regards, Roger Browne

Re: Solving '=' confusion: ':=' for aliasing

2005-11-29 Thread Roger Browne
Delphi...)? How about: "=>" for aliasing (looks like something pointing to something else), ":=" for assignment, and "=" unchanged so that existing code doesn't break? Or perhaps "set", "assign" and "="? Oh, hang on... Regards, Roger Browne

Re: pdd20 and :outer

2005-11-23 Thread Roger Browne
d) end end Regards, Roger Browne

Re: DynLexPad

2005-11-23 Thread Roger Browne
On Wed, 2005-11-23 at 09:09 -0500, Will Coleda wrote: > I can, of course, add the C now, and have it be functional. I was > just pondering what might be a simpler way for future PMC authors. A bigger problem will occur for any HLL that has no PMCs of its own, yet wishes to use DynLexPad. How to

Re: pdd20 and :outer

2005-11-23 Thread Roger Browne
ne #(4) - remove the .HLL declaration at the top of the program - replace line #(5) by "$P0 = n_neg arg" (the significance of this might be that 'n_neg' is redefined in the Amber_INTEGER PMC - other operations are inherited unchanged from the Integer P

Re: DynLexPad

2005-11-23 Thread Roger Browne
Pad. Why bother with an artifical subclass? You could choose an arbitrary Tcl PMC and do the mapping of DynLexPad to LexPad in the class_init of that arbitrary PMC. You wouldn't need another 'pmclass' keyword if you call Parrot_register_HLL_type. Regards, Roger Browne

Re: DynLexPad

2005-11-22 Thread Roger Browne
ip wrote: > Hm. Why? Because you don't always want a mapped type. You might really want an .Integer to pass to a method that can't usefully work with a TclInteger. Leo has since stated that the "automatic mapped type" example was in error, so there's actually no problem. Regards, Roger Browne

Re: DynLexPad

2005-11-22 Thread Roger Browne
en I really want a new Integer (e.g. to pass to a routine written in something other than the current .HLL?)? I'd prefer to ask for mappings explicitly, e.g. something like this: .HLL "Tcl", "tcl_group" ... $P0 = new Integer # really Integer $P1 = new_mapped Integer # really TclInteger Regards, Roger Browne

Re: New pmc syntax for HLLs.

2005-11-19 Thread Roger Browne
HLL that doesn't have any special Boolean type. It's likely that its integer type will map both Integer and Boolean. My current PMCs map only one type each, so it's not an issue for me. Regards, Roger Browne

Announcing "Amber for Parrot 0.3.1 (Magic cookies)"

2005-11-15 Thread Roger Browne
ease 1.0: language constructs 43%, libraries 6%, documentation 4%, robustness 4% Roger Browne

Re: This week's summary

2005-11-15 Thread Roger Browne
On Tue, 2005-11-15 at 16:24 +, The Perl 6 Summarizer wrote: > ...Roger Browne (whose name I keep wanting to use as a Clerihew)... Thanks for the summaries, Piers! Here's a Clerihew for you: Roger Browne took his Parrot to town Wearing an upside-down Amber crown >:)

Re: HLL Debug Segments

2005-11-15 Thread Roger Browne
nters. I hope this example is useful for the purposes of discussion, and maybe also as sample input data for whoever implements this. I will keep the example updated according to any design decisions that are made. Regards, Roger Browne

Re: HLL Debug Segments

2005-11-14 Thread Roger Browne
On Mon, 2005-11-14 at 22:33 +0100, Leopold Toetsch wrote: > I'd much more prefer that a compiler (amber anyone ;) just emits PIR > with debug syntax so that folks get a feeling how it looks like. Good idea. I'll do it tomorrow (off to bed now). Regards, Roger Browne

Re: HLL Debug Segments

2005-11-14 Thread Roger Browne
hll_debug_begin line 2 I don't think the "end" directives add much. There's almost always going to be an "end line" before a "begin line", so why not let 'begin line' to imply the end of any previously-declared line? Regards, Roger Browne

Re: HLL Debug Segments

2005-11-14 Thread Roger Browne
the message for its piece of code before finding and handing over to the Amber error handler for the remainder. Regards, Roger Browne

Re: HLL Debug Segments

2005-11-14 Thread Roger Browne
27;t see the need for special syntax. Just reset everything to defaults at the start of each new file. Within a file, the usual syntax can be used (e.g. you could just set filename to ""). Thanks for your work on this. Regards, Roger Browne

Re: Legal names for PMCs

2005-11-11 Thread Roger Browne
ffer only by letter case (because the corresponding *.pmc files need to be storable on operating systems where filenames are case-insensitive). Roger Browne.

Legal names for PMCs

2005-11-11 Thread Roger Browne
pattern and use "AmberBOOLEAN". Regards, Roger Browne

schizophrenic 'find_type' opcode considered dubious

2005-11-09 Thread Roger Browne
atype. For example: .sub main :main $P1 = newclass "INTVAL" .end ...gives the rather bizarre message native type with name '';'' already exists - can't register PMC Maybe I'm missing something deep here... Regards, Roger Browne

Re: Determining number of return values expected

2005-11-03 Thread Roger Browne
On Sun, 2005-10-30 at 20:54 +, Jonathan Worthington wrote: > $P0 = result_info > $I0 = elements $P0 > > Will leave $I0 containing the number of return values. Thanks Jonathan, it seem to work perfectly. I'm very grateful for this. Regards, Roger Browne

[perl #37386] [PATCH] Swapped enum_cclass_any and enum_cclass_none in cclass.h

2005-11-03 Thread Roger Browne via RT
This patch has not been applied, but the same bug has been fixed by Leo's work in revision 9737. Could somebody please mark this ticket as "Resolved"? Thanks. Regards, Roger Browne -- Roger Browne - [EMAIL PROTECTED] - http://xamber.org/

Re: Segfault with structs and CSTR

2005-11-03 Thread Roger Browne
e #IFDEFs in dirent.h and decided that a NCI approach was unlikely to work on other platforms, so I wrote a PMC instead. Regards, Roger Browne

Re: JSON support

2005-10-24 Thread Roger Browne
s. For sure, Parrot's various serialization libraries could be generalized, and the common stuff factored out. But in the meantime, the JSON lib is useful. Regards, Roger Browne

Re: wxParrot -- linking problems

2005-10-22 Thread Roger Browne
l basis for your work. Regards, Roger Browne

Determining number of return values expected

2005-10-21 Thread Roger Browne
>From within a PIR sub or method, how can I detect how many return values the caller is expecting? I'm wondering how to implement a method that will return an error code if its caller is prepared to receive one, otherwise it will raise an exception. Anyone have any suggestions? Regard

Announcing "Amber for Parrot 0.3.0 (Struggle)"

2005-10-20 Thread Roger Browne
of performance and functionality. Up to now the kernel library was really just a stub to interact with the Parrot runtime and get things working. The major development focus for the next release of Amber for Parrot will be to implement enhanced kernel libraries as Custom Amber PMC classes. Roger Browne

Re: HLL type mappings and PIR

2005-10-11 Thread Roger Browne
ype $S2 for the language currently set by the .HLL directive. For example: .local int lang_int_type .local pmc p lang_int_type = get_lang_type .Integer p = new lang_int_type Regards, Roger Browne

HLL type mappings and PIR

2005-10-11 Thread Roger Browne
In a PMC you can set and use HLL type mappings using these calls: Parrot_get_HLL_id Parrot_register_HLL_type Parrot_get_ctx_HLL_type I've been using these in some experimental PMCs, with good results. Is there any way to set and use these HLL type mappings from PIR? Regards,

Re: [perl #37340] Calling vtable functions from PIR fails in 0.3.0

2005-10-04 Thread Roger Browne
> ... infix multi subs take an optional 3rd argument (the > destination) and that there is no good means yet to denote :optional > NCI arguments. OK. It's my fault for developing against the 0.2.3 release rather than against the svn branch. > ... Just use: > >b = a + a > > This will call

Re: Exception handlers and calling conventions

2005-10-03 Thread Roger Browne
andler If you agree that the 0.3.0 behaviour is wrong, I'll file a bug report. Regards, Roger Browne

Re: merge & release

2005-09-28 Thread Roger Browne
Regards, Roger Browne

Re: PMCs in the dynclasses directory

2005-09-27 Thread Roger Browne
On Tue, 2005-09-27 at 15:11 +0200, Leopold Toetsch wrote: > Have a look at languages/tcl/classes - it contains Tcl PMCs. We could do > the same for languages/amber. Thanks - now I just need to learn to program in C :-) Roger

PMCs in the dynclasses directory

2005-09-27 Thread Roger Browne
ot be a problem). Regards, Roger Browne

Re: [RFC] Debug Segment, HLL Debug Segment And Source Segment

2005-09-27 Thread Roger Browne
th HLL debug for now Fair enough! A small task undertaken is always better than a larger task warnocked. By the way (just to complicate things further) PIR files can include other PIR files using the ".include" directive, but the included filename and line numbers are not currently be

Announcing "Amber for Parrot 0.2.3a (Ashes)"

2005-09-24 Thread Roger Browne
(regexp.am) - Documentation: Extended the website pages that describe language interoparability and the use of Amber keywords. Added website pages to document Amber symbols, other lexical elements, and operator precedence. - Major refactoring of the lexical analysis and parsing code - Various bug fixes - Estimated progress towards release 1.0: language constructs 41%, libraries 2%, documentation 2%, robustness 2% Roger Browne

Re: loadlib and libraries with '.' in the name

2005-09-23 Thread Roger Browne
htmost dot is followed by a letter? Regards, Roger Browne

Re: [perl #17490] Magic is useless unless verifiable.

2005-09-21 Thread Roger Browne
s.org/rfcs/rfc2083.html Regards, Roger Browne

Re: [RFC] Debug Segment, HLL Debug Segment And Source Segment

2005-09-21 Thread Roger Browne
inds of metadata including line numbers? Sure, there's a small performance penalty - only during debugging runs - but there's a worthwhile space saving on disk (because typical HLLs produce a lot of bytecodes per line of source). Regards, Roger Browne

Announcing "Amber for Parrot 0.2.3 (Cornwall)"

2005-08-18 Thread Roger Browne
er supported by SmartEiffel - Various bug fixes - Estimated progress towards release 1.0: language constructs 40%, libraries 1%, documentation 1%, quality 1% Roger Browne.

Re: PMCs: Should We Use Them?

2005-07-07 Thread Roger Browne
nd I may yet have to do this. Leo: > I still like to unify ParrotObjects and PMCs more. I second that. I liked the directions in which that was moving. Regards, Roger Browne

Announcing "Amber for Parrot" version 0.2.2

2005-07-06 Thread Roger Browne
rtEiffel license issues - Added lots of code snippet examples to the website "Keywords" page - Assorted improvements to the generated PIR code - Various bug fixes Roger Browne.

Re: [perl #36411] New form of 'setattribute' fails when there are multiple inheritance levels

2005-06-29 Thread Roger Browne
ow many attributes CHILD has in the case of multiple inheritance (where PARENT_1 and PARENT_2 both have attribute 'foo'): PARENT_1 PARENT_2 ^ ^ \ / CHILD I can live with either answer (from the point of view of implementing the Amber compiler). Regards, Roger Browne

What is the default MRO?

2005-06-25 Thread Roger Browne
t; by Guido van Rossum http://www.python.org/2.2/descrintro.html Regards, Roger Browne

Website still refers to 0.2.0 as latest version

2005-06-10 Thread Roger Browne
By the way, the website http://www.parrotcode.org/ still refers to 0.2.0 as the latest version. Regards, Roger Browne

File/Directory handling

2005-06-06 Thread Roger Browne
ctory, or get the subdirectories of that directory. What's the best way to access functionality like that? Should I write a PMC that behaves like Ruby's pathname class? Or should I use NCI to access some C stuff? Regards, -- Roger Browne <[EMAIL PROTECTED]>

Announcing amber for parrot 0.2.1

2005-06-05 Thread Roger Browne
do if n = 0 then result := "No more bottles of beer" elseif n = 1 then result := "1 bottle of beer" else result := n & " bottles of beer" end end end Regards, -- Roger Browne <[EMAIL PROTECTED]>

Re: Proposed steps towards the next release 0.2 and beyond.

2005-03-07 Thread Roger Browne
very pleased to see working support in 0.2 for setfile/setline/setcolumn so that when my IMC code fails due to (e.g.) a divide by zero error, the parrot runtime can report the source location in my high-level code rather than the source location in my IMC. Regards, Roger -- Roger Browne <[EMAIL PROTECTED]>

Re: [perl #34258] [TODO] Here documents for PIR

2005-02-25 Thread Roger Browne
he .NET > pill? Naaah! Parrot is the scripting platform for the next few decades, so it doesn't matter if it takes a few years for it to catch on. Sorry that I can't help out more myself - I'm not fluent in either C or Perl (I'm getting pretty good at IMC though!). But I'll at least help out bringing the compilers that Melvin craves. Regards, Roger -- Roger Browne <[EMAIL PROTECTED]>