Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: sci.electronics.design,comp.lang.forth Subject: Re: Microchip ICD4 ? Date: Fri, 18 Aug 2017 23:19:21 -0700 Organization: A noiseless patient Spider Lines: 20 Message-ID: <87efs8nkpi.fsf@nightsong.com> References: <4flbpcdr024camgg3qi1neo56tjk7cs28a@4ax.com> <_XolB.2447$kJ2.2238@fx33.iad> <87a82xqvap.fsf@nightsong.com> <2017Aug18.154248@mips.complang.tuwien.ac.at> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="d9e8a4b7fbc75cf8d1fd57031ebd8f7a"; logging-data="27616"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+6B/SErpNEFvalsW/96Pzk" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:js+ms3+UFPRSDHlOcY8JtctjcVU= sha1:u22M6qxbmdg0Bbd8DN6vJiGuZl4= Xref: csiph.com sci.electronics.design:474016 comp.lang.forth:63030 anton@mips.complang.tuwien.ac.at (Anton Ertl) writes: > As an example, I know of a microprocessor simulator that was written > in C++, and it was, in a sense, well-written C++, using lots of > abstractions. The resulting simulator worked, at 300 simulated cycles > per (wall-clock) second. One of the driving ideas of C++ is to provide useful abstractions at essentially zero cost. Evidently it wasn't used that way in that first implementation. Was it written in C++1x (i.e. C++11 or later)? C++11 made it much easier to do certain important things efficently, by introducing move constructors. > they threw it away, wrote a simulator designed for efficiency ...and > the result simulated at 3M simulated cycles per second It could be that the first implementation was intended as a prototype. I probably would have done it in Python or Haskell, so it would have been even slower, but allowed easier instrumentation and exploration. Anyway, you can write bad code in any language.