Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #1426

Re: Writing A Plain English Compiler

From Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid>
Newsgroups comp.compilers
Subject Re: Writing A Plain English Compiler
Date 2014-11-08 10:48 -0600
Organization A noiseless patient Spider
Message-ID <14-11-018@comp.compilers> (permalink)
References <14-11-004@comp.compilers> <14-11-005@comp.compilers> <14-11-012@comp.compilers>

Show all headers | View raw


On 11/7/2014 3:23 PM, George Neuner wrote:
> On Wed, 05 Nov 2014 00:54:18 -0600, Joshua Cranmer ?
> <Pidgeot18@verizon.net> wrote:
>> Essentially, I find your categorization troubling because you're
>> assuming a particular, very specific way of looking at
>> programming--and a model that's not necessarily reflective of most
>> large-scale programs (where object-oriented code rules the day).
>
> OO has its place, but it isn't any kind of universal solution.  There
> is a large class of problems that are not a good fit.

I apparently didn't state this very well in my original post, but my
personal opinion is that there is no "one true paradigm" but rather a
set of paradigms best suited to different tasks. IMHO, programming
languages ultimately need to have a collection of paradigms that it
supports well, and for languages targeting large applications, OO is
one (but not the only one) of the ones that absolutely needs to
supported.

> IMO, the utility of a language is measured by how easily it bends to
> fit the problem.  I try to avoid using languages that unnecessarily
> force the problem to bend.
>
>> A good example of where things really break down is in the
>> introduction of parallelism. Many (all?) languages these days have put
>> some emphasis on trying to decide good parallelism and concurrency
>> models at increasingly fundamental positions in the language.
>
> Most of which are ineffective.

I won't deny that parallelism is a problem for which a good solution
does not yet exist. But we've reached an age where it's a problem that
can't be solved by sticking your head in the sand--and a solution that
allows you to solve some problems well is better than one that allows
you to solve nothing.

I think it's clear that the mutable shared model and
mutex/condvar/etc.-based building blocks as the only level of support is
a, well, disaster, as you put it. Immutable data I think has also been
shown to be a complete non-starter. Sometimes when your parallelism is
completely centered on very large mutable, shared data structures, and a
solution that completely prevents that from being used is untenable. At
the same time, shared mutable memory is a definite lightning rod for
disaster--maybe having "unsafe" blocks isn't such a bad idea. :-)

I think actor models (which is basically CSP?) appear to be winning out,
but, as you say, they're not completely sufficient. If I had to make a
bet, it would be on an actor-based model with some support for
cross-thread shared data collections. But I would be hesitant to wager
very much even on that.

You've failed to mentioned transactional memory. There are also things
like Concurrent Collections which I'm hard-pressed to place, particular
since I'm vague on the details (maybe dataflow?).

> What's important is problem solving logic - the language used to
> express the logic of the solution may either help or hinder the
> implementation.
>
> Most natural languages are a hindrance to logic because they are
> inherently ambiguous.  There is some anecdotal evidence that Sumerian
> might have been sufficiently unambiguous to program with, but the
> issue is moot because no one today speaks it.

There's an issue not strictly related to ambiguity that I realized
when reading Gerry's examples. English (and presumably other natural
languages, but I'm not enough of a linguist to say with any
confidence) allows you to reliably refer to one, sometimes two, things
without naming them. At the same time, it makes it cumbersome to name
a temporary object.

> E.g., anything you can write in Lisp you also can write in assembler
> ... assuming you have unlimited time on your hands.

I prefer Brainfuck as the go-to "unprogrammable" language. :-)

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth

Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-04 15:50 -0600
  Re: Writing A Plain English Compiler Joshua Cranmer 🐧 <Pidgeot18@verizon.net> - 2014-11-05 00:54 -0600
    Re: Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-06 18:52 -0600
      Re: Writing A Plain English Compiler Joshua Cranmer 🐧 <Pidgeot18@verizon.net> - 2014-11-07 22:54 -0600
        Re: Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-08 02:41 -0600
        Re: Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-08 03:46 -0600
          Re: Writing A Plain English Compiler "BartC" <bc@freeuk.com> - 2014-11-09 01:16 +0000
            Re: Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-10 14:37 -0600
            Re: self-hosting, was Writing A Plain English Compiler Richard Hable <portempa@aon.at> - 2014-11-11 19:50 +0100
              Re: self-hosting, was Writing A Plain English Compiler "BartC" <bc@freeuk.com> - 2014-11-11 23:33 +0000
                Re: self-hosting, was Writing A Plain English Compiler anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-11-12 08:46 +0000
                Re: self-hosting, was Writing A Plain English Compiler "BartC" <bc@freeuk.com> - 2014-11-12 11:15 +0000
              Re: self-hosting, was Writing A Plain English Compiler anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-11-12 08:40 +0000
    Re: Writing A Plain English Compiler "BartC" <bcas@freeuk.com> - 2014-11-07 11:36 +0000
    Re: Writing A Plain English Compiler George Neuner <gneuner2@comcast.net> - 2014-11-07 16:23 -0500
      Re: Writing A Plain English Compiler Richard Hable <portempa@aon.at> - 2014-11-08 17:22 +0100
      Re: Writing A Plain English Compiler Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2014-11-08 10:48 -0600
        Re: language design models, was Writing A Plain English Compiler George Neuner <gneuner2@comcast.net> - 2014-11-09 14:30 -0500
          Re: language design models, was Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-10 03:29 -0600
          Re: Writing A Plain English Compiler Tomasz Kowaltowski <tk@ic.unicamp.br> - 2014-11-10 09:13 -0200
            Re: Writing A Plain English Compiler "Gerry Rzeppa" <gerry.rzeppa@pobox.com> - 2014-11-10 17:19 -0600
      Re: matching tasks to languages, was Writing A Plain English Compiler Gene Wirchenko <genew@telus.net> - 2014-11-10 15:37 -0800
    Re: Writing A Plain English Compiler Martin Ward <martin@gkc.org.uk> - 2014-11-10 22:56 +0000
  Re: Writing A Plain English Compiler "BartC" <bcas@freeuk.com> - 2014-11-07 11:39 +0000
    Re: Writing A Plain English Compiler "BartC" <bc@freeuk.com> - 2014-11-08 00:35 +0000
  Fundamentals for a Compiler and Language (was: Writing A Plain English Compiler) federation2005@netzero.com - 2014-12-29 13:30 -0800

csiph-web