Slashdot Mirror


Designing And Building A New Pragmatic Language

ctrimble writes "A bunch of folks on the pragprog Yahoo! Group have banded together to design and implement a 'pragmatic' programming language. Ostensibly, the language is informed by the principles in Hunt and Thomas's well-received book, The Pragmatic Programmer: From Journeyman to Master but the purpose of the language is to help ease some of the pain of development and bridge the impedance mismatch between the academic aspects of a programming language and the discipline of software engineering. The design is still very much in flux. If you're a programmer, this might be a language you'll be using in a few years (or earlier). This is your chance to get in on the ground floor. What kind of features do you want the language to have? What are your PL pain points? Where could this language do better than existing languages?"

14 of 192 comments (clear)

  1. what is a pragmatic language? by Anonymous Coward · · Score: 1, Interesting

    In my mind, Perl is the ultimate pragmatic language. Quick and easy with little attention paid to consistency and orthogonality. I.e., not a "theoretical" language.

    I haven't read this book and I can't find any info at those links. What is a "pragmatic language" and why don't any existing languages meet the definition?

    1. Re:what is a pragmatic language? by turgid · · Score: 2, Interesting
      I've programmed in BASIC (several dialects), FORTH, FORTRAN-77, C (K&R and ANSI), C++, Pascal (Borland TP 7.0), Modula-2, Z80 assembler, 8086 assembler, 80386 assembler, Java and bash.

      I started coding when I was 8 years old.

      My day job involves a lot of shell scripting, Makefiles and the very odd bit of Java and C.

      For pleasure, in my own time, code in C.

      I have found C to be the most pragmatic language I've tried so far, closely followed by Turbo Pascal (I can't comment on Delphi, I stopped using Windows PCs then).

      FORTRAN is completely un-pragmatic. Like the example of PERL given above, it has a terrbile syntax and is inconsistent and unforgiving of errors.

      At the other end of the scale I've tried is Modula-2. This language is un-pragmatic in a different way. It is very orthogonal, rigid and comprehensive. Unfortunately there is so much red tape involved in writing code in this language it is very frustrating.

      C and Pascal (not straight Pascal though) represent a happy medium. I've looked at C++ over the years, read books on it, looked at people's code and tried to write my own, but it's all Greek to me. It is fiendishly complicated.

      Now, FORTH.... don't get me started on FORTH :-)

  2. Wish list by jbrandon · · Score: 2, Interesting

    Strong typing: I'm tired of seeing casting errors at runtime.

    Metacode/macros: Sometimes I would like things done at compile time, especially if they have to do with types.

    Overloading: Can be implemented with a decent macro system.

    OO/functional: So many languages miss one. So few have both (Eiffel, O'Caml)

    So many languages are so close, especially ones w/ active user communities, like perl and C++. They're just not there yet . . .

  3. Strong emphasis from a GUI standpoint. by xagon7 · · Score: 2, Interesting

    We have PLENTY of generic memory moving, scriptable, and interpreted languages that can all perform the same command line batch processing.

    I think we need a language that not only performs those operations but is built with Cross-platform GUI design in mind. I don't know HOW or even it it is simply another part of the standard libraries, but I think you you REALLY want you rlanguage to be successful it should be able to hook into existing GUI APIs and/or implement its own with ease and consistancy. If anything a strong enphasis of a GUI library is a must have.

    Delphi (MAYBE VB) is the closest thing I have seen that allows this. Yes I know the "language" is object pascal, but the IDE allows for quick and semi-graceful GUI design.

    In addition to that if you could implement a pointerless environment with automatic garbage in a FAST way it would be helpful...but allowing for manual overrides if necessary.

    Let the elitist flames begin.

    1. Re:Strong emphasis from a GUI standpoint. by pbox · · Score: 2, Interesting

      Psyco is a very interesting concept for Python. It compiles python bytecode to native, but it is not JIT, rather it takes the code, analyzes it and compiles several versions, of which the optimal one is going to be chosen at runtime. You really need to check it out. It promises about 40% speedup on random py code, but about 400% speedup on algorhytmic code (that counts for scientific apps). that is almost as fast as the equivalent C code. His motto is "High-level languages are faster than low-level ones!"

      Pyrex is also interesting, where you can use C concepts within Python. And the project Weave allows you to directly write C code into Pyhton. With careful design you can convert about 5-15% of your code to C and have an app that runs as fast as a C one, with about 20% of the development time.

      --
      Code poet, espresso fiend, starter upper.
  4. What about a graphical language by Anonymous Coward · · Score: 1, Interesting

    I'm not sure we need another text based language ( ok, I'm not actually a programmer - just dabble a bit ). But isn't it about time we had a graphical language. After all, most software designs do utilise graphs of data types and flows - UML?. Not sure how it would work, or how it could be more than a glorified flow chart. But it may end up being easier to program debug etc. After all - a pictures worth a thousand works.

    1. Re:What about a graphical language by crmartin · · Score: 4, Interesting

      I actually did my PhD and Masters' work with the idea originally being to develop a visual or direct-manipulation (see Ben Schneiderman's stuff if you don't know the term) programming environment. You know what happened? I went to Fred Brooks' original "No Silver Bullet" presentation (see the paper to see the details) and found that I couldn't manage to refute his arguments. (I hate it when that happens. :-)

      The basic argument is this: are the complexities of notation (language, whatever) essential or accidental aspects of the difficulties in programming? Brooks' argument is that the notation is an accidental issue -- that you can't gain, say, an order of magnitude improvement by chaning notation alone.

      This is clearly not 100 percent true 100 percent of the time -- "drawing" a GUI with something like Powerbuilder, Eclipse, or JBuilder is clearly a lot more effective than coding it, even with EMACS. On the other hand, in real industrial development, actual coding is only about 15 percent of the total time and cost invested -- so no matter how wonderful the language is, it can't possibly account for more than about a 15 percent improvement.

  5. Re:... and for God's sake get it right this time! by crmartin · · Score: 2, Interesting

    Oh, just in case I misuinderstood -- there are languages which get a lot of the details right -- eg, Occam makes a pretty good job of defining a semantics for a limited model of concurrency based on Hoare's Communicating Sequential Processes.

  6. Wish List by bwt · · Score: 2, Interesting
    I'd like a language that could run in three different modes: interactive interpreted form, highly portable runtime form, and full natvie speed optimized form. Give me common syntax for each and let them interact. For example, if you want to, you can use Jython to script java code. If you need something to be really fact, you write it in C and us the native interface. Why do I have to learn three syntaxes for this? OK, Jython is dynamically type and Java is statically typed.

    Give me both OO abstraction and powerful bit-twiddling capabilities. If I want a 29 bit variable type, dammit I want a 29 bit variable type. Give it to me and let me do all kinds of low level stuff like shift three bits and mask it and treat the first 3 bytes as a unit. Then let me encapsilate that in an object oriented lock box.

    The language MUST have these things built in: associate arrays, regular expressions, iterators, introspection, "here" documents, both static and dynamicly sized arrays.

    The language should be database savy. This means implicit SQL cursors (like in SQLJ or PL/SQL) so that I can say something like
    DBI_DRIVER.set(driver)
    DBI_DRIVER.login(dbname, user, passwd)
    for current_employee in {{
    select emp_name, salary, start_date
    from employee
    where dept_no = $department }}
    do
    {{update employee set salary = salary + $accounting.calulate_bonus}}
    end"
  7. The 100 year language by t482 · · Score: 4, Interesting

    I think that Alan Kay was way ahead of his time - getting kids to program. I think much like the spreadsheet revolutionized office work by allowing dynamic analysis of data the next big language will be one that is simple enough to allow average office workers to speed up and automate their own work. Abstraction is key.

    VBA is being used currently for a lot of that work - but it is truly horrible. Wharton has started teaching its MBA students Python.

    Check out what Paul Graham has to say about programming languages in 100 years (basically they won't change much).
    http://www.paulgraham.com/hundred.html
    And Artima had a discussion on this topic, "After Java and C# - what is next?". http://www.artima.com/weblogs/viewpost.jsp?thread= 6543

  8. Holy War by Tablizer · · Score: 2, Interesting

    I have been in a jillion language and paradigm wars over the years, (Itsa hobby of mine :-) I have come to conclude that many aspects of programming and languages are purely subjective. What floats your boat may sink mine and visa versa. People process symbols and patterns differently in their head. There is no one right language.

    It also seems that committee-designed languages usually fail because they compromise so much that they don't "sing" to any one group. You need a fan-base to get a language to take off. But, this also means catering it to specific mental types.

    That being said, I have documented a bunch of potential scripting language features and give justification for my favorites in the list:


    http://www.geocities.com/tablizer/langopts.htm

    You may not agree with my decisions, but there is plenty food for thought for anybody researching and collecting lists of language options and alternatives. (I don't cover staticly-typed languages because I don't really like them.)

  9. Enough already? by Fastball · · Score: 2, Interesting
    I don't want to learn any more languages. Are new languages necessary, or can existing languages be extended to meet our needs? Personally, I'd rather it be the latter, but then I'm a thirty year old burnout.

    Man. Anybody else tired of keeping up?

  10. My thoughts by DimGeo · · Score: 2, Interesting

    I think Java is good. It fails at some points (this is by a person with 3+ years of professional Java experience):
    1) No convenient way to call methods by name. Takes quite a few try-catch constructs, etc. What about this snippet:
    Object x = ...
    call someMethod(a, b, c, d) at x;
    or something. Ok, it may throw any necessary exceptions.
    2) No standard way to access DBs. JDBC is a pain. It works, but with lots of workarounds for different dbs. One must implement class loaders, selecting the driver at runtime is terrible, parsing the CREATE statements to replace the data types is way out of bounds.
    3) Terrible with memory management, especially the GUI stuff. There just HAS to be some efficient way to deal with this. Maybe mix GC with ref count + explicit delete statement, which zeros all references to the object (possible with the current Sun JVM implementation, because the references are one step further).
    4) No way collect a few threads, name them an "application", then kill them off. Oh, there is, but you have to worry about bizarre deadlocks resulting from unsent notifications, etc.
    5) The localization is a PAIN. You must write properties files, compare locales, etc. i.e. do all the work by hand. And there is always the temptation to hardcode a string in a hurry.
    6) Nothing really to force you to avoid deadlocks. Some ideas : throw exceptions when deadlock is reached, etc.

    I love the idea of OSGI (my company, ProSyst, is a lead vendor of the OSGI framework). The idea is simple : jar files, called bundles, export and import packages, and register services (objects implementing interfaces both the user and the exporter have access to). Problems : no way to completely kill off (safely) any threads the bundle might have started when it is uninstalled.

    Some suggestions about the new language:

    1) Add call-by-name.
    2) DB support. I saw one message before this one which was very well thought out, and was on this subject.
    3) Add ref counts and explicit delete-s to the GC
    4) Borrow ideas from OSGI - easy plugins, services, etc. Runtime load/unload of components. Runtime SAFE kill-off of entire bundles. Kill their threads, close their files, free their memory. This is done (sort of - the memory freeing comes to mind) with win32 dlls, but no way to do it in Java
    5) Add localization support. For example, some library class which loads the appropriate string tables according to the locale (the easiest solution)
    6) Two ideas here : 1) force the monitor objects to be declared beforehand, and assign priorities. If someone tries to lock these objects out-of-order, throw exceptions. 2) throw exceptions when a deadlock is reached.

    more things to think about:
    - realtime support. Threads which cannot allocate memory, and can only use static memory.
    - good cross-platform gui. Swing is a great idea, I mean its programming interface, no the terrible self dead-locking, ugly implementation. Having platform-dependent look and feel (I *mean* native look and feel, not some "lightweight" blown-out implementation, which slows down to a crawl at the simplest operations). See previous thoughts about deadlocks.

    And about templates : I do not care, really (oh, the horror). Typecasts are not a problem, when you only have one or two types of objects in the same collection. I even prefer there not to be such.

    Now, about the platform:
    How about have the language compile to C or Java (make it an option). Then, make an option to disable the garbage collector (impossible for Java, but a valid options for C). If you compile to C, make sure you use a serious GC, not a conservative one which treats all your data as pointers. Use a Java-like type system. This can even compile to .NET if necessary. Thus, you can target 3 platforms with an ease.

    -- bailing out.

  11. Keeping up just sounds hard -- it isn't really by Anonymous+Brave+Guy · · Score: 2, Interesting
    Man. Anybody else tired of keeping up?

    I think the problem today is that everything seems to be moving on much faster than it actually is.

    Quite a few years ago, I learned to program in C and x86 assembler. They were useful at the time, and I learned a lot about structured programming and such while using them.

    Several years later, I learned C++, and encountered OO for the first time.

    At university, I discovered things like Java and ML. ML was new and interesting, but at the time Java was just underpowered C++ with a heavyweight standard library, and to a large extent it still is. That was when I realised that many "advances" that come along "at breakneck speed" aren't really any different to what you've already got.

    For several years at the start of my professional career, I relied on little more than standard C++ and a few very common libraries (MFC, mainly, and some in-house things). I didn't need any more.

    After a while, I got the feeling I was stagnating, and since I wanted to do a few things that weren't convenient with the C++, I went out and learned some more.

    In the past couple of years, I've learned to generate HTML with XML/XLT, I've learned to write scripts in Perl, I've learned about server side scripting and CGI, I've learned to use MySQL, and recently I've put it all together and written a pretty solid bulletin board web site for a club I help run. And this was just with a few hours now and then out of curiosity; the day job writing back-end C++ without much whizz still pays the rent.

    I guess my point is that three years ago, CGI, MySQL, Perl, XML and all the rest were just buzzwords to me. Everywhere you looked on the Internet, there were millions of pages of tutorials, mostly very bad ones, and people telling you it was the next great thing, radically different to all that's gone before, etc. You know what? I learned the basics of each of these things inside of a day, once I actually sat down, did some real homework to track down a decent tutorial and got on with it. None of this stuff is hard. Just find useful info -- which often still comes on paper, or in the form of docs from the tool provider for high calibre things like Perl, MySQL or Apache, and not from random glitzy web sites and magazines -- and do some reading.

    I reckon if you have a general knowledge of programming in procedural, OO and functional styles, a bit of experience with database design and SQL, a bit of web savvy and familiarity with mark-up, and some general knowledge of modern computers, you can learn any of the buzzword technologies in a week, maybe even a day. They're really not very clever at all; the reason they're buzzwords is that stupid people talk them up to make them sound clever.

    Keep the faith; if you've got solid basics -- as any old-timer in this industry probably does -- you're never far behind the lead edge if you choose to catch up. The only people who claim everything is advancing at lightspeed all the time are marketroids selling new buzzwords, and impressionable kids too new to the business to know any better. The rest of us can well afford to relax, keep an eye on new developments now and then, and simply learn whatever tools we need to do what we want to do, if and when we need them.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.