http://qs321.pair.com?node_id=11118931

geertvc has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I know this is a question that has been asked maybe a zillion times or more but still I want to take the risk asking it again.

What's the best environment to create GUI's in Perl?

Perl is maybe not the best language to create GUI's but since I am knowledgeable about wxWidgets, my first choice would be wxPerl. I know this is a bit biased and this question is very subjective (you hardly can't discuss about flavours and tastes, can you?) but my problem is that I can't install wxPerl on my Windows 10 PC where I installed Strawberry Perl. It fails when it wants to compile the Alien::wxWidgets module. This is what I get:

C:\Users\Geert>cpan -i Wx Loading internal logger. Log::Log4perl recommended for better logging CPAN: CPAN::SQLite loaded ok (v0.217) Database was generated on Sun, 05 Jul 2020 13:15:41 GMT Running install for module 'Wx' CPAN: Digest::SHA loaded ok (v6.02) CPAN: Compress::Zlib loaded ok (v2.093) Checksum for D:\WinApps\PROGRA~1\STRAWB~1\cpan\sources\authors\id\M\MD +\MDOOTSON\Wx-0.9932.tar.gz ok CPAN: Archive::Tar loaded ok (v2.36) CPAN: YAML::XS loaded ok (v0.81) CPAN: CPAN::Meta::Requirements loaded ok (v2.140) CPAN: Parse::CPAN::Meta loaded ok (v2.150010) CPAN: CPAN::Meta loaded ok (v2.150010) ---- Unsatisfied dependencies detected during ---- ---- MDOOTSON/Wx-0.9932.tar.gz ---- Alien::wxWidgets [build_requires] Running install for module 'Alien::wxWidgets' Checksum for D:\WinApps\PROGRA~1\STRAWB~1\cpan\sources\authors\id\M\MD +\MDOOTSON\Alien-wxWidgets-0.69.tar.gz ok CPAN: Module::CoreList loaded ok (v5.20200314) CPAN: Module::Build loaded ok (v0.4231) Configuring M/MD/MDOOTSON/Alien-wxWidgets-0.69.tar.gz with Build.PL Created MYMETA.yml and MYMETA.json Creating new 'Build' script for 'Alien-wxWidgets' version '0.69' MDOOTSON/Alien-wxWidgets-0.69.tar.gz D:\WinApps\Programming\StrawberryPerl\perl\bin\perl.exe Build.PL -- +OK Running Build for M/MD/MDOOTSON/Alien-wxWidgets-0.69.tar.gz Building Alien-wxWidgets process_begin: CreateProcess(NULL, D:/WinApps/Programming/StrawberryPe +rl/c/bin/ -c "echo gcc_mswdll/minimal_sample_rc.o >> gcc_mswdll/minim +al.exe.rsp.tmp", ...) failed. makefile.gcc:221: pipe: No such file or directory process_begin: CreateProcess(NULL, D:/WinApps/Programming/StrawberryPe +rl/c/bin/ -c "echo gcc_mswdll/minimal_minimal.o >> gcc_mswdll/minimal +.exe.rsp.tmp", ...) failed. makefile.gcc:221: pipe: No such file or directory Can't open(GLOB(0x2f31a90), D:\WinApps\Programming\wxWidgets\lib\gcc_d +ll\msw\build.cfg): No such file or directory at ./Build line 66. MDOOTSON/Alien-wxWidgets-0.69.tar.gz D:\WinApps\Programming\StrawberryPerl\perl\bin\perl.exe ./Build -- N +OT OK Stopping: 'install' failed for 'Alien::wxWidgets'.
An alternative would be Perl/Tk, but I have no experience with this. I've also seen Win32::GUI but again, no experience with this.

Next to the fact that I'm missing experience with those GUI "languages", I see those modules are quite old and I'm wondering if it's still useful to step into such "unsure" development environment.

Any suggestions?

Best rgds,
Geert

Replies are listed 'Best First'.
Re: Best GUI for Perl?
by aitap (Curate) on Jul 05, 2020 at 18:41 UTC

    IUP is great (it uses Gtk on GNU/Linux and native WinAPI calls on Windows; it also makes programming GUIs in C almost enjoyable despite the fact that you are writing a GUI in C), but I'm not sure about the quality of the Perl bindings. Last time I wanted to write a GUI program, I ended up learning a new language :(

    Prima is also an interesting toolkit; relatively easy to install and well maintained (getting a few commits per month since early 2000-s till now), but it looks the same on every platform.

    Of course, it's really hard to topple the popularity of Tk. Despite looking dated overall and it belonging to a different language (Tcl), the toolkit is still used by many other languages, including Perl, R, and Python. Chances are that Tk is already installed on the target machine, unlike IUP and Prima.

Re: Best GUI for Perl?
by haukex (Archbishop) on Jul 05, 2020 at 18:53 UTC
    What's the best environment to create GUI's in Perl?

    See Perl GUI (2013), which is still relatively current.

    Also, if you don't mind the plug, part of my motivation for WebPerl was to make it possible to write in-browser GUIs (single-page apps) with Perl. I provided two examples in the repository at gui_basic and gui_sweet. This is probably best for people who already have a bit of experience with JavaScript. Since you have experience with wx, then Wx may be good for you - personally, though I always liked the idea of wxWidgets, I found the Perl module's documentation a bit lacking.

Re: Best GUI for Perl?
by 1nickt (Canon) on Jul 05, 2020 at 14:07 UTC

    Hi, looks like Perl is telling you what the problem is ...

    Can't open(GLOB(0x2f31a90), D:\WinApps\Programming\wxWidgets\lib\gcc_d +ll\msw\build.cfg): No such file or directory at ./ +Build line 66.

    Also: I do not build GUI apps, but Perl/Tk is very far from an "unsure" development environment. Search this monastery for recent threads on the topic.

    Hope this helps!


    The way forward always starts with a minimal test.
      Oh, my....

      I was too much focused on makefile.gcc:221: pipe: No such file or directory and was blind for the rest of the errors apparently...

      Glad you kicked my ass to look further down the road... :-)

      I'll look into that and also the other suggestions (GUI candidates) made by other members. I'm always eager to learn new languages anyway...


      Best rgds,
      Geert
Re: Best GUI for Perl? -- panorama 2020
by Discipulus (Canon) on Jul 06, 2020 at 08:02 UTC
    Hello geertvc,

    If in your situation I'd go for Prima because it seems to me a valid, modern and maintained set of modules.

    In my real experience I only have Tk as tool and I subscribe what zentara said in in praise of poor old Tk but there are precisations to be made. What follows is my personal understanding of the Perl GUI panorama in 2020.

    Tk is a port of the tcl but the author has problems to fix issues and to incorporate new features of the tcl language. My warmest thanks to him for all his work. Tk is solid and works: if some little thing does not work, it will never work.

    I can add from my experience that perlmonks is the last place in the planet where some Tk wisdom is conserved.

    Then there is Tkx which is a tiny layer on top of Tcl that allows Tk based applications to be written in Perl: it is well maintained and you can expect every new feature to be available.

    Tcl::Tk module by other hand provides access to the Tk library within Tcl/Tk installation.

    Re: How to build a scrabble type of game with perl is also interesting and a bounch of links in my bibliotheca

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re: Best GUI for Perl?
by Perlbotics (Archbishop) on Jul 06, 2020 at 17:04 UTC

    Do you really need a classical GUI? Personally, where possible, I try to wrap a webservice around the app and let the browser do the visual stuff, esp. adaptation to the visuals of the OS at hand. A combination of Mojolicious and Bootstrap worked well for me. Pros:

    • separation of business logic execution from presentation (can run locally but also on a remote server)
    • no hassle with compilation of C/C++ libraries on different platforms
    • with Responsive Design, looks decent on phone, tablet, PC, etc.
    • HTML & CSS is easy to use and pretty portable

    The drawbacks might be slower response times and sometimes more work to realise complicated GUI structures. Also networking (firewalls) and security has to be considered when not working locally (localhost). But then, there are a lot of frameworks available and being forced to think about easier ways to achieve a given functionality has some worth of its own.

      Additionally, distributing local applications like this has been made much easier by containerizations like Docker. Instructions to the client would be,
      1. install Docker
      2. docker run mycoolapp
      3. in browser, go to https://localhost:1234578
      4. profit!
      Use an exported volume so their data is always safely outside the container, and you have the recipe for pretty smooth client and maintainer experiences.
Re: Best GUI for Perl?
by thechartist (Monk) on Jul 07, 2020 at 18:50 UTC

    You might want to consider the minimalist Nuklear, single file C89 project. Nuklear GUI. I know people who develop games in Common Lisp, and they have recommended it. You might have to get your hands a bit dirty with XS, or use Inline::C, or FFI::Platypus, though.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Best GUI for Perl?
by karlgoethebier (Abbot) on Jul 06, 2020 at 10:47 UTC
    «...the best...»

    This doesn’t exist. And probably never will. What is also the quintessence of the node haukex linked to: «Who needs a GUI? We have a CLI!» Too bad.

    Update: Real GUI programming. Yes, yes. No typo. No kidding.

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

      Yes, I agree, ...the best... doesn't exist. But I hope (and I'm sure of it) you know what I mean...

      Regarding the statement «Who needs a GUI? We have a CLI!» I have the following about that:
      Yes, we don't need anything more than a CLI. That's true... We're like a fish in the water when we can work on the CLI.

      But I think we (programmers) are so focused and isolated in our "CLI cocoon" that we sometimes forget that there's much more people out there that have not even a clue what CLI is, let alone how to use it and to work with it on the command line. Whether it's Linux or Windows or Mac, doesn't matter. I'm sure they are in much bigger numbers than we are, to be honest. The majority of people simply use a computer, they don't work with it. They hardly know how to switch it on/off and send an e-mail. And perhaps look a bit on the internet. And there it stops for many of them...

      It's for that "other kind of users"-reason that I want to make a small GUI so that it's doable for them to use my application written in Perl. And in the meantime I will enjoy learning yet another language. Always inspiring... ;-)

      Best rgds,
      Geert
Re: Alien-wxWidgets-0.69 CreateProcess ... failed.. No such file
by Anonymous Monk on Jul 06, 2020 at 07:53 UTC