Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: "minf...@arcor.de" Newsgroups: comp.compilers Subject: Re: What attributes of a programming language simplify its implementation? Date: Mon, 14 Nov 2022 05:14:29 -0800 (PST) Organization: Compilers Central Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <22-11-007@comp.compilers> References: <22-09-026@comp.compilers> <22-10-025@comp.compilers> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="16901"; mail-complaints-to="abuse@iecc.com" Keywords: design, history Posted-Date: 15 Nov 2022 05:31:05 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com In-Reply-To: <22-10-025@comp.compilers> Xref: csiph.com comp.compilers:3240 Thomas Koenig schrieb am Sonntag, 9. Oktober 2022 um 02:20:13 UTC+2: > Christopher F Clark schrieb: > > I answered this question on Quora, but I think it is relevant to this > > community (and I know I'll get discussion as a result).. > > > > What attributes of a programming language simplify its implementation. > > ... > If ease of language implementation is the primary concern, then > one could use a stack-based language. Easy to write an interpreter > or compiler for, hard to write in the language itself, so it will > likely be very unpopular (but popularity wasn't in the list of > requirements). > > Have a very simple set of types. BASIC had numbers, strings, and arrays. > > Don't worry about type conversions and floating point versus integer. Sweep > > that all under the rug. > You cannot "sweep it under the rug", you have to define the semantics > somewhere. It is possible to define the semantics ad-hoc and not to > document them (which you seem to be advocating). That is a recipe > for problems later. > > Whatever your implementation does, that's what it > > does. (Even simpler is what a lot of shells do, you have just "strings" and > > if the strings happen to be a number when you pass them to the "add > > function", + operator, it does arithmetic. If they aren't it, whatever it > > does is the definition.) > That strikes me as a bad idea if the language is supposed to be > used for something in the real world. Ill-defined semantics are > a disservice to potential users (but not laying traps for the user > was not on the list of requirements, either). > > [...] > [Sounds like we're on our way to reinventing Forth. It had (still has) > famously tiny implementations. -John] Reinventing old wheels is not much fun. But use Forth as your toolbox to make your own DSL and you can go _very_ far without diving into all those dragon books and gigabyte compilers and toolsets.