Re: [fpc-pascal] Modern Compiler Construction using Pascal

2018-01-05 Thread Graeme Geldenhuys

On 2018-01-02 15:30, Marc Santhoff wrote:

Sorry for mentioning something nasty like Java on this list.


The more I use Java (and the ecosystem around it) the more I love it. :)

It is expected that any developer these days are proficient in multiple 
languages. Object Pascal (Delphi) and Java are good combinations/choices 
in my eyes.


Regards,
  Graeme

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Modern Compiler Construction using Pascal

2018-01-04 Thread leledumbo via fpc-pascal
I used to play with this a bit: https://github.com/lysee/lysee
It's written by a Chinese programmer and I remember reading his page about
the language using google translate :p
The github page is without documentation, but its older google code page is
still accessible (just hope he didn't break anything lately):
https://code.google.com/archive/p/lysee/



--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Modern Compiler Construction using Pascal

2018-01-04 Thread Yves Cloutier
Wow, these are all amazing links!  Thanks so much. This should keep me busy
for a while!

On Tue, Jan 2, 2018 at 10:49 AM, Santiago A.  wrote:

> El 01/01/2018 a las 19:17, Yves Cloutier escribió:
> > Hi there,
> >
> > I'd be interested to know if any modern compilers have been written in
> > Pascal (other than the Pascal Compiler).
> >
> > It's unfortunate that that most Pascal books out there are rather
> > dated.  I did recently purchase
>
> The first version of nim language  https://nim-lang.org/ was written in
> Pascal. Here are the sources
> https://github.com/nim-lang/Nim/tree/ea1f1ec6d4d6c776eb0f81c2bebdd4
> cb4c817ebe/nim
>
> Many times, when compiler is mature, the compiler is re-written in the
> target language itself. Freepascal compiler is written in Freepascal.
>
> First version of compiler must be written in other language, (of course,
> the are not compilers for the language ), usually a language that
> generates binary, compiling is very demanding to rely on virtual
> machines Probably that is why there are not Java compilers written in
> Java, or Python or Perl compilers written in Python or Perl . As usual,
> the most popular language will be most used language: C, C++
>
>
> --
> Saludos
>
> Santiago A.
>
>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Modern Compiler Construction using Pascal

2018-01-02 Thread Marc Santhoff
On Mon, 2018-01-01 at 13:17 -0500, Yves Cloutier wrote:
> Hi there,
> 
> I'd be interested to know if any modern compilers have been written
> in
> Pascal (other than the Pascal Compiler).

A bit outdated, but intresting:

http://pascaland.org/pascall.htm

-- 
Marc Santhoff 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Modern Compiler Construction using Pascal

2018-01-02 Thread Santiago A.
El 01/01/2018 a las 19:17, Yves Cloutier escribió:
> Hi there,
>
> I'd be interested to know if any modern compilers have been written in
> Pascal (other than the Pascal Compiler).
>
> It's unfortunate that that most Pascal books out there are rather
> dated.  I did recently purchase 

The first version of nim language  https://nim-lang.org/ was written in
Pascal. Here are the sources
https://github.com/nim-lang/Nim/tree/ea1f1ec6d4d6c776eb0f81c2bebdd4cb4c817ebe/nim

Many times, when compiler is mature, the compiler is re-written in the
target language itself. Freepascal compiler is written in Freepascal.

First version of compiler must be written in other language, (of course,
the are not compilers for the language ), usually a language that
generates binary, compiling is very demanding to rely on virtual
machines Probably that is why there are not Java compilers written in
Java, or Python or Perl compilers written in Python or Perl . As usual,
the most popular language will be most used language: C, C++


-- 
Saludos

Santiago A.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Modern Compiler Construction using Pascal

2018-01-02 Thread Marc Santhoff
On Mon, 2018-01-01 at 13:17 -0500, Yves Cloutier wrote:
> Hi there,
> 
> I'd be interested to know if any modern compilers have been written in
> Pascal (other than the Pascal Compiler).
> 
> It's unfortunate that that most Pascal books out there are rather dated.  I
> did recently purchase
> mailman/listinfo/fpc-pascal

Pascal purists, please do not read on!



Really good an modern books on writing compilers are those from Terence
Parr. They are really readable and understandable, forget about the
Dragon Book.

The tool in use is the well known ANTLR, the newer versions implemented
in Java. If you want to build real compilers look for version 3, if
making DSLs is your target version 4 would be appropriate.

Have a look at antlr.org, the books to read are:

  "The Definitive ANTLR Reference - Building Domain Specific Languages"

Like the title says, a verbose and well written refernce for using
antlr.

The best book on the topic by far is (for me):

  "Language Implementation Patterns"

That's a very clear, pragmatic, and analytic view on compiler
construction. It is structured modular and easy to read. Guido van
Rossum, the creator of Python, writes about it "Throw away your
compiler theory book!"
I would really appreciate a translation of the code from the book to
pascal. ;)



Sorry for mentioning something nasty like Java on this list.

-- 
Marc Santhoff 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Modern Compiler Construction using Pascal

2018-01-02 Thread greim



I guess you already noticed the book of the master himself: Nicklaus Wirth


https://www.inf.ethz.ch/personal/wirth/CompilerConstruction/index.html

Its revised 2017 (!) based on Oberon.

Afaik one of the first editions was based on Pascal.

Markus




Am 01.01.2018 um 19:17 schrieb Yves Cloutier:

Hi there,

I'd be interested to know if any modern compilers have been written in 
Pascal (other than the Pascal Compiler).


It's unfortunate that that most Pascal books out there are rather 
dated.  I did recently purchase



  Compiler Engineering Using Pascal (by Capon)


https://www.amazon.ca/Compiler-Engineering-Using-Pascal-Capon/dp/0333471555/ref=sr_1_1?ie=UTF8&qid=1514829567&sr=8-1&keywords=Compiler+Engineering+Using+PASCAL

And look forward to getting it in my mailbox.

I also have Brinch Hansen on Pascal Compilers. I did have another book 
on writing a compiler using pascal but it was using some framework which 
I was not able to find.


Another great book I have is Introduction to Compiler Construction by 
Thomas Parsons, but I was not able to follow it all the way through.


My interest for the moment is more for creating a DSL that scans, parses 
then generates Groff as its target code.


After gaining some experience with the process I would like to venture 
into writing a transpiler for something like SETL -> Pascal or Oberon -> 
Pascal.  There are other interesting older languages too like BCPL that 
could be used as the source language.  Implementing Icon in Pascal would 
be interesting as well as its implementation is extremely well 
documented in the book "Implementing Icon and Unicon" by Clinton Jeffery


I find the Pascal compiler to be really fast and the fact that it is 
available for so many platforms is very appealing.







___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Modern Compiler Construction using Pascal

2018-01-02 Thread Mattias Gaertner
On Mon, 1 Jan 2018 13:17:47 -0500
Yves Cloutier  wrote:

> Hi there,
> 
> I'd be interested to know if any modern compilers have been written in
> Pascal (other than the Pascal Compiler).

pas2js is written in FPC.

Mattias
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Modern Compiler Construction using Pascal

2018-01-02 Thread Yves Cloutier
Hi there,

I'd be interested to know if any modern compilers have been written in
Pascal (other than the Pascal Compiler).

It's unfortunate that that most Pascal books out there are rather dated.  I
did recently purchase

Compiler Engineering Using Pascal (by Capon)

https://www.amazon.ca/Compiler-Engineering-Using-Pascal-Capon/dp/0333471555/ref=sr_1_1?ie=UTF8&qid=1514829567&sr=8-1&keywords=Compiler+Engineering+Using+PASCAL

And look forward to getting it in my mailbox.

I also have Brinch Hansen on Pascal Compilers. I did have another book on
writing a compiler using pascal but it was using some framework which I was
not able to find.

Another great book I have is Introduction to Compiler Construction by
Thomas Parsons, but I was not able to follow it all the way through.

My interest for the moment is more for creating a DSL that scans, parses
then generates Groff as its target code.

After gaining some experience with the process I would like to venture into
writing a transpiler for something like SETL -> Pascal or Oberon ->
Pascal.  There are other interesting older languages too like BCPL that
could be used as the source language.  Implementing Icon in Pascal would be
interesting as well as its implementation is extremely well documented in
the book "Implementing Icon and Unicon" by Clinton Jeffery

I find the Pascal compiler to be really fast and the fact that it is
available for so many platforms is very appealing.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal