Results matching “galileo”

Mojolicious: Do It For The Candy!

Most of my recent blog posts about Mojolicious have revolved around its non-blocking capabilities. I like to write about those because I think that it is those capabilities that can bring new eyes to Perl from other languages, much like Node.js brought eyes to server-side javascript (for the same reason). That said, lately I have had excuses to show off Mojolicious and when I have done so, it has been some of the other cool features that have garnered the “Ooooh”s and “Aaaah”s from onlookers.

In this article I will show you some of those extras, like accessing your generated pages and even app itself direcly from the command line. I will also show how testing can be easy, powerful, expressive and yet still readably beautiful.

Anyone miss Mojolicious' memorize helper?

Mojolicious’s 4.0 release came with lots of shiny features but it also came with a lot of housecleaning. One of the old things swept away was the memorize helper, which would cache a part of a template and prevent its repeated evaluation. Do you miss it, as some users undoubtedly do, or else does this helper sound useful to you? Then read on, because its back and better than ever!

Come see me at YAPC::Brazil!

I love open source programming. I’m continually humbled to see even the small impacts that my contributions to the Perl community have made for fellow programmers around the world. Mostly my use of Perl has been to write a complex simulation and the tools that it uses to simulate the dynamics of electron bunches in an Ultrafast Electron Microscope column, which is the subject of my recent Ph.D. thesis. So while I have enjoyed sharing my work both here and at the 2012 YAPC::NA I never would have expected that my name would mean too much in the greater Perl world.

That is why I was most surprised and humbled to receive an email not too long ago from Felipe Leprevost, a fellow scientist, Perler and organizer for this year’s YAPC::Brazil. They have chosen this year’s theme to be “The Scientific Universe,” and what a great topic it is! Perl is used by scientists around the world from astronomy to bioinformatics and yes, even in instrumentation physics, to further the pursuit of knowledge and scientific discovery.

I’m honored to announce that I have been asked to give the keynote address. I intend to use this great opportunity to discuss the use of Perl and open source software in science. Please see my abstract below.

I want to thank the organizers for this chance. I also want to invite all of you, whether scientist, programmer, or other enthusiast, to come to Curitiba this November 15-16, to enjoy what I’m sure will be a fine discussion of science and Perl. I especially want to extend a welcome to those of you in big data fields, even those outside of a scientific discipline, because big data is the way of the future for all science.

I hope to see you there!

Mojolicious 4.0 is coming soon!

As a newer member of the Mojolicious Core Development Team, I am more than usually excited for a Mojolicious release. This is because the next major release, version 4.0, is set to ship very soon! For those of you who don’t know, Mojolicious is a modern Perl web framework which is lightweight and easy to get started learning and using, while containing features that are cutting-edge. It’s asynchronous/non-blocking to the core, websockets work out of the box, comes with built-in DOM/JSON/UserAgent, etc etc.

Our fearless leader Sebastian Riedel (aka sri) will no doubt post a message with all the details when it ships. In the meantime, I want to share a little story of how community interaction, even at the StackOverflow level, can lead to innovation and enhancement of major projects like Mojolicious!

A Case for Tie::Array::CSV

What is the favorite module you have released to CPAN? For me, its not some shiny CMS or fancy scientific simulation. In fact, mine is probably horribly inefficient, maybe even a little evil, but I like this one best because it is clever.

Today I used my favorite of my modules in order to accomplish a difficult task, and in doing so I found a little bug, which I have just fixed. Which one is it? Let me introduce you to Tie::Array::CSV.

I love CPANtesters and Travis-CI

I have mentioned before how much I like CPANtesters! Here is another story.

Yesterday I got an email from them listing a number of failures from Galileo, my CMS. I had recently pushed some bugfix releases, but it had some new, and as yet unused code and tests for that code in it. The tests passed on all my Linux systems, so I wasn’t worried about the release. Yet the failures came in. Some on Linux, some on other platforms, but not all the tests were failures and I couldn’t figure out a pattern. CPANtesters put me on to a problem but for this I needed faster results.

I had heard about Travis-CI, a free continuous integration platform based around GitHub. I set up travis testing for Galileo and sure enough it failed there. Though it was frustrating I now had failing tests that I could run at will! After much trial and error, I found that I had an undeclared dependency, but due to the way I was testing, it was throwing a seemingly unrelated error. My problem was that all my systems have the module installed and so I didn’t get the failure on my box, its a common module File::Next (used by Ack) and so many of the CPANtesters had it as well.

CPANtesters alerted me to the problem and Travis-CI let me continuously test on fresh platforms (5.10/12/14/16) until I found the problem. I love open source.

I have released Galileo 0.026 which fixes the problem. There are exciting additions to Galileo in the works, slowed only by my upcoming Ph.D. defense (which obviously takes much of my time). I hope that by this summer Galileo will have several of the most requested features you have told me that you would like.

Happy Perl-ing and remember to thank those projects and developers who make your lives easier, both in person and in public. Thanks guys!

Galileo 0.023 has a pretty web setup page!

Just a little note to announce the release of Galileo version 0.023. Galileo is my CMS that aims to be 100% CPAN installable, all you have to do is this:

$ cpanm Galileo
$ galileo setup
$ galileo daemon

This release makes installing even better, because now when you run galileo setup you get a web interface to configure your CMS and then install the database!

Galileo configure page

Ok that image is just slightly ahead of what is now on CPAN, but its close :-)

#galileo on irc.perl.org

Hi all,

I just wanted to drop a quick note to announce #galileo on irc.perl.org as a place to talk about Galileo my CPAN installable CMS and its new companion project GalileoSend which isn’t quite to CPAN yet, but it will be soon.

GalileoSend will make sending files via websocket easy! So far the package includes a command-line sender (client) and receiver (listener/server), a Mojolicious plugin and a javascript client. Futher GalileoSend is a protocol spec, which means if you want to write a client or server in your other favorite language, or a plugin for your favorite framework, its very possible.

Interested? Drop on by and chat about it!

A new protocol for sending files over websockets

Today I’m happy to make public the work I’ve been doing to make some kind of “standard” for sending files over websockets. I call it GalileoSend because it was created for the Galileo CMS.

The protocol itself is language independent for both the client and server side, assuming that both can open a websocket connection and send JSON (as text) and binary data over it. Since communication by websocket is cheap, 2-way communication is highly encouraged throughout the transfer and positive confirmation of receipt is required.

Further, I have written a javascript client-side implementation (which could be used for any server) and a non-blocking Mojolicious server-side implemenation (which could be used for any client).

Read on (examples!) …

In the name of "Create great things (in Perl)"

You may have noticed my commentary on the Perl version number debate. I think that that debate is a possible way of raising the profile of the language we love, but that’s not why I called.

chromatic petdance and I’m sure others have suggested that rather than infight (which I don’t believe I’m doing, btw) is to make something great and show it off. While I don’t think this is enough to raise Perl’s profile ourside of our community, I have seen and IMHO done some very cool things this week:

Things I’ve Seen

  • play-perl - A social coding game
  • TryPerl - An online IDE for writing and running Perl scripts (per the author, it might still need a little help). This is a “try before you install” solution.
  • Farabi - A CPAN installable browser-based Perl IDE.
  • PerlTuts - An interactive “learn as you go” introduction to Perl

Things I’ve Done

  • Demonstate non-blocking websocket file uploads (for eventual use in Galileo)
  • Played with Lvalue accessors. Should it be a MooseX module?

It may not be enough, but its always nice to share what you and others are doing. Go Perl!

Does Perl (5) have a future?

TL;DR: Not if it can never have a major release. Please read on.

Note: I’m now not talking about soon, or what it would be named/numbered. I’m talking about ever.

Let me tell you my story, some of you may know it. I’m a Ph.D. candidate in Physics. Programming is woefully ignored in science education now. All my professors learned FORTRAN in courses during their Ph.D. (or B.S. in some cases) but now, given the ease of Mathematica, we seem to be expected to pick it up as we go on.

One day I had a nutty idea, I wanted to parse one of the temporary files created during LaTeX compilation. A friend, who knew next to nothing about Perl, suggested I needed Perl and Regexes. I can here you out there, saying “now I had two problems”. Not so. I learned, I improved and finally my first Perl script was out in the world. It doesn’t bear much resemblance to its current form but it worked.

This project had nothing to do with science, but I was awed by the power I now possessed. I went to start using Perl in my work. Perl finally solved a near-intractable programming problem in Mathematica with relative (hmmmm) ease. Physics::UEMColumn now forms the basis of my Ph.D. thesis which I am defending this spring.

To get that simulation working I needed more tools, so I wrote them, and those tools needed tools so I wrote them and suddenly I discovered that I had something I could give back, so I’m writing it too. Further I often need PDL, and amazing numerical package for Perl. It really needs some internal TLC, which David Mertens, project pumpking Chris Marshall and others are planning.

Why am I telling you this? Because in 2009 I became a Perl programmer, and I fell for language hard. I love Perl. I came for regexes, but I stayed because it works well with the way I think. I use it for lots of things now. Unfortunately few others have come with me.

Chromatic implores us to write good software and show it off. For these years I have tried, and it doesn’t work. I have given talks at my university, I have told friends, I have used it to help coworkers, I share with the community. I have recruited one person. I have converted none. Most people who know Python or ROOT (C++) laugh at me. Its not enough.

Until yesterday, I had a steely resolve. Even in the face of Stevan’s recent pronouncement and embarking on replacing the Perl internals with Scala, which would probably kill or at least maim most of my work. Moe wasn’t the future of Perl, just an offshoot, right?

Yesterday, for the first time, I saw a flaw. There are people out there who really think that Perl will never see another major point release. I don’t mean soon, I don’t mean for cheap marketing, I mean ever. I mean for at some point breaking some small amount of backward compatibility. For some the reason is that compatibility is too important (the future is our past), for some its that Perl 6 is the future of Perl 5 (whether spoken/believed or not) and some its just because there is no number available. All that got me to thinking …

Is the work on Perl 5 really just a shim to support CPAN? Is it really going to be an ever-growing feature pragma? Will there always need to be a magic incantation to activate some of the best Unicode support in the programming world? Will new Perlers need to be told to use good practices like strict and warnings forever? Is the herculean work of Nick Clark and Dave Mitchell just going to go for naught after a few years of a usable Perl 6 and Moe?

If Perl can never have a major point release. I think all of the above is fated to be true. I’m not asking about soon; I’m asking about ever.

In my mind I’m planning future work on the Perl we now call 5. I want to help improve the giant XS extension called PDL, possibly using another one called Prima. I intend to keep working on Alien::Base. But is it all just going to vaporize in a few years do to lack of external interest, or after being replaced by something? Why should I?

In the upcoming months, I will be looking for my first real job. It might be a post-doc appointment with Pacific Northwest National Lab (PNNL) doing the hardware/software integration for a brand new ultrafast electron microscope. Should I do it in Perl? I will only be there a year or two, is it fair to saddle them with that? Will they find someone else who can maintain it?

If I don’t do that, I might form a company, one that aids research groups in writing the software that they often cobble together, for analysis, data warehousing and search, for hardware integration. Would I do that in Perl?

If the powers that be don’t see a major point release at some point in Perl’s future, then it has none. The userbase will keep sliding away. Not purely for a number, or marketing, or perception, but because you will need too much knowledge to start using it. You will need to know the incantations to do things right, ones that we already know, but new users can’t find. How many people find a CPAN module that does just what they want, and so set out to write their Perl first script, only to fail and walk away? We can’t ever know.

I ask you p5p (whom I admire greatly) and I ask you Larry, creator, benevolent dictator, does the language we call Perl 5 have a future? At some time, will we see a major release? If not, then I don’t know what I’m working towards. Should I tie my future to this language?

Galileo 0.012 released!

Galileo is a simple but modern Perl CMS which is totally installable from CPAN. Just a few quick commands and the site is live and usable! The primary focus is small sites, which need immediate availability and easy (no?) administration. All content is written in a markdown editor in the browser and saved live via websockets with no reload.

This morning I released the newest version of Galileo with several improvements that have been in waiting for months. Among the most exciting is preliminary support for in-place database upgrades via DBIx::Class::DeploymentHandler.

In addition, Mojolicious author Sebastian Riedel made an extra effort to ease the testing of JSON messages passed via websockets. This means that Galileo’s two-way communications between the browser and the server are now even more robust and better tested. Further, this move has made unicode handling more reliable (since websocket unicode handling has its own quirks) so I can now say that Galileo should be unicode friendly! Thanks SRI!

Need a quick website? Give Galileo a try!

EDIT: I have now released a few nit-fixes so the release number is now 0.015. This should ease installation in some situations and on more platforms.

The next Galileo will allow database upgrades

I wrote Galileo partially as a reason to learn DBIx::Class. For those of you who may not know, Galileo is my CMS, designed to be completely installable from CPAN.

As a scientist I’m not very proficient as a database admin. Part of what I love about DBIx::Class is that I didn’t have to learn database administration or SQL, it does that for me. Perhaps I had gotten a little overconfident.

Caught up, finally

Hello again Perl world!

After a wonderful vacation, I came back to discover that I had far more work to do than I had realized. I have only just started to claw out of the heap and arrive at a place where I have had some time for Perl-ing.

First of all I need to apologize. I missed my Grant Report this month. While this is no excuse, there also was nothing to report. I do hope to keep honing in on the few remaining problems that Alien::Base has developed, but I am increasingly believing that a few of my initial assumptions may have been too flawed, possibly requiring a little bit of rewrite. That said, what I really need is someone who has a longer beard than I (metaphorically) to help me understand some Makefile/linking stuff to help me over the hump.

That brings me to some more interesting things. I had almost gotten my additions to vti’s PerlTuts running before my vacation, and now they have finally hit; thats right, live science tutorials in Perl are coming! For now its only a few pages on my plotting extension and PDL constructors, but believe me, that was the hard part.

Finally, this weekend I added up a few more features to Galileo, these include such novel features as deleting pages and easy links to adding users and pages. For those of you who don’t know (many I’m sure), Galileo is my attempt at a fully CPAN installable content management system (website). Its runs on Mojolicious and uses websockets for real-time updating wherever possible. Please take a look and let me know if you have any issues; especially if you use the (still untested, sorry) environment variables for controlling file locations.

Cheers!

Galileo and websockets

While I have been on vacation, I have found a little time to add some polish to Galileo, my recently released CMS. Recent additions include a utility for writing a mostly generic configuration file and administrative popups which explain how to create new pages or add new users. The most important thing I have added though is some more setup-time documentation! Hopefully people will now find it even easier to get a Galileo-based CMS up and running.

In writing the documentation, however, I was faced with a question that I do not know the answer to: do any other plack-based or otherwise Mojolicious compatible Perl webservers (i.e. plackup, starman, twiggy etc) support websockets? While in principle a Mojolicious app can run under all of these, Galileo depends heavily on websockets, especially for content editing.

If any of you know, please comment.

I have more ideas for improvements to Galileo, but they will take a little more work than I want to put in here on vacation. In the meantime it is still very functional, go take a peak. :-)

Announcing Galileo - A minimal but modern CMS

I am happy to announce that Galileo CMS is now available from CPAN! This project has been my on-train side-project, but its come a long way in a short time. The most exciting thing for me is that its entirely installable from CPAN. To try it out, simply do

$ cpanm Galileo
$ galileo setup
$ galileo daemon

of course, you can also run it using the servers provided by Mojolicious, or using your favorite psgi-compliant server (as long as they support websockets).

Authorized users edit pages using markdown with a live-preview. All updates to pages, menus and users are sent via websockets. Styling is courtesy of Twitter’s Bootstrap library.

By default it uses an SQLite database, and indeed this is all its been tested on, but in principle it can use anything that DBIx::Class supports. All other dependencies are available from CPAN, with the exception of the javascript libraries, which are bundled with the distribution.

Some things that are still on the list:

  • Other than the database, it is not tremendously configurable yet, but I don’t think that should be hard to do. With a few changes it might be decently themable by overloading the styles defined by Bootstrap.
  • Images cannot be uploaded yet, but they can be linked to from external sources, or at least that should work :-)

Unfortunately I missed the deadline for Perl Weekly, but I did get it out before I go on vacation tomorrow, and I’m excited that I made that goal. So please, try it out; though probably not for anything mission-critical yet.

Let me know what you think!

Having fun with some modern web technologies

Edit: MojoCMS has been renamed to Galileo and released to CPAN. Enjoy!

Over the holiday break, I decided to have a little fun learning some things about the web. I usually get my Perl fix through science, but several upcoming projects might have some web involvement; so I thought I should brush up. The following are some reflections on that experience.

The task I set myself was to make a micro CMS (it is currently named MojoCMS, but I’m not sure I like that), leaving most of the heavy lifting to freely available Javascript libraries. I didn’t think I would be especially good at writing the actual interface, but rather the routing and functionality would be my task. In a strange way, the result was a kind of nostalgic Perl experience; Perl was the glue in my project again, not the main/only language involved.

I used several great libraries, jQuery of course, jQuery-UI for a small part, HumaneJS for notifications (works great for websocket responses!) and PageDown for a real-time markdown renderer. FYI, PageDown is the editor from the StackOverflow team. These projects make life much easier, I can’t imagine writing that kind of Javascript by hand!

I must say, Javascript still eludes me. I can parrot it, but I’m sure I’m not doing it correctly. I think the problem lies with its dependence on the HTML/browser that is running it; the odd way that the language doesn’t have a use command, and that “page”-globals can be used, still feels odd. I can definitely see the need for jQuery, but that adds even further cognitive dissonance. Anyway, I think most of this is my shortcoming, not its.

HTML5/CSS3 on the other hand is brilliant. Its easy to make the markup do what you mean without too many machinations. Of course I pull in some libraries for that too, namely Bootstrap.

Back to the Perl of it though, I must say I have high marks for Mojolicious, for many reasons, but the highest are for Websockets! Now I know Mojolicious didn’t invent them, but it makes them easy. Using Websockets I was able to make the “save page” and “update main nav” windows save without reloading. That was rather cute and feels modern.

The biggest point I want to make (long ramblings aside) is my most recent addition: DBIx::Class. I’m a scientist, not a database admin. I have setup some PHP CMSes and have used mysql just enough to get them started; terrified the entire time. So much so that I started my CMS project with the idea of using DBM::Deep for as long as possible. Soon enough though, I was nesting hash-keys three deep and wishing I had objects; if I hadn’t needed persistence I would have reached for Moose long before.

I investigated KiokuDB, and while I had some hope for it, I think I would need someone sitting in on the setup process with me. Then I remembered, throughout YAPC::NA along with the list of my favorite Modern Perl modules, everyone else adds DBIx::Class. Ok they can’t all be wrong. They weren’t. Sure the syntax is a little different from Moose, but its not that hard. The payoff for me started even before running the site, in the deploy command. With a simple script I can create all the necessary tables and inject sample content without ever needing to write SQL! After this the ORM quickly and easily replaced the DBM::Deep vestiges throughout the code, and just like that I have readable, OO structures for users, pages and the menu configuration.

Anyway, if anyone wants to play with MojoCMS (or suggest a better name!) feel free. It is still very rough but I may try to see it forward a little further. Passwords are stored in the clear for now, so be careful! But this is my next task. After that and some other work on users (like being able add them through the website!) the thing might even be able to host a small site. Not bad for a one-week side project!

1

About Joel Berger

user-pic As I delve into the deeper Perl magic I like to share what I can.