Nп/п : 1 из 93
 От   : none) (albert                       2:5075/128        07 июн 23 16:40:20
 К    : Brian Fox                                             07 июн 23 17:45:16
 Тема : Re: Estimate: How man Forth-LOCs (line of code) for 10000 C-LOCs ?
----------------------------------------------------------------------------------
                                                                                 
@MSGID:
f1b98e57
@REPLY:
<00e4b748-0cc2-4143-9cd4-ebcb443feb43n@googlegroups.com> 25608fb0
@REPLYADDR none) (albert
@REPLYTO 2:5075/128 none) (albert
@CHRS: CP866 2
@RFC: 1 0
@RFC-References:
<2bcb3a48-7082-4d29-9496-829749a5403cn@googlegroups.com> <00e4b748-0cc2-4143-9cd4-ebcb443feb43n@googlegroups.com>
@RFC-Message-ID:

@TZUTC: 0200
@TID: FIDOGATE-5.12-ge4e8b94
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. (?)
>

I`m easily going to step3 a calculator implemented in this way.

Then I stumble upon this gem
"


 Add the quasiquote function. The quasiquote function takes a
parameter ast and has the following conditional.

  If ast is a list starting with the "unquote" symbol, return its
second element.

  If ast is a list failing previous test, the result will be a
list populated by the following process.

  The result is initially an empty list. Iterate over each element
elt of ast in reverse order:
  If elt is a list starting with the "splice-unquote" symbol,
replace the current result with a list containing: the "concat" symbol, the
second element of elt, then the previous result.
  Else replace the current result with a list containing: the "cons"
symbol, the result of calling quasiquote with elt as argument, then the
previous result.

    This process can also be described recursively:
        If ast is empty return it unchanged. else let elt be its first element.
  If elt is a list starting with the "splice-unquote" symbol, return
a list containing: the "concat" symbol, the second element of elt,
then the result of processing the rest of ast.
  Else return a list containing: the "cons" symbol, the result of
calling quasiquote with elt as argument, then the result of processing the
rest of ast.

  If ast is a map or a symbol, return a list containing: the
"quote" symbol, then ast.

  Else return ast unchanged. Such forms are not affected by
evaluation, so you may quote them as in the previous case if implementation is
easier.

"
If a language needs such things I doubt its usefulness.

I suspect this has to do with the decision that a list
(a b c ) requires that a is a function (prohibiting a simple list
denotation as "(1 2 3)" ) and that b and c are "evaluated".
In this example "b" cannot be a symbol (no evaluation possible)
but has to be contrived to be a variable via a key-value hash map,
then it has to replaced by the value.

The mal quote continues :
"sets the stage for the next very exciting step: macros."

I come to suspect that macro`s are in fact immediate words,
but more difficult to use.
We are experiencing a surge in artificial intelligence.
It is because of neural nets, not computer languages.

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 -
--- trn 4.0-test77 (Sep 1, 2010)
 * Origin: KPN B.V. (2:5075/128)
SEEN-BY: 5005/49 5015/255 5019/40 5020/715 848 1042
4441 12000 5030/49 1081
SEEN-BY: 5058/104 5075/128 6078/80
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх