Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Premature optimization is the root of all evil. -- D. E. Knuth


devel / comp.lang.forth / Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

SubjectAuthor
* Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Andreas Neuner
+* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Zbig
|`* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Lorem Ipsum
| +- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Zbig
| `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?none
|  `- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Lorem Ipsum
+* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Anton Ertl
|`- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Andreas Neuner
+- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?minforth
+* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Marcel Hendrix
|`- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?none
+* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Brian Fox
|`* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Anton Ertl
| `- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Zbig
+- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?dxforth
+* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Brian Fox
|+- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?dxforth
|+- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?none
|+* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?none
||`* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?NN
|| `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?none
||  `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Brian Fox
||   `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?none
||    `- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Brian Fox
|+- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?none
|+* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?none
||+* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Marcel Hendrix
|||+- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?none
|||`* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Anton Ertl
||| `- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?none
||`* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Brian Fox
|| `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?none
||  +* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?ccur...@gmail.com
||  |`* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?minforth
||  | `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?dxforth
||  |  `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?minforth
||  |   +* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Marcel Hendrix
||  |   |+* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?minforth
||  |   ||`- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?JKN
||  |   |`* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Anton Ertl
||  |   | +* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?minforth
||  |   | |`* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Anton Ertl
||  |   | | `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Marcel Hendrix
||  |   | |  +* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?none
||  |   | |  |`* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Marcel Hendrix
||  |   | |  | `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?none
||  |   | |  |  `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Marcel Hendrix
||  |   | |  |   `- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?none
||  |   | |  `- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Anton Ertl
||  |   | `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Marcel Hendrix
||  |   |  +* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?none
||  |   |  |`* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Marcel Hendrix
||  |   |  | `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?minforth
||  |   |  |  `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Marcel Hendrix
||  |   |  |   `- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?dxforth
||  |   |  `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Anton Ertl
||  |   |   `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Marcel Hendrix
||  |   |    `- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Anton Ertl
||  |   +- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?dxforth
||  |   `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?none
||  |    +- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?dxforth
||  |    `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?minforth
||  |     `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Marcel Hendrix
||  |      `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?minforth
||  |       `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Marcel Hendrix
||  |        `- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?minforth
||  `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Andy Valencia
||   `- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?ccur...@gmail.com
|`* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?none
| `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Kaz Kylheku
|  `- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?none
`* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Gerry Jackson
 `* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Marcel Hendrix
  +* Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?none
  |`- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?Andreas Neuner
  `- Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?dxforth

Pages:1234
Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23692&group=comp.lang.forth#23692

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:8c5:b0:618:8410:f02f with SMTP id da5-20020a05621408c500b006188410f02fmr824054qvb.0.1685206800727;
Sat, 27 May 2023 10:00:00 -0700 (PDT)
X-Received: by 2002:a05:620a:4587:b0:75c:b18b:713c with SMTP id
bp7-20020a05620a458700b0075cb18b713cmr814632qkb.14.1685206800501; Sat, 27 May
2023 10:00:00 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 27 May 2023 10:00:00 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2003:cb:272a:7808:c42f:b4df:8889:7d3;
posting-account=_otJbgoAAAAn0WpUMJ4jAhuhvrT5XpAU
NNTP-Posting-Host: 2003:cb:272a:7808:c42f:b4df:8889:7d3
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
Subject: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
From: andreas.neuner@w3group.de (Andreas Neuner)
Injection-Date: Sat, 27 May 2023 17:00:00 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 5
 by: Andreas Neuner - Sat, 27 May 2023 17:00 UTC

Because FORTH Code is far more condensed and efficient, how many lines of FORTH Code would I need to recode a 10000 LOC C application?
Only as a raw estimation. I'm sure people there are people around here who have recoded some C apps.

Thank you
Best Wishes
Andreas

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<beb4a2c3-5412-4893-9555-184bc6abf376n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23693&group=comp.lang.forth#23693

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:40d6:b0:757:6864:6d0 with SMTP id g22-20020a05620a40d600b00757686406d0mr892438qko.4.1685210686510;
Sat, 27 May 2023 11:04:46 -0700 (PDT)
X-Received: by 2002:a05:620a:46ac:b0:759:40d8:b265 with SMTP id
bq44-20020a05620a46ac00b0075940d8b265mr985310qkb.0.1685210686298; Sat, 27 May
2023 11:04:46 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 27 May 2023 11:04:45 -0700 (PDT)
In-Reply-To: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=83.22.134.113; posting-account=cxuXKwoAAABQpPOMD55A9IPz7pPrw6ml
NNTP-Posting-Host: 83.22.134.113
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <beb4a2c3-5412-4893-9555-184bc6abf376n@googlegroups.com>
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
From: zbigniew2011@gmail.com (Zbig)
Injection-Date: Sat, 27 May 2023 18:04:46 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1498
 by: Zbig - Sat, 27 May 2023 18:04 UTC

OK, let's see:

„Hello, world” program in C:

#include <stdio.h>
int main()
{ printf("Hello, world!");
return 0;
}

„Hello, world” program in Forth:

..( Hello, world! )

It seems the Forth program will take about 1/6 lines of similar C program.

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<fb7e7f22-2b83-48e2-9f48-f2febaab027an@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23694&group=comp.lang.forth#23694

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:95:b0:3f1:fc85:9d74 with SMTP id o21-20020a05622a009500b003f1fc859d74mr1447848qtw.6.1685216825273;
Sat, 27 May 2023 12:47:05 -0700 (PDT)
X-Received: by 2002:a05:622a:1a29:b0:3f7:fc71:f3ad with SMTP id
f41-20020a05622a1a2900b003f7fc71f3admr1356737qtb.9.1685216824992; Sat, 27 May
2023 12:47:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 27 May 2023 12:47:04 -0700 (PDT)
In-Reply-To: <beb4a2c3-5412-4893-9555-184bc6abf376n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=63.114.57.174; posting-account=I-_H_woAAAA9zzro6crtEpUAyIvzd19b
NNTP-Posting-Host: 63.114.57.174
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com> <beb4a2c3-5412-4893-9555-184bc6abf376n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <fb7e7f22-2b83-48e2-9f48-f2febaab027an@googlegroups.com>
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
From: gnuarm.deletethisbit@gmail.com (Lorem Ipsum)
Injection-Date: Sat, 27 May 2023 19:47:05 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 27
 by: Lorem Ipsum - Sat, 27 May 2023 19:47 UTC

On Saturday, May 27, 2023 at 2:04:47 PM UTC-4, Zbig wrote:
> OK, let's see:
>
> „Hello, world” program in C:
>
> #include <stdio.h>
> int main()
> {
> printf("Hello, world!");
> return 0;
> }
>
> „Hello, world” program in Forth:
>
> .( Hello, world! )
>
> It seems the Forth program will take about 1/6 lines of similar C program..

It's been a while since I looked at LOC much, but don't they actually use SLOC, which removes the cruft and only counts functional lines?

--

Rick C.

- Get 1,000 miles of free Supercharging
- Tesla referral code - https://ts.la/richard11209

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<2023May27.214128@mips.complang.tuwien.ac.at>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23695&group=comp.lang.forth#23695

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
Date: Sat, 27 May 2023 19:41:28 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 24
Message-ID: <2023May27.214128@mips.complang.tuwien.ac.at>
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
Injection-Info: dont-email.me; posting-host="3d3ae75f349545b0de86902be6235221";
logging-data="564679"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+h54cxHi4ul0DuunQIeyE"
Cancel-Lock: sha1:iGgj2j6SCRaDNprmO+MrxTEGyyI=
X-newsreader: xrn 10.11
 by: Anton Ertl - Sat, 27 May 2023 19:41 UTC

Andreas Neuner <andreas.neuner@w3group.de> writes:
>Because FORTH Code is far more condensed and efficient, how many lines of FORTH Code would I need to recode a 10000 LOC C application?

Depends on what you mean by "recode". Wil Baden has taken some
"profane" (as he put it) code and recoded it in Forth, with the result
looking unidiomatic IMO (in particular, long definitions). If you
want to go this way, you may compare the code sizes of Forth and C for
the stuff he did. Another exercise in that direction is Gilbreath's
Sieve, which he wrote in a number of languages, including Forth.

Another approach is to write the application from requirements.
Somewhat in that direction is
http://www.euroforth.org/ef99/ertl99.pdf, where I compared parser
generators written in different languages; the requirements were not
the same, but the formal nature of the subject causes relatively
similar requirements (e.g., they all take grammars as inputs and
produce programs as output).

- 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: https://forth-standard.org/
EuroForth 2022: https://euro.theforth.net

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<5eb294c2-a897-485b-a1d8-c112d6375444n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23696&group=comp.lang.forth#23696

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:1999:b0:74e:437f:e942 with SMTP id bm25-20020a05620a199900b0074e437fe942mr835294qkb.8.1685218340475;
Sat, 27 May 2023 13:12:20 -0700 (PDT)
X-Received: by 2002:a05:620a:4093:b0:75b:15b6:7677 with SMTP id
f19-20020a05620a409300b0075b15b67677mr988568qko.13.1685218340279; Sat, 27 May
2023 13:12:20 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 27 May 2023 13:12:20 -0700 (PDT)
In-Reply-To: <fb7e7f22-2b83-48e2-9f48-f2febaab027an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=83.22.134.113; posting-account=cxuXKwoAAABQpPOMD55A9IPz7pPrw6ml
NNTP-Posting-Host: 83.22.134.113
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
<beb4a2c3-5412-4893-9555-184bc6abf376n@googlegroups.com> <fb7e7f22-2b83-48e2-9f48-f2febaab027an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5eb294c2-a897-485b-a1d8-c112d6375444n@googlegroups.com>
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
From: zbigniew2011@gmail.com (Zbig)
Injection-Date: Sat, 27 May 2023 20:12:20 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1489
 by: Zbig - Sat, 27 May 2023 20:12 UTC

> It's been a while since I looked at LOC much, but don't they actually use SLOC, which removes the cruft and only counts functional lines?

;)

More seriously: I hope you see the question doesn't make much sense?

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<ec553139-f7de-4b56-b263-2137242efaa5n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23697&group=comp.lang.forth#23697

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:1a08:b0:75c:dc02:afb5 with SMTP id bk8-20020a05620a1a0800b0075cdc02afb5mr129360qkb.6.1685219613718;
Sat, 27 May 2023 13:33:33 -0700 (PDT)
X-Received: by 2002:a05:622a:1996:b0:3f8:20a:1c73 with SMTP id
u22-20020a05622a199600b003f8020a1c73mr1513863qtc.5.1685219613454; Sat, 27 May
2023 13:33:33 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 27 May 2023 13:33:33 -0700 (PDT)
In-Reply-To: <2023May27.214128@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:cb:272a:7808:f919:b9a2:3ed3:6ebc;
posting-account=_otJbgoAAAAn0WpUMJ4jAhuhvrT5XpAU
NNTP-Posting-Host: 2003:cb:272a:7808:f919:b9a2:3ed3:6ebc
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com> <2023May27.214128@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ec553139-f7de-4b56-b263-2137242efaa5n@googlegroups.com>
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
From: andreas.neuner@w3group.de (Andreas Neuner)
Injection-Date: Sat, 27 May 2023 20:33:33 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2138
 by: Andreas Neuner - Sat, 27 May 2023 20:33 UTC

Anton Ertl schrieb am Samstag, 27. Mai 2023 um 21:53:14 UTC+2:
> Andreas Neuner <andreas...@w3group.de> writes:
> >Because FORTH Code is far more condensed and efficient, how many lines of FORTH Code would I need to recode a 10000 LOC C application?
> Depends on what you mean by "recode". Wil Baden has taken some

Not a simple 1:1 translation. Implementing the same requirements in Forth.

> Another approach is to write the application from requirements.
> Somewhat in that direction is
> http://www.euroforth.org/ef99/ertl99.pdf, where I compared parser

yes! thats it.
Thank you Anton.

Best wishes
Andi

> - 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: https://forth-standard.org/
> EuroForth 2022: https://euro.theforth.net

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<48cb3ea0-5622-49ad-baf4-0daf3b4e02dbn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23698&group=comp.lang.forth#23698

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:1a12:b0:3f6:ad84:9ac9 with SMTP id f18-20020a05622a1a1200b003f6ad849ac9mr1592378qtb.0.1685222984036;
Sat, 27 May 2023 14:29:44 -0700 (PDT)
X-Received: by 2002:ac8:570f:0:b0:3f3:8d9c:7d4 with SMTP id
15-20020ac8570f000000b003f38d9c07d4mr1580279qtw.4.1685222983839; Sat, 27 May
2023 14:29:43 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!newsfeed.hasname.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 27 May 2023 14:29:43 -0700 (PDT)
In-Reply-To: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.34.176.205; posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 80.34.176.205
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <48cb3ea0-5622-49ad-baf4-0daf3b4e02dbn@googlegroups.com>
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
From: minforth@arcor.de (minforth)
Injection-Date: Sat, 27 May 2023 21:29:44 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1649
 by: minforth - Sat, 27 May 2023 21:29 UTC

Andreas Neuner schrieb am Samstag, 27. Mai 2023 um 19:00:02 UTC+2:
> Because FORTH Code is far more condensed and efficient, how many lines of FORTH Code would I need to recode a 10000 LOC C application?
> Only as a raw estimation. I'm sure people there are people around here who have recoded some C apps.

That's no fun job if there's no real good reason behind.

I would probably just call libtcc from Forth and use the C sources as they are:
https://bellard.org/tcc/tcc-doc.html#Libtcc

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<9214c492-d28a-43fa-bc94-a6f32a3a3ca8n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23699&group=comp.lang.forth#23699

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:306:b0:3f6:aaac:6ffb with SMTP id q6-20020a05622a030600b003f6aaac6ffbmr1573673qtw.3.1685224528002;
Sat, 27 May 2023 14:55:28 -0700 (PDT)
X-Received: by 2002:a05:622a:1190:b0:3f5:2504:4db9 with SMTP id
m16-20020a05622a119000b003f525044db9mr1471274qtk.13.1685224527841; Sat, 27
May 2023 14:55:27 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 27 May 2023 14:55:27 -0700 (PDT)
In-Reply-To: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f18:6d00:154d:d7b5:cc6b:f06a;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f18:6d00:154d:d7b5:cc6b:f06a
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9214c492-d28a-43fa-bc94-a6f32a3a3ca8n@googlegroups.com>
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
From: mhx@iae.nl (Marcel Hendrix)
Injection-Date: Sat, 27 May 2023 21:55:27 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2111
 by: Marcel Hendrix - Sat, 27 May 2023 21:55 UTC

On Saturday, May 27, 2023 at 7:00:02 PM UTC+2, Andreas Neuner wrote:
> Because FORTH Code is far more condensed and efficient, how many lines
> of FORTH Code would I need to recode a 10000 LOC C application?
> Only as a raw estimation. I'm sure people there are people around here who have recoded some C apps.

Very difficult to say without more information on what needs to be done.
The Forth code can be very compact because normally Forth will be extended
to fullfil the requirements of the application. Size also depends on the amount of
special libraries that are needed and of course, the programmer.

An (atypical) example is a SPICE-like circuit simulator. In iForth this is 10,000
LOC (including comments) in 5 files. The open source ngspice simulator
counts 16,481 source files with a total size of 2.4 GB.

-marcel

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<d945bbba-9075-486b-9395-2ed608013589n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23700&group=comp.lang.forth#23700

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:242:b0:3f6:be61:9cf1 with SMTP id c2-20020a05622a024200b003f6be619cf1mr1764006qtx.2.1685237565748;
Sat, 27 May 2023 18:32:45 -0700 (PDT)
X-Received: by 2002:a05:622a:1888:b0:3f6:b933:5c12 with SMTP id
v8-20020a05622a188800b003f6b9335c12mr975707qtc.1.1685237565498; Sat, 27 May
2023 18:32:45 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 27 May 2023 18:32:45 -0700 (PDT)
In-Reply-To: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=184.75.211.138; posting-account=2z7GawoAAADc70p5SM5AbaCyzjLblS3g
NNTP-Posting-Host: 184.75.211.138
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d945bbba-9075-486b-9395-2ed608013589n@googlegroups.com>
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
From: brian.fox@brianfox.ca (Brian Fox)
Injection-Date: Sun, 28 May 2023 01:32:45 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2754
 by: Brian Fox - Sun, 28 May 2023 01:32 UTC

On Saturday, May 27, 2023 at 1:00:02 PM UTC-4, Andreas Neuner wrote:
> Because FORTH Code is far more condensed and efficient, how many lines of FORTH Code would I need to recode a 10000 LOC C application?
> Only as a raw estimation. I'm sure people there are people around here who have recoded some C apps.
>
> Thank you
> Best Wishes
> Andreas

I am not an expert but when I have looked at C code compared to Forth
the results can be quite varied on which is smaller.
It seems to depend on if the problem plays to the strengths of one or the other.

And sometimes (maybe most of the time?) Forth coders build a solution that
would not make sense in C. My favourite example is making an Assembler.

The C program will be a substantial project because it has to create everything.

A Forth assembler is normally a set of tiny "assemblers" for each instruction.
These little "assembler" are knitted together to make programs.

These kind of solutions can cause a cry of "foul" in 'C' camp because the
project is not complete by their standards and from the conventional
perspective this is true however for the Forth world it's all we need.

I know Stephen Pelc has commented in that past that on the Europay
project the Forth programs were smaller than the equivalents written by
competent 'C' programmers. I don't remember the exact ratio nor do
I remember if that was the final binary or the source size or both.

Perhaps Stephen can refresh our memories.

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<u4ugbf$nln3$2@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23702&group=comp.lang.forth#23702

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxforth@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
Date: Sun, 28 May 2023 13:04:14 +1000
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <u4ugbf$nln3$2@dont-email.me>
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 28 May 2023 03:04:15 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d1af32e46d9c57c3987302b589fd5a18";
logging-data="775907"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ET2YdJk8buCkvJSpzLBDJ"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.10.1
Cancel-Lock: sha1:o7/6ujmumb33LTUhLMpOQGlUU6I=
Content-Language: en-GB
In-Reply-To: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
 by: dxforth - Sun, 28 May 2023 03:04 UTC

On 28/05/2023 3:00 am, Andreas Neuner wrote:
>
> I'm sure people there are people around here who have recoded some C apps.

I've done that one or twice and the result was (unsurprisingly) much like C.
It's very difficult to un-see the map put in front of you.

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<2023May28.085206@mips.complang.tuwien.ac.at>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23703&group=comp.lang.forth#23703

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
Date: Sun, 28 May 2023 06:52:06 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 46
Message-ID: <2023May28.085206@mips.complang.tuwien.ac.at>
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com> <d945bbba-9075-486b-9395-2ed608013589n@googlegroups.com>
Injection-Info: dont-email.me; posting-host="b48303022fffdf0675972a95b45334c0";
logging-data="832390"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19PCfHnWwxdxH3KRVw2gQme"
Cancel-Lock: sha1:JY9rsOR6LeYmLzzuFUU4TE3cXEY=
X-newsreader: xrn 10.11
 by: Anton Ertl - Sun, 28 May 2023 06:52 UTC

Brian Fox <brian.fox@brianfox.ca> writes:
>And sometimes (maybe most of the time?) Forth coders build a solution tha=
>t
>would not make sense in C. My favourite example is making an Assembler.
>
>The C program will be a substantial project because it has to create everyt=
>hing.
>
>A Forth assembler is normally a set of tiny "assemblers" for each instructi=
>on.
>These little "assembler" are knitted together to make programs.=20

One way to emulate the Forth approach in C is to have a library with a
bunch of definitions for assembler functions/macros and then write the
assembly-language program like this:

#include <asm.h>
int main()
{ global("start");
movrm(rax,disp(8,rdi));
addrm(rax,idx(0,rsi,rcx,8));
ret();
return 0;
}

then compile and run this program, and get the object file as result.
I have seen such techniques used by C++ programmers, but it's not
really idiomatic in C. I think there are several reasons for this:

* As we can see, it results in a not-so-nice syntax. C++ has ways to
make the syntax look nicer.

* When C started, compiling it was slow, so you wanted to avoid that
additional step. So you bit the bullet, and wrote a parser for the
assembly language, which then called these functions/macros without
needing to compile a program to do it. When C++ came in full swing,
machines were faster and had much more RAM, so the practical costs
of such techniques were more acceptable.

- 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: https://forth-standard.org/
EuroForth 2022: https://euro.theforth.net

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<c7a0de8c-b5d9-4a99-93b0-b5c42b034e2an@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23705&group=comp.lang.forth#23705

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:28cb:b0:75c:b403:271 with SMTP id l11-20020a05620a28cb00b0075cb4030271mr1272490qkp.1.1685267350461;
Sun, 28 May 2023 02:49:10 -0700 (PDT)
X-Received: by 2002:a05:622a:1a12:b0:3f6:ad84:9ac9 with SMTP id
f18-20020a05622a1a1200b003f6ad849ac9mr1859504qtb.0.1685267350294; Sun, 28 May
2023 02:49:10 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer03.ams4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 28 May 2023 02:49:10 -0700 (PDT)
In-Reply-To: <2023May28.085206@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=83.22.134.113; posting-account=cxuXKwoAAABQpPOMD55A9IPz7pPrw6ml
NNTP-Posting-Host: 83.22.134.113
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
<d945bbba-9075-486b-9395-2ed608013589n@googlegroups.com> <2023May28.085206@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c7a0de8c-b5d9-4a99-93b0-b5c42b034e2an@googlegroups.com>
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
From: zbigniew2011@gmail.com (Zbig)
Injection-Date: Sun, 28 May 2023 09:49:10 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1516
 by: Zbig - Sun, 28 May 2023 09:49 UTC

To sum up: ANY Forth program can be written in a single* line
of code; just the length of that line may vary. :)

*) (Proper) Forth screens don't contain end-of-line characters.

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<nnd$24ebb711$5b827588@cf00b16e83dbf0e6>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23706&group=comp.lang.forth#23706

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com> <beb4a2c3-5412-4893-9555-184bc6abf376n@googlegroups.com> <fb7e7f22-2b83-48e2-9f48-f2febaab027an@googlegroups.com>
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: albert@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$24ebb711$5b827588@cf00b16e83dbf0e6>
Organization: KPN B.V.
Date: Sun, 28 May 2023 13:00:58 +0200
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe005.abavia.com!abp003.abavia.com!news.kpn.nl!not-for-mail
Lines: 73
Injection-Date: Sun, 28 May 2023 13:00:58 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 3039
 by: none - Sun, 28 May 2023 11:00 UTC

In article <fb7e7f22-2b83-48e2-9f48-f2febaab027an@googlegroups.com>,
Lorem Ipsum <gnuarm.deletethisbit@gmail.com> wrote:
>On Saturday, May 27, 2023 at 2:04:47 PM UTC-4, Zbig wrote:
>> OK, let's see:
>>
>> „Hello, world” program in C:
>>
>> #include <stdio.h>
>> int main()
>> {
>> printf("Hello, world!");
>> return 0;
>> }
>>
>> „Hello, world” program in Forth:
>>
>> .( Hello, world! )
>>
>> It seems the Forth program will take about 1/6 lines of similar C program.
>
>It's been a while since I looked at LOC much, but don't they actually
use SLOC, which removes the cruft and only counts functional lines?

In forth I look at WOC's (words of code) similarly stripping comments.
----------
#!/bin/sh

cat $1 |\
sed -e 's/\\ .*//' |\
sed -e 's/( [^)]*)//g' |\
sed -e '/\<DOC\>/,/\<ENDDOC\>/d'|\
sed -e 's/\\D .*//' |\
wc -w

exit
----------
My crc facility is 62 woc.

But look at the code, the table is generated on the fly,
a table included in c has dozens of loc's or 512 woc's.
This cannot be done in c.

----------------------------------------------------
( CRC-MORE CRC ) CF: ?32 \ AvdH C2feb27

"BOUNDS" WANTED "-scripting-" WANTED HEX
\ Well the polynomial
EDB8,8320 CONSTANT CRC32_POLYNOMIAL \ CRC-32K
\ Auxiliary table with values for single bytes.
CREATE CRCTable
100 0 DO I 8 0 DO
DUP >R 1 RSHIFT R> 1 AND IF CRC32_POLYNOMIAL XOR THEN
LOOP , LOOP
\ For initial CRC and BUFFER COUNT pair, leave the updated CRC
: CRC-MORE BOUNDS ?DO DUP I C@ XOR 0FF AND CELLS CRCTable + @
SWAP 8 RSHIFT XOR LOOP ;
\ For BUFFER COUNT pair, leave the CRC .
: CRC -1 ROT ROT CRC-MORE INVERT ;
DECIMAL
----------------------------------------------------

I think any "fair" comparison is bound to give c an unfair
advantage.

> Rick C.

Groetjes Albert
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning. - the Wise from Antrim -

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<nnd$25b20a80$4dc2b066@cf00b16e83dbf0e6>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23707&group=comp.lang.forth#23707

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com> <9214c492-d28a-43fa-bc94-a6f32a3a3ca8n@googlegroups.com>
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: albert@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$25b20a80$4dc2b066@cf00b16e83dbf0e6>
Organization: KPN B.V.
Date: Sun, 28 May 2023 13:05:56 +0200
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe006.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 32
Injection-Date: Sun, 28 May 2023 13:05:56 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 2328
 by: none - Sun, 28 May 2023 11:05 UTC

In article <9214c492-d28a-43fa-bc94-a6f32a3a3ca8n@googlegroups.com>,
Marcel Hendrix <mhx@iae.nl> wrote:
>On Saturday, May 27, 2023 at 7:00:02 PM UTC+2, Andreas Neuner wrote:
>> Because FORTH Code is far more condensed and efficient, how many lines
>> of FORTH Code would I need to recode a 10000 LOC C application?
>> Only as a raw estimation. I'm sure people there are people around here who have recoded some C apps.
>
>Very difficult to say without more information on what needs to be done.
>The Forth code can be very compact because normally Forth will be extended
>to fullfil the requirements of the application. Size also depends on the amount of
>special libraries that are needed and of course, the programmer.
>
>An (atypical) example is a SPICE-like circuit simulator. In iForth this is 10,000
>LOC (including comments) in 5 files. The open source ngspice simulator
>counts 16,481 source files with a total size of 2.4 GB.

I want to draw attention to another thread. I like to port an editor to
Forth. It has a facility to compile escape sequences to list of
actions, that are interpreted. I expect that an order of magnitude easier in
Forth, and also way more compact. (The editor is sort of a cross between
emacs and vim, with lots of disadvantages removed.)

>
>-marcel

Groetjes Albert
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning. - the Wise from Antrim -

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<447119fc-1b92-45fb-918e-1dda78b0b293n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23708&group=comp.lang.forth#23708

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:315:b0:3f5:4c07:5a64 with SMTP id q21-20020a05622a031500b003f54c075a64mr2002391qtw.7.1685274311105;
Sun, 28 May 2023 04:45:11 -0700 (PDT)
X-Received: by 2002:a05:6214:901:b0:61a:bbd9:2c64 with SMTP id
dj1-20020a056214090100b0061abbd92c64mr1016904qvb.6.1685274310785; Sun, 28 May
2023 04:45:10 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 28 May 2023 04:45:10 -0700 (PDT)
In-Reply-To: <nnd$24ebb711$5b827588@cf00b16e83dbf0e6>
Injection-Info: google-groups.googlegroups.com; posting-host=63.114.57.174; posting-account=I-_H_woAAAA9zzro6crtEpUAyIvzd19b
NNTP-Posting-Host: 63.114.57.174
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
<beb4a2c3-5412-4893-9555-184bc6abf376n@googlegroups.com> <fb7e7f22-2b83-48e2-9f48-f2febaab027an@googlegroups.com>
<nnd$24ebb711$5b827588@cf00b16e83dbf0e6>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <447119fc-1b92-45fb-918e-1dda78b0b293n@googlegroups.com>
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
From: gnuarm.deletethisbit@gmail.com (Lorem Ipsum)
Injection-Date: Sun, 28 May 2023 11:45:11 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3765
 by: Lorem Ipsum - Sun, 28 May 2023 11:45 UTC

On Sunday, May 28, 2023 at 7:01:02 AM UTC-4, none albert wrote:
> In article <fb7e7f22-2b83-48e2...@googlegroups.com>,
> Lorem Ipsum <gnuarm.del...@gmail.com> wrote:
> >On Saturday, May 27, 2023 at 2:04:47 PM UTC-4, Zbig wrote:
> >> OK, let's see:
> >>
> >> „Hello, world” program in C:
> >>
> >> #include <stdio.h>
> >> int main()
> >> {
> >> printf("Hello, world!");
> >> return 0;
> >> }
> >>
> >> „Hello, world” program in Forth:
> >>
> >> .( Hello, world! )
> >>
> >> It seems the Forth program will take about 1/6 lines of similar C program.
> >
> >It's been a while since I looked at LOC much, but don't they actually
> use SLOC, which removes the cruft and only counts functional lines?
> In forth I look at WOC's (words of code) similarly stripping comments.
> ----------
> #!/bin/sh
>
> cat $1 |\
> sed -e 's/\\ .*//' |\
> sed -e 's/( [^)]*)//g' |\
> sed -e '/\<DOC\>/,/\<ENDDOC\>/d'|\
> sed -e 's/\\D .*//' |\
> wc -w
>
> exit
> ----------
> My crc facility is 62 woc.
>
> But look at the code, the table is generated on the fly,
> a table included in c has dozens of loc's or 512 woc's.
> This cannot be done in c.
>
> ----------------------------------------------------
> ( CRC-MORE CRC ) CF: ?32 \ AvdH C2feb27
>
> "BOUNDS" WANTED "-scripting-" WANTED HEX
> \ Well the polynomial
> EDB8,8320 CONSTANT CRC32_POLYNOMIAL \ CRC-32K
> \ Auxiliary table with values for single bytes.
> CREATE CRCTable
> 100 0 DO I 8 0 DO
> DUP >R 1 RSHIFT R> 1 AND IF CRC32_POLYNOMIAL XOR THEN
> LOOP , LOOP
> \ For initial CRC and BUFFER COUNT pair, leave the updated CRC
> : CRC-MORE BOUNDS ?DO DUP I C@ XOR 0FF AND CELLS CRCTable + @
> SWAP 8 RSHIFT XOR LOOP ;
> \ For BUFFER COUNT pair, leave the CRC .
> : CRC -1 ROT ROT CRC-MORE INVERT ;
> DECIMAL
> ----------------------------------------------------
>
> I think any "fair" comparison is bound to give c an unfair
> advantage.

I think that is adequately self contradictory. Certainly, it would be more useful with a clear explanation.

--

Rick C.

+ Get 1,000 miles of free Supercharging
+ Tesla referral code - https://ts.la/richard11209

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<00e4b748-0cc2-4143-9cd4-ebcb443feb43n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23710&group=comp.lang.forth#23710

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:5895:0:b0:3f6:b519:9487 with SMTP id t21-20020ac85895000000b003f6b5199487mr2101343qta.7.1685328623596;
Sun, 28 May 2023 19:50:23 -0700 (PDT)
X-Received: by 2002:a05:622a:1884:b0:3f6:abf3:d716 with SMTP id
v4-20020a05622a188400b003f6abf3d716mr2071825qtc.2.1685328623353; Sun, 28 May
2023 19:50:23 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 28 May 2023 19:50:23 -0700 (PDT)
In-Reply-To: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:fea8:8921:f200:51ce:15dd:594c:f261;
posting-account=2z7GawoAAADc70p5SM5AbaCyzjLblS3g
NNTP-Posting-Host: 2607:fea8:8921:f200:51ce:15dd:594c:f261
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <00e4b748-0cc2-4143-9cd4-ebcb443feb43n@googlegroups.com>
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
From: brian.fox@brianfox.ca (Brian Fox)
Injection-Date: Mon, 29 May 2023 02:50:23 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2074
 by: Brian Fox - Mon, 29 May 2023 02:50 UTC

On Saturday, May 27, 2023 at 1:00:02 PM UTC-4, Andreas Neuner wrote:
> Because FORTH Code is far more condensed and efficient, how many lines of FORTH Code would I need to recode a 10000 LOC C application?
> Only as a raw estimation. I'm sure people there are people around here who have recoded some C apps.
>
> Thank you
> Best Wishes
> Andreas

This may be of some use to compare C to Forth in a real project.
Here is an exercise to make a LISP interpreter in many languages.

https://github.com/kanaka/mal/tree/master/impls

I was surprised to see a GForth implementation there.

The wild card is that these LISPs are built to a recipe for the course
and so might not fully use idiomatic methods that take advantage
of the implementation language's features. (?)

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<u51861$19cls$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23711&group=comp.lang.forth#23711

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxforth@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
Date: Mon, 29 May 2023 14:03:13 +1000
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <u51861$19cls$1@dont-email.me>
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
<00e4b748-0cc2-4143-9cd4-ebcb443feb43n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 29 May 2023 04:03:13 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="8db6b9df4b6a68e451dec0456f1d5dd3";
logging-data="1356476"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/M5XGePrE7qW6BZmuVrStD"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.10.1
Cancel-Lock: sha1:BEJTtRZUXxfKL+oiQmKy8O0B2xI=
Content-Language: en-GB
In-Reply-To: <00e4b748-0cc2-4143-9cd4-ebcb443feb43n@googlegroups.com>
 by: dxforth - Mon, 29 May 2023 04:03 UTC

On 29/05/2023 12:50 pm, Brian Fox wrote:
> ...
> The wild card is that these LISPs are built to a recipe for the course
> and so might not fully use idiomatic methods that take advantage
> of the implementation language's features. (?)

"There used to be, perhaps still is, a distinction between programmers and
coders. Programmers understand the problem; coders are grunt labour." - CM

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<nnd$14ff8c7a$16c8d5d6@132a6255aa171175>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23712&group=comp.lang.forth#23712

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com> <00e4b748-0cc2-4143-9cd4-ebcb443feb43n@googlegroups.com>
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: albert@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$14ff8c7a$16c8d5d6@132a6255aa171175>
Organization: KPN B.V.
Date: Mon, 29 May 2023 12:17:18 +0200
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe005.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 39
Injection-Date: Mon, 29 May 2023 12:17:18 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 2295
 by: none - Mon, 29 May 2023 10:17 UTC

In article <00e4b748-0cc2-4143-9cd4-ebcb443feb43n@googlegroups.com>,
Brian Fox <brian.fox@brianfox.ca> wrote:
>On Saturday, May 27, 2023 at 1:00:02 PM UTC-4, Andreas Neuner wrote:
>> Because FORTH Code is far more condensed and efficient, how many lines
>of FORTH Code would I need to recode a 10000 LOC C application?
>> Only as a raw estimation. I'm sure people there are people around here
>who have recoded some C apps.
>>
>> Thank you
>> Best Wishes
>> Andreas
>
>This may be of some use to compare C to Forth in a real project.
>Here is an exercise to make a LISP interpreter in many languages.
>
>https://github.com/kanaka/mal/tree/master/impls
>
>I was surprised to see a GForth implementation there.
>
>The wild card is that these LISPs are built to a recipe for the course
>and so might not fully use idiomatic methods that take advantage
>of the implementation language's features. (?)

That was the point of my post. In almost every situation imaginable
there is a Forth exploit, not possible in most other languages,
that may be considered by others as cheating.
My 100 line Pentium I (inclusive floating point) assembler is an example.

The convincing examples were by E. Rather were actual commercial
applications were involved.

Groetjes Albert
>
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning. - the Wise from Antrim -

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<nnd$78c904c1$40e03479@3bdf9eecba976ba5>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23713&group=comp.lang.forth#23713

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com> <00e4b748-0cc2-4143-9cd4-ebcb443feb43n@googlegroups.com>
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: albert@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$78c904c1$40e03479@3bdf9eecba976ba5>
Organization: KPN B.V.
Date: Mon, 29 May 2023 12:33:38 +0200
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!feeder1.feed.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe006.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 39
Injection-Date: Mon, 29 May 2023 12:33:38 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 2285
 by: none - Mon, 29 May 2023 10:33 UTC

In article <00e4b748-0cc2-4143-9cd4-ebcb443feb43n@googlegroups.com>,
Brian Fox <brian.fox@brianfox.ca> wrote:
>On Saturday, May 27, 2023 at 1:00:02 PM UTC-4, Andreas Neuner wrote:
>> Because FORTH Code is far more condensed and efficient, how many lines
>of FORTH Code would I need to recode a 10000 LOC C application?
>> Only as a raw estimation. I'm sure people there are people around here
>who have recoded some C apps.
>>
>> Thank you
>> Best Wishes
>> Andreas
>
>This may be of some use to compare C to Forth in a real project.
>Here is an exercise to make a LISP interpreter in many languages.
>
>https://github.com/kanaka/mal/tree/master/impls

This is why github sucks.
1. There is no way to estimate the size of source files
2. There is no description of source files

You have to click on files to see the content and were it fits in the whole.
All the source combined for dozens as languages takes only 3.6 Mbyte
(that is byte with an M not byte with a G)
That is indicative of only toy lisp.

>
>I was surprised to see a GForth implementation there.
>
>The wild card is that these LISPs are built to a recipe for the course
>and so might not fully use idiomatic methods that take advantage
>of the implementation language's features. (?)
>
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning. - the Wise from Antrim -

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<1b72a450-8166-41a0-9528-69d11694c3a8n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23714&group=comp.lang.forth#23714

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:d82:b0:75c:415a:bf37 with SMTP id q2-20020a05620a0d8200b0075c415abf37mr2062366qkl.3.1685358072748;
Mon, 29 May 2023 04:01:12 -0700 (PDT)
X-Received: by 2002:a05:620a:2404:b0:75b:360b:fcfe with SMTP id
d4-20020a05620a240400b0075b360bfcfemr2057675qkn.6.1685358072518; Mon, 29 May
2023 04:01:12 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!2.eu.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Mon, 29 May 2023 04:01:12 -0700 (PDT)
In-Reply-To: <nnd$78c904c1$40e03479@3bdf9eecba976ba5>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23c5:6f05:3a01:a40c:7a8d:9475:2cb5;
posting-account=9A5f7goAAAD_QfJPZnlK3Xq_UhzYjdP-
NNTP-Posting-Host: 2a00:23c5:6f05:3a01:a40c:7a8d:9475:2cb5
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
<00e4b748-0cc2-4143-9cd4-ebcb443feb43n@googlegroups.com> <nnd$78c904c1$40e03479@3bdf9eecba976ba5>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1b72a450-8166-41a0-9528-69d11694c3a8n@googlegroups.com>
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
From: november.nihal@gmail.com (NN)
Injection-Date: Mon, 29 May 2023 11:01:12 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 53
 by: NN - Mon, 29 May 2023 11:01 UTC

On Monday, 29 May 2023 at 11:33:41 UTC+1, none albert wrote:
> In article <00e4b748-0cc2-4143...@googlegroups.com>,
> Brian Fox <bria...@brianfox.ca> wrote:
> >On Saturday, May 27, 2023 at 1:00:02 PM UTC-4, Andreas Neuner wrote:
> >> Because FORTH Code is far more condensed and efficient, how many lines
> >of FORTH Code would I need to recode a 10000 LOC C application?
> >> Only as a raw estimation. I'm sure people there are people around here
> >who have recoded some C apps.
> >>
> >> Thank you
> >> Best Wishes
> >> Andreas
> >
> >This may be of some use to compare C to Forth in a real project.
> >Here is an exercise to make a LISP interpreter in many languages.
> >
> >https://github.com/kanaka/mal/tree/master/impls
> This is why github sucks.
> 1. There is no way to estimate the size of source files
> 2. There is no description of source files
>
> You have to click on files to see the content and were it fits in the whole.
> All the source combined for dozens as languages takes only 3.6 Mbyte
> (that is byte with an M not byte with a G)
> That is indicative of only toy lisp.
> >
> >I was surprised to see a GForth implementation there.
> >
> >The wild card is that these LISPs are built to a recipe for the course
> >and so might not fully use idiomatic methods that take advantage
> >of the implementation language's features. (?)
> >
> --
> Don't praise the day before the evening. One swallow doesn't make spring.
> You must not say "hey" before you have crossed the bridge. Don't sell the
> hide of the bear until you shot it. Better one bird in the hand than ten in
> the air. First gain is a cat spinning. - the Wise from Antrim -

His name is Joel Martin, and you can find videos documenting the process on
youtube.

Heres an example if you are interested https://youtu.be/jVhupfthTEk

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<nnd$73d28553$27e13af6@4430d7e6dc55f5f2>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23715&group=comp.lang.forth#23715

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com> <00e4b748-0cc2-4143-9cd4-ebcb443feb43n@googlegroups.com>
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: albert@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$73d28553$27e13af6@4430d7e6dc55f5f2>
Organization: KPN B.V.
Date: Mon, 29 May 2023 13:09:48 +0200
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!feeder1.feed.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe006.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 51
Injection-Date: Mon, 29 May 2023 13:09:48 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 2599
 by: none - Mon, 29 May 2023 11:09 UTC

In article <00e4b748-0cc2-4143-9cd4-ebcb443feb43n@googlegroups.com>,
Brian Fox <brian.fox@brianfox.ca> wrote:
>On Saturday, May 27, 2023 at 1:00:02 PM UTC-4, Andreas Neuner wrote:
>> Because FORTH Code is far more condensed and efficient, how many lines
>of FORTH Code would I need to recode a 10000 LOC C application?
>> Only as a raw estimation. I'm sure people there are people around here
>who have recoded some C apps.
>>
>> Thank you
>> Best Wishes
>> Andreas
>
>This may be of some use to compare C to Forth in a real project.
>Here is an exercise to make a LISP interpreter in many languages.
>
>https://github.com/kanaka/mal/tree/master/impls
>
>I was surprised to see a GForth implementation there.

It is supposed to be clojure style of lisp.

Most of the language are supposed to load a version of the mother
language but that fails, unsurprisingly.
If I have a language that is available, (say c) it isn't even
compiling most of the time.

The forth and python implementation seems to works
in the sense that
(+ 1 2)
gives
3
The project is overly ambitious, it is surprising that the gforth
version works this far.
Note it is a gforth version, gforth is explicitly
called and there is nothing to cater for a supposedly ISO program.

>
>The wild card is that these LISPs are built to a recipe for the course
>and so might not fully use idiomatic methods that take advantage
>of the implementation language's features. (?)
>
That is 100% true. That make the reference to this site contribute little
to this discussion.

Groetjes Albert
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning. - the Wise from Antrim -

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<nnd$305277fb$681e72e3@aa018250ab76657a>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23716&group=comp.lang.forth#23716

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com> <00e4b748-0cc2-4143-9cd4-ebcb443feb43n@googlegroups.com> <nnd$78c904c1$40e03479@3bdf9eecba976ba5> <1b72a450-8166-41a0-9528-69d11694c3a8n@googlegroups.com>
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: albert@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$305277fb$681e72e3@aa018250ab76657a>
Organization: KPN B.V.
Date: Mon, 29 May 2023 14:09:59 +0200
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe004.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 74
Injection-Date: Mon, 29 May 2023 14:09:59 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 3892
 by: none - Mon, 29 May 2023 12:09 UTC

In article <1b72a450-8166-41a0-9528-69d11694c3a8n@googlegroups.com>,
NN <november.nihal@gmail.com> wrote:
>On Monday, 29 May 2023 at 11:33:41 UTC+1, none albert wrote:
>> In article <00e4b748-0cc2-4143...@googlegroups.com>,
>> Brian Fox <bria...@brianfox.ca> wrote:
>> >On Saturday, May 27, 2023 at 1:00:02 PM UTC-4, Andreas Neuner wrote:
>> >> Because FORTH Code is far more condensed and efficient, how many lines
>> >of FORTH Code would I need to recode a 10000 LOC C application?
>> >> Only as a raw estimation. I'm sure people there are people around here
>> >who have recoded some C apps.
>> >>
>> >> Thank you
>> >> Best Wishes
>> >> Andreas
>> >
>> >This may be of some use to compare C to Forth in a real project.
>> >Here is an exercise to make a LISP interpreter in many languages.
>> >
>> >https://github.com/kanaka/mal/tree/master/impls
>> This is why github sucks.
>> 1. There is no way to estimate the size of source files
>> 2. There is no description of source files
>>
>> You have to click on files to see the content and were it fits in the whole.
>> All the source combined for dozens as languages takes only 3.6 Mbyte
>> (that is byte with an M not byte with a G)
>> That is indicative of only toy lisp.

First impression, probably not true.

>> >
>> >I was surprised to see a GForth implementation there.
>> >
>> >The wild card is that these LISPs are built to a recipe for the course
>> >and so might not fully use idiomatic methods that take advantage
>> >of the implementation language's features. (?)
>> >
>> --
>> Don't praise the day before the evening. One swallow doesn't make spring.
>> You must not say "hey" before you have crossed the bridge. Don't sell the
>> hide of the bear until you shot it. Better one bird in the hand than ten in
>> the air. First gain is a cat spinning. - the Wise from Antrim -
>
>
>His name is Joel Martin, and you can find videos documenting the process on
>youtube.
>
>Heres an example if you are interested https://youtu.be/jVhupfthTEk

I studied the source of forth further. *This is not a toy lisp.*
Despite having a number of languages in a 3.6 mbyte archive.

He follows Schani that he puts parameters into local values where
that is not needed. It remains to be seen if that inflates the
source code substantially. Otherwise I can't see much that
can be trimmed much for now.

In the first inspection I missed the step by step instructions
with debugging.
That is the way to bring it up using any language c but possibly ciforth.

ciforth features the code/date/name/link/flag headers. Once that is
harnessed to store the type information of lisp, one can have compiled
programs that are subsequently be optimised with Forth tools.

Groetjes Albert
>
>
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning. - the Wise from Antrim -

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<1bbf1f53-f3e1-4843-be65-5db291995cd9n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23718&group=comp.lang.forth#23718

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:584d:0:b0:3f6:9184:9970 with SMTP id h13-20020ac8584d000000b003f691849970mr530217qth.7.1685453682689;
Tue, 30 May 2023 06:34:42 -0700 (PDT)
X-Received: by 2002:ad4:48c2:0:b0:626:2366:e4c7 with SMTP id
v2-20020ad448c2000000b006262366e4c7mr269456qvx.11.1685453682459; Tue, 30 May
2023 06:34:42 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Tue, 30 May 2023 06:34:42 -0700 (PDT)
In-Reply-To: <nnd$305277fb$681e72e3@aa018250ab76657a>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:fea8:8921:f200:6855:6fff:a1d8:16ce;
posting-account=2z7GawoAAADc70p5SM5AbaCyzjLblS3g
NNTP-Posting-Host: 2607:fea8:8921:f200:6855:6fff:a1d8:16ce
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
<00e4b748-0cc2-4143-9cd4-ebcb443feb43n@googlegroups.com> <nnd$78c904c1$40e03479@3bdf9eecba976ba5>
<1b72a450-8166-41a0-9528-69d11694c3a8n@googlegroups.com> <nnd$305277fb$681e72e3@aa018250ab76657a>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1bbf1f53-f3e1-4843-be65-5db291995cd9n@googlegroups.com>
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
From: brian.fox@brianfox.ca (Brian Fox)
Injection-Date: Tue, 30 May 2023 13:34:42 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1784
 by: Brian Fox - Tue, 30 May 2023 13:34 UTC

I made this sheet using the Github LOC and size data for the LISP project.

Forth uses 59% less code in the "CORE" file but not as much in the "step" lesson files.
I can't be sure but this might indicate that there was less Forth style factoring
in the "recipe" to build the project. ?

https://docs.google.com/spreadsheets/d/1BHJY-odMvyV2e5MhcfVPlctEaMGz9hdlLDkGZyx7CzI/edit?usp=sharing

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<nnd$1c8954a7$63a54bb4@24dca09067453a46>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23719&group=comp.lang.forth#23719

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com> <1b72a450-8166-41a0-9528-69d11694c3a8n@googlegroups.com> <nnd$305277fb$681e72e3@aa018250ab76657a> <1bbf1f53-f3e1-4843-be65-5db291995cd9n@googlegroups.com>
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: albert@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$1c8954a7$63a54bb4@24dca09067453a46>
Organization: KPN B.V.
Date: Tue, 30 May 2023 18:45:46 +0200
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe004.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 42
Injection-Date: Tue, 30 May 2023 18:45:46 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 2527
 by: none - Tue, 30 May 2023 16:45 UTC

In article <1bbf1f53-f3e1-4843-be65-5db291995cd9n@googlegroups.com>,
Brian Fox <brian.fox@brianfox.ca> wrote:
>I made this sheet using the Github LOC and size data for the LISP project.
>
>Forth uses 59% less code in the "CORE" file but not as much in the "step" lesson files.
>I can't be sure but this might indicate that there was less Forth style factoring
>in the "recipe" to build the project. ?
>
>https://docs.google.com/spreadsheets/d/1BHJY-odMvyV2e5MhcfVPlctEaMGz9hdlLDkGZyx7CzI/edit?usp=sharing
>

I'd say it is a wash. Realize that step_A contains the whole clojure
and that steps are incremental.
E.g going from 9 to A there are only 18 lines different.
diff step9_try.fs stepA_mal.fs | wc -l
18

run contains:
gforth stepA_mal.fs

At the start forth looses when going up to speed building the
necessary structures, which is about normal.

I'm going to attempt it in ciforth, mapping the lisp objects to
Forth header structures, mapping using the fields {code data link name flags }
appropriately.
Environments map to wordlist defined by links.
In ciforth they can be chained and be nested.
Possibly use my mini classes.

Lesson 1 and 2 taught me why my previous attempt to lisp failed.
It is absolutely mandatory to first build the parse tree,
then the next step. If you attempt to do it the Forth
fashion step by step that is hard (or even impossible).

Groetjes Albert
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning. - the Wise from Antrim -

Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?

<73366bdd-cd14-4ad3-ae16-6e627e8062f5n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=23720&group=comp.lang.forth#23720

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:148f:b0:3f5:4699:107c with SMTP id t15-20020a05622a148f00b003f54699107cmr655957qtx.12.1685467320198;
Tue, 30 May 2023 10:22:00 -0700 (PDT)
X-Received: by 2002:ac8:4e8d:0:b0:3f6:abf3:d716 with SMTP id
13-20020ac84e8d000000b003f6abf3d716mr598206qtp.2.1685467319850; Tue, 30 May
2023 10:21:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Tue, 30 May 2023 10:21:59 -0700 (PDT)
In-Reply-To: <nnd$1c8954a7$63a54bb4@24dca09067453a46>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:fea8:8921:f200:2cc7:b836:46ca:7a5e;
posting-account=2z7GawoAAADc70p5SM5AbaCyzjLblS3g
NNTP-Posting-Host: 2607:fea8:8921:f200:2cc7:b836:46ca:7a5e
References: <2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com>
<1b72a450-8166-41a0-9528-69d11694c3a8n@googlegroups.com> <nnd$305277fb$681e72e3@aa018250ab76657a>
<1bbf1f53-f3e1-4843-be65-5db291995cd9n@googlegroups.com> <nnd$1c8954a7$63a54bb4@24dca09067453a46>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <73366bdd-cd14-4ad3-ae16-6e627e8062f5n@googlegroups.com>
Subject: Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
From: brian.fox@brianfox.ca (Brian Fox)
Injection-Date: Tue, 30 May 2023 17:22:00 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Brian Fox - Tue, 30 May 2023 17:21 UTC

On Tuesday, May 30, 2023 at 12:45:49 PM UTC-4, none albert wrote:
> I'd say it is a wash. Realize that step_A contains the whole clojure
> and that steps are incremental.
> E.g going from 9 to A there are only 18 lines different.
> diff step9_try.fs stepA_mal.fs | wc -l
> 18
>
> run contains:
> gforth stepA_mal.fs
>
> At the start forth looses when going up to speed building the
> necessary structures, which is about normal.
>
> I'm going to attempt it in ciforth, mapping the lisp objects to
> Forth header structures, mapping using the fields {code data link name flags }
> appropriately.
> Environments map to wordlist defined by links.
> In ciforth they can be chained and be nested.
> Possibly use my mini classes.
>
> Lesson 1 and 2 taught me why my previous attempt to lisp failed.
> It is absolutely mandatory to first build the parse tree,
> then the next step. If you attempt to do it the Forth
> fashion step by step that is hard (or even impossible).
> Groetjes Albert
> --
> Don't praise the day before the evening. One swallow doesn't make spring.
> You must not say "hey" before you have crossed the bridge. Don't sell the
> hide of the bear until you shot it. Better one bird in the hand than ten in
> the air. First gain is a cat spinning. - the Wise from Antrim -

I am very interested to see how yours works. I notice the Forth version
uses locals a great deal, but I can understand that it might have been
the simplest way to translate the reference material.

I was thinking about using Forth headers as well. That could give faster
search times I suspect.

Pages:1234
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor