Skip to content

Commit

Permalink
Add report #6
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Dec 2, 2014
1 parent 6546558 commit 542db8e
Show file tree
Hide file tree
Showing 21 changed files with 236 additions and 133 deletions.
57 changes: 56 additions & 1 deletion index.html
Expand Up @@ -39,6 +39,61 @@ <h1 class="blog-title">The TPF Inline Grant Info Site</h1>
<div class="row">
<div class="col-sm-8 blog-main">
<div class="blog-post">
<h2 class="blog-post-title">Inline Grant Weekly Report #6</h2>
<p class="blog-post-meta">
December 1, 2014 by
<a href="page/ingy-and-david-bio.html">Ingy and David</a>
</p>
<p><strong>Happy belated Thanksgiving!!!</strong></p>

<p>Last week was a bit slow on the Inline front. Not much code got done but one important idea came along that (potentially) simplifies the whole Inline::Module dance. We call it <em>auto-stubbing</em>.</p>

<h2>Auto-Stubbing</h2>

<p>When a module has Inline C (or C++) code in it, it needs a <strong>stub</strong> module to invoke Inline and/or dynaload a shared library. This stub is <em>generated code</em>. We had a command for the module auhor to generate it:</p>

<pre><code>perl-inline-module generate Acme::Math::XS::Inline
</code></pre>

<p>and we assumed authors would commit this code, and regenerate it from time to time as Inline::Module required it to change.</p>

<p>(<strong>NOTE:</strong> <em>This is all about author side experience. The user side installation process and result remains the same.</em>)</p>

<p>Last week we called <strong>BS</strong> on that:</p>

<ul>
<li>Generated code should be automagic</li>
<li>Generated code should not get committed if possible</li>
</ul>

<p>We think we figured out how to make this work in a few styles that will fit in with various module author development styles. One of our goals is that when you use Inline::Module, you can test using the pure Perl mantra:</p>

<pre><code>prove -lv t/
</code></pre>

<p>But at this point it is too late to autostub. We need something to happen just before that. One idea is to do this:</p>

<pre><code>PERL5OPT=&#39;-MInline::Module=autostub&#39; prove -lv t/
</code></pre>

<p>or:</p>

<pre><code>export PERL5OPT=&#39;-MInline::Module=autostub&#39;
... later on ...
prove -lv t/
</code></pre>

<p>This adds a CODE ref to <code>@INC</code> to do the autostubbing, just in time.</p>

<p>We&#39;ll have a few ways to do it, so that if you are someone who likes to do everything explicitly, you can still just:</p>

<pre><code>perl-inline-module generate Acme::Math::XS::Inline
</code></pre>

<p>This autostubbing should be done in the next couple days. We&#39;ll let you know how it turned out in the next review.</p>
</div>
<hr />
<div class="blog-post">
<h2 class="blog-post-title">Inline Grant Weekly Report #5</h2>
<p class="blog-post-meta">
November 22, 2014 by
Expand Down Expand Up @@ -423,7 +478,7 @@ <h2>Welcome to the Inline Grant blog!</h2>
<p>We really want to thank the community for this opportunity to make Perl better!</p>
</div>
<hr />
</div><!-- /.blog-main -->
</div><!-- /.blog-main -->
<div class="col-sm-3 col-sm-offset-1 blog-sidebar">
<div class="sidebar-module sidebar-module-inset">
<h4>About</h4>
Expand Down
16 changes: 16 additions & 0 deletions js/all.js
Expand Up @@ -1982,6 +1982,22 @@ output += '<p>Name: Inline Grant Weekly Report #4 Type: post Date: November 15,
return output;
}

Jemplate.templateMap['n6sv.html'] = function(context) {
if (! context) throw('Jemplate function called without context\n');
var stash = context.stash;
var output = '';

try {
output += '<p>Name: Inline Grant Weekly Report #6 Type: post Date: December 1, 2014</p>\n\n<p><strong>Happy belated Thanksgiving!!!</strong></p>\n\n<p>Last week was a bit slow on the Inline front. Not much code got done but one important idea came along that (potentially) simplifies the whole Inline::Module dance. We call it <em>auto-stubbing</em>.</p>\n\n<h2>Auto-Stubbing</h2>\n\n<p>When a module has Inline C (or C++) code in it, it needs a <strong>stub</strong> module to invoke Inline and/or dynaload a shared library. This stub is <em>generated code</em>. We had a command for the module auhor to generate it:</p>\n\n<pre><code>perl-inline-module generate Acme::Math::XS::Inline\n</code></pre>\n\n<p>and we assumed authors would commit this code, and regenerate it from time to time as Inline::Module required it to change.</p>\n\n<p>(<strong>NOTE:</strong> <em>This is all about author side experience. The user side installation process and result remains the same.</em>)</p>\n\n<p>Last week we called <strong>BS</strong> on that:</p>\n\n<ul>\n<li>Generated code should be automagic</li>\n<li>Generated code should not get committed if possible</li>\n</ul>\n\n<p>We think we figured out how to make this work in a few styles that will fit in with various module author development styles. One of our goals is that when you use Inline::Module, you can test using the pure Perl mantra:</p>\n\n<pre><code>prove -lv t/\n</code></pre>\n\n<p>But at this point it is too late to autostub. We need something to happen just before that. One idea is to do this:</p>\n\n<pre><code>PERL5OPT=&#39;-MInline::Module=autostub&#39; prove -lv t/\n</code></pre>\n\n<p>or:</p>\n\n<pre><code>export PERL5OPT=&#39;-MInline::Module=autostub&#39;\n... later on ...\nprove -lv t/\n</code></pre>\n\n<p>This adds a CODE ref to <code>@INC</code> to do the autostubbing, just in time.</p>\n\n<p>We&#39;ll have a few ways to do it, so that if you are someone who likes to do everything explicitly, you can still just:</p>\n\n<pre><code>perl-inline-module generate Acme::Math::XS::Inline\n</code></pre>\n\n<p>This autostubbing should be done in the next couple days. We&#39;ll let you know how it turned out in the next review.</p>\n';
}
catch(e) {
var error = context.set_error(e, output);
throw(error);
}

return output;
}

Jemplate.templateMap['se9g.html'] = function(context) {
if (! context) throw('Jemplate function called without context\n');
var stash = context.stash;
Expand Down
48 changes: 28 additions & 20 deletions js/all.json
@@ -1,5 +1,8 @@
{
"site_title" : "The TPF Inline Grant Info Site",
"heading" : "Up to date information on The Perl Foundation's 2014 grant for Inline.pm.",
"node_order" : [
"n6sv",
"cc8p",
"mh4x",
"m6z3",
Expand All @@ -9,59 +12,64 @@
"y6ut",
"y5yq"
],
"site_title" : "The TPF Inline Grant Info Site",
"heading" : "Up to date information on The Perl Foundation's 2014 grant for Inline.pm.",
"nodes" : [
{
"link" : "inline-grant-weekly-report-5",
"date" : "November 22, 2014",
"cogid" : "n6sv",
"type" : "post",
"title" : "Inline Grant Weekly Report #6",
"date" : "December 1, 2014",
"link" : "inline-grant-weekly-report-6"
},
{
"type" : "post",
"cogid" : "cc8p",
"title" : "Inline Grant Weekly Report #5",
"cogid" : "cc8p"
"link" : "inline-grant-weekly-report-5",
"date" : "November 22, 2014"
},
{
"link" : "inline-grant-weekly-report-4",
"date" : "November 15, 2014",
"link" : "inline-grant-weekly-report-4",
"type" : "post",
"title" : "Inline Grant Weekly Report #4",
"cogid" : "mh4x"
"cogid" : "mh4x",
"title" : "Inline Grant Weekly Report #4"
},
{
"link" : "inline-grant-weekly-report-3",
"date" : "November 9, 2014",
"type" : "post",
"title" : "Inline Grant Weekly Report #3",
"cogid" : "m6z3"
"cogid" : "m6z3",
"title" : "Inline Grant Weekly Report #3"
},
{
"link" : "inline-grant-weekly-report-2",
"date" : "November 2, 2014",
"type" : "post",
"title" : "Inline Grant Weekly Report #2",
"cogid" : "ecf6"
"cogid" : "ecf6",
"type" : "post",
"link" : "inline-grant-weekly-report-2",
"date" : "November 2, 2014"
},
{
"link" : "inline-grant-weekly-report-1",
"date" : "October 25, 2014",
"type" : "post",
"title" : "Inline Grant Weekly Report #1",
"cogid" : "se9g"
"cogid" : "se9g",
"type" : "post"
},
{
"link" : "inline-module-spec",
"title" : "Inline Module Spec",
"cogid" : "v3e7"
"cogid" : "v3e7",
"title" : "Inline Module Spec"
},
{
"link" : "ingy-and-david-bio",
"title" : "Ingy and David Bio",
"cogid" : "y6ut"
},
{
"link" : "inline-grant-accepted",
"date" : "October 20, 2014",
"type" : "post",
"link" : "inline-grant-accepted",
"title" : "Inline Grant Accepted",
"type" : "post",
"cogid" : "y5yq"
}
]
Expand Down
7 changes: 0 additions & 7 deletions node/cc8p.html
Expand Up @@ -16,12 +16,6 @@
<!-- Custom styles for this template -->
<link href="css/blog.css" rel="stylesheet">
<link href="css/cog.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="blog-masthead">
Expand Down Expand Up @@ -126,7 +120,6 @@ <h4>Elsewhere</h4>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://getbootstrap.com/dist/js/bootstrap.min.js"></script>
<script src="http://getbootstrap.com/assets/js/docs.min.js"></script>

<!-- Cog JS
================================================== -->
Expand Down
7 changes: 0 additions & 7 deletions node/ecf6.html
Expand Up @@ -16,12 +16,6 @@
<!-- Custom styles for this template -->
<link href="css/blog.css" rel="stylesheet">
<link href="css/cog.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="blog-masthead">
Expand Down Expand Up @@ -134,7 +128,6 @@ <h4>Elsewhere</h4>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://getbootstrap.com/dist/js/bootstrap.min.js"></script>
<script src="http://getbootstrap.com/assets/js/docs.min.js"></script>

<!-- Cog JS
================================================== -->
Expand Down
7 changes: 0 additions & 7 deletions node/m6z3.html
Expand Up @@ -16,12 +16,6 @@
<!-- Custom styles for this template -->
<link href="css/blog.css" rel="stylesheet">
<link href="css/cog.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="blog-masthead">
Expand Down Expand Up @@ -134,7 +128,6 @@ <h4>Elsewhere</h4>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://getbootstrap.com/dist/js/bootstrap.min.js"></script>
<script src="http://getbootstrap.com/assets/js/docs.min.js"></script>

<!-- Cog JS
================================================== -->
Expand Down
7 changes: 0 additions & 7 deletions node/mh4x.html
Expand Up @@ -16,12 +16,6 @@
<!-- Custom styles for this template -->
<link href="css/blog.css" rel="stylesheet">
<link href="css/cog.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="blog-masthead">
Expand Down Expand Up @@ -172,7 +166,6 @@ <h4>Elsewhere</h4>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://getbootstrap.com/dist/js/bootstrap.min.js"></script>
<script src="http://getbootstrap.com/assets/js/docs.min.js"></script>

<!-- Cog JS
================================================== -->
Expand Down

0 comments on commit 542db8e

Please sign in to comment.