Archive for September 4th, 2006

September 4th, 2006

Continuum Languages

by Tim Cull

I would like to see a new breed of programming language. I’ve been seeing lots of talk lately about functional languages like Lisp, and it’s been a good reminder that the currently popular way (ie. object oriented languages) isn’t necessarily the only or even the best way.

I remember being so excited by Prolog the first time I learned it in college. Using it felt like I was telling the computer: “here’s what I want, now go figure out how to do it.” I remember thinking that was the coolest thing in the world. So why have I never used it in reality-land? Well, at the time you couldn’t build a GUI out of it, or interface it with anything useful, and if you started getting into useful and interesting problem spaces, you ended up having to figure out how to make Prolog do what you want, rather than tell it what you want and let it figure out how to do it.

So there’s that.

From another angle, I’ll often times have a problem to solve where I just care that the solution my software comes up with is “close enough.” That’s because I live in reality-land where the Real Number Line is real and there are an infinity of points between 1 (true) and 0 (false). But computers don’t live there. They can only pretend to live there if we give them algorithms and approximations for filtering an infinity of possibilities into a one or a zero.

So smash those two wants together and you get what I’m thinking of as a Continuum Language. At this point this is mostly a 10%-formed idea that started brewing in my head a couple of days ago. But here’s what I have so far…

Start with a program like this (obviously very high level):
1-Make money;
2-Sell widgets;
3-Where 1 and 2 conflict, 1 is more important;

Or the next step, like this:
1-Make money;
2-Sell widgets;
3-Where 1 and 2 conflict, 1 is 3 times more important than 2;

If you’ve only got 2 variables, this program isn’t very interesting. But if you’ve got many more, it’s much more interesting.

How do I boil that down to its most primitive concepts to make a language?

Something else I’ve also always wanted to say easily in code:
1-Log this message 30% of the time you get to this line
2-This input field should mostly look like (510) 555-1212.
3-Do this very expensive and usually unnecessary validation step with %40 probability.

Anyway, a thought still brewing. Hopefully I’ll come up with something more concrete over time.