Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.arch.embedded > #21522
| From | "WJ" <w_a_x_man@yahoo.com> |
|---|---|
| Newsgroups | comp.arch.embedded, comp.lang.forth |
| Subject | Re: Which scripting for embedded automation? |
| Date | 2015-07-24 23:06 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <mougdl$b1d$1@dont-email.me> (permalink) |
| References | <0e930740-22d8-4e2b-833f-bb5843437d0d@googlegroups.com> <87y4i6rvyc.fsf@jester.gateway.sonic.net> <motoev$eeu$1@dont-email.me> <87lhe5sciz.fsf@jester.gateway.sonic.net> |
Cross-posted to 2 groups.
Paul Rubin wrote:
> > Otherwise Forth can be used to advantage in the same environments
> > where you would use C, Python or any others.
>
> I didn't say anything about C and I'd consider it comparable to Forth in
> most regards. C would IMHO be a poor choice of scripting language in
> this situation too.
>
> Have you actually used Python? It's not anything like C or Forth.
> Lumping Python with C seems to miss the distinction. If you haven't
> actually used both, then making comparisons between them isn't
> convincing.
It's obvious that the reason that he is recommending Forth
over all other languages is that he knows no language that
is higher-level than Forth. And he finds it too difficult
to learn another language.
If a hammer is the only tool that you have, then you use
a hammer for everything.
How would these tasks be done with a hammer?
Using Gauche Scheme:
Write a function that accepts a vector (1-dimensional array) of
16-bit numbers and replaces each number with its difference
from the average.
(use gauche.uvector)
(use gauche.collection)
(define (relativize vec)
(let ((avg (round->exact (/ (fold + 0 vec) (s16vector-length vec)))))
(s16vector-sub! vec avg)))
(define my-vec (s16vector 0 1 2 3 4 5 6 7 8 9))
(relativize my-vec)
my-vec
===>
#s16(-4 -3 -2 -1 0 1 2 3 4 5)
Take a string that contains numbers separated by semicolons or
commas and convert it to a list of numbers.
(map string->number (string-split "2,3.14;5.8,9" #/[,;]/))
===>
(2 3.14 5.8 9)
--
The report card by the American Society of Civil Engineers showed the national
infrastructure a single grade above failure, a step from declining to the point
where everyday things simply stop working the way people expect them to. ---
washingtonpost.com/local/trafficandcommuting/us-infrastructure-gets-d-in-annual-report/2013/03/19/c48cb010-900b-11e2-9cfd-36d6c9b5d7ad_story.html
Back to comp.arch.embedded | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Which scripting for embedded automation? abhishekkumardwivedi@gmail.com - 2015-07-23 02:24 -0700
Re: Which scripting for embedded automation? Les Cargill <lcargill99@comcast.com> - 2015-07-23 12:18 -0500
Re: Which scripting for embedded automation? Don Y <this@is.not.me.com> - 2015-07-23 10:42 -0700
Re: Which scripting for embedded automation? rickman <gnuarm@gmail.com> - 2015-07-23 15:08 -0400
Re: Which scripting for embedded automation? rickman <gnuarm@gmail.com> - 2015-07-24 18:44 -0400
Re: Which scripting for embedded automation? Paul Rubin <no.email@nospam.invalid> - 2015-07-23 22:00 -0700
Re: Which scripting for embedded automation? rickman <gnuarm@gmail.com> - 2015-07-24 12:19 -0400
Re: Which scripting for embedded automation? Paul Rubin <no.email@nospam.invalid> - 2015-07-24 10:15 -0700
Re: Which scripting for embedded automation? "WJ" <w_a_x_man@yahoo.com> - 2015-07-24 23:06 +0000
Re: Which scripting for embedded automation? Don Y <this@is.not.me.com> - 2015-07-24 17:00 -0700
Re: Which scripting for embedded automation? rickman <gnuarm@gmail.com> - 2015-07-24 20:52 -0400
Re: Which scripting for embedded automation? "WJ" <w_a_x_man@yahoo.com> - 2015-11-28 18:06 +0000
Re: Which scripting for embedded automation? rickman <gnuarm@gmail.com> - 2015-11-29 02:45 -0500
Re: Which scripting for embedded automation? Paul Rubin <no.email@nospam.invalid> - 2015-11-29 23:02 -0800
Re: Which scripting for embedded automation? rickman <gnuarm@gmail.com> - 2015-11-30 02:55 -0500
csiph-web