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


Groups > comp.lang.forth > #60222 > unrolled thread

Astronomy and programming languages

Started byanton@mips.complang.tuwien.ac.at (Anton Ertl)
First post2017-06-03 09:09 +0000
Last post2017-06-13 10:52 -0500
Articles 5 on this page of 125 — 21 participants

Back to article view | Back to comp.lang.forth


Contents

  Astronomy and programming languages anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-06-03 09:09 +0000
    Re: Astronomy and programming languages krishna.myneni@ccreweb.org - 2017-06-03 04:38 -0700
      Re: Astronomy and programming languages anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-06-03 13:45 +0000
        Re: Astronomy and programming languages krishna.myneni@ccreweb.org - 2017-06-03 08:46 -0700
        Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-03 18:49 +0000
      Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-03 18:48 +0000
        Re: Astronomy and programming languages krishna.myneni@ccreweb.org - 2017-06-03 13:33 -0700
          Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-03 22:34 +0000
          Re: Astronomy and programming languages Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-06-04 03:05 -0500
    Re: Astronomy and programming languages krishna.myneni@ccreweb.org - 2017-06-03 05:58 -0700
      Re: Astronomy and programming languages krishna.myneni@ccreweb.org - 2017-06-03 06:01 -0700
      Re: Astronomy and programming languages anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-06-03 13:37 +0000
        Re: Astronomy and programming languages foxaudioresearch@gmail.com - 2017-06-03 07:28 -0700
          Re: Astronomy and programming languages anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-06-10 17:31 +0000
        Re: Astronomy and programming languages mhx@iae.nl - 2017-06-03 08:21 -0700
          Re: Astronomy and programming languages Julian Fondren <julian.fondren@gmail.com> - 2017-06-03 12:01 -0700
            Re: Astronomy and programming languages mhx@iae.nl - 2017-06-03 13:09 -0700
            Re: Astronomy and programming languages mhx@iae.nl - 2017-06-03 13:20 -0700
              Re: Astronomy and programming languages Brad Eckert <hwfwguy@gmail.com> - 2017-06-03 18:30 -0700
              Re: Astronomy and programming languages Brad Eckert <hwfwguy@gmail.com> - 2017-06-03 18:43 -0700
                Re: Astronomy and programming languages anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-06-10 17:52 +0000
              Re: Astronomy and programming languages Julian Fondren <julian.fondren@gmail.com> - 2017-06-03 19:15 -0700
                Re: Astronomy and programming languages mhx@iae.nl - 2017-06-04 00:19 -0700
              Re: Astronomy and programming languages anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-06-10 17:39 +0000
    Re: Astronomy and programming languages NN <november.nihal@gmail.com> - 2017-06-03 06:57 -0700
      Re: Astronomy and programming languages anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-06-03 14:48 +0000
        Re: Astronomy and programming languages NN <november.nihal@gmail.com> - 2017-06-03 11:12 -0700
          Re: Astronomy and programming languages Mark Wills <markwills1970@gmail.com> - 2017-06-06 06:28 -0700
            Re: Astronomy and programming languages minforth@arcor.de - 2017-06-06 06:56 -0700
            Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-07 19:40 +0000
            Re: Astronomy and programming languages Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-06-08 05:10 -0500
              Re: Astronomy and programming languages Mark Wills <markwills1970@gmail.com> - 2017-06-08 04:28 -0700
                Re: Astronomy and programming languages Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-06-08 07:20 -0500
                Re: Astronomy and programming languages Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-06-09 04:08 -0500
                  Re: Astronomy and programming languages Mark Wills <markwills1970@gmail.com> - 2017-06-09 02:31 -0700
                    Re: Astronomy and programming languages Raimond Dragomir <raimond.dragomir@gmail.com> - 2017-06-09 03:54 -0700
                      Re: Astronomy and programming languages Mark Wills <markwills1970@gmail.com> - 2017-06-09 05:00 -0700
                  Re: Astronomy and programming languages Raimond Dragomir <raimond.dragomir@gmail.com> - 2017-06-09 04:03 -0700
                    Re: Astronomy and programming languages Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-06-09 08:37 -0500
                    Re: Astronomy and programming languages hughaguilar96@gmail.com - 2017-06-09 09:27 -0700
        Re: Astronomy and programming languages Cecil Bayona <cbayona@cbayona.com> - 2017-06-03 13:49 -0500
          Re: Astronomy and programming languages Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-06-04 03:11 -0500
            Re: Astronomy and programming languages Paul Rubin <no.email@nospam.invalid> - 2017-06-04 17:20 -0700
              Re: Astronomy and programming languages Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-06-07 03:10 -0500
                Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-07 19:41 +0000
                  Re: Astronomy and programming languages anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-06-08 11:48 +0000
                    Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-09 17:25 +0000
                Re: Astronomy and programming languages Paul Rubin <no.email@nospam.invalid> - 2017-06-10 00:31 -0700
                  Re: Astronomy and programming languages Melzzzzz <Melzzzzz@zzzzz.com> - 2017-06-10 08:18 +0000
                    Re: Astronomy and programming languages Paul Rubin <no.email@nospam.invalid> - 2017-06-16 00:23 -0700
                      Re: Astronomy and programming languages Melzzzzz <Melzzzzz@zzzzz.com> - 2017-06-16 07:40 +0000
                  Re: Astronomy and programming languages Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-06-11 02:21 -0500
                    Re: Astronomy and programming languages Brad Eckert <hwfwguy@gmail.com> - 2017-06-14 23:36 -0700
        Re: Astronomy and programming languages Cecil Bayona <cbayona@cbayona.com> - 2017-06-03 13:53 -0500
    Re: Astronomy and programming languages mhx@iae.nl - 2017-06-03 08:04 -0700
      Re: Astronomy and programming languages rickman <gnuarm@gmail.com> - 2017-06-03 11:29 -0400
      Re: Astronomy and programming languages krishna.myneni@ccreweb.org - 2017-06-03 08:55 -0700
    Re: Astronomy and programming languages Brad Eckert <hwfwguy@gmail.com> - 2017-06-03 09:57 -0700
      Re: Astronomy and programming languages Paul Rubin <no.email@nospam.invalid> - 2017-06-03 10:35 -0700
      Re: Astronomy and programming languages Lars Brinkhoff <lars.spam@nocrew.org> - 2017-06-03 19:44 +0200
    Re: Astronomy and programming languages Raimond Dragomir <raimond.dragomir@gmail.com> - 2017-06-03 10:15 -0700
      Re: Astronomy and programming languages Mark Wills <markwills1970@gmail.com> - 2017-06-06 06:20 -0700
        Re: Astronomy and programming languages Raimond Dragomir <raimond.dragomir@gmail.com> - 2017-06-06 07:13 -0700
          Re: Astronomy and programming languages minforth@arcor.de - 2017-06-06 08:21 -0700
            Re: Astronomy and programming languages Raimond Dragomir <raimond.dragomir@gmail.com> - 2017-06-06 09:05 -0700
          Re: Astronomy and programming languages Paul Rubin <no.email@nospam.invalid> - 2017-06-06 23:49 -0700
            Re: Astronomy and programming languages Raimond Dragomir <raimond.dragomir@gmail.com> - 2017-06-07 00:58 -0700
          Re: Astronomy and programming languages Rod Pemberton <NeedNotReplyHere@xrsevnneqk.cem> - 2017-06-07 16:05 -0400
            Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-07 20:26 +0000
              Re: Astronomy and programming languages Mark Wills <markwills1970@gmail.com> - 2017-06-07 14:00 -0700
                Re: Astronomy and programming languages hughaguilar96@gmail.com - 2017-06-07 15:46 -0700
                Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-07 23:06 +0000
                  Re: Astronomy and programming languages Mark Wills <markwills1970@gmail.com> - 2017-06-08 01:24 -0700
                    Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-09 17:27 +0000
                Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-07 23:08 +0000
                  Re: Astronomy and programming languages Raimond Dragomir <raimond.dragomir@gmail.com> - 2017-06-07 22:26 -0700
                    Re: Astronomy and programming languages Mark Wills <markwills1970@gmail.com> - 2017-06-08 01:29 -0700
                    Re: Astronomy and programming languages Rod Pemberton <NeedNotReplyHere@xrsevnneqk.cem> - 2017-06-08 08:28 -0400
                      Re: Astronomy and programming languages Raimond Dragomir <raimond.dragomir@gmail.com> - 2017-06-08 08:02 -0700
                  Re: Astronomy and programming languages Mark Wills <markwills1970@gmail.com> - 2017-06-08 01:26 -0700
                    Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-09 17:30 +0000
                Re: Astronomy and programming languages Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-06-08 05:17 -0500
                  Re: Astronomy and programming languages Mark Wills <markwills1970@gmail.com> - 2017-06-08 04:37 -0700
                    Re: Astronomy and programming languages Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-06-08 07:28 -0500
                      Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-09 17:33 +0000
              Re: Astronomy and programming languages anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-06-08 11:46 +0000
                Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-09 17:35 +0000
                  Re: Astronomy and programming languages Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-06-10 02:18 -0500
                    Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-10 07:54 +0000
                    Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-10 08:00 +0000
                      Re: Astronomy and programming languages Melzzzzz <Melzzzzz@zzzzz.com> - 2017-06-10 08:38 +0000
                        Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-11 17:53 +0000
                          Re: Astronomy and programming languages Melzzzzz <Melzzzzz@zzzzz.com> - 2017-06-11 18:03 +0000
                            Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-11 18:17 +0000
                              Re: Astronomy and programming languages Melzzzzz <Melzzzzz@zzzzz.com> - 2017-06-11 18:23 +0000
                            Re: Astronomy and programming languages Alex <alex@rivadpm.com> - 2017-06-11 19:21 +0100
                              Re: Astronomy and programming languages Melzzzzz <Melzzzzz@zzzzz.com> - 2017-06-11 18:24 +0000
                                Re: Astronomy and programming languages Alex <alex@rivadpm.com> - 2017-06-11 19:28 +0100
                                  Re: Astronomy and programming languages Melzzzzz <Melzzzzz@zzzzz.com> - 2017-06-11 19:04 +0000
                                    Re: Astronomy and programming languages Alex <alex@rivadpm.com> - 2017-06-11 21:13 +0100
                                      Re: Astronomy and programming languages Alex <alex@rivadpm.com> - 2017-06-11 21:22 +0100
                                        Re: Astronomy and programming languages Melzzzzz <Melzzzzz@zzzzz.com> - 2017-06-12 03:11 +0000
                                          Re: Astronomy and programming languages anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-06-12 07:38 +0000
                                            Re: Astronomy and programming languages Melzzzzz <Melzzzzz@zzzzz.com> - 2017-06-12 08:13 +0000
                                              Re: Astronomy and programming languages Alex <alex@rivadpm.com> - 2017-06-12 11:22 +0100
                                          Re: Astronomy and programming languages Alex <alex@rivadpm.com> - 2017-06-12 11:48 +0100
                            Re: Astronomy and programming languages anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-06-12 13:58 +0000
                              Re: Astronomy and programming languages Melzzzzz <Melzzzzz@zzzzz.com> - 2017-06-13 02:19 +0000
                  Re: Astronomy and programming languages anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-06-10 13:16 +0000
                    Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-11 17:53 +0000
              Re: Astronomy and programming languages Rod Pemberton <NeedNotReplyHere@xrsevnneqk.cem> - 2017-06-08 08:28 -0400
                Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-09 17:38 +0000
    Re: Astronomy and programming languages Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-06-03 12:23 -0500
    Re: Astronomy and programming languages Paul Rubin <no.email@nospam.invalid> - 2017-06-03 10:27 -0700
    Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-03 18:46 +0000
    Re: Astronomy and programming languages Julian Fondren <julian.fondren@gmail.com> - 2017-06-03 12:42 -0700
      Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-03 22:24 +0000
        Re: Astronomy and programming languages Julian Fondren <julian.fondren@gmail.com> - 2017-06-03 15:34 -0700
          Re: Astronomy and programming languages "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-06-03 22:55 +0000
    Re: Astronomy and programming languages Raimond Dragomir <raimond.dragomir@gmail.com> - 2017-06-10 10:27 -0700
    A Small Challenge (Re: Astronomy and programming languages) Joel Rees <joel.rees@gmail.com> - 2017-06-12 22:20 -0700
      Re: A Small Challenge (Re: Astronomy and programming languages) Paul Rubin <no.email@nospam.invalid> - 2017-06-12 22:52 -0700
      Re: A Small Challenge (Re: Astronomy and programming languages) Rod Pemberton <NeedNotReplyHere@xrsevnneqk.cem> - 2017-06-13 10:04 -0400
      Re: A Small Challenge (Re: Astronomy and programming languages) minforth@arcor.de - 2017-06-13 07:30 -0700
      Re: A Small Challenge (Re: Astronomy and programming languages) Cecil Bayona <cbayona@cbayona.com> - 2017-06-13 10:52 -0500

Page 7 of 7 — ← Prev page 1 2 3 4 5 6 [7]


#60680 — A Small Challenge (Re: Astronomy and programming languages)

FromJoel Rees <joel.rees@gmail.com>
Date2017-06-12 22:20 -0700
SubjectA Small Challenge (Re: Astronomy and programming languages)
Message-ID<0d43eaa4-26b4-4e26-801f-fec56d43a717@googlegroups.com>
In reply to#60222
On Saturday, June 3, 2017 at 7:35:30 PM UTC+9, Anton Ertl wrote:
> [...]
> The interesting thing for Forthers context is that Forth used to be
> very strong in astronomy.  There is a section in the article titled
> "Why Python?"  Some of the reasons mentioned there are an antithesis
> to the positions many present as Forth philosophy: It is used
> because:
> 
> * it works nicely with other languages such as C and Fortran, rather
>   than doing everything yourself because you can do it better.

How about writing a C compiler in Forth?

I recall that, about thirty years ago, many were saying it could be done.

If I had the money to support myself while I did it, I would think it 
great fun. But I would be careful to retain Forth's split stack and 
other run-time architecture features. Otherwise, why bother?

The whole purpose being to get Forth playing nice with other languages, ....

> * it has a "battries included" philopsophy of providing all sorts of
>   extras rather than minimalism that worries about kilobytes on a
>   gigabyte machine.
>
> * there is a huge number of third-party libraries that can be and are
>   used, even though they are 'full of inefficient code to take care of
>   all possible cases, etc.'

I was out taking a walk recently, thinking about the abomination that is 
the opendesktop clot of code (including systemd), and thinking over the 
bloat in modern code.

That bloat is essentially a lot of "knowledge base articles" rewritten 
as software.

People want computers to think for them, more than they want computers 
to help them think.

And Forth helps us think through our problems, ...
 
> * You can publish the Python code, and another scientist can use it to
>   reproduce your result (and check what you did to the data to get the
>   result).  This requires a stronger level of portability than the
>   concept of "programmer portability" or the attitude "you can do it
>   on every system using carnal knowledge" that we can often see here.

Actually, the problem with sharing code in Forth is that most people, 
scientists included, don't want the dual burden of understanding the 
stack games that the programmer worked out to avoid having to use 
words that access deeply in the stack.

They want to read with partial understanding, just enough to convince 
themselves that the code they are using really solves the problem they 
are wanting to solve. 

That's a different task from understanding the code, or even the problem.

> So, while the positions that are often called the Forth philosophy
> have their virtues in some contexts, they are probably a major
> contributor for Forth's decline in astronomy.

Decline?

> Some want to make us believe that the reason for the lack of
> popularity of Forth is the lack of a marketing campaign by a big
> corporation, but if that was the case, astronomers would be
> programming in PL/I, not Python.  Also, it's pretty hard to wean
> programmers off their favourite language, and network effects make it
> easy for a language to stay in a field where it is strong.  Forth
> obviously dropped the ball in astronomy.

I don't think so. Forth is deeply interwoven in this planet's history 
of computing, and in the technology.

Much of that history is trying to escape from what Forth gives the 
engineer, but that is also impossible.

> Anyway, my conclusions: The positions that are usually presented as
> Forth philosophy are not beneficial in every case, so we should not
> treat them as absolutes.  And some of the things that are often
> maligned here, in particular, libraries, are actually helpful in many
> cases.

If we really want to make a "popular Forth", we would start with demoting 
the integer.

Then we would proceed to produce an infix interpreter (and a few words 
to escape from it when we want) and agree on a standard version of that
interpreter.

(Actually, we could have several, modeled after each of several of the 
popular languages.)

We apparently have optimization better developed than I'd thought, and 
I keep hearing that we have macro-pre-processor tools to help us lop 
bits of source that are not needed for a particular OS or environment.

Using C as an example, we could construct an ANSI C interpreter, and 
then we could add some things like optional namespaces, with a #pragma 
called FORTH_DIALECT_C or something, to turn them off and on, and 
another to test whether the dialect is available.

The question is whether anyone interested in popularizing Forth has 
the time (and money to support himself and his family) to do it.

(I currently have the time, but not the money. In a few more days, I
probably won't have the time, either.)

> - anton
> -- 
> M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
> comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
>      New standard: http://www.forth200x.org/forth200x.html
>    EuroForth 2017: http://www.euroforth.org/ef17/

One last thought to kind of throw a little water on the flame war at 
"THAT WON'T BE FORTH!!!!!" ...

Every application written, in any language, really, defines its own 
language. That is true from a mathematicians point of view, and it's 
true enough from the non-mathematical person's viewpoint, as well.

--
Joel Rees

Trying to re-invent the industry all by myself:
http://defining-computers.blogspot.jp/

[toc] | [prev] | [next] | [standalone]


#60681 — Re: A Small Challenge (Re: Astronomy and programming languages)

FromPaul Rubin <no.email@nospam.invalid>
Date2017-06-12 22:52 -0700
SubjectRe: A Small Challenge (Re: Astronomy and programming languages)
Message-ID<871sqo4eor.fsf@nightsong.com>
In reply to#60680
Joel Rees <joel.rees@gmail.com> writes:
> How about writing a C compiler in Forth?  I recall that, about thirty
> years ago, many were saying it could be done.

There is a partial C to Forth converter on mpeforth.com somewhere, iirc.
Maybe that counts.

[toc] | [prev] | [next] | [standalone]


#60693 — Re: A Small Challenge (Re: Astronomy and programming languages)

FromRod Pemberton <NeedNotReplyHere@xrsevnneqk.cem>
Date2017-06-13 10:04 -0400
SubjectRe: A Small Challenge (Re: Astronomy and programming languages)
Message-ID<20170613100422.3c624a77@_>
In reply to#60680
On Mon, 12 Jun 2017 22:20:37 -0700 (PDT)
Joel Rees <joel.rees@gmail.com> wrote:

> How about writing a C compiler in Forth?

...

> I recall that, about thirty years ago, many were saying it could be
> done.

There are some complexities to parsing C.  It's not as simple and
straight forward as it seems.  But, if you get past that, then you need
to convert C's functions, which take function parameters, to
zero-operand, i.e., stack based, like Forth.  C doesn't require a stack
for functions, but most C's use one because it allows for recursion.
I.e., C's function calls push and pop arguments to the stack.  Once the
behavior to push/pop parameters is implemented, then you need to convert
C's control-flow to Forth.  I think that would cover a very large
percentage of C, if not all of it.

In other words, most of Forth (high-level) is basically procedures
with a bunch of C function calls declared as "void function
(void)" (i.e., zero-operand) with some control-flow.  Some procedures
primitives which do work.  You'd need to contort/rewrite C to fit this
simpler model.

> Using C as an example, we could construct an ANSI C interpreter,

There are ANSI C interpreters out there.  So far, I haven't seen any
which are able to implement the entire C language.  The ones I'm aware
of are not coded in Forth either.  However, they could be modified to
emit Forth.  The same is probably true of C compilers.  Someone should
be able to convert GCC's IR or AST to Forth.

Anyway, my suggestion would be to modify an existing project which
parses C correctly, e.g., GCC, and convert the intermediate code
produced by such a compiler to Forth.  Less work.  More accurate.


Rod Pemberton
-- 
The Paris Agreement is irrelevant. A carbon tax is futile. The only
solution is technology. Please tell Elon Musk that he is not being a
technology visionary.

[toc] | [prev] | [next] | [standalone]


#60694 — Re: A Small Challenge (Re: Astronomy and programming languages)

Fromminforth@arcor.de
Date2017-06-13 07:30 -0700
SubjectRe: A Small Challenge (Re: Astronomy and programming languages)
Message-ID<50ea6710-6357-49c7-b35c-297e860cb216@googlegroups.com>
In reply to#60680
Am Dienstag, 13. Juni 2017 07:20:38 UTC+2 schrieb Joel Rees:
> On Saturday, June 3, 2017 at 7:35:30 PM UTC+9, Anton Ertl wrote:
> > [...]
> > The interesting thing for Forthers context is that Forth used to be
> > very strong in astronomy.  There is a section in the article titled
> > "Why Python?"  Some of the reasons mentioned there are an antithesis
> > to the positions many present as Forth philosophy: It is used
> > because:
> > 
> > * it works nicely with other languages such as C and Fortran, rather
> >   than doing everything yourself because you can do it better.
> 
> How about writing a C compiler in Forth?
> 

There is no software value per se without any application (if it's not
educational or pastime). So C code upfront translated to Forth backend
must show benefits which I fail to see. Both languages are too similar
and low-level. Forth's major benefit is its interactivity.

I could imagine a Forth system with an interactively controllable
embedded C compiler like tcc.

Or a C Compiler married with a preprocessing Forth macro system.

But is it worth the effort? 

So what remains are embedded DSL Interpreters built in Forth.
Embedded Compilers are very rare in practice.

[toc] | [prev] | [next] | [standalone]


#60698 — Re: A Small Challenge (Re: Astronomy and programming languages)

FromCecil Bayona <cbayona@cbayona.com>
Date2017-06-13 10:52 -0500
SubjectRe: A Small Challenge (Re: Astronomy and programming languages)
Message-ID<ohp1hp$sa6$1@dont-email.me>
In reply to#60680
On 6/13/2017 12:20 AM, Joel Rees wrote:
>
> 
> How about writing a C compiler in Forth?
> 
> I recall that, about thirty years ago, many were saying it could be done.
> 
> If I had the money to support myself while I did it, I would think it
> great fun. But I would be careful to retain Forth's split stack and
> other run-time architecture features. Otherwise, why bother?
> 
> The whole purpose being to get Forth playing nice with other languages, ....
> 

In the 80s I was working at porting a homemade C compiler to various 
CPUs and one of the things I did was to include a Forth engine inside 
the C compiler, I used it to generate the code and optimize it for the 
target CPU. Since the C compiler used a recursive decent LL3 grammar, it 
naturally generated RPN code which the Forth compiler took, optimized 
and generated the output code. I planned eventually to write the whole 
thing in Forth but never got to do it as life got in the way.

> 
> We apparently have optimization better developed than I'd thought, and
> I keep hearing that we have macro-pre-processor tools to help us lop
> bits of source that are not needed for a particular OS or environment.
> 

Optimization has gotten to be excellent but its way complicated compared 
to alternatives which although not as good it can be excellent and 
simple to understand using advance macro processors, it's not often used 
but I like the approach.

> --
> Joel Rees
> 
> Trying to re-invent the industry all by myself:
> http://defining-computers.blogspot.jp/
> 


-- 
Cecil - k5nwa

[toc] | [prev] | [standalone]


Page 7 of 7 — ← Prev page 1 2 3 4 5 6 [7]

Back to top | Article view | comp.lang.forth


csiph-web