January 04, 2010
Walter Bright wrote:
> retard wrote:
>> Fri, 01 Jan 2010 12:19:25 -0800, Walter Bright wrote:
>>> When I then picked up K+R C, I never wrote another line of Pascal. It so
>>> soured me on Pascal that I never got on the later bandwagons of Modula
>>> II, Delphi, TurboPascal, etc. Never even looked at them.
>>
>> The programming-language-as-religion problem exists only in your imagination. I fail to see Pascal as a religion. I don't know what the pure Pascal compiler you're talking about is, but ordinary Pascal is just another procedural systems programming language like C. It has a bit different syntax ("begin end" vs "{}" and so on), somewhat different rules for some default data types, but it's more or less C wrapped in a syntactic mask.
> 
> Pick up a copy of "Pascal User Manual and Report." That's pure Pascal. It's also quite useless. Your program has to be all in one file, for instance. For another, writing I/O always appends a newline. Try writing binary files with that. There was no way to get at the bit representation of a type. Etc.

That's all gone in modern Pascal dialects. Delphi is very similar to D; it's practically a Pascal version of D. The OOP features are the same, except for some small differences, which make Delphi a bit more flexible (virtual and named constructors...).

The only thing that was really lacking in Delphi are templates. But for compensation, it had powerful RTTI. Try writing a reflection/serialization mechanism in D that's as powerful Delphi's. I bet you won't succeed, not even with D2. (Need to fix some compiler bugs or deficiencies in the area of __traits first.) Even if you succeed, the end result will be probably harder to use. (If that sounds polemic, show me a D library that implements full serialization on Delphi/Java/whatever level, and I'll shut up.)
January 04, 2010
grauzone wrote:
> Walter Bright wrote:
>> retard wrote:
>>> Fri, 01 Jan 2010 12:19:25 -0800, Walter Bright wrote:
>>>> When I then picked up K+R C, I never wrote another line of Pascal. It so
>>>> soured me on Pascal that I never got on the later bandwagons of Modula
>>>> II, Delphi, TurboPascal, etc. Never even looked at them.
>>>
>>> The programming-language-as-religion problem exists only in your imagination. I fail to see Pascal as a religion. I don't know what the pure Pascal compiler you're talking about is, but ordinary Pascal is just another procedural systems programming language like C. It has a bit different syntax ("begin end" vs "{}" and so on), somewhat different rules for some default data types, but it's more or less C wrapped in a syntactic mask.
>>
>> Pick up a copy of "Pascal User Manual and Report." That's pure Pascal. It's also quite useless. Your program has to be all in one file, for instance. For another, writing I/O always appends a newline. Try writing binary files with that. There was no way to get at the bit representation of a type. Etc.
> 
> That's all gone in modern Pascal dialects. Delphi is very similar to D; it's practically a Pascal version of D. The OOP features are the same, except for some small differences, which make Delphi a bit more flexible (virtual and named constructors...).

The problem was, in the 80's, pure Pascal was useless and so needed dialects. Every Pascal vendor added a boatload of extensions, all incompatible with each other. None had enough market share to create a de-facto standard.

All this left a huge opening for C, and the rest, as they say, is history. The market window closed for Pascal.
January 04, 2010
Walter Bright wrote:
> grauzone wrote:
>> Walter Bright wrote:
>>> retard wrote:
>>>> Fri, 01 Jan 2010 12:19:25 -0800, Walter Bright wrote:
>>>>> When I then picked up K+R C, I never wrote another line of Pascal. It so
>>>>> soured me on Pascal that I never got on the later bandwagons of Modula
>>>>> II, Delphi, TurboPascal, etc. Never even looked at them.
>>>>
>>>> The programming-language-as-religion problem exists only in your imagination. I fail to see Pascal as a religion. I don't know what the pure Pascal compiler you're talking about is, but ordinary Pascal is just another procedural systems programming language like C. It has a bit different syntax ("begin end" vs "{}" and so on), somewhat different rules for some default data types, but it's more or less C wrapped in a syntactic mask.
>>>
>>> Pick up a copy of "Pascal User Manual and Report." That's pure Pascal. It's also quite useless. Your program has to be all in one file, for instance. For another, writing I/O always appends a newline. Try writing binary files with that. There was no way to get at the bit representation of a type. Etc.
>>
>> That's all gone in modern Pascal dialects. Delphi is very similar to D; it's practically a Pascal version of D. The OOP features are the same, except for some small differences, which make Delphi a bit more flexible (virtual and named constructors...).
> 
> The problem was, in the 80's, pure Pascal was useless and so needed dialects. Every Pascal vendor added a boatload of extensions, all incompatible with each other. None had enough market share to create a de-facto standard.
> 
> All this left a huge opening for C, and the rest, as they say, is history. The market window closed for Pascal.

Yeah, as it was discussed in this thread. I was just posting this, because you tell so often about your bad experiences with Pascal.

I context of retard's posting I also found it funny how the history of programming languages seems to repeat itself.
January 04, 2010
grauzone:
> That's all gone in modern Pascal dialects. Delphi is very similar to D; it's practically a Pascal version of D. The OOP features are the same, except for some small differences, which make Delphi a bit more flexible (virtual and named constructors...).

And as you know, C# was partially designed by the same people :-)

About Delphi virtual constructors: http://www.felix-colibri.com/papers/oop_components/delphi_virtual_constructor/delphi_virtual_constructor.html

About Delphi named constructors: http://stackoverflow.com/questions/1758917/delphi-pascal-overloading-a-constructor-with-a-different-prototype/1759217#1759217

In Table 2-1 shows a list of some Delphi features:
http://oreilly.com/catalog/delphi/chapter/ch02.html
Beside virtual methods there are dynamic methods too, that are unrelated to dynamic methods of C#:
>Instead of using the virtual directive, you can also use the dynamic directive. The semantics are identical, but the implementation is different. Looking up a virtual method in a VMT is fast because the compiler generates an index directly into a VMT. Looking up a dynamic method is slower. Calling a dynamic method requires a linear search of a class's dynamic method table (DMT). If the class does not override that method, the search continues with the DMT of the base class. The search continues with ancestor classes until TObject is reached or the method is found. The tradeoff is that in a few circumstances, dynamic methods take up less memory than virtual methods. Unless you are writing a replacement for the VCL, you should use virtual methods, not dynamic methods. See Chapter 3 for a complete explanation of how dynamic and virtual methods are implemented.<


There are even metaclasses (from the same document):
>A class, too, is a distinct entity (as in Java, but unlike C++). Delphi's representation of a class is a read-only table of pointers to virtual methods and lots of information about the class. A class reference is a pointer to the table. (Chapter 3, Runtime Type Information, describes in depth the layout of the class tables.) The most common use for a class reference is to create objects or to test the type of an object reference, but you can use class references in many other situations, including passing class references as routine parameters or returning a class reference from a function. The type of a class reference is called a metaclass.<

In C++/D to do something similar to metaclasses you use templates: http://marcin.wudarczyk.pl/education/tipstricks/metacls.htm


> The only thing that was really lacking in Delphi are templates. But for compensation, it had powerful RTTI.

About Delphi RTTI, this document is not new (it seems updated to Delphi 4, that's a bit ancient) but it looks well written:
http://www.blong.com/Conferences/BorConUK98/DelphiRTTI/CB140.htm

Bye,
bearophile
January 04, 2010
Walter Bright Wrote:

> grauzone wrote:
> > Walter Bright wrote:
> >> retard wrote:
> >>> Fri, 01 Jan 2010 12:19:25 -0800, Walter Bright wrote:
> >>>> When I then picked up K+R C, I never wrote another line of Pascal.
> >>>> It so
> >>>> soured me on Pascal that I never got on the later bandwagons of Modula
> >>>> II, Delphi, TurboPascal, etc. Never even looked at them.
> >>>
> >>> The programming-language-as-religion problem exists only in your imagination. I fail to see Pascal as a religion. I don't know what the pure Pascal compiler you're talking about is, but ordinary Pascal is just another procedural systems programming language like C. It has a bit different syntax ("begin end" vs "{}" and so on), somewhat different rules for some default data types, but it's more or less C wrapped in a syntactic mask.
> >>
> >> Pick up a copy of "Pascal User Manual and Report." That's pure Pascal. It's also quite useless. Your program has to be all in one file, for instance. For another, writing I/O always appends a newline. Try writing binary files with that. There was no way to get at the bit representation of a type. Etc.
> > 
> > That's all gone in modern Pascal dialects. Delphi is very similar to D; it's practically a Pascal version of D. The OOP features are the same, except for some small differences, which make Delphi a bit more flexible (virtual and named constructors...).
> 
> The problem was, in the 80's, pure Pascal was useless and so needed dialects. Every Pascal vendor added a boatload of extensions, all incompatible with each other. None had enough market share to create a de-facto standard.

Borland Pascal, Borland Pascal with Objects and Borland Delphi became the de-facto standard. They dropped the ball and Freepascal/Lazarus picked up the ball. Freepascal now includes templates.

> 
> All this left a huge opening for C, and the rest, as they say, is history. The market window closed for Pascal.

January 04, 2010
Mike James:

>Freepascal now includes templates.<

I didn't know it. They are for classes only for now, but in future they may add for records, functions, etc, too. They are named Generics:
http://www.freepascal.org/docs-html/ref/refch8.html
It has operator overloading too:
http://www.freepascal.org/docs-html/ref/refch12.html
(And other things like built-in properties were already present).

FreePascal generics are more limited than D2 templates, but FreePascal has metaclasses and RTTI that replace some template purposes. Now FreePascal looks like a quite expressive language, you can probably use it to do most of things you can do with D :-)

Bye,
bearophile
January 04, 2010
On Mon, 04 Jan 2010 04:10:28 +0000, retard wrote:

> Sat, 02 Jan 2010 12:23:36 -0800, Walter Bright wrote:
> 
>> yigal chripun wrote:
>>> Have you ever actually used Smalltalk?? I have used it and it's the easiest language to use by far, having conditionals as methods of Boolean is much better, easier to read and more flexiable.
>>> 
>>> The beauty of smalltalk is that you can easily add new "language" features in the library with little effort and they do not look foreign to the language. in fact, almost all of smalltalk is implemented in the library and it only has 5 actual keywords.
>> 
>> 
>> What's your opinion, then, about why Smalltalk has failed to catch on?
> 
> The same question could be asked just about any language. If you have followed the internet discussion & hype around JVM/.NET languages - these are all very young languages and share many aspects. Languages like Clojure seem to be doing well.. Why? Charismatic leaders, perhaps? "Clojure: Lisp done right" - I don't believe that, but many do. People are sheeple. They believe that languages are religions. Marketing matters. Technical superiority rarely has much effect.


I had a quick look to see what Clojure was about, and watched the video on the link on the http://clojure.org site. (Video of a talk from QCon on State and Identity).

Clojure is designed as better ways to mix imperative and functional parts of programs easily "on a local system".  No more messing directly with locks, which can have problems. ( which "only experts can get right initially, and then its hard to maintain").

With multi-processor cores, easily doing parallel programming is becoming the future.  We cannot expect as programmers to "stop the world" as in iterative-only programming.


Well it was a good sales talk.

I found the complicated ways of using indirection to support different versions of object instances using shared tree node membership, interesting, and the statement that we had better get used to the idea that the version being accessed may already be outdated, and the use of time relative checks, compare and Set, immutable data, software transactional memory (STM).  And Lisp syntax.  But no classic OO inheritance.

A lot of things needed to support concurrency, and Richard Hickey says you have to do all of clojures tricks to make it all work. The builtin collection facilities are designed with the STM support. Its for JVM or CLR.


Most programs, with the exeception of multi-user databases and servers, massive climate and weather models, maybe a few concurrent threads at most.

Of course we can still get by with fiddling synchronized object locks, notify and wait. Its nice if the language has support built in.


I look forward to seeing results of more evolution of D to support concurrency, and what will need to change.






January 04, 2010
retard wrote:
> Fri, 01 Jan 2010 12:19:25 -0800, Walter Bright wrote:
> 
>> Nick Sabalausky wrote:
>>> "Walter Bright" <newshound1@digitalmars.com> wrote in message
>>> news:hhgvqk$8cj$2@digitalmars.com...
>>>> An interesting counterpoint to the usual FP hype:
>>>>
>>>> http://prog21.dadgum.com/55.html
>>> Didn't read the original article, but the one being linked to is
>>> completely in line with how I feel about not just FP, but all
>>> programming paradigms, for example, OO: It's great as long as you don't
>>> pull a Java or (worse yet) a Smalltalk and try to cram *everything*
>>> into the paradigm.
>> I agree, the old programming-language-as-religion problem. I first ran
>> into this when I read the original Pascal book, and became enamored with
>> it. I tried doing a modest project in Pascal using a pure Pascal
>> compiler.
>>
>> 80% went smoothly, the other 20% spent wrestling with the nanny language
>> tsk-tsking consumed nearly 100% of the time spend on the project. I just
>> couldn't get things that had to be done, done, as the language would
>> shut off all the avenues.
>>
>> When I then picked up K+R C, I never wrote another line of Pascal. It so
>> soured me on Pascal that I never got on the later bandwagons of Modula
>> II, Delphi, TurboPascal, etc. Never even looked at them.
> 
> The programming-language-as-religion problem exists only in your imagination.

You don't have an idea how many times I heard the phrase "Please, please, let this work" out of a programmer's mouth in front of a computer.
January 04, 2010
Mon, 04 Jan 2010 07:50:12 -0200, Ary Borenszweig wrote:

> retard wrote:
>> Fri, 01 Jan 2010 12:19:25 -0800, Walter Bright wrote:
>> 
>>> Nick Sabalausky wrote:
>>>> "Walter Bright" <newshound1@digitalmars.com> wrote in message news:hhgvqk$8cj$2@digitalmars.com...
>>>>> An interesting counterpoint to the usual FP hype:
>>>>>
>>>>> http://prog21.dadgum.com/55.html
>>>> Didn't read the original article, but the one being linked to is completely in line with how I feel about not just FP, but all programming paradigms, for example, OO: It's great as long as you don't pull a Java or (worse yet) a Smalltalk and try to cram *everything* into the paradigm.
>>> I agree, the old programming-language-as-religion problem. I first ran into this when I read the original Pascal book, and became enamored with it. I tried doing a modest project in Pascal using a pure Pascal compiler.
>>>
>>> 80% went smoothly, the other 20% spent wrestling with the nanny language tsk-tsking consumed nearly 100% of the time spend on the project. I just couldn't get things that had to be done, done, as the language would shut off all the avenues.
>>>
>>> When I then picked up K+R C, I never wrote another line of Pascal. It so soured me on Pascal that I never got on the later bandwagons of Modula II, Delphi, TurboPascal, etc. Never even looked at them.
>> 
>> The programming-language-as-religion problem exists only in your imagination.
> 
> You don't have an idea how many times I heard the phrase "Please, please, let this work" out of a programmer's mouth in front of a computer.

Now what does that prove? That the person has religious beliefs or that programming languages are religions? My point was, it's just stupid to claim that some languages like ML or Iswim are religions. They were originally built for scientific use, namely for proving mathematical properties of some systems and as a proof of concept. I guess lolcode isn't a religion in your book because not only is it useless, it's fun unlike most functional languages.
January 04, 2010
> 
> That's all gone in modern Pascal dialects. Delphi is very similar to D; it's practically a Pascal version of D. The OOP features are the same, except for some small differences, which make Delphi a bit more flexible (virtual and named constructors...).
> 
> The only thing that was really lacking in Delphi are templates. But for compensation, it had powerful RTTI. Try writing a reflection/serialization mechanism in D that's as powerful Delphi's. I bet you won't succeed, not even with D2. (Need to fix some compiler bugs or deficiencies in the area of __traits first.) Even if you succeed, the end result will be probably harder to use. (If that sounds polemic, show me a D library that implements full serialization on Delphi/Java/whatever level, and I'll shut up.)

Other interesting features of Delphi were:
- incredibly fast compilation time allowed by the language, you can almost develop in release mode
- properties "done right", with zero overhead (but cumbersome to write)
- similar productivity and feeling that D can provide
- very good low-level bit manipulation: absolute prevent all union tricks, "value" type casts are reinterpret_cast (no way to turn a float into an int silently), inline-assembly like D
- "Borland fastcall", using the three registers EAX, ECX and EDX