DEV Community

Cover image for Work report. Week 8
Antonio
Antonio

Posted on • Updated on

Work report. Week 8

Welcome to a new work report! Sorry for being two days late, I've had a lot on my plate these days. Let's see what happened this week :D.

P6DOC

I am not sure if you know this tool: p6doc. It's being improved by one of my partners in #gsoc2019, Joel. It's a command line interface to consult the Official Perl6 Documentation. Something similar to man but for Perl6!

I tested it out this week and I thought it would be nice to integrate my project with that tool to improve the consulting time. So I write down my ideas in a issue and Joel and I are currently discussing this new feature!

In a few days some new changes will come (see next branch), so be alert!

GitHub Templates

I did not realize I did not have any template to use by issues or pull requests, so I have added them to the repository :D. I also have realized that perl6/doc was using the old template system so I made an issue to update it! One of the things I am enjoying the most about #gsoc19 is the huge amount of things that I am learning about git and github. There are so many features to help you develop your ideas like projects, milestones, etc.

Big TODO list

A few days ago, my mentor revised my code and suggested a lot of improvements on this TODO list. It's kind of long, but I am trying to complete it item by item.

A lot of them have already been made, but others, like generate documents in parallel, has proved impossible to me to resolve. It turns out that pod2html (used to convert all pods to HTML) cannot be executed in parallel. I tried it by all means without any results. I have reported this problem, but as you can see the error is a segfault. So this looks like a bug in Rakudo rather than the module itself. Debug this problem is the definition of hell, there are so many functions being called, several threads, etc. Hence, generate the documents in parallel will have to wait until this bug is resolved or a new HTML module is developed.

I have also refactored and deleted some modules, to improve the readability and understanding of the process. I have also made a new documentation under docs/reference explaining how the things are made. I did this because the previous docs were too much technical and it was hard for people to see the big picture. I hope that with this approach, the system will be easier to understand.

And that's has been my work this week. It does not look a lot, but the refactor and some items of the TODO list have caused several problems because some things were highly coupled (my fault). Now everything is more modular and less prone to errors.

Perl6 goodies!

Now is when I tell you something interesting about perl6! If you are a programmer, you are bound to work with Arrays, Lists, etc. Perl6 gives you everything you need to work with these data structures very easily.

One function I use a lot is grep (see the docs). This function is like a filter. You can filter by type, using regexes, functions, everything you can think of. Let's see some examples.

say ('hello', 1, 22/7, 42, 'world').grep: Int; 
# OUTPUT: «(1 42)␤» 

say ('hello', 1, 22/7, 42, 'world').grep: Rat; 
# OUTPUT: «(3.142857)␤» 

say ('hello', 1, 22/7, 42, 'world').grep: {.Str.chars > 3};
# OUTPUT: «(hello 3.142857 world)␤» 
~~~

![simply perl6](https://thepracticaldev.s3.amazonaws.com/i/x6smko21cv1tovbchlrc.jpg)

You will see how amazing is this once you start using it.

### Closing

And that's have been everything for today. I hope you give Perl6 a try and start using these amazing features.

See you next week with a new report and a new thing about Perl6! :D.






Enter fullscreen mode Exit fullscreen mode

Top comments (0)