Work report. Week 8
Tags: perl6, opensource, gsoc
Published: 2019-07-24 08:28:51

---
title: Work report. Week 8
published: true
description: Work report, week 8.
tags: #perl6 #opensource #gsoc
series: GSoC 2019
cover_image: https://thepracticaldev.s3.amazonaws.com/i/efz8oj2vdq41j61djv17.png
---

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][1]. 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][2] and Joel and I are currently discussing this new feature!

In a few days some new changes will come (see [next branch][3]), 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][4]. 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][5], 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](https://github.com/antoniogamiz/Perl6-Documentable/tree/master/docs) 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][6]). This function is like a filter. You can filter by type, using regexes, functions, everything you can think of. Let's see some examples.

~~~perl6
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.

[1]: https://github.com/noisegul/perl6-p6doc
[2]: https://github.com/noisegul/perl6-p6doc/issues/17
[3]: https://github.com/noisegul/perl6-p6doc/tree/next
[4]: https://github.com/antoniogamiz/Perl6-Documentable/blob/master/TODO.md
[5]: https://github.com/perl6/Pod-To-HTML/issues/63
[6]: https://docs.perl6.org/routine/grep