Tag Info

New answers tagged

6

Is each and every language written in C language? A language is a set of abstract mathematical rules and restrictions ("if I write this, that happens"). It isn't written in anything, really. It is specified, usually in a mixture of a formalized subset of English, mathematical notation, and maybe some specialized specification language. The syntax is ...


1

Obviously not. How could the first C compiler be written in C if C wasn't exist before? This isn't the chicken and the egg problem. There are many ways to write the first compiler of a language which are called bootstrapping Moreover most compilers try to achieve self-hosting, or compile itself it its language, mainly to promote the language and the ...


1

I would make this a comment if I could, but I can't so here goes: One of the reasons C seems so ubiquitous is because it is one of the earliest languages developed, and an enormous amount of modern languages are based off of its structure (Java, Go, PHP, Perl, etc.) - making it seem like it's more places than it is. Another oft-forgotten reason is that in ...


16

Most of the core of many important languages is written in C, but things are changing: the reference implementation of Python (CPython) is written in C (but there are other implementations written in other languages, e.g. Jython / Java, PyPy / Python, IronPython / C#...) PHP Zend Engine is written in C very first Java compiler developed by Sun Microsystems ...


47

No. OCaml, Haskell, Lisp dialects like Scheme, and several other languages are often used in the development of hobby languages. Many languages are implemented in C because it's a ubiquitous language, and compiler-writing tools like lexer-parser generators (such as yacc and bison) are well-understood and almost as ubiquitous. But C itself couldn't ...


6

No, some languages pre-date C. And many are implemented independently of C, e.g. see http://en.wikipedia.org/wiki/Lisp_%28programming_language%29 Also, see http://blog.terrencemiao.com/archives/the-family-tree-of-all-the-programming-languages-you-even-only-know-the-name for an attempt at a family tree


2

Method chaining implies that multiple method calls are related, with each call building on the previous one. An example is a "fluent" style of programmatically querying the database. $posts = Post::where(array('name' => 'Test')) .order_by(array('date' => 'desc')) .limit(10); (Forgive my lackluster PHP, it's been quite a while since I wrote ...


-2

It depends on why you want to learn the new language. The obvious cons to learning a language with little adoption is its much harder to get help however if you want to learn about a specific feature there is little point learning a widely adopted language if it doesn't have that feature.


2

They mean that you shall be required to write things that could reasonably be inferred from other things in the code. But you will not be implementing the same thing twice. An example of what they mean is type systems. You might be able to infer the existence and types of variables from their usage, but the redundancy of explicit declaration can catch ...


3

In this context "redundant" means that program's behavior is described multiple times. But "not duplicative" means that each of the of the specific types behaviors is different. For example, automated testing. The code is "redundant", because the behavior is described twice : once in code and once in form of automated test. But it is not duplicative, ...


6

First off, "modern OOP" is not a deviation from Alan Kay's OOP. Kay may have coined the term itself, but Smalltalk-style "OOP" is a significant deviation from actual class-and-object programming as it existed before Smalltalk. The original OOP system was called Simula, and it was an extended dialect of of ALGOL whose OOP concepts would feel right at home ...


5

It should be pretty obvious that if you have two or more persons working on the same program, they need to use the same language, or at least the same (small) set of languages. So when there is is only one team or department in the company who does software development, they will typically not make their lifes harder by unnecessarily chosing a new language ...


7

Typically, companies standardize on a single language for a variety of reasons (tool support, talent availability, interoperability, etc). I've worked for some companies that used multiple languages, but they were the exception. Having individuals pick their own technologies is usually a recipe for disaster. When the PHP guy leaves, if nobody else knows PHP ...


1

One aspect not mentioned so far is the push for "open" systems in the 1980s and 1990s. In many places, software vendors would have to provide industry standard access to the data in their databases. At the time, SQL was an established standard which was well know and understood; Prolog was pretty esoteric and academic. Once you started getting interfaces ...


4

There is another reason. Practically speaking, SQL is useful for data persisted on disk. So databases are used to store data for a "long" time (several months). Every SQL database (e.g. PostgreSQL, MySQL, Oracle, ....) is managing data on disks (or SSDs, i.e. hardware which could keep data if properly powered down). However, most Prolog implementations I am ...


18

I believe this is primarily historical thing. SQL was primarily used in businesses for making business applications. Some companies build their livelyhood on selling SQL solutions and they used their money to advertise and push SQL into minds of many. This was especially empowered by how important data is for business people. This is why SQL won over it's ...


5

The reason is actually pretty simple. It has nothing to do with how useful the language is for a given task and everything to do with how maintainable the code is. Reading an SQL statement, many developers will be able to determine what most basic queries do without knowing the language. They might have a harder time in the case of complex examples but ...


0

I'm going to take a different tact. Consistency in development is one of the most important features of software design, it's a critical tool in making applications extensible and maintainable but can be difficult to achieve when managing a team across multiple sites, languages and timezones. If achieved, consistency makes code much more accessible "once ...


2

If you want to have a compiler for language X be self-hosting, your first have to implement it in some other language, say Y, such that it takes input for language X and spits out assembly code, or some intermediate code, or even object code for the machine the compiler is running on. You want to choose language Y to be as similar to language X as possible, ...


1

Is it possible to produce a programming language that is not well designed for writing a compiler but is well designed for some other purpose? Looking at a language like SQL I suppose the answer is yes. But languages of that nature are not general purpose.


9

People create new general purpose languages for one main reason: they hate at least one thing about every other language out there. This is why so many languages don't get off the ground. You have a great idea for a language that would improve your programming life, but you have to make the first implementation in a language that annoys you in at least ...


13

The goal of having a compiler in the language that is being compiled is often part of the practice of "eating your own dog food." It demonstrates to the world that you consider the language, compiler, and ecosystem of supporting modules and tools to be "good enough for serious work" or "production ready." It also has the virtuous effect of forcing those ...


0

It shows that the language is capable of processing complex parsing jobs and translating to another language/interpreting itself. In the process of creating a compiler (the first big project) there will be issue that come to the fore.


13

Wouldn't it make more sense to spend the effort working in something that will give better results? Like what? The nice thing about compilers is that they don't have many dependencies. This makes them good candidates for a new language that likely doesn't have a very large or diverse standard library yet. Better yet, they require a variety of things, ...


1

Who says that? ...anyway, it's just an opinion. Some might agree, some may not, there is no right or wrong here. Some languages have compilers written in itself, others don't. Whatever. Nevertheless, I think it's a nice exercice/proof-of-concept if a language is able to "self-compile" ...it's just ...nice ...and it prooves the language is suited to do some ...



Top 50 recent answers are included