“C++” Tagged Pages

Mixing Hand-Written, Generating, and Generated Code with Koog

Revised on
Created on

Some days ago I released a little code generation utility that I have been using for well over a year in cranking out repetitive C++ code. Koog is—for lack of a better established term—a mixed-code generator. It is similar to other tools of its kind (such as Cog), but the only one that I know of that uses the Scheme language for specifying what code to generate. The concept of mixed-code generation is simple.

Read more…

Koog

Revised on
Created on

Koog is a mixed-code generation tool. It supports a choice of comment styles (C-style block comments by default), and assumes that code-generation directives are written in Racket. Koog provides a Racket API, a command-line interface, and editor integration for Emacs and Vim. The one novel feature it has (compared to existing mixed-code generators) is the option of only (re)generating individual code regions, which provides more control when used interactively in an editor.

Read more…

Let Us Have More C++ Languages

Revised on
Created on

C++ is a good language in that it is widely supported and has a large ecosystem around it. As a result, it has a large number of libraries, including extensive cross-platform frameworks (such as Qt). There are also entire operating systems written in C++, of which Symbian is an example. All of this provides ample motivation to use C++ (or at least its libraries) from time to time. However, as a language C++ can feel verbose and constraining at times.

Read more…

Ideas for Language Constructs Implementable by Translation to Readable C++

Last modified on

This is a collection of ideas of what one might do with technology that makes it easy to add language constructs to an extensible language (closely related to C++) that targets readable C++ source code. The C++ compatibility and readability constraints restrict the language, for sure, but many interesting things can still be done, and barrier for adoption is low, especially when the compiler is used merely as a one-off code generation wizard.

Read more…

Scanning for ABLD Errors and Warnings

Revised on
Created on

Symbian’s ABLD build system tends to produce a lot of output, especially when run with the verbose flag (-v), as I like to do to see the compiler invocations. Also, ABLD likes to run to “completion” despite individual build steps failing. The end result is that it takes some effort to look for the errors and warnings in the output. Some suggest scanning ABLD output in order to terminate the build on error or to highlight errors and warnings.

Read more…

On Patching S60 SDKs for GCCE 4 Compatibility

Written on

I’ve tried GCCE version 4 before for building Symbian software, but have been somewhat put off by all the warnings it produces, mostly due to incompatibilities with the header files in the existing S60 SDKs. Well, I finally managed to get a working S60 application built with GCCE 4 without any warnings. Mind you, this was just one application, and not built with the full Symbian toolchain, but still. I used the S60 5th Edition SDK with a number of patches, some of which I have posted here.

Read more…

Look, S60 Software Installation with No Hands

Written on

S60 3rd Edition has been out for quite a while by now, and for me, the one thing that has all but killed the pleasure of developing native software for the platform has been the humiliating wait—dismiss dialog—wait—dismiss dialog—wait—dismiss dialog—wait procedure during installation of the software being tested and developed. For one-off installations the installation procedure is no problem, but when you’re a developer it gets old real fast. On 1st and 2nd edition I would bypass the installer by simply transferring the binaries to where they ultimately belong on the target filesystem, using a tool such as obexftp.

Read more…

Another PyS60 Extension with a take_photo Function

Written on

Earlier releases of the Miso PyS60 extension had a take_photo function, for taking photos (without a viewfinder). This functionality (and more) has since then been integrated to PyS60 itself in the form of the built-in camera module. I’d now like to introduce the pynewfile library for PyS60, which (at least for some S60 phones) offers an alternative to the camera module when wishing to take photos interactively with a viewfinder.

Read more…

Accessing OBEX Pushed Messages with Python for S60

Written on

Early last year at HIIT I hacked the Python for S60 inbox module to have it support querying for the content and metadata of messages in the device Inbox that have been sent via Bluetooth OBEX Push. (The built-in inbox module apparently only supports accessing SMS messages.) I changed the name of the hacked module to pyinbox, to avoid conflicts with the built-in Inbox access module. I recently made pyinbox available via a dedicated webpage, in case it should prove useful to others.

Read more…

pyaosocket aka aosocketnativenew Released Standalone

Written on

In the PDIS project at HIIT we developed a socket library for Python for S60. The library consisted of both a native extension and quite a bit of Python code. The native extension was called aosocketnativenew, and became somewhat well known as an extension supporting non-interactive Bluetooth discovery. We never made a standalone release of the library, nor did we release a version of the native extension built for S60 3rd Edition.

Read more…