Path: csiph.com!aioe.org!.POSTED!not-for-mail From: Rod Pemberton Newsgroups: comp.lang.forth Subject: Re: When forth powered desktop pc? Date: Wed, 14 Jun 2017 20:00:34 -0400 Organization: Aioe.org NNTP Server Lines: 61 Message-ID: <20170614200034.4dbdfa54@_> References: <3b344e85-826d-4ba7-a533-925fda7be44f@googlegroups.com> NNTP-Posting-Host: ZTD62cW/Uw8bymX5ok+0NA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:60764 On Tue, 13 Jun 2017 19:32:20 -0700 (PDT) gavino himself wrote: > can forth outperform php ruby python java c? Outperform? Unlikely. All high-level languages are converted to assembly. (Actually, it's converted to the processor's binary instruction format, but this is usually referred to as "assembly" since no one programs in binary.) So, the best outcome is the most optimized assembly for the given task. A good compiler will generate very optimized assembly. If you have two high-level languages whose compilers generate excellently optimized assembly, how can one outperform the other? They'll both basically generate the exact same code for the same task. I.e., you're limited by the assembly language of the microprocessor, if you have a good optimizing compiler for your high-level language. If you don't have a good optimizing compiler, then you're limited by the compiler or your ability to code efficiently. > is forth the best? The best is the language which most accurately and easily expresses the problem you're attempting to solve via your program. This can be measured in various ways. One way is called the "code density" of a language. There are all sorts of metrics to measure code density, e.g., "function points." > is it really simpler? In certain aspects, Forth really is simpler than the C language. That's not a good thing. Simplicity can mean much more work for you. In Forth, you must keep track of items on a stack, i.e., stack juggling. C does much of this for you and hides much of it too. So, the question you should ask is: "is it really easier?" I'd argue that *NOT* having to handle certain types of simplicity makes the language simpler, as in less work. Let's call that being easier. Personally, one reason I don't like assembly is because of the simplicity. There is no easy way to implement variables in many assembly languages. The variable may be in memory where you need to reference it by a memory address, or it may be in a register where you need to reference it by a register name, or it may be on the stack where you need to reference it by an offset to another register, usually. There is no unified method to access a variable in assembly, i.e., you can't access it by name no matter where the value is located, unlike a high-level language. Arguably, assembly is simpler, but it's not easier. Whereas, with a high-level language like C, variables are available. Variables make my life easier, hence simpler. > I dont think I can learn coloforth... Why? Unavailable? Too complex? Colorblind? Low IQ? Handicapped? Medicated? What? 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.