views:

99

answers:

3

Can someone give me a clear, concise definition of the difference between a programming language and a framework? I have scoured the web and been unable to find an adequate definition.

For extra credit, is it possible for a language and a framework to become so inextricably linked that there IS no difference, or is there such a clear line between them that this isn't possible?

+9  A: 

A language is syntax, grammar, semantics (and perhaps a core library) that implementers are required to support. A framework is a cohesive set of library code that together simplifies programming in any given language.

mquander
That was a good one :)
vc 74
A framework doesn't have to written in the language. It just has to be available to the language.
David
OK, that's fair. I edited my post.
mquander
-1. What you are describing is a *library* not a framework.
Jörg W Mittag
@Jorg - In that case could you specify the difference between a library and a framework?
Ender
@Ender: the difference is Inversion Of Control: you call the library, but the framework calls you. BTW: this question has benn discussed extensively on SO.
Jörg W Mittag
@Ender: The difference is cohesion. Yes, a framework is a set of libraries, but these libraries work well together and have consistent syntactics and semantics.
Frederick
@Jorg: I disagree that what you're describing is an important difference, much less the difference between a library and a framework (which seems like a very wishy-washy distinction to me -- a framework is just a kind of library.) I agree more with Frederick's usage, and I don't mind his edit to my answer (although I want to emphasize that a framework is entirely comprised of code, not a specification.) Feel free to attempt to convince me otherwise.
mquander
Addendum: I changed my mind without Jorg having to convince me. It looks like framework has a technical definition: http://en.wikipedia.org/wiki/Software_framework However, I think my answer still encapsulates the key distinction, which is that a language is a specification while a framework is made of code.
mquander
A: 

A programming language is a specified, standardized method of communication between the programmer and computer (in modern languages, technically it's between programmer and compiler, which "interprets" your code into simpler instructions the computer can work with). It is a pure abstraction that specifies its structure, syntax and semantics; implementations of the language are generally considered part of the environment in which the programmer develops, and incorporate the compiler and any virtual machine implementation.

A framework is a standardized set of pre-written code libraries designed to be used and reused by developers, and is again tied more to the environment. An environment is the intersection of the language, framework, virtual machine or runtime (an abstraction layer in which managed or interpreted code is translated from a machine-independent form into native code) and machine (the hardware layer on which native instructions are executed).

KeithS
-1. What you are describing is a *library* not a framework.
Jörg W Mittag
+1  A: 

Regarding the clear line between language and framework, i suppose you can count DSLs (Domain Specific Languages) as constructs that are both a Language and a Framework ( as it is a Framework in the original Language it is build upon).

Lisp is the only language i can think of now that may blur such distinction:

"The name LISP derives from "LISt Processing". Linked lists are one of Lisp languages' major data structures, and Lisp source code is itself made up of lists. As a result, Lisp programs can manipulate source code as a data structure, giving rise to the macro systems that allow programmers to create new syntax or even new domain-specific languages embedded in Lisp."

http://en.wikipedia.org/wiki/Lisp_(programming_language)

Leonardo Figueiredo