Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Compiling C program with a Static Perl

by Your Mother (Archbishop)
on Sep 03, 2017 at 15:10 UTC ( [id://1198616]=note: print w/replies, xml ) Need Help??


in reply to Re: Compiling C program with a Static Perl
in thread Compiling C program with a Static Perl

This is a perfectly reasonable answer and I need to explain why I think it's completely awful.

A true Foo for whatever Bar to work with Baz just might be easier. It becomes more sinister than the platitude it is without giving a specific example

Perl is not a bad language or a language fated to lose to Ruby, Python, Go, Dart, PHP, or any other. Its major disadvantage today is lack of applications and code libraries matching currently relevant, growing problem domains.

In this SoPW we have a user willing to sink time into attempting to relieve some tiny corner of that problem. The problem, above all others, which is withering the language and its adoption.

The best solution to the user's problem may well be, forget about Perl, use this instead. The best solution for Perl, especially in cases like this where there is a clear interest in hearing it is, get after that with Perl and good luck!

Update: fixed embarrassing typo.

Replies are listed 'Best First'.
Re^3: Compiling C program with a Static Perl
by rodd (Scribe) on Sep 03, 2017 at 19:31 UTC
    I agree that there's a tool for every job. In my case Perl would be the right tool. The code with LibYAML is just the tip of the iceberg (a proof of concept). Behind my example there is actually a good codebase that I'm not willing to rewrite and that make a single static Perl executable the right choice my use case... But unfortunately I can't find good simple examples on how to get it done. App::staticperl, like I said, is a huge mess that packs over 100 libs in one big Perl based on 5.12. But I guess there's no other way of doing it but by going over that code and see if I can figure it out.
        Thanks, it looks promising. If I understood correctly, I build a static perl with -Uusedl and my dependencies with -Dextras so that they're statically built also. I've just tried to put the YAML::XS module in-Dextras and it didn't build with some mysterious "Failed" CPAN message. So I stuck YAML::XS into the ext/ dir before building it and it worked...!

        ...well, apparently. I'm still getting this error when I test to see if my new static Perl has the module linked to it:

        perl -MYAML::XS -E '' Can't load module YAML::XS::LibYAML, dynamic loading not available in +this perl. (You may need to build a new perl executable which either supports dynamic loading or has the YAML::XS::LibYAML module statically linke +d into it.) at localperl/lib/5.24.2/YAML/XS.pm line 20.

        ...but I'm pretty sure I saw LibYAML being compiled during make (I did make LINKTYPE=static actually). Why is my static perl trying to Dynaload the module??

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1198616]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (7)
As of 2024-03-28 20:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found