views:

716

answers:

15

I've been designing a pragmatic programming language for 5 or so years, and it probably won't be released for several more years (probably until after my current and next startups succeed or fail).

In the mean time, I have two questions that may prove interesting:

1) What attributes of a new programming language could entice you try it on your next project?

2) What attributes of a new programming language could prevent you from trying it on a project? (i.e. no libraries, ...)

To make sure this question isn't a philosophical debate (thus getting closed by admins), please describe your own tool selection predicates, rather than theorize about the broader population's preferences :)

Thanks!

A: 

New Language - people who work on C++ always look for a language which has better support for memory management without compromising on speed [Java has better management, but slow compared to c/c++].

Qt is really nice in such a way that it takes ownership of children and destroys whenever parent goes out of scope but when you have pointer to pointer kind of stuff, it also fails.

--Cheers

Koteswara sarma
What relevance does this have to whether to adopt a new language?
David Thornley
When did QT become a language?
slomojo
1: Some studies have shown Java to be faster than C++ for long running programs, specifically because of its "slower" memory management.2:Qt is not a language, and does provide smart pointers for the situation described (see http://stackoverflow.com/questions/1481616/smart-pointers-in-qt).
André Caron
@slomojo: when it began requiring a custom preprocessor? (Ha ha only serious.)
Derrick Turk
+16  A: 

For a new general purpose language to gain adoption, I think one feature trumps all others: integration with an existing established platform. You don't have time to write all the libraries a language needs, and why should you have to? New languages like Clojure and Scala are cool in and of themselves, but what has really made them "go viral" is the fact that they target the JVM and and interoperate with Java. Besides the free libraries your language gains, this means people who use it don't have to abandon their old code base overnight; they can instead migrate incrementally over time.

The next big thing is tooling; you need a rock solid, preferably fast compiler. You need an IDE with a debugger. A package manager can't hurt. Most programmers will not tolerate second-rate tools; they'd rather keep writing Java boilerplate, because at least there they have a nice IDE to help them refactor it.

Finally there is the actual technology of the language itself; its new ideas, or novel combinations of old ideas, the cuteness or brevity of its syntax. These are probably the things you, as the language designer, care about most in the language--and it is important. Even with platform integration and great tools, nobody's going to switch to a language that brings nothing new to the table.

pelotom
Thanks for the thoughtful answer Tom. Maybe we should be less drunk when we talk about programming. That way I can remember more of what you say. I don't spend a lot of time thinking about implementation, but I agree that these things are required for a language to even be considered for serious projects. I'm no expert, but I suspect implementing on the JVM (with solid integration) is the best approach right now.
stevewedig
Integrating with the JVM will force the user to use the whole Java infrastructure with all its faults. I don't want to touch thousands of XML files just to run a web app, or fill my RAM (on a VPS) with bloat.
stesch
@stesch - using the JVM certainly has its drawbacks, and there will always be those whose requirements rule it out. I fail to see what targeting the JVM has to do with touching XML files though
pelotom
A: 

The "crossing the chasm" approach is to pick a niche and dominate it - be leaps and bounds ahead of the competition. That will at least give you a shot at further visibility. You have to pick a niche, because, with limited time and resources, you're simply not going to be better at everything - you have to pick something you can excel at.

Even then, I don't think the odds are good, so doing it for your own education and for fun is the best thing. Also: release early and release often!

David N. Welton
+3  A: 

I give you my 2 cents.

1 - Absolute need:

  • Garbage collector,
  • very high level feeling (bonus if it also can feel low level at wish),
  • Readable
  • feel new ; here are some possible examples:
    • have a metapost like linear equation resolver (bonus if convex equation resolver)
    • visual debugger
    • even better metaprogramming feature than Ruby
    • ...

Bonus:

  • impressive graphic library (visible program)

2 - Absolute NO:

  • too Verbose,
  • not fun
  • not portable
yogsototh
high abstraction with low level ability sounds a bit like the goals of D: http://www.digitalmars.com/d/
stevewedig
+1  A: 

First class functions and closures with an easy syntax. Ever since learning ruby and javascript I can't look at any language that doesn't have first class functions and runtime code manipulation facilities.

davidk01
Totally agree. I learned functional programming originally with Javascript, and Python since then. I have trouble going back to thinking in a language without reified function objects.
stevewedig
+3  A: 

1) What attributes of a new programming language could entice you try it on your next project?

Two basic things stand out for me when selecting a language:

  • A different cognitive model needed to use it. Something different than Lisp, Prolog, Haskell, C++, or Perl.
  • Excellent libraries.

2) What attributes of a new programming language could prevent you from trying it on a project? (i.e. no libraries, ...)

  • Lack of libraries
  • Duplication of a solution existing programming languages already have solved.
  • Buggy compiler
  • Compiler that only works on 1 OS.

--

Generally, it has to either perform my goals better or stretch my mind better. Not only a little bit better, but a lot better - enough to justify learning it in a deep sense and committing months of work to it. At the moment, I'm working on understanding Lisp on my own time - learning other languages is only going to happen at the behest of my workspace.

Paul Nathan
I suspect you improve the most when learning new cognitive models, which is along the lines of Norvig's classic essay: http://norvig.com/21-days.html. In some situations, I bet that leads to a criteria that is fairly different from selecting the language best suited to your current project's needs.
stevewedig
+2  A: 

For me it must be easy and understandable to use. It must also solve a business need. And it absolutely must have a first class debugger.

Beyond that, it will have to solve the problems I currently face in C#; which, quite frankly, are very few.

My history runs from pascal to Delphi to VB (oh how I hated those 2 months) to ColdFusion, PHP, Classic ASP, Java on to my current favorite: c#. There was a viable personal and business reason for each change.

Before finally leaping between them I dug in and made the code work. However, for each move there finally came a moment when it was obvious the new language exceeded the previous one. This isn't to say that Java (for example) isn't better today than it once was; just that at the time I moved it wasn't good enough.

Now, if you were able to make a language with a c style syntax that provided better scale out potential (think in the hundreds of servers with 10's of thousands of users arena) then I might seriously consider it. Maybe something with a strong tie in to both a traditional RDBMS and a NoSQL database and an awesome multi-threaded debugger.

Chris Lively
+2  A: 

Here are a couple of my own answers:

  1. (good)

    • encodes lessons learned & best practices: I'd rather not have to re-discover over time what more experienced developers already know.
    • compiles to javascript: I just learned Java + GWT for this reason. I personally believe this is currently the best way to develop sophisticated in-browser programs.
  2. (bad)

    • no static typing: Despite the verbosity of Java, I am in love with the tool support (Eclipse) made possible by static typing. (I'm contrasting this with my Python background).
    • no libraries: I can't build a competitive product if I have to start from scratch.
stevewedig
What kind of tool support does static typing make possible?
Ken
@Ken - Better code completion, basically. Without static typing, if a variable is not declared in the current scope, there's no way to know what methods might be (reasonably) available on it. (I say this as a dedicated Python fan and PyDev user, mind.)
detly
The GWT team chose Java as source language because of the tool support. Here's the post explaining this rational: http://gwt-unofficial.blogspot.com/2008/12/gwt-javascript-and-correct-level-of.html. Static typing gets you: "Code completion, automated refactoring, static error detection, code coverage, testing, and so forth, are pretty hard to give up once you're used to them." As he says, its really hard to give up these tools once you use them.
stevewedig
stevewedig: Static typing does not *get* you those things, though it may make some of them *slightly easier*. Heck, automated refactoring was invented for Smalltalk! (The post you link to only says optimization is easier with static typing, not that any of the features listed here require static typing.)
Ken
@ken: Static typing is required for tools to comprehensively provide these benefits. Without knowing the type of a variable, you can't provide consistent completion and inline documentation. Without static typing, the amount of static error detection you can do is limited. Without static typing, the amount of safe automated refactorings you can do are reduced. There are lots of tradeoffs when choosing between static typing, dynamic typing, or shades of both. However I don't think it is controversial to say static typing enables better tool support than dynamic typing. (btw I'm a Python user).
stevewedig
@Ken - "slightly easier," sure. But the probability of a tool existing is proportional to ease of implementation, and not linearly. At any rate, I don't see how it's logically possible to have `def func(blah)` and have an IDE know what methods to suggest, even if blah's expected class is defined elsewhere. But with `void func(FormData blah)`, it seems almost trivial. Then again, I've never written an IDE and am quite ignorant of the tricks used for code completion.
detly
+9  A: 

My biggest absolute no is any language that doesn't treat its users as consenting adults and tries too hard to enforce its vision of "correct" programming. To me a language should make it easy to write good code, not hard to write bad code.

Examples:

  1. Purely functional languages.
  2. Requiring that everything be declared inside a class to force OO-style programming.
  3. A general avoidance of highly expressive features (lambdas, operator overloading, dynamic typing, type inference, default function parameters, etc.) just because they can lead to obfuscated code when used incorrectly.
  4. Extremely rigid type safety, even when I explicitly ask to get around the type system.
  5. Pedantic "features" like checked exceptions and requiring that every file contain only one top-level, public class.
  6. Abstractions that you can't get underneath when there is no good technical reason for these limitations.
dsimcha
+1 for so explicitly describing Java without naming it!
André Caron
Your description, as stated, goes against the use of domain-specifc languages which would typically try to enforce a programming model. Domain-specific languages can be a significant aid and speed up a project, although when poorly chosen or designed, a significant hindrance.
André Caron
@Andre: I generally hate DSLs (Matlab and to a lesser extent R come to mind) too. I feel like every number crunching project I do, even if it's tiny, needs to step out of their rigid programming models at least a little, and even this little bit is enough of a hassle that I almost always prefer Python or D plus a good plain old library for anything >10 lines of code.
dsimcha
As both a Python *and* MATLAB user, I have to partially agree. I frequently find myself wanting to pass from MATLAB to Python. However, I can't generalize this feeling. I like Django's template language *in combination* with Python because I get the best of both worlds: `print` statements and string interpolation suck at generating HTML and a the template language sucks for general purpose computing. Perhaps what makes it even better is that you can extend the template language by writing custom tags and filters in Python!
André Caron
On one hand, I agree with the examples you list. I'd prefer a language that targets skilled developers who often have good reasons for doing things. On the other hand, teams are made of multiple consenting adults sharing a codebase. So I think there is complexity reducing value in enforcing conventions (as opposed to TMTOWTDI).
stevewedig
I think you have it backwards with purely functional languages. Functional languages almost invariably bend over backwards to allow imperative constructs because they recognize that sometimes you just need effects. Imperative languages, on the other hand, usually make purely functional programming difficult if not impossible. The difficulty of programming imperatively in Haskell is much less than the difficulty of programming in a purely functional style in Java or Ruby. I suspect the difference is that you *try* to program imperatively in functional languages *but not vice-versa*.
Chuck
+2  A: 

What would be cool:

  1. A language that just understands concepts as "Numbers" and "Text" and doesn't make ME choose between int16, long, double or latin1, utf8, utf16.

  2. Programming modal/concepts/ide that makes threads/multi-core a breeze.

What would be uncool:

  1. Compiler/Interpreter crashes. The Language should expect idiot programmers ;-)

  2. Unexpected/unreliable results or behaviour.

Bob Fanger
I agree that reifying the distinction between the concept Number, and the varying representations it has in a machine is a good idea. In the common case, I don't care what representation the compiler uses (as long as I get the correct result). However when you need to serialize or optimize, you need to be able to take control.
stevewedig
Also, my understanding is that Clojure has some innovations in programming model for threads/multi-core. I've read the book, but haven't had time to try them out yet.
stevewedig
I can't say I agree with removing the different types of numbers and strings. If I compute something like x=sin(y), a program that computes the result accurate to 1,000 significant digits is going to take many times longer than one that computes it to 15. If what I need is 15 significant digits, I don't want a language that insists on computing 1,000. Essentially everything that can be done with text, other than I/O, can be done with UTF-32, but a language that insists on using UTF-32 or everything will use up to twice as much memory as one that uses UTF-16, or four times as much as UTF-8.
supercat
@supercat: I guess my view is that you should be able to easily specify that behavior you want. There are lots of everyday examples like yours requiring this. However, you shouldn't be forced to over-specify representation when it doesn't really matter to you.
stevewedig
@stevewedig: There should be a means of allowing the compiler some extra flexibility, but that's actually giving the programmer more control rather than less. For example, there should be an option in C to specify that a variable is needed which can support numbers in a certain range, but that the compiler is free to do whatever it wants it they go outside that range. This may improve efficiency if variables smaller than a machine's register size get mapped to registers, since it would eliminate the need for special-purpose code. But that doesn't sound like what you were after.
supercat
I'm not really sure what I'm after. It is more of a vague design heuristic than something well thought out. I think software development proceeds roughly in this sequence: A) Do the easiest/hackiest thing to get the tests passing, B) refactor/clean to maximize simplicity, C) trade some of that simplicity for efficiency (space/time). I think your range idea is a great feature for step (C). But if the language forces me to specify ranges up front (int32 vs int64), then that slows me down during steps (A) and (B) where I'm focused on correctness and simplicity. Plus, most code never gets to (C).
stevewedig
+4  A: 
  1. Garbage collection. It's like air. There are very few cases where I don't want it. If I don't want it chances are I'm willing to do some sort of dance to make a vacuum chamber.

  2. Decent String support. Pretty much everything these days involves string manipulation.

  3. Exceptions. Unless you have something actually better. Go's tacked on exceptions remind me of the cat puking on the floor.

  4. Libraries. Despite what Lisp programmers say. I don't want to spend any of my time coding for database inter-connectivity.

  5. Objects. Somethings really want to be objects. Database connections for instance.

  6. Lambdas. Somethings want to be functions not objects.

  7. CPAN. Not specifically CPAN but something filling it's shoes. There may be value in a license compatibility check.

  8. Optional lazy evaluation. This is pure wish list. Sometimes you want to get data lazily and have it look like everything else. There probably needs to be some sort of mechanism to ensure non memory resources get released in a timely fashion.

Jason
Should optional lazy evaluation be baked in more than python's iterators and generators? My feeling is yes, but I haven't used enough Haskell to have any concrete examples.
stevewedig
Haskell's laziness is great for computation. For IO it makes me a bitnervous. If I have a lazy file read, I want to be reasonably sure thatthe file gets closed when I'm done with it. Even if I don't read theentire thing. Of course, there is a reason the enabling functionsnames begin with "unsafe".
Jason
+1  A: 

If it has the letters 'J', 'A', and 'V'.

EDIT: BTW, I answered this for the "not try".

muntoo
+1  A: 

Documentation Whenever I think of adopting pretty much anything new -- be it an API, a framework, or a language -- I want to make sure that there is solid documentation so I can get it working and/or resolve problems quickly. I realize this is not a language feature per se, but one thing I really like about python is that it's very easy to add documentation to functions and classes, and very easy to get access to that documentation directly from the console.

Are you planning on making this open source? If so, go ahead and release it now. Everyone will understand that it's in alpha stage, but waiting until it is "ready" sometimes means it is never ready. Having a lot of early adopters and users means that you'll have the second important feature for a programming language:

Jordan Reiter
It will be open source, and I just commented on the original question explaining why there isn't anything release at this moment. Thanks for your advice!
stevewedig
+1  A: 

Bear with me, as I'm writing this from my mobile phone.

The reason I'll personally go for a new language & try it out are the following:

  1. The purpose it was created: Pascal was first an educational language that gain worldwide popularity. Java gained popularity as you could write mobile applications. For C++, the fact that it was designed to write kernels, you get the point.

  2. Readability: Java & Pascal are easier to read source codes (close to the english language) than its C++ counterparts with many pointers. If language can be easily programmed and source code can be easily read, that will constitute to easy documentations and source tutorials.

  3. Can run on multiple platforms: The reason I haven't played with Objective C & X-code is simple, I don't own a Mac. I can develop on .NET platform in linux with Mono. Adobe released Flex whose compiler is written in java & runs on any platform. You can't leave one demographics of developers.

  4. IDE integration: not ideal but IDE's have advantages.

In essence, what I'm trying to say is that a new language exists based on:

  • Problem existing languages have & the creator of the new language thinks that he/she has a better solution that can work in his/her new language.
  • Do what Apple does, You must have a Mac and X-Code (or Mono Touch) to program iPhones, etc.

Focus on Point #1 (which I think is priority) and work from there. That's how Microsoft came up with C#.

Hope my 1 cent worth helps! :-)

The Elite Gentleman
You're clearly better at using your phone than I am! I agree with all of these. I spend the most of my effort trying to improve #2 readability (and more generally simplicity). Also, I wonder what purpose (#1) would appeal to you now and over the next 5 or so years?
stevewedig
@stevewedig, lol....For purpose #1, anything that can handle complex number crunching without eating CPU (e.g. writing a 1024MB encryption algorithm and encrypt a 200TB file) will definitely get my attention.
The Elite Gentleman
+1  A: 

The only thing that would absolutely entice me to try a new language would be a language that's at least as high-level as what I have now, and at least as flexible (e.g., w.r.t. metaprogramming). The good news is that I'm willing to try anything once, especially if it has crazy new ideas, so this isn't a rule set in stone. :-)

Things that would tend to turn me away from trying a new language, again not absolutes:

  • if it didn't have a repl, I'd probably be much less inclined to try it

  • if its syntax is complex, I'd probably avoid it entirely, because life is too short to become a language lawyer in yet another arcane syntax

    For example, Ruby syntax, if you took out some of the crufty old corner cases, is about the right level -- adding complexity beyond that, like Perl or C++, just means that I'm going to spend more time thinking about the syntax than the program, and that my text editor is never going to work quite right with it -- you don't need complex syntax for good language features.

    (If you grok Perl and C++, cool, more power to you. I mean no disrespect to you or your language. I personally can't figure them out, so any language with that level of syntactic complexity is not for me.)

  • complete lack of tools

    You don't need everything right away, but if all you've got is an interpreter, especially one written in C, it's certainly going to seem like a language not built for metaprogramming, and so I'll not have much interest in it. (Extra bonus points for being self-hosted!)

  • being called "pragmatic"!

    Ouch ... sorry. But that sounds to me like a language aimed at solving one kind of problem, and I want general-purpose tools. (I don't think their creators ever called C or Lisp or Smalltalk "pragmatic", and I want to learn the next C or Lisp, not the next PHP or Java.)

  • if it depends on some very different platform for key functionality (like C or the JVM, if the language isn't otherwise much like C or Java), I'm less interested

    This one is admittedly in stark contrast to what other people have already written. For example, I'm less inclined to try Clojure because it's on the JVM. They seem to have less incentive to build good new native libraries, and if I just wanted to glue existing Java-language libraries together, Java itself is pretty good at that. The kinds of metaprogramming I do today would be impossible in Clojure-using-Java-libraries, because they're black boxes.

    Also, over the years I've used native libraries, and "just wrap a C library" libraries for HLLs, and the "wrap a C library" solution is always much more complex, which means it's harder to set up, and when (not if) I run into trouble, much harder to debug. So if you say you've got a new system that can use all my existing libraries, I just hear "cross-language function call debugging nightmare".

    A powerful and flexible language needs far fewer libraries than weaker languages. If I had to write a C program that needed a linked list, I'd probably look for a library (maybe Glib). If I had to do it in Python, I could probably write one in less time than it took to find a library. And that's not even the easiest language for writing a linked list!

    If I'm moving up in the abstraction spectrum, it means I'll need fewer libraries than I'm using now, which is already "not very many". So make a great language, and we'll figure out libraries if we need them, using the new metaphors for this language. Any time spent wrapping <string.h> or java.lang is a waste of time, to me.

I guess a few of my remarks are the opposite of what other people have said. The possible interpretations are either:

  1. they're right, I'm wrong
  2. I'm right, they're wrong
  3. none of us know what the heck we're talking about, and you should just make something cool for yourself, like Dennis and Ken did :-)

Good luck, and I look forward to seeing what you make. I think 5 years of design time is a lot more than a lot of successful programming languages get!

Ken
Thank you very much for your thoughtful answer. I'm curious to explore more how people interpret "pragmatic" in this context. My intent was to communicate that our design goals are pragmatic, rather than academic. Mostly we're looking for ways to make small software teams more productive and competitive, starting with our own. But if "pragmatic" causes people to lump us with PHP and Java, and contrast us with C, Lisp and Smalltalk, then I'll need a different word :)
stevewedig