In Enigma, I will use a font with astrological symbols. This font can also be used in other software. It is now available for download at http://radixpro.com/downloads/font/
Source code available
Release 0.3 of Enigma is available as source from GitLab. You can download it from https://gitlab.com/jkampherbeek/enigma.git . The current version handles the calculation of the most important celestial objects and of Placidus houses. Much more to do, but it is a start.
I did not implement the tests based on fakes as I described in my previous post. It added too much boilerplate code. But I do need a decent test coverage. Possibly I will use integration tests for the more complex objects. In the current version, you already find 70 unit tests for the more basic tests. A first version of the technical documentation is available for download
Release 0.2 is finished and I started working on release 0.3. I will push the resulting code to GitLab so it will be available to anyone interested.
Release 0.3 will focus on refactoring the current application. Part of the refactoring will be the use of interfaces. Not the interface-parts of the units but interfaces for the objects. These interfaces will help in making the objects more loosely-coupled but also be a great help in automatically testing the code.
Free Pascal supports unit testing but it does not support mocking objects. There is a mock-tool but it is pretty old and not supported anymore. As an alternative, I will use Fake objects; in short, ‘Fakes’. A Fake implements the same interface as the original object but gives hardcoded answers instead of the real thing. If you write a unit test for an object that uses the results from another object, which again will have its own dependencies, you might end up testing a whole range of objects instead of the single object. That is where Fakes come in. They replace the objects that are not tested in the current unit test and make it possible to test just one class per unit test.
After I finished the code of release 0.3 you will be able to check the code, including the Fakes, yourself.
Free Pascal vs Delphi
Shortly after I started working on Enigma using Free Pascal, a free version of Delphi came available. Embarcadero introduced a community edition of Delphi. You can use this edition if your yearly profit does not exceed $ 5000. For the Engima project that is an easy condition as there will be no profit whatsoever. The community edition is a welcome addition to the paid version that will cost you several thousands of dollars.
It is a nice opportunity but I decided to stick to Free Pascal. Why? I do not believe the official Delphi version has essential advantages compared to Free Pascal. The only advantage I can see is Firemonkey, visual components for Android, that are currently not available in Free Pascal. But as I will focus on a Windows version, for now, this is not an important advantage. Free Pascal, however, does have advantages compared to Delphi, mainly its support for Linux. And more importantly: you can rest assured that Free Pascal will be available for some time and will remain free. There is no guarantee that Embarcadero will continue the community edition forever. I still remember the end days of Borland, when a free version of Delphi was discontinued.
So I will place my bets on Fee Pascal and Lazarus.
Facebook group for Enigma
Today I started a Facebook group about Enigma. You can subscribe at https://www.facebook.com/groups/246475509388734/
I will mention all new items on this blog at this Facebook group.
Enigma: A new project for astrology software
Enigma is a new software project, aimed at astrological research. I just started it and there is not anything to show yet. But if you are interested you might want to follow my progress.
I have been experimenting with software for astrology for a long time and I used quite some programming languages and techniques in the process. Some of these approaches were reasonably fruitful and some were dead ends. But none of them was sufficiently effective for building the kind of application I wanted to create.
I decided to start from scratch again, this time ignoring new and sexy techniques and focusing on astrological functionality. And I will describe my progress in this blog.
This blog is aimed at other developers of astrology software. It will not be useful for astrologers who do not program. And it will also make no sense to developers that are not versed in astrology. I suppose I will have a pretty small audience…
A new start
I terminated all my previous efforts and started again. This time with Free Pascal. The main reason is the support for RAD; it allows me to build User Interfaces in an effective way. It also runs natively, resulting in speedy performance. I need that because Enigma will support analyzing large amounts of charts.
I will use the following techniques:
- Free Pascal and the Lazarus IDE for coding.
- SQLite as the database.
- Swiss Ephemeris for the majority of the astronomical calculations.
- FPCUnit for unit testing.
- JSON for exporting data.
- GitLab as the code repository.
Back to Pascal
I am returning to Pascal and this was my most important decision.
I used Pascal and similar languages like Delphi and Modula-2 for years but that was a long time ago.
Computer programming became my profession and that meant I had to learn some other languages; the major one being Java. I liked Java very much; I used it for my day job and it only made sense to use the same language for my private projects.
But Enigma is a native application and that is not something Java is very good at. OK, you can use Swing or JavaFX. But Swing looks pretty awkward – you can change that but only with a lot of effort – and Oracle has abandoned its support for JavaFX: it will not be part of the upcoming Java 11 release.
What to do?
I needed a pragmatic solution and I had some essential requirements.
- A language should support Object Orientation.
- It should support Unit testing.
- A reasonable number of developers must be using it.
- It should be affordable as my Enigma is non-commercial.
- It should support an effective way of building a UI.
These were Must Haves. Additionally, there were some Should Haves: preferably no large runtime solution to ship, the ability to access existing compiled libraries without using a port. And of course, the language should be fun to work with.
Free Pascal and Lazarus to the rescue
Based on my Must Haves, two solutions were available. C# combined with the free version of Visual Studio and Free Pascal with the Lazarus IDE. I used C# once and I was impressed with the language and with the RAD support in Visual Studio. But C# does not fulfill one of the Should Haves: it required the installation of the .Net runtime environment.
Free Pascal and Lazarus, however, do fulfill all Must Haves and all Should Haves. Object Orientation is optional but fully implemented, Unit testing is available, looking at the Tiobe index it still has a reasonable amount of users – about 1% – and the community is certainly very active. It is very affordable (free) and it has excellent support for building a UI based on RAD. Also, the Should Haves are being covered: no additional runtime, easy access to existing libraries, and it sure is fun to work with this environment.
I decided to switch to Free Pascal and Lazarus.
Enigma will be free and open source. I consider this important for research software: make everything controllable.
After a 0.0 version is finished I will push the code to GitLab where you can obtain a copy. This version will not be available for regular download: I will make only the source available.
I expect to need at least a year before I can deliver a first more or less useful version for end users.