The Artima Developer Community
Sponsored Link

Weblogs Forum
English-centric Programming Languages vs DSLs

16 replies on 2 pages. Most recent reply: Jul 18, 2006 9:40 AM by John Cowan

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 16 replies on 2 pages [ 1 2 | » ]
Andy Dent

Posts: 165
Nickname: andydent
Registered: Nov, 2005

English-centric Programming Languages vs DSLs (View in Weblogs)
Posted: May 6, 2006 2:00 AM
Reply to this message Reply
Summary
If you don't speak English, what programming languages are the best fit and does this radically change how you develop Domain-Specific Languages?
Advertisement

Some languages allow you to effectively define your own language, often used for DSL (Domain-Specific Languages). The best-known examples of these are Lisp and Forth.

As an English speaker (now with Aussie accent) and in awe of the multi-lingual Europeans I meet, I've wondered if the English-centrism of programming languages bothers people and is seen as a productivity barrier?

The obvious spelling issues of words like "if", "then", "while" etc. are probably not a major pain to learn.

How hard do people find dealing with the language semantics if their native language has different verb-noun rules?

Is there an optimal programming language to learn if your native language is not English and you don't know English?

Perl famously allows you to code many different styles to solve a given problem, the direct opposite of the Pythonic style. Does this mean Perl code around the world exhibits more variety due to native language semantics?

(disclaimer: I know very little Perl but haven't any particular prejudices)


Kevin Lawrence

Posts: 13
Nickname: kevlaw
Registered: Feb, 2005

Re: English-centric Programming Languages vs DSLs Posted: May 6, 2006 8:27 AM
Reply to this message Reply
I am an english speaker and the noun.verb() construct bothers me.

Kevin

Kay Schluehr

Posts: 302
Nickname: schluehk
Registered: Jan, 2005

Re: English-centric Programming Languages vs DSLs Posted: May 6, 2006 9:35 AM
Reply to this message Reply
I'm a non-native english speaker and I consider the use of english in the programming domain as a particular kind of jargon just like the former latin that was the linua franca among medieval scholars. Above all a language is a communication medium and although I have a hard time processing english in my brain ( a language that I do read much but listen only sometimes ) I prefer it this way above having incompatible localizations and culture specific ideolects. This is even more so since PLs create by themselves a diversity/manifold. I'm working intensely and with quite some passion about DSLs in Python but I'm still a sceptics of the whole DSL/mutable language approach and I'm not sure that we won't drive ourselves in the next hell that we could call the "DSL hell" this time. On the other hand I worked once for Alcatel and we had to maintain a piece of code from a spanish programmers group - equipped with spanish comments. I remember we had a lot of fun besides being annoyed... The DSL hell could be a very funny place.

Joao Pedrosa

Posts: 114
Nickname: dewd
Registered: Dec, 2005

Re: English-centric Programming Languages vs DSLs Posted: May 6, 2006 4:52 PM
Reply to this message Reply
As a Brazilian Portuguese speaker, I think non-English speaking people prefer languages that have a defined set of English constructs that they can learn once and use it forever.

PHP, for example, is a language that many people throughout the world can bear, because it has a set of hardcoded methods that anyone can learn by heart, while making HTML and JavaScript straightforward.

Before PHP, ASP/VBScript was a popular combination around here.

On the other hand, I see languages like Java, that even have conventions for long (descriptive) method names, like:
getSomethingMadeOfSomethingElse (exagerated, but it's an example)

Java is way too verbose, technology-wise and "English-wise". And for that reason it's a little bit harder for non-English people. Luckily, the famous auto-completion and online help (F1) can be used to make development "easier" (bearable).

I assume DSLs make it harder if they aren't popular enough, because they can have their own set of documentations and conventions.

The best way to help the non-Enlgish speaking people is to create and support a popular language that has great development tools and has a well-defined core, to keep the things straightforward.

Andy Dent

Posts: 165
Nickname: andydent
Registered: Nov, 2005

Re: English-centric Programming Languages vs DSLs Posted: May 6, 2006 11:12 PM
Reply to this message Reply
> As a Brazilian Portuguese speaker, I think non-English
> speaking people prefer languages that have a defined set
> of English constructs that they can learn once and use it
> forever.

Good point and a good argument for API stability.

> On the other hand, I see languages like Java, that even
> have conventions for long (descriptive) method names,
> like:
> getSomethingMadeOfSomethingElse (exagerated, but it's an
> example)

Thanks, Joao, for making this point. Smalltalk and Objective-C tend to have effectively long method names because they have keyworded arguments.

This makes the length of original method names worse as you can have long method names plus a "tail", eg:


[path appendBezierPathWithArcWithCentre:center radius:radius startAngle:0.0 endAngle:theAngle clockwise:NO];

so the entire method name is

appendBezierPathWithArcWithCentre:radius:startAngle:endAngle:clockwise:


("Cocoa Programming", Anguish et al, p727)

The silly thing is that those method names don't really need to be that fixed in that long if you consider the signature is the combination of all keyworded arguments and modifiers - there's no reason why a language couldn't accept those in any order as a unique set.

Furthermore, if you had a synonym processor in your environment, you could have a preferred order for display, if someone wanted to view such code in the English vs Portugese manner.

As you say, the very basic syntactic constructs are small enough to learn as a formal language - it's the DSLs formed by method names like the above which can embed the coder's native language and slow readers with a different background.

piglet

Posts: 63
Nickname: piglet
Registered: Dec, 2005

Re: English-centric Programming Languages vs DSLs Posted: May 8, 2006 4:09 PM
Reply to this message Reply
I am glad English has become the standard for programming languages. I find the english syntax to be simple, concise, and logical. If you compare the same text in different languages, the english version is always the shortest. For programming, as for other kinds of technical/scientific communication, short and simple is preferable as long as you don't lose precision.

English has abandoned most grammatical verb and noun forms, without losing precision. English hardly cares about grammatical gender. The english grammar has many nice constructions combining succinctness and expressivity. And of course words tend to be short, due in part to the lack of endings. I like program code that can be read like natural language, thanks to the use of explicit, unabbreviated names for language constructs. This is hard to imagine, say, in German. Compare:

English: add, sort, copy, close, clear, save, get, set

German: hinzufuegen, sortieren, kopieren, schliessen, freimachen, sichern, holen, setzen

French: ajouter, trier, copier, fermer, effacer, sauvegarder, obtenir, fixer

(Some of these translations do not convey the exact meaning, e.g. set and get, so crucial in OO programming, don't have adequate counterparts in German and French.)

German-speaking programmers usually code in English. I am curious how natives of other languages handle this. In Québec, the standard is to code in French, especially in the administration. The results of this policy are not beautiful. French doesn't lend itself well to programming. The accents are an issue. Without the articles, it sounds wrong. You can't group nouns together, as in "data base column name". You have to say "nom de colonne de (la) base de données". Try this: obtenirNomDeColonneDeBaseDeDonnees(). And imagine that this has to coexist with language constructs based on English. In Java, you have the keywords in English, you have to observe the get/set convention, you make extensive use of libraries that are all designed in English. You simply can't combine this with another language without producing gobbledygook. It is an abuse, an insult to both languages. It may however have the advantage of making outsourcing to India more difficult ;-)

Calvin Mathew Spealman

Posts: 13
Nickname: ironfroggy
Registered: Aug, 2005

Re: English-centric Programming Languages vs DSLs Posted: May 8, 2006 6:55 PM
Reply to this message Reply
An interesting solution to this problem can be seen in the pre-pre-alpha versions of Subtextual, a programming environment that keeps your code in a database, rather than source files. an interesting result of this is that references between constructs are kept internally, you never get syntax errors or missing names, and the labels put on things doesnt matter a single bit for the execution of the program because all labels are just for the developers benefit. All that is needed is to extend the model to allow multiple, locale-encoded labels for every construct, and you could have programs written that change language depending on your preference.

Andy Dent

Posts: 165
Nickname: andydent
Registered: Nov, 2005

Re: English-centric Programming Languages vs DSLs Posted: May 9, 2006 4:01 AM
Reply to this message Reply
Thanks, Calvin, for the link to Subtextual.

In my research for CEDSimply I have come across an encouraging number of people expressing similar sentiments but they have a particularly clear manifesto http://alarmingdevelopment.org/index.php?p=5

Storage in a database is just an implementation detail, there's no reason why you can't have storage in a textual format with abstraction of locale as you edit. (This is not a request for yet-another-XML-language.)

What about Mandarin speakers - would ideogram support make a difference in a programming language?

Calvin Mathew Spealman

Posts: 13
Nickname: ironfroggy
Registered: Aug, 2005

Re: English-centric Programming Languages vs DSLs Posted: May 9, 2006 4:57 AM
Reply to this message Reply
I have to disagree about Storage in a Database being just an implementation detail and this being realistically acheivable with the continuation of text-based code storage. The problem is that as long as you can still use notepad to work with the code, someone will do so and at that point will break the code so that it still functions but is not useable for the features that you are looking for with languages, or the other things that can be accomplished. Text files need to be dropped, is my view.

Tim LS

Posts: 37
Nickname: parchandri
Registered: Jul, 2005

Re: English-centric Programming Languages vs DSLs Posted: May 9, 2006 6:09 AM
Reply to this message Reply
Disclaimer: I'm not a native speaker, but I have experience using Japanese and Chinese character entry, and know native speakers.

Chinese characters are fairly hard to type, even with practice. There are lots of different systems for entering characters, I've found phonetic ones easier to use. People fluent only with Chinese would have two difficulties programming with roman characters: Chinese is ambiguous to read if typed phonetically (especially without tone markers). And roman characters are hard to read without practice. (Of course this automatically becomes less of a problem over time.)

With Japanese, on the other hand, use of phonetic kana (hiragan/katakana) gives a standard way of entering kanji. You can just write everything in Japanese in kana, and hope to read it, but native speakers find it much harder to read than the normal text with mixed kanji and kana. (The Japanese writing system is really interesting by the way - I highly recommend learning about it!)

I have seen Japanese/Chinese source code - written using English terms, and native comments, which seems a reasonable compromise for programming languages not supporting ideagrams. I think in practice they learn a lot of english programming terminology (stack, list, array, if, integer, ) and sometimes mix english and japanese terms in identifiers. But for local variables they sometimes just use short names, a, b, etc, and use comments to indicate meaning if it's not easily described in pseudo-english.

So a good thing about ideagrams would be that they would convey the meaning with much less ambiguity. Another good thing is it should be faster to read.

A possible difficulty with ideagrams is that their interpretation can be slightly context sensitive. E.g. Japanese re-uses the same ideagrams for day and sun, month and moon, although in context (and in the spoken language) they can be distinguished.

Another thing I think worth mentioning is that punctuation characters are different in these languages than from English. (in terms of sentence end marker, parenthesis, speech marks, etc). So how to talk about operators/special characters would need to be carefully thought about.

All that said (it may sound discouraging), I think it would be really nice to have a programming language that doesn't just understand ascii, and a lot of Chinese/Japanese programmers might appreciate it if it's a good one!

Jeff Heon

Posts: 40
Nickname: jfheon
Registered: Feb, 2005

Re: English-centric Programming Languages vs DSLs Posted: May 9, 2006 6:50 AM
Reply to this message Reply
> curious how natives of other languages handle this. In
> Québec, the standard is to code in French, especially in
> the administration. The results of this policy are not
> beautiful. French doesn't lend itself well to programming.

I guess the standard in the province of Quebec varies on the city and industry. I've worked in Montreal city or around for different consulting companies or software shops, and now I'm working for an local financial company. In these places, the standard has always been to code in English and comment in English. I also worked for an international company based in France (Gemplus), and the standard was English too. Mind you, most of the companies I've worked for had a healthy mix of cultures, and English is usually the common language. I've never worked for the Quebec Government though.

Anyhow, I was raised in French, and I absolutely agree that "French doesn't lend itself well to programming." To me, it doesn't feel right to program with French variable names.

I also agree with piglet on shortness and directness of names in English.

piglet

Posts: 63
Nickname: piglet
Registered: Dec, 2005

Re: English-centric Programming Languages vs DSLs Posted: May 9, 2006 8:39 AM
Reply to this message Reply
Jean-François: "I guess the standard in the province of Quebec varies on the city and industry." Right. Coding in French is enforced in government departments. I have seen it in the private sector too but it is probably not the rule.

Calvin: "All that is needed is to extend the model to allow multiple, locale-encoded labels for every construct, and you could have programs written that change language depending on your preference." In this system, how do you share libraries? It is true that plain-language labels are there for the benefit of the programmer, not of the computer, but I don't like the idea that they are superficial to the programming constructs. From my programmer's view, the program *is* the textual code that I write and not the references that the compiler extracts from that code.

And: Would you also allow localization of the syntax?

Andy Dent

Posts: 165
Nickname: andydent
Registered: Nov, 2005

Re: English-centric Programming Languages vs DSLs Posted: May 9, 2006 9:37 PM
Reply to this message Reply
piglet asked
>Would you also allow localization of the syntax?

That is one of the core things I have been debating in the CEDSimply design - to me that is a logical consequence of expanding a language design to allow synonyms and encourage use in non-ASCII languages.

My dismissal of the term "database" earlier was based on two things - I think it leads people to make assumptions about shared repositories and I firmly believe programs should be able to be serialised into a single document format (eg: Smalltalk VM images).

The other experience I have, about which I will blog sometime, was using Object Master which provided a Smalltalk-like environment, with storage in standard Java, Pascal or C++ textual source files.

Obviously, a rich environment is required if you have various pictorial and possibly other enhanced text renditions - something like an XML encoding or RTF would be required.

Looking to programming on tablets, PDA's or other gestural environments, even English-speaking programmers may find ideogrammic renderings more convenient - something a bit like a more legible UML, not a full-blown visual programming environment. I think it is highly appropriate that parts of a software system remain in diagrammatic form, even if they are implemented by a code generator.

It is worth noting that some of the most successful "visual programming environments" combine a visual layer with components implemented in traditional languages eg:
- Serius http://en.wikipedia.org/wiki/AppWare
- Viper http://www.scripps.edu/~sanner/python/viper/index.html
- LabView http://ftp.rasip.fer.hr/research/labview/example3.html

Gerry Rzeppa

Posts: 1
Nickname: osmosian
Registered: May, 2006

Re: English-centric Programming Languages vs DSLs Posted: May 15, 2006 10:10 PM
Reply to this message Reply
Our "manifesto" (just two pages of large type, available at www.osmosian.com) suggests that the ideal programming tool is, indeed, natural language, and we offer our Plain English compiler as proof of that concept. We presume that similar compilers be developed for other natural languages so we can all begin to communicate with our computers as if they were HALs or C-3POs. Take a look, or contact us: help@osmosian.com.

Andy Dent

Posts: 165
Nickname: andydent
Registered: Nov, 2005

Re: English-centric Programming Languages vs DSLs Posted: May 16, 2006 1:20 PM
Reply to this message Reply
I think the osmosian website is elegant and beautiful I've seen but you could do with a readme explaining how to drive the sample program. I had to read the source to realise I could type in keywords to get images drawn.

The language is interesting, looks like Hypercard meets Proce55ing with a dash of Python (indentation) and Logo.

I suspect, like Hypertalk, it can be harder to write than people may think. It depends on how sloppy your Plain English is allowed to become before it is a syntax error.

I liked your choice of a simple impressionist filter as an example program - it's very impressive visually.

To compare with a similar example in Proce55ing, see the Pointilist renderer http://www.proce55ing.org/learning/examples/pointillism.html

Proce55ing combines Java for "scripting" with an amazingly powerful environment to simplify all the framework access for drawing and animation (plus other features). So, it loses points on the language!

To get an example of its upper limits there is a 1000 line animated word frequency visualiser at http://www.toxi.co.uk/p5/base26/ that is awesome (make sure you try clicking on the graph).

Flat View: This topic has 16 replies on 2 pages [ 1  2 | » ]
Topic: English-centric Programming Languages vs DSLs Previous Topic   Next Topic Topic: Duck Typing, Libraries, and Concurrency

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use