Inventing a new PL

August 21, 2007

I’d like to implement a new programming language for my personal use. Here are some qualities I’m interested in:

  • small: It should be as small as possible, like lambda calculus.
  • extensible: All syntactic sugar added here. Also, must support compiler extensions.
  • concurrent: need abstract notion of concurrency built in.
  • typed: static is better than dynamic typing, but it should support both.
  • lazy: the implementation can still be strict, but lazy gives more freedom to programmers
  • modules: need a simple, yet reflective, module system.
  • FFI: should be able to easily access foreign code, preferably C-like.

It seems like I could build my language on top of Clean. I’ll try writing some programs in Clean first.


2 Responses to “Inventing a new PL”

  1. Vag Says:

    Explain please, what `reflective module system’ exactly mean?

  2. projectshave Says:

    “Reflection” generally means that you can manipulate something at runtime. Most module systems are static: at compile-time you declare that methods A, B and C are public. A module system that supports reflection would allow you to iterate over the methods, change their visibility (make it private or change the names), wrap methods around those (like aspect oriented programming), redefine the method (replace A with Z), or merge different modules at runtime (implement parameterized modules or generics). A flexible module system that can be modified at runtime allows programmers to implement a wide-variety of features hard-coded into current languages.

    The counter argument, which I don’t buy, is that a static module system allows the compiler to check your code and do a better job of compiling stuff. If it knows you’re calling method A, it can inline it. I believe modern high-level languages should support runtime recompilation to dynamically improve performance; therefore, I don’t need to statically declare anything (except types, which should be consistent). That reminds me of an idea I should post about…

Leave a Reply

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

You are commenting using your 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: