Posts Tagged ‘software’

[GSoC] Getting started

Today is the start of coding for Google Summer of Code 2013. This year I was accepted by DUNE, a Distributed and Unified Numerics Environment. It is a toolbox for solving partial differential equations, and as a student of Computational Physics I have some experience with that.

My project, however, won’t be directly related to differential equations. Instead, I will provide a tool for measuring, storing and analyzing the performance of DUNE applications. This project consists of several parts, and the final workflow will look like this.

  • Measure the time spent compiling and running a program
  • Store the result into a database, so they can be compared with previous data
  • Perform statistical analysis on the data, find outliers, general trends, and quantify optimizations.
  • Visualize the data as a HTML page with pretty graphs
  • Upload local data to a central server, where performance of the same program on different computers with different compilers can be compared
  • More statistics and visualizations performed on the central server

DUNE currently has helpers for some of the parts (log format, uploading), but the project will still require a lot of work with different languages and frameworks. I plan to use Python for the most part, but charts will require JavaScript. I will also start with some example DUNE programs, which will be written in C++.

My work will progress roughly in the order written above. I’m starting with a small script that measures theĀ  running time of a program and writes it to a logfile. I’m leaving for a conference in England after this week, so I hope to complete at least this first item by then.

Advertisements

Finally, KDevelop file templates

The title of this post is slightly misleading, because you can’t use them in the stable version of KDevelop yet. However, after months of laziness schoolwork, I finally managed to upload some to http://kde-files.org. This means that anyone running KDevelop master can now download some of the templates they need. So far, I only made templates for things I am using: QObject subclasses with bells and whistles (properties, signals, private pointers), QML items, and a differential equation solver. This covers all my current programming activities, although I do hope to write some code (and templates) in Java for Android and/or some web framework, preferably Meteor.

template-complex-qt

Example class made with a template, only by specifying its name and members. Note the proper insertion of const references for QString (which is known to KDevelop as a class), and lack thereof for QDateTime which has not been included and parsed yet.

Now, I am certain that at least some of you write code in different languages and framework. I would like to have some more templates ready for the 4.5 release, so people won’t go “oh, there’s only three” and never look at it again. I am having some trouble with non-C++ languages, because they all have simpler syntaxes with less boilerplate and fewer files. Java comes close, but I as far as I know most people use Eclipse with it. In C++, using Qt and all the best practices, you have to do the following for every class member:

  • Add a public member to the private class
  • Add a Q_PROPERTY() declaration to the main class
  • Declare a getter, and a setter if the property is not read-only
  • Declare a signal
  • Define the getter and the setter in the implementation file

In QML or ORM’s like Django, you only need a single-line property declaration, while in pure Python you don’t really have to do anything. Obviously templates, as pretty much all code generation, are much more useful in C++. I presume there are other examples of such complicated languages, or at least different uses of the same ones. So I ask you for ideas, what kind of template would help you write code quicker. They don’t really have to be classes, for example unit testing frameworks require quite a bit boilerplate code and could be sped up by using pre-made templates. What are the things you write again and again, but are different enough to not be able to simply copy?