<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>xiaoayfeng</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/xiaoayfeng/" />
    <link rel="self" type="application/atom+xml" href="http://blogs.perl.org/users/xiaoayfeng/atom.xml" />
    <id>tag:blogs.perl.org,2009-11-03:/users/xiaoayfeng//863</id>
    <updated>2013-04-11T06:32:08Z</updated>
    <subtitle>A blog about the Perl programming language</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 4.38</generator>

<entry>
    <title>wild thoughts about small core.</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/xiaoayfeng/2013/04/wild-thoughts-about-small-core.html" />
    <id>tag:blogs.perl.org,2013:/users/xiaoayfeng//863.4551</id>

    <published>2013-04-11T06:02:15Z</published>
    <updated>2013-04-11T06:32:08Z</updated>

    <summary>new version perl will lose weight. that&apos;s what I want to see for long time. but cleanning package size is not an ultimate target to me. cleanning internal code and attract developers to improve bizatine define is. I&apos;ve been using...</summary>
    <author>
        <name>xiaoyafeng</name>
        
    </author>
    
    <category term="perl6perl" label="perl6 perl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/xiaoayfeng/">
        <![CDATA[<p>new version perl will lose weight. that's what I want to see for long time. but cleanning package size is not an ultimate target to me. cleanning internal code and attract developers to improve bizatine define is.   </p>

<p>I've been using perl for years. and I love it, because of its expression, its cpan, and its community. But its weakness is also apparent, its implementation and its history which have to be compatible backward. Every time I am frustrated in some deficiencies of perl, which ambition of improving perl failed by it’s internal makes me more frustrated. In other word, perl has been evolving thirty years. Which makes perl burden too much history, mistakes, inconsistence etc. Ie. It can call c function by win32::api without a compiler, but you end up dealing with xs. Why You can find many wrap of c library on cpan? just because xs is an weird and obsruced, and nobody want to learn it. </p>

<p><br />
With waiting a perl6, we'd better learning a new language to strengthen my arsenel, and maybe we can learn how improve perl. Here are some choices:</p>

<p>lua: it's my first choice.  It’s small, and thus, it can be handled fully. Question about table? See source code;  question about coroute? See source code;  Actually, except a little weird syntax, Its nice and clear code explains everything. It’s limit, but its extensible enough to add new feature with c. <br />
In terms of general language, lua is not good. but its internal code is a way to perl evovle, small core, large modules. I've been watching <a href="https://github.com/perl11/perl11.github.com/blob/master/p2/potion.html">potion</a> for serveral months, hope it, whose compiler is a little like lua can bring freshing air to perl5.</p>

<p>scala: this is a wonderful language, and it's very similar with perl6. it's type system. I even impulse to use it as my primary language. But when using it, I found it's not mature so as to a working language to me, a person who spoiled by perl5. its modules are still limited. and sometimes you have to use java module which bring you many pitfall and headache.</p>

<p>And many many.....</p>

<p>There are still many projects to improve perl inside is been implementing actively, rakudo, potion, moe and perl5 itself. I'm confident about it,  the guys who get involved, and community . But why dont you dabble into the outside world when enjoying perl?</p>]]>
        
    </content>
</entry>

<entry>
    <title>Mix Perl and C++/CLI</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/xiaoayfeng/2012/05/mix-perl-and-ccli.html" />
    <id>tag:blogs.perl.org,2012:/users/xiaoayfeng//863.3235</id>

    <published>2012-05-12T12:41:13Z</published>
    <updated>2012-05-12T13:08:53Z</updated>

    <summary></summary>
    <author>
        <name>xiaoyafeng</name>
        
    </author>
    
    <category term="c" label="C" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/xiaoayfeng/">
        
        <![CDATA[<p>
Perl is a language with many features to manipulate string. I always want to embed Perl into C program.  But a conclusion in perlembed shocks me:

<p><i><br />
Corollary: you can't use Perl from your C program unless Perl has been compiled on your machine, or installed properly--that's why you shouldn't blithely copy Perl executables from machine to machine without also copying the lib directory.<br />
</i></p>

<p>I posted <a href="http://www.perlmonks.org/?node_id=969929"> this </a> on perlmonks and got excellent advice from <a href="http://www.perlmonks.org/?node_id=5348"> Corion </a>, and know in windows, all you need is just copy perl dll with c program. ;) <br />
</p><br />
<p><br />
As monks help, I made a toy program embedded perl, and works fine! Thanks, perl! thanks perl community!</p>

<p>post main code here below, hope it could help guys who want to embed perl like me. ;)</p>

<p>#include "stdafx.h"<br />
#include "Form1.h"<br />
#pragma unmanaged<br />
#include "perl.h"<br />
#include "EXTERN.h"<br />
#pragma managed<br />
using namespace perl_form;<br />
PerlInterpreter *my_perl; <br />
[STAThreadAttribute]</p>

<p>int main(array<System::String ^> ^args)<br />
    {<br />
		char *embed[] = {"", "-e", 0};<br />
		char *argss[] = { NULL };<br />
      PERL_SYS_INIT3((int *)NULL,(char ***)NULL,(char ***)NULL);<br />
      my_perl = perl_alloc();<br />
      perl_construct(my_perl);<br />
	<br />
      PL_exit_flags |= PERL_EXIT_DESTRUCT_END;</p>

<p>	// Enabling Windows XP visual effects before any controls are created<br />
	Application::EnableVisualStyles();<br />
	Application::SetCompatibleTextRenderingDefault(false); </p>

<p>	// Create the main window and run it<br />
	Application::Run(gcnew Form1());<br />
    <br />
	perl_destruct(my_perl);<br />
        perl_free(my_perl);<br />
       PERL_SYS_TERM();</p>

<p>	return 0;<br />
}</p>

<p></p>

<p><br />
</p>]]>
    </content>
</entry>

<entry>
    <title>My first perl blog</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/xiaoayfeng/2012/04/my-first-perl-blog.html" />
    <id>tag:blogs.perl.org,2012:/users/xiaoayfeng//863.3147</id>

    <published>2012-04-24T07:09:16Z</published>
    <updated>2012-04-24T07:10:40Z</updated>

    <summary>write down my thought, experience and life about perl....</summary>
    <author>
        <name>xiaoyafeng</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/xiaoayfeng/">
        <![CDATA[<p>write down my thought, experience and life about perl. </p>]]>
        
    </content>
</entry>

</feed>
