Designing a Programming Language

As some of you know, I’ve been bouncing around ideas for a new programming language for the last three or four years. I’ve finally reached the stage where I want to start writing some things down and sharing them with others. There likely won’t be much material here at first, but if you’re interested, please let me know.

This page exists to explain some of the goals and objectives behind my designs. First, lets get some legalese out of the way first.

I welcome comments & contributions from anyone who is interested. For the record, I retain any and all rights associated with the ideas discussed here or on any related page. If you make a suggestion or critique you are explicitly granting me rights to use, modify, and republish that idea without restriction. Also note that this is not design by committee. I reserve sole right to make all decisions related to language design or implementation.

Having said that, I will provide credit where due. If you mentioned an idea to me at some point and weren’t given credit, please let me know. I will correct that as soon as I am able.

In general, my aim with this language design is to create something which is suitable as direct replacement for C++. I am not aiming for perfection in language design or anything similar to it. I am perfectly willing to throw ideals under the bus of practicality. My hope is to create a C++ like language which is easier to develop for and less bug prone without giving up the flexibility, power, and performance which have made C++ a cornerstone of the computer software industry for so many years.

Now on to the goals I have for my - as yet unnamed - language. Some of these may seem obvious at first, but please bear with me. Since no language is truly complete without a canonical compiler implementation, I have not tried to separate the compiler and language specific goals.

  1. Suitable for wide scale adoption in a wide variety of applications as a replacement or supplement to C++ and other existing languages
  2. Make the both the easy, easy, and the hard, easier
    • Have the default behavior of the language be safe for most uses, but don’t worry about perfection. That’s where programmer skill comes in.
    • Allow explicit escape mechanism to perform needed work at the lowest level actually needed.
    • Native support (and ease of extension) for “good” design patterns
    • Change syntax in ways which discourages “bad” coding practices and design patterns
  3. Explicit support for parallelism and functional programming concepts, without requiring the total abandonment of structural and object oriented programming techniques
    • Syntax Features: blocks and closures, foreach, global vs thread local storage, etc..
    • Compiler Support: Race condition and dead lock detection (where possible)
    • Core Library: inbuilt locking and threading primitives, etc..
  4. Highly portable and cross platform, without limiting use as systems implementation language
    • Portability is the default, not the only
    • Escape mechanisms explicitly built into the language
  5. Make as much as possible (but no more) provably correct
    • support pre/post conditions and assertion proving when possible
    • optionally allow runtime checking (primarily for debugging)
    • extensible memory allocation model and tracking (near memory safety without expense of garbage collection - unless of course you explicitly request it)
  6. Design for customization and extension
    • Ideally parser should be fully generated by automatic tools given a well defined grammar
    • Hooks into each (well defined) step in the compilation
    • Explicit support for language versioning and depreciation
    • Explicit support for module/library versioning

-