Menu Home

Perl6 Cro with video evidence

I am pleased to say that my side project http://myjudo.net is now running Perl6 and the Cro framework in production and if you don’t believe me, you can actually watch me do it over at https://www.twitch.tv/lancew/videos/all.

 

MyJudo was previously running the Bailador framework, which for me was familiar territory as it is aport of the Dancer framework from Perl5. But, it’s not as actively maintained or plain interesting as Cro.

Cro is new and it’s not billed as a web framework, rather as a set of tools for “…set of libraries for building reactive distributed systems…”. But it was very simple to get started creating a http service, that serves the MyJudo website. Lets face it a website/server is pretty much just a reactive distributed system.

Cro has great tooling, so the “cro stub” command gets you going and “cro run” gets a server up and running. “cro web” also gets a server up and running, but provides a really nice web interface to look at logs, turn on tracing, start/stop services and even stub out new services.

Cro also provides a Dockerfile and the docs encourage you down this route early; so it all feels curretn and modern.

I was fortunate I guess that I had built MyJudo with thin controllers and a MyJudo class that contained the “business logic”, so over the course of maybe 6 hours on the ban holiday I was able to replicate all the routes from the original across to the cro implementation. And that 6 hours included many occasions of me forgetting how Perl6 works, as I have said before being a Perl5 developer can actually be a bit of a hinderance when doing Perl6 as Perl6 is not a new version of Perl5; but an entirely new language.

One of the motivators for the port is my desire to get https working on the site, which I have made several attempts at in Baildor and failed. Cro seems to have excellent tooling for this; so my next step is to make https work (I’ll live stream that too). Which is what I will do after I finish making the docker container work as I want it to.

Live streaming my dev efforts on Twitch has been interesting to say the least. I want to continue with it and will make a blog post about it once I have some more experience under my belt.

 

 

 

 

 

Categories: Uncategorized

Lance