Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

a practical question

8 views
Skip to first unread message

Richard Nabil Hainsworth

unread,
Aug 22, 2006, 9:41:34 AM8/22/06
to perl6...@perl.org
I've been following the development of perl6 from its beginnings, read
the Apocalypses and Exegesis as they came out, and though I am not a
perl guru and did not understand it all, the language looks interesting
and one I would like to experiment with.

But I want to start doing real things. Which for me requires gui toolkits.

I have used Tk with perl5 and I am looking at WxWidgets.

WxWidgets (and the more commercial Qt) exist as C++ classes, although
WxPerl is a set of wrappers around WxWidgets for perl5.

So how to write an application in perl6 that uses (for the sake of
illustration) WxWidgets?

For simplicity, just a small window with "Hello World", a button "cool"
that adds text to the window", and a button "Be gone!" to kill the window.

Can, in fact, pugs do the following?

1) Suppose initially, we use WxPerl, taken from cpan?

Presumably, we write a perl6 program that has some perl5 in it that
instantiates the objects using WxPerl.
Then we switch to perl6 scripting. From what I understand from pugs
documentation it is possible to switch from one representation to the other.

How then does perl6 manipulate the scalars which perl5 generates as
blessed references?

2) The other possibility is for perl6 to use the WxWidgets classes
directly.
[ This actually would be useful because there are contributed classes in
WxWidgets that have not yet been "wrapped" for perl5 consumption. ]

How do I tell the perl6 (pugs) compiler where the classes reside? How do
I get them to instantiate? How do I then manipulate the objects?

From the documentation on perl6, this sort of manipulation of other
languages' objects is supposed to be much easier that it was for perl5,
viz, no knowledge of XS is required.

Some examples would help me understand how to get perl6 working to do
the things I want to do with it.

Richard

Conrad Schneiker

unread,
Aug 23, 2006, 12:58:06 AM8/23/06
to Richard Nabil Hainsworth, perl6...@perl.org
> From: Richard Nabil Hainsworth [mailto:ric...@rusrating.ru]

> But I want to start doing real things. Which for me requires gui toolkits.


[...]

> So how to write an application in perl6 that uses (for the sake of
> illustration) WxWidgets?
>
> For simplicity, just a small window with "Hello World", a button "cool"
> that adds text to the window", and a button "Be gone!" to kill the window.
>
> Can, in fact, pugs do the following?

[...]

> Presumably, we write a perl6 program that has some perl5 in it that
> instantiates the objects using WxPerl.
> Then we switch to perl6 scripting.

[...]

> Some examples would help me understand how to get perl6 working to do
> the things I want to do with it.

I'm interested in the same thing. In addition, I'm also even more interested
in getting the same sorts of questions answered for using Mozilla (Firefox)
GUI technology stuff such as XPCOM, XUL, and so on.

Best regards,
Conrad Schneiker

http://perl.net.au/wiki/Perl_6_Users_FAQ (Moved from AthenaLab to Perl 6
Wiki.)

www.AthenaLab.com (Nano-electron-beam and micro-neutron-beam technology.)


Steffen Schwigon

unread,
Aug 23, 2006, 4:15:26 AM8/23/06
to perl6...@perl.org
Richard Nabil Hainsworth <ric...@rusrating.ru> writes:
> But I want to start doing real things. Which for me requires gui
> toolkits.
>
> I have used Tk with perl5 and I am looking at WxWidgets.
>
> WxWidgets (and the more commercial Qt) exist as C++ classes,
> although WxPerl is a set of wrappers around WxWidgets for perl5.
>
> So how to write an application in perl6 that uses (for the sake of
> illustration) WxWidgets?

I don't think there's a big knowledge base beside what the current
Pugs hackers know.

But if I were you, I would start a small step before, especially with
experimenting with the "use perl5:Some::Lib;"-features and generally
the current ways of intermixing Perl5 and Perl6.

I would love to see a "Pugs Use Perl5 - First Blood" article
somewhere, made from users for users. It's on my personal TODO list
too and I will help you with experimenting, but I'm currently, erm,
well, occupied with @otherstuff ("the same excuse as every year").

If you start experimenting and writing down something, expect me to
follow you.

If we know and document something in an easy understandable form,
wxWidgets or any other lib can be the next step.

GreetinX
Steffen
--
Steffen Schwigon <schw...@webit.de>
Dresden Perl Mongers <http://dresden-pm.org/>

0 new messages