views:

119

answers:

3

Hello there! I have no programming experience but am interested in learning a language.

So reading this section "http://wiki.freaks-unidos.net/weblogs/azul/principles-of-software#extend-your-language-to-match-your-domain" made me curious about programming a single application in 2 or more languages.

How is it actually done?

+1  A: 

A few thoughts:

  • The page you linked to explains pretty clearly how it's done
  • If you are interested in learning a language, this is probably not the place to start
  • Programing a single application in two or more languages is only marginally related to the linked document.

Still, in the face of all that, I'll try to give an example of how this works by analogy.

Suppose you need to work with a group of people on some technical task--ranking chess puzzles by difficulty or testing marshmallows for contamination or something. Suppose further that one of the people on your team speaks only Japanese, another only Portuguese, and the third only Esperanto.

Being blessed with the ability to speak all of these languages fluently, your best bet is to make up an artificial language specialized to the task at hand; this is called a Domain Specific Language, or DSL. It should have all the terminology you need to talk about knights and rooks or silicate nanoparticles or whatever for the task, and not much else. Teach this to each of your team members, and then you can give them all their instructions at the same time. They can talk to each other about what they are doing, ask for help (so long as it's related to something covered by your language) as if they all spoke the same language.

That's roughly what he's talking about.

MarkusQ
+1  A: 

I think you may be trying to run before you can walk. The concepts in there probably require a little programming experience to start with.

The thrust of the article (and frankly poorly expressed) is that when you are programming you often encounter tasks that benefit from a declarative syntax, i.e. you should be able to express the intent of what you want to do and leave the implementation details to a library. A good example is querying a database, it's much more readable (usually) to be able to declaratively describe what you want to do and let some middleware figure out the best way to do it, SQL and Linq are 2 examples of a declarative mechanism for querying data.

This is a very interesting topic, but honestly if you have no programming experience it's probably more of a 201 subject than a 101 subject, get your basics down first.

Tim Jarvis
A: 

Thank you for taking the time to explain the article to me, Markus and Tim. I'll listen to the advices and get my basics down. :)

Actually a few months ago, I went to a Basic programming site and read that Basic could be extended using Assembly. I'm not sure if I word my query right, but I am curious as to how a programmer extend a language. For example, how do one extend the C programming language with say, Python?

More importantly, how do parts of the program written in the different languages communicate with each other?