Origin, part 1

The details and tutorials of G# have started going up so it’s a good time to shed some light on how the language came to have its current philosophy, appearance, and behaviour.

Initial Thoughts

As a very short recap, the ideation of the language snowballed from reading a music theory textbook. There are a number of scales; each characterised by its ratio of the number of sharps to flats they contain. A Major has three sharps: C#, F#, and G#. C# and F# are already popular .NET languages, so the notion to complete the trio was a nearly instantaneous goal.

Initially, the language was meant to be a toy language for a senior project. Regardless, I wanted to implement a faithful symbolism of the scale that had inspired it. Above all, it had to embody the leadership trait as this sharp in the scale is known as the leading tone. From here on out, it was a series of questions that came to shape the language. The obvious first obstacle was deciding what the language would look like. Arguably, a cosmetic issue, but who can deny the impact that a look and feel have on any language, even spoken ones? Besides, it did not yet have the purpose it does today. At the time, deciding what would go into the compiler (or interpreter?) was most pressing as it would be the actual deliverable and core of my presentation.


So, what characteristics should be considered to give the feel of a trio? It’s not like C# and F# have that many features in common, both built upon CIL and all that entails not withstanding. What would encourage a sense of fluidity among them? It took no more than simple consideration on the nature of both languages to start making some progress.

C# is a multiparadigm language, but its major strength lies in its object-oriented capabilities. It (obviously) descends from C. As a fun fact for anyone who doesn’t know why it was given a # in its name, recall what C++ represents. C++ is a superset of C and symbolically succeeds it by adding features and using the ++ operator (which increments a value by 1) in its name to show this increased value. Similarly, C# sought to refine the class features of C++ and add its own set of improvements. Though no longer a superset, it still used the same naming convention. C++++ would have been rather inconvenient, so it was opted to place them in a grid.

F#, on the other hand, is a functional language. Turns out it too is part of a lineage. It originally started as (though many would argue it still is) a .NET implementation of OCAML (and thus resembles it strongly). Functional programming features were seen as valuable additions to add to the .NET ecosystem and the search was on to find a feasible candidate. The first language of interest was Haskell. It was an excellent choice and attempting to explain why in this short amount of space would be insulting. Haskell is an amazing language and I highly recommend you look into it if only to broaden your horizons. However, Haskell is intensely faithful to the functional programming paradigm. It enforces purity to what some would call the extreme and .NET’s inner workings were not amenable to these stringent requirements. Rather than a watered down rendition, another language was selected to be the foundation. OCAML is a fantastic choice in its own right and descends from ML (an older language and a pioneer of early modern programming released in 1973, only a year after C).

Naturally, programs written in these two languages don’t look anything alike. Each also requires a different set of principles when designing solutions. For example, functional thinking favours recursion over the looping of imperative languages. By now, it’s apparent that G# doesn’t really have anything to adhere to in terms of design. I was free to pursue any syntax and in fact should not resemble either one so as to not lean in either direction. It needed to be a standalone addition. The camaraderie and fluidity of the trio would need to come from elsewhere. It also needed to be balanced since G# was still meant to stand out as the “leading tone.”

Another thing was clear. C# and F# both had prestigious pedigrees. Surely, a new language inspired by well-established principles would carry more weight than an arbitrary syntax with no more purpose than to be different. Of course, a new set of well thought out principles could be used as this new language’s foundation, but there was something to be said about attempting to further the name of a family that gives it a je ne sais quoi appeal. Suddenly, there’s a sense of mission in its creation. Besides, it would only be the foundation. Nothing said further inspiration from other languages couldn’t occur nor other philosophies and principles used to shape this new language.

Then it struck. This is how the two design goals would balance. G# would be designed the same way the first two were designed. Each was inspired by a strong language family (I like to see them as the royal foundations of the modern languages) and sought to either add features and value to its lineage or incorporate its advancements into a powerful ecosystem and expand the ecosystem’s features and value. However, though being symbolically given the same “birth,” it would be this enrichment of features that would help it stand out as the leader. Selecting what language it would most take after immediately became a crucial decision. C# refined and F# contributed new concepts that didn’t previously exist in the .NET framework. Could G# do both?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: