Cloud IDE for DSLs

I am attempting to provide a cloud based IDE for DSLs. The first question is where to start from. There are many great Cloud-IDEs out there, but they are all aimed at supporting various programming environments. For DSL support, I want to find something that is minimal, that I can subsequently add to with DSL extensions.

My requirements would be:

  • Minimal starting point (similar to creating an Eclipse RCP)
  • Plugin architecture
  • Preference for ability to use Java in plugins
  • Open Source (of course!)

I have investigated the following as possible starting points, details are in separate posts (follow the links), but a brief summary is included here:

  • Cloud 9
    • Widely used
    • Mainly Javascript
    • Potential problem with the open source licence, currently unsure if I can legally use it!
  • Eclipse-Che / Codenvy
    • GWT and Java based
    • Runs in its own tomcat (! what…ridiculous!..but I have attempted to get round this)
    • Complex to reduce to a minimal IDE
  • Eclipse-Orion
    • OSGI at the server
    • Javascript on client
    • Complex to minimise
    • not that easy to add plugins
  • Codiad
    • php based
    • simplest starting point
    • plugins are easy
    • needs a php-java bridge to execute java
    • Can run it in tomcat with a little persuasion
    • tomcat 8 requires quercus war (for php interpretation) – which has GPL licence.

 

Praise and Worship: Sit or Stand

Come, let us sing for joy to the Lord;
    let us shout aloud to the Rock of our salvation.
Let us come before him with thanksgiving
    and extol him with music and song. [Psalm 95:1-2]

Praising God can take many forms and singing is simply one way to express our praise. But when we praise him by singing we should be focused on God, engaging with him, freely expressing our joy and happiness that we are in his presence, and allowing our hearts to engage with him.

Having recently moved to Germany, one thing has struck me as distinctly different between church in Germany and church in Britain. In Germany, traditionally, people sit down in church when singing! Why, I am not sure. However, coming from a British church culture where I have never (or rarely) sat down whilst singing, I find it very odd and a little uncomfortable. It is of course possible to sing praise whilst sitting, but I find this much easier to do when standing.

Apparently, in Denmark, they also sit down to sing, and I agree with this author that it is not necessary to always stand when singing. There can be good reasons to sit sometimes, however, I would present an argument that, on the whole, standing is better. How do I define better? In this case I mean that one can sing more freely, i.e. one feels less constrained when standing rather than sitting and one is better able to engage fully with the act of praising our maker.

Scientifically and physiologically, good posture is obviously important. Constriction in the airways and the diaphragm would hinder singing and make it a strain on the singer. However, although most professional singers do stand when singing, there are many occurrences of professionals sitting to sing. According to a trained opera singer friend of mine, when sitting one must sit upright with straight back in order to sing properly.

Is there any biblical guidance on whether we should sit or stand when singing? There are many verses about singing as a means to praise God, the psalms are full of references about singing, and other verses in both Old and New Testament encourage us to sing and praise God. However, there is no reference I have found that says anything about sitting or standing as a posture for singing.

Various verses that state we should praise God with our whole being, spirit, mind, body, and in particular with our hearts. Praise him with all of your heart, i.e. passionately and with feeling.

…Sing and make music from your heart to the Lord. [Ephesians 5:19]

…Is anyone happy? Let them sing songs of praise. [James 5:13]

God is spirit, and his worshipers must worship in the Spirit and in truth. [John 4:24]

…I will sing praise with my spirit, but I will sing with my mind also. [1 Corinthians 14:15]

Lift up your hands in the sanctuary and praise the Lord. [Psalm 134:2]

If we look at other times when we engage with a musical event, it is quite common to see people standing waving their arms around and jumping about. Just look at any modern pop concert where the audience is ecstatic in the presence of the latest teen idol (and could be described as worshiping the singer) – they do not sit mildly in their seats. At a more reserved classical concert, or opera, people do have more of a tendency to stay in their seats, however at events such as “The Last Night of the Proms” the same joyous and highly active behaviour can also be seen. Similarly, take a football match, when your favoured team scores, do you sit and politely thinking “oh well done”, or do you jump up, wave your hands and cheer?

One of my favourite examples of someone fully praising God with all their being is that of David in 2 Samuel,

Then David danced before the Lord with all his might; and David was wearing a linen ephod. So David and all the house of Israel brought up the ark of the Lord with shouting and with the sound of the trumpet. [2 Samuel 6:14-15]

So David said …, “It was before the Lord, … Therefore I will play music before the Lord. And I will be even more undignified than this, and will be humble in my own sight. …” [2 Samuel 6:21:22]

Clearly, this was heartfelt praise and David was dancing and singing before his Lord, without worrying what other people thought of him. He was thinking only of engaging joyfully with God. So much so that he upset his wife by dancing in his underwear. Now, I don’t think I really want to turn up to church in only my underpants, however this example of praising God and not worrying about what the person next to us is thinking is certainly a good example to follow.

If we look the the psalms, as the primary biblical example of praise, clearly praising God is a joyful and noisy thing to do,

Praise him with the sounding of the trumpet,
praise him with the harp and lyre,
Praise him with timbrel and dancing,
praise him with the strings and pipe,
Praise him with the clash of cymbals,
praise him with resounding cymbals. [Psalm 150]

and again in Psalm 47

Clap your hands, all you nations;
    shout to God with cries of joy. [Psalm 47:1]

I would assert that it is natural, when freed from traditions and conventions, for people to engage in joyous praise and worship with their whole body, and this is easier if not seated. I want to praise God, singing with my voice, my body, my mind, my spirit and my heart, passionately and with joy.

– Open Bible: Verses on Singing

Examples: UML: Simple Hello World

Most programming language tutorials start with a very simple “Hello World!” program. This post discusses a very simple “Hello World!” UML model.

  1. UML is a modelling language (Unified Modelling Language). It is a graphical language that is designed for communication about software (though can and is also used for other things).
  2. A model is an abstraction of the real thing, and as such, a UML model is an abstraction of the software which it is describing.
  3. An abstraction of something hides, or simply doesn’t show, certain detail about that something. UML can be used to communicate a variety of different abstractions (views) of the software.
  4. UML is an Object-Oriented modelling languages, hence is best used to model Object-Oriented software. (Although various approaches for using UML to model non Object-Oriented software do exist.)

The Hello World program is, to quote wikipedia,

“used to illustrate to beginners the most basic syntax of a programming language. It is also used to verify that a language or system is operating correctly”

Similarly, I am using it here to illustrate some basic UML syntax. There a many different approaches to using UML. I show here an approach that I like and find to work.

First, let us look at the typical “Hello World!” program written in a number of different programming languages (many others listed here), thus helping us to form a UML abstraction that could be implemented in any of them. [The normal design process would involve constructing the UML model first, but this is not a normal design project.]

Java
public class HelloWorldApp {
  public static void main(String[] args) {
    System.out.println("Hello World!");
  }
}
C++
int main() {
  std::cout << "Hello World!" << std::endl;
  return 0;
}
C#
class HelloWorldApp {
  public static void Main(string[] args) {
    System.Console.WriteLine("Hello World!");
  }
}

Once these programs have been compiled, an executable (binary) is formed and this is what the user executes in order to run the program. Our first UML model is a representation of this executable:

The different things that make up a UML model are known as “model elements”. This model element is an called Artifact and has had the stereotype <<executable>> applied to it. [Follow the links for more detail about artifacts or stereotypes.]

This is a simple model, in UML. It abstracts away all the programming detail, and simply represents the executable. I think, however, that a little more model would be useful, perhaps something that shows a bit about the program that is manifest by the executable.

An option would be to add to our model a package, containing a class, which contains a static method,

Picture_of_Code

and we can show that the executable Artifact manifests this package,

Artifacts

However, although this is a perfectly valid UML model, there are a number things about this model that make it unsatisfactory to me,

  • It does not really form much of an abstraction from the code.
  • Neither is it a true representation of the code for each of the three programs shown above (C++, Java C#).
    • the primitive type String is named differently in each programming language
    • there is no class in the C++ version, nor does the code function require parameters

Looking back at our Hello World programs from above, these are all quite acceptable as a first HelloWorld program. However, although they are all written in Object-Oriented (OO) languages, they cannot really be said to be Object-Oriented programs.  They are all very similar to the C version of the program and thus not very Object-Oriented.

C
int main() {
  printf("Hello, world!n");
  return 0;
}

The (static) “main” procedure/method in each of the OO languages is there as an entry point to the program. If we are to execute a true OO program, this entry point procedure should be used to enter the program’s world of objects. In other words it needs to instantiate an initial (entry point) object and start the object executing.

Following this approach, the above 3 examples could be rewritten as follows:

Java
class Greeter {
  public void start() {
    System.out.println("Hello World!");
  }
}

public class HelloWorldApp {
  public static void main(String[] args) {
    Greeter greeter = new Greeter();
    greeter.start();
  }
}
C++
class Greeter {
  public: void start() {
    std::cout << "Hello World!" << std::endl;
  }
};

int main() {
  Greeter greeter;
  greeter.start();
  return 0;
}
C#
class Greeter {
  public void start() {
    System.Console.WriteLine("Hello, world!");
  }
}

class HelloWorldApp {
  public static void Main(string[] args) {
    Greeter greeter = new Greeter();
    greeter.start();
  }
}

Now all three of these follow a similar structure and a better abstraction can be formed.

We add a property to the executable Artifact which indicates the initial object that is instantiated when the program runs,

and we can now provide a class that is a better abstraction of all three programs,

ClassDiagram

This UML model is an abstraction that is only showing two aspects of the Hello World program,

  1. A view of the binary, or executable, artifact that is produced by a program compiler
  2. A class diagram that shows the class and method that is executed.

All other aspects of the program are not shown.

In a future post I will continue to use the Hello World example in order to illustrate the use of other parts of the UML.

Good Notations (A. N. Whitehead)

…by relieving the brain of all unnecessary work, a good notation sets it free to concentrate on more advanced problems, and in effect, increases the mental power of the race.

Alfred North Whitehead,
British mathematician,
logician and philosopher

Simple Transformations

A simple transformation is uni-directional from a source data structure to a target data structure.

SiTra is (in my biased opinion) the easiest way to write a simple uni-directional model transformation.

SiTra is a simple Java library for supporting a programming approach to writing transformations aiming to, firstly use Java for writing transformations, and secondly, to provide a minimal framework for the execution of transformations. SiTra consists of two interfaces and a class that implements a transformation algorithm. The aim is to facilitate a style of programming that incorporates the concept of transformation rules.

 

Thoughts about life: The Bible is the manual for how to operate your Life

The human spirit, soul, body, and the world we live in is a complex and intricate system or machine. It is both fragile and able to be repaired, giving a sense of robustness. However, as with all complex things, they work best, you get the most out of them, life to the full, by operating them in the way they were designed to be operated. You don’t have to use them the way they were intended, they will function (badly) if used wrongly. I.e. Drive a car with flat tires and no oil, etc. It works, you get from A to B in it, but it gets damaged, doesn’t last long, and does not work so well – bit of a rough ride. Well in order to operate life and yourself correctly, follow the manufactures instructions [Gen 1v27]. Additionally He will repair you as you go, and repair damage already done [Luk 9v11]. Do this and He promises your life be amaizing [Romans 8v2, John 10:10].

Psalm 1: How should one live life?

(based on Psalm 1 [original])

He who follows good advice
How blessed is he indeed
Who keeps others on the path
And gives encouragement in need.

His delight is the Word of the Lord
On this he dwells by day and night
All he does prospers well
Nourished by its power and might

Not the case for wicked men
Who will be blown away like dust
They will not get a righteous end
Or be held account by what is just

For the Lord does guard and guide
The way of those who do what’s right
But the wicked man, he will be lost
In the darkness of the final night

author: Dr David H. Akehurst

If you liked this, consider reading some of my other poems.

(I have always thought that it would be good to read a translation/interpretation of the psalms that actually read like poetry in the English language. I know that many other people have done this, however a few years back I was house bound for a few weeks and had a go at writing poetry based on them. This is one of the results.)

Thoughts about Life: Love God

Humans have a built in instinct to worship and love something. With out God we invent our own gods, made of wood, stone, gold, gems, beer, football, pop stars, sex, money, power [Exo 32v1]. Whatever we choose, we will inevitably focus on and make our life revolve around something. Let us choose purposefully what that should be, and pick something – the someone – that will last for eternity, and is worth worshipping and loving. [Mat 22v37, Det 6v5]

Jesus as Servant

I was asked to speak at my church youth group about Jesus as a Servant. To be honest, although I knew the phrase “Jesus came to serve not to be served”, probably mainly through having heard and played Graham Kendrick’s The Servant King, I had never really though about it much.

I understand to worship Jesus as God, I know to come under the authority and protection of Jesus as King, I know that Jesus as Man understands me, my life, and has grace for me. But I have never considered whether or not I actually let Jesus as Servant, serve me?

These four characteristics of Jesus, God, King, Man, Servant are often associated with each of the four Gospels (Matthew, Mark, Luke and John), with each Evangelist (Gospel writer) writing about Jesus from the perspective of a different one of His characteristics. However, different people seem to associate different Gospels with different characteristics [Wikipedia, Joseph Prince, etc].

(Of additional interest, each of the characteristics and each gospel writer, is also associated with an animal – Eagle (God), Lion (King), Ox (Servant), Man (Man). These animals appear a number of times throughout the Bible [Ezekiel 1:10, Revelation 4:7]. Also in Jewish history [Garland 4.7.2], the Camp of Israel described in the book of Numbers may have used these animals on their banners.)

However, regarding Jesus as Servant, let us first look at the biblical reference to this. Jesus himself emphasised it to the disciples [Matthew 20:26-28],

whoever wants to become great among you must be your servant, 27 and whoever wants to be first must be your slave— 28 just as the Son of Man did not come to be served, but to serve

referring to himself as “the Son of Man” He claimed that He came to serve not be served. Also in [Luke 22:27],

For who is greater, the one who is at the table or the one who serves? Is it not the one who is at the table? But I am among you as one who serves.

Jesus states that He is among the disciples (and us) as one who serves.

At the evening meal just before passover, as recorded in [John 13:2-5 & 13-16], Jesus famously washes His disciples feet. Taking the role of a house slave or servant, Jesus washes and dries the feet of each disciple. The significance of this is probably lost slightly in today’s western society, although we still think a foot wash and massage is very pleasant. At this time in history people walked all day in sandals on hot dusty roads, and it was customary [Wikipedia] to offer a guest water for washing their feet.

A modern-day parallel might be imagined where, when you arrive at a friend’s birthday party, the birthday boy (or girl) washes your car for you. Or maybe they have asked you to a high class restaurant to celebrate and it is the birthday person (rather than a waiter/waitress) who serves the table bringing you menus, food, and perhaps a hand washing bowl.

The two parables told by Jesus from [Luke 14:8-14] imply that putting others before yourself and not giving to or serving those who will repay in kind is the approach He would want people to take.

Not forgetting, of course, the many acts of service actually performed by Jesus – healing, other miracles, teaching, and the biggest act of service of them all – paying the consequences of our bad choices by dying on the cross.

Jesus clearly came to serve. He clearly served whilst physically among us, and clearly emphasised and taught that we should serve each other.

Servanthood is not only a New Testament idea; King David, of Old Testament renown, wrote many of the Psalms, in which he frequently refers to himself as a servant and elsewhere is referred to as a man after Gods own heart – despite the many mistakes he seemed to make in his life.

There are many other examples of people serving in Old and New Testament writings. Even in our current modern-day life, many people talk of themselves as serving, in the police or fire service, in the military, in politics etc. But as Joseph Prince states, all these people have flaws. There is only one perfect servant – Jesus – and it is from Him that we should take our example. As implied in [John 13:3],

It is only those people who truly know that they have everything from God, and who understand their importance to God, that are able to stoop down and perfectly serve – serving out of the overflow of their revelation regarding Gods love for them.

This is how Jesus served during His time among us. Given His resurrection and the consistency of God, this must be how He still desires to serve us. He still wants and is able to serve me, teaching me, healing me, and providing for my needs. His payment for the cost of my ongoing mistakes still stands (His original payment on the cross stands for all people for all time).

So in addition to obeying His asking of us to serve one another, I really should allow Him to serve me and enjoy His gift of service.