Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?Q?Arne_Vajh=C3=B8j?= Newsgroups: comp.os.vms Subject: Re: Clair Grant on VMS code base Date: Sun, 6 Apr 2025 20:58:43 -0400 Organization: A noiseless patient Spider Lines: 83 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Mon, 07 Apr 2025 02:58:44 +0200 (CEST) Injection-Info: dont-email.me; posting-host="69fc3d0d26e4a53062a6b4470ae74fc6"; logging-data="2391974"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18LT1fX02eKOinsMkwDdDvoEHBa9r71bOk=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:AfzKrW5vAhKsJ627gk5PJciG02o= Content-Language: en-US In-Reply-To: On 4/6/2025 8:34 PM, Arne Vajhøj wrote: > On 4/4/2025 2:00 PM, Simon Clubley wrote: >> It basically parses, validates, and executes commands it has been given. >> That is something which can be implemented a lot more easily and >> concisely >> in a HLL with abstracted data structure capabilities (which includes >> even C) than an assembly language with no such capabilities. > > It is not obvious to me that: > > (LOC/FP for Macro-32) / (LOC/FP for C) > > is a lot higher for a shell than for the average application - data > structures are not anything special for shells. > > But maybe. And Macro-32 can be used to work with data structures. Many have worked with FAB and RAB in Macro-32. :-) To illustrate: $ type ds.c #define MAX_LEN 80 struct data { int v; int slen; char s[MAX_LEN]; }; void m(struct data * d) { d->v = d->v + 1; d->s[d->slen] = 'X'; d->slen += 1; } $ type ds.mar .title ds MAX_LEN=10 V=0 SLEN=V+4 S=SLEN+4 X=88 .psect $CODE quad,pic,con,lcl,shr,exe,nowrt .entry m,^m<> movl 4(ap),r0 addl2 #1, V(r0) movab S(r0), r1 addl2 SLEN(r0), r1 movb #X, (r1) addl2 #1, SLEN(r0) ret .end $ type dstest.for program dstest structure /data/ integer*4 v integer*4 slen character*80 s end structure record /data/buf buf.v = 123 buf.s = 'ABC' buf.slen = len('ABC') call m(buf) write(*,*) buf.v, buf.s(1:buf.slen) end $ for dstest $ cc ds $ link dstest + ds $ run dstest 124 ABCX $ macro ds $ link dstest + ds $ run dstest 124 ABCX Arne