Skip to content

Commit

Permalink
maybe v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
G4Vi committed Jun 6, 2024
1 parent cd25040 commit 4c4ce51
Show file tree
Hide file tree
Showing 28 changed files with 71 additions and 140 deletions.
2 changes: 1 addition & 1 deletion Alien-libextism/Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Revision history for Alien-libextism

v0.1.0 2024-06-XX
v0.1.0 2024-06-05
First version, released on an unsuspecting world.

6 changes: 3 additions & 3 deletions Alien-libextism/Makefile.PL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use 5.006;
use 5.016;
use strict;
use warnings;
use ExtUtils::MakeMaker;
Expand All @@ -10,11 +10,11 @@ my %WriteMakefileArgs = (
$abmm->mm_args (
DISTNAME => 'Alien-libextism',
NAME => 'Alien::libextism',
AUTHOR => "Gavin Hayes <gahayes\@cpan.org>",
AUTHOR => 'Extism Authors <extism@cpan.org>',
VERSION_FROM => 'lib/Alien/libextism.pm',
ABSTRACT_FROM => 'lib/Alien/libextism.pm',
LICENSE => 'perl_5',
MIN_PERL_VERSION => '5.006',
MIN_PERL_VERSION => '5.016',
CONFIGURE_REQUIRES => {
'ExtUtils::MakeMaker' => '0',
'Sort::Versions' => 0,
Expand Down
5 changes: 3 additions & 2 deletions Alien-libextism/README
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ Alien-libextism

Alien package to find or build and install libextism with development dependencies


INSTALLATION

To install this module, run the following commands:
Expand All @@ -22,10 +21,12 @@ perldoc command.
Additional documentation, support, and bug reports can be found at the
Extism perl-sdk repository https://github.com/extism/perl-sdk

Additional Extism support may be found in the discord server:
https://extism.org/discord

LICENSE AND COPYRIGHT

This software is copyright (c) 2024 by Dylibso.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

12 changes: 6 additions & 6 deletions Alien-libextism/lib/Alien/libextism.pm
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package Alien::libextism;

use 5.006;
use 5.016;
use strict;
use warnings;
use parent qw( Alien::Base );
use version; our $VERSION = version->declare("v0.2.0");
use version 0.77;
our $VERSION = qv(v0.1.0);

1;

Expand All @@ -19,10 +20,6 @@ __END__
Alien::libextism - find or build and install libextism with development
dependencies
=head1 AUTHOR
Gavin Hayes, C<< <gahayes at cpan.org> >>
=head1 SUPPORT AND DOCUMENTATION
You can find documentation for this module with the perldoc command.
Expand All @@ -32,6 +29,9 @@ You can find documentation for this module with the perldoc command.
Additional documentation, support, and bug reports can be found at the
Extism perl-sdk repository L<https://github.com/extism/perl-sdk>
Additional Extism support may be found in the discord server:
L<https://extism.org/discord>
=head1 LICENSE AND COPYRIGHT
This software is copyright (c) 2024 by Dylibso.
Expand Down
2 changes: 1 addition & 1 deletion Alien-libextism/t/00-load.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!perl
use 5.006;
use 5.016;
use strict;
use warnings;
use Test::More;
Expand Down
2 changes: 1 addition & 1 deletion Alien-libextism/t/manifest.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!perl
use 5.006;
use 5.016;
use strict;
use warnings;
use Test::More;
Expand Down
2 changes: 1 addition & 1 deletion Alien-libextism/t/pod-coverage.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!perl
use 5.006;
use 5.016;
use strict;
use warnings;
use Test::More;
Expand Down
2 changes: 1 addition & 1 deletion Alien-libextism/t/pod.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!perl
use 5.006;
use 5.016;
use strict;
use warnings;
use Test::More;
Expand Down
2 changes: 1 addition & 1 deletion Alien-libextism/xt/boilerplate.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!perl
use 5.006;
use 5.016;
use strict;
use warnings;
use Test::More;
Expand Down
2 changes: 1 addition & 1 deletion Extism/Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Revision history for Extism

v0.1.0 2024-06-XX
v0.1.0 2024-06-05
First version, released on an unsuspecting world.

6 changes: 3 additions & 3 deletions Extism/Makefile.PL
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
use 5.006;
use 5.016;
use strict;
use warnings;
use ExtUtils::MakeMaker;
use Alien::Base::Wrapper ();

my %WriteMakefileArgs = Alien::Base::Wrapper->new('Alien::libextism')->mm_args2(
NAME => 'Extism',
AUTHOR => q{Gavin Hayes <[email protected]>},
AUTHOR => q{Extism Authors <[email protected]>},
VERSION_FROM => 'lib/Extism.pm',
ABSTRACT_FROM => 'lib/Extism.pm',
LICENSE => 'perl_5',
MIN_PERL_VERSION => '5.006',
MIN_PERL_VERSION => '5.016',
CONFIGURE_REQUIRES => {
'ExtUtils::MakeMaker' => '0',
},
Expand Down
25 changes: 5 additions & 20 deletions Extism/README
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
Extism

The README is used to introduce the module and provide instructions on
how to install the module, any machine dependencies it may have (for
example C compilers and installed libraries) and any other information
that should be provided before the module is installed.

A README file is required for CPAN modules since CPAN extracts the README
file from a module distribution so that people browsing the archive
can use it to get an idea of the module's uses. It is usually a good idea
to provide version information here so that people can decide whether
fixes for the module are worth downloading.

Extism https://extism.org/ Perl SDK

INSTALLATION

Expand All @@ -28,16 +18,11 @@ perldoc command.

perldoc Extism

You can also look for information at:

RT, CPAN's request tracker (report bugs here)
https://rt.cpan.org/NoAuth/Bugs.html?Dist=Extism

CPAN Ratings
https://cpanratings.perl.org/d/Extism
Additional documentation, support, and bug reports can be found at the
Extism perl-sdk repository https://github.com/extism/perl-sdk

Search CPAN
https://metacpan.org/release/Extism
Additional Extism support may be found in the discord server:
https://extism.org/discord


LICENSE AND COPYRIGHT
Expand Down
Binary file added Extism/count_vowels_kvstore.wasm
Binary file not shown.
98 changes: 25 additions & 73 deletions Extism/lib/Extism.pm
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package Extism;

use 5.006;
use 5.016;
use strict;
use warnings;
use Extism::XS qw(version log_file);
use Extism::Plugin;
use Extism::Function ':all';
use Exporter 'import';
use version 0.77;
our $VERSION = qv(v0.1.0);

sub log_custom {
my ($level) = @_;
Expand All @@ -33,92 +35,44 @@ our @EXPORT_OK = qw(
our %EXPORT_TAGS;
$EXPORT_TAGS{all} = [@EXPORT_OK];

=head1 NAME
Extism - The great new Extism!
1;

=head1 VERSION
__END__
Version 0.01
=head1 NAME
=cut
Extism - Extism Perl SDK
use version 0.77; our $VERSION = qv(v0.0.1);
=head1 DESCRIPTION
Extism L<https://extism.org/> is a cross-language framework for building
with WebAssembly. This distribution integrates Extism into Perl so Perl
programmers can easily use WebAssembly. Possibily to add a Plugin system
into their application or to integrate native deps without the headache
of native builds.
=head1 SYNOPSIS
Quick summary of what the module does.
Perhaps a little code snippet.
use Extism;
my $foo = Extism->new();
...
=head1 EXPORT
A list of functions that can be exported. You can delete this section
if you don't export anything, such as for a purely object-oriented module.
=head1 SUBROUTINES/METHODS
=head2 function1
=cut

sub function1 {
}

=head2 function2
=cut

sub function2 {
}

=head1 AUTHOR
Gavin Hayes, C<< <gavin at dylibso.com> >>
=head1 BUGS
Please report any bugs or feature requests to C<bug-extism at rt.cpan.org>, or through
the web interface at L<https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Extism>. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
use Extism ':all';
my $wasm = do { local(@ARGV, $/) = 'count_vowels.wasm'; <> };
my $plugin = Extism::Plugin->new($wasm, {wasi => 1});
my $output = $plugin->call('count_vowels', "this is a test");
=head1 EXAMPLES
See script/demo-perl-extism and t/02-extism.t
=head1 SUPPORT
=head1 SUPPORT AND DOCUMENTATION
You can find documentation for this module with the perldoc command.
perldoc Extism
Additional documentation, support, and bug reports can be found at the
Extism perl-sdk repository L<https://github.com/extism/perl-sdk>
You can also look for information at:
=over 4
=item * RT: CPAN's request tracker (report bugs here)
L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Extism>
=item * CPAN Ratings
L<https://cpanratings.perl.org/d/Extism>
=item * Search CPAN
L<https://metacpan.org/release/Extism>
=back
=head1 ACKNOWLEDGEMENTS
Additional Extism support may be found in the discord server:
L<https://extism.org/discord>
=head1 LICENSE AND COPYRIGHT
Expand All @@ -128,6 +82,4 @@ This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut

1; # End of Extism
=cut
2 changes: 1 addition & 1 deletion Extism/lib/Extism/CurrentPlugin.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Extism::CurrentPlugin;

use 5.006;
use 5.016;
use strict;
use warnings;
use feature 'say';
Expand Down
2 changes: 1 addition & 1 deletion Extism/lib/Extism/Function.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Extism::Function;

use 5.006;
use 5.016;
use strict;
use warnings;
use feature 'say';
Expand Down
2 changes: 1 addition & 1 deletion Extism/lib/Extism/Plugin.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Extism::Plugin;

use 5.006;
use 5.016;
use strict;
use warnings;
use Extism::XS qw(
Expand Down
2 changes: 1 addition & 1 deletion Extism/lib/Extism/Plugin/CancelHandle.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Extism::Plugin::CancelHandle;

use 5.006;
use 5.016;
use strict;
use warnings;
use Extism::XS qw(plugin_cancel);
Expand Down
2 changes: 1 addition & 1 deletion Extism/lib/Extism/XS.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Extism::XS;

use 5.006;
use 5.016;
use strict;
use warnings;
use Exporter 'import';
Expand Down
8 changes: 4 additions & 4 deletions Extism/script/demo-perl-extism
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/perl
use 5.006;
use 5.016;
use strict;
use warnings;
use feature 'say';
Expand All @@ -9,12 +9,12 @@ use Extism;
say "Extism version: " . Extism::version() . "\n";

# Should fail with an error message, invalid manifest
my $notplugin = Extism::Plugin->new('', 1) // "did not load as expected";
my $notplugin = Extism::Plugin->new('', {wasi => 1}) // "did not load as expected";
say "notplugin: $notplugin\n";

# load count vowels and test
my $wasm = do { local(@ARGV, $/) = 'count_vowels.wasm'; <> };
my $plugin = Extism::Plugin->new($wasm, 1);
my $plugin = Extism::Plugin->new($wasm, {wasi => 1});
my $input = "this is a test";
say "count_vowels - input: $input";
my $output = $plugin->call('count_vowels', $input);
Expand All @@ -24,6 +24,6 @@ say "plugin->reset: ". $plugin->reset() . "\n";

# load fail and call run_test, it should fail
my $failwasm = do { local(@ARGV, $/) = 'fail.wasm'; <> };
my $failplugin = Extism::Plugin->new($failwasm, 1);
my $failplugin = Extism::Plugin->new($failwasm, {wasi => 1});
my $failed = $failplugin->call('run_test', "") // "call failed as expected";
say "failplugin: $failed\n";
Loading

0 comments on commit 4c4ce51

Please sign in to comment.