> 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
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
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
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
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
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
is throws an exception for the above sample code.
>
> Should we just use this syntax?
It works for me. Thanks!
Regards,
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
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
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
.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
the PMCs without a statically linked parrot? (might
be a clue to my other problem).
Regards,
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
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
cimal arithmetic and
'float'/'real'/'double' implies binary arithmetic.
Regards,
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
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
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
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
d code use PMC Integers or native ints? (I'm using
PMCs).
Regards,
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
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
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
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
$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
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
> 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
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
by - the source:
source_namespace.export_into(target_namespace, options...)
Regards,
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
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
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
> I take inspiration in code of Tcl and Amber.
My inspiration for the Amber PMCs was from the PMCs of Lua and Tcl :-)
Roger.
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
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
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
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
> > >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
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
d)
end
end
Regards,
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
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
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
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
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
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
ease 1.0: language constructs
43%, libraries 6%, documentation 4%, robustness 4%
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 >:)
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
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
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
the message
for its piece of code before finding and handing over to the Amber error
handler for the remainder.
Regards,
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
ffer
only by letter case (because the corresponding *.pmc files need to be
storable on operating systems where filenames are case-insensitive).
Roger Browne.
pattern and use "AmberBOOLEAN".
Regards,
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
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
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/
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
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
l basis for your work.
Regards,
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
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
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
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,
> ... 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
andler
If you agree that the 0.3.0 behaviour is wrong, I'll file a bug report.
Regards,
Roger Browne
Regards,
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
ot be a problem).
Regards,
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
(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
htmost dot is followed
by a letter?
Regards,
Roger Browne
s.org/rfcs/rfc2083.html
Regards,
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
er supported by SmartEiffel
- Various bug fixes
- Estimated progress towards release 1.0: language constructs 40%,
libraries 1%, documentation 1%, quality 1%
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
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.
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
t; by Guido van Rossum
http://www.python.org/2.2/descrintro.html
Regards,
Roger Browne
By the way, the website
http://www.parrotcode.org/
still refers to 0.2.0 as the latest version.
Regards,
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]>
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]>
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]>
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]>
85 matches
Mail list logo