GSoC – Port of R to QProcess

Hello, this post will be about what all targets I completed , what’s left and what I did during the last month.

During the first two months I had ported 2 back ends to QProcess, which includes Lua and Qalculate. For the last month I was left with 2 more backends , which were  R and Python .  Due to time constraint I decided that I will be working on just one of the two. Python’s code base was a bit large because of the two versions of Python(2.7 and 3), hence I decided to work on R.

Cantor’s R backend was broken, so my job to was to get it in a working state and make use of QProcess for all the communication.

R’s backend architecture was a bit different from the rest of the backends. It was divided into 2 parts

1.  RServer:
This is a separate application, that uses the R-API to run commands,
and exposes it’s functionality over DBUS

2. R backend
This implements the Cantor interfaces, and starts the RServer. It delivers
the commands to the server over DBUS, and connects to it’s signals to get
the result.

Due to such an architecture the code of R backend was quite complicated. To remove such complications we used R’s command line interface and made use of QProcess to connect to it. Instead of the multi step communication(rbackend->rserver->R API), we now have a simple one step communication(Rbackend->QProcess).

Previously R back end supported:
* Plotting graphs
* Tab completion
* Syntax completion(incomplete state)

Current Status:
* User can still plot graphs but the graphs are not integrated in the worksheet

* Tab completion- Not working. This used to make use of Rserver for getting the completions, but since we have disabled the Rserver tab completion is not working.

* Syntax higlighter – Same state as before. It just highlights the keywords(if,else etc) and not the built-in functions/variables of R

Overall, R back end is in a better state than before. We have more or less most of the functionalities working. The only thing that’s not working is tab completion. Hopefully in future we will able to make use of  R’s command line interface for tab completion. R back end also does not have support for variable management but it should ideally support this since R(language)  supports it.

With this most of what I planned to do during GSoC has been completed and the only back end left to be ported is Python’s.

The last 3 months have been great and a bit hectic for me, but nonetheless I enjoyed working on the  project. I plan to keep working on my project, complete what’s left and continue contributing to KDE.

I want to thank my mentor Filipe Saraiva  for being such a cool mentor that he is and for all the support he provided during the last three months

Lastly I want to thank KDE for giving me and others this opportunity.

Thanks and Happy Hacking 🙂

 

Advertisements

GSoC- Port of Lua to QProcess

Hi, it has been a bit long since I last wrote a blog about the status of my GSoC project. This has been majorly because I got a job and it has kept me busy ever since. Anyway, I managed to complete my second month target , mostly by working on weekends. Here’s a quick update on what I did during the 2nd month

I worked on porting Lua backend to QProcess. Lua backend was dependent on Lua’s C api for all the communication. By default Lua had spport for:
* Syntax highlighting
* Tab completion

Lua backend now makes use of Lua’s command line interface, which we connect to using QProcess. Most of the mathematical functionalities of Lua are offered through the math library. Here are some screen shots showing the output to different commands

Usage of math library

lua_newsheet

 

String manipulation/Os functionalities/arrays  lua_string

 

Current Design of Lua

* we make use of Lua’s command line interface for all the mathematical calculations or any other functionality offered by Lua’s  CLI

* Tab completion is still dependent on Lua’s C API. This should eventually be ported to make use of the command line interface as well.

All of the functionalities offered by Lua have been ported safely and nothing has been broken. As of now Lua does not have support for Variable management. I would love to work on it in future.

That’s it for this blog.

Happy hacking