Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.forth Subject: Re: EuroForth 2015 paper deadline approaching Date: Mon, 02 Nov 2015 02:57:59 -0800 Organization: A noiseless patient Spider Lines: 22 Message-ID: <87egg8zn0o.fsf@nightsong.com> References: <2015Sep20.104537@mips.complang.tuwien.ac.at> <998d0f99-93b4-4d44-ba3a-6d96cb2b91d1@googlegroups.com> <9a8983c2-20ad-4538-852e-ca7bee0cb9a3@googlegroups.com> <5b6cea81-03f7-4619-b8ec-6e691a2e21bf@googlegroups.com> <87lhagzqft.fsf@nightsong.com> <2015Nov2.112640@mips.complang.tuwien.ac.at> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="1a9f5856d25720e42c135b990c70bebb"; logging-data="31463"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX181gAXCtvUQfNRMzxAnBefF" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:KCq0Tv+b7T6eE3pMWiVXSTsOdCQ= sha1:7PWPNy77GilIFRPcZjNtvJf0RHY= Xref: csiph.com comp.lang.forth:43100 anton@mips.complang.tuwien.ac.at (Anton Ertl) writes: > the C approach is not workable in Forth, because with a big zoo of > integer types, you need type-based overloading resolution I guess it might be ok to treat the additional integer types like floating point, i.e. separate stacks. Or to just implement a 32-bit Forth that runs on the 16-bit target, as Raimond suggested. Hey, now I have an excuse to write a Forth ;-). I guess if it's STC, there's not even much of a bloat problem from the bigger cell size vs the machine word size. > Concerning your problem: If you have values that does not fit in 16 > bits, but you want to write a program that ports to 16-bit platforms, > use doubles for these values. Specifically I want to run the SHA1 hash function in order to use an MSP430 Launchpad (the one with the RTC and LCD) as a TOTP token. SHA1 requires a lot of 32-bit wraparound additions and xors. Doing it all with doubles might or might not work; and I'd much rather debug the code with Gforth and then run it on the target, than deal with debugging on a tiny embedded Forth. And doing it with doubles makes the code a heck of a lot more complicated.