Google Группы больше не поддерживают новые публикации и подписки в сети Usenet. Опубликованный ранее контент останется доступен.

Emacs and/or Lisp on Lego Mindstorms?

8 просмотров
Перейти к первому непрочитанному сообщению

Emanuel Berg

не прочитано,
1 апр. 2018 г., 20:51:3801.04.2018
The other day I acquired a quantity of Lego
Mindstorms robots, and put one together with
a focus on having all the sensors symmetrically
placed and then all the IO readily available,
in other words a "vanilla bot" so one could
have it built once and then just focus on
programming it.

This is a good idea but to my surprise while
building it it all happened naturally, so one
wonder why the out-of-the-box models are so bad
as robots *and* so user-unfriendly?
Perhaps they make them to look cool on the box
in the shop... Obviously, I think mine is much
cooler all the same :)

Next step is to get the ev3dev Linux OS
onboard, flashed on a MicroSD an inserted -
which does not require mucking with the
Lego firmware, btw.

Here [1] is a list of supported programming
languages. The only one what I can see (?) from
the Lisp world is Clojure [2], which 1) I don't
really care for, and 2) is on the "Out-of-date,
abandoned and unfinished implementations" part
of the list!

I do care for C [3], which is on the regular
list, as is C++ [4] which is also fine,
sometimes, but c'mon, this is AI,
autonomous/embedded systems, how can Lisp *not*
be supported almost at all?

And what are we going to do about it?

I guess I'll write one program in C, one in
C++, and then see if the situation has
improved, if not I'll see if one can have CL or
even Elisp be ported in some way.

Because that would be, like, cool :)

[1] http://www.ev3dev.org/docs/programming-languages/
[2] https://github.com/annapawlicka/clj-ev3dev
[3] https://github.com/in4lio/ev3dev-c
[4] https://github.com/ddemidov/ev3dev-lang-cpp

--
underground experts united
http://user.it.uu.se/~embe8573

Marcin Borkowski

не прочитано,
5 апр. 2018 г., 06:32:0705.04.2018
– Emanuel Berg, help-gn...@gnu.org

On 2018-04-02, at 02:51, Emanuel Berg <moa...@zoho.com> wrote:

> Here [1] is a list of supported programming
> languages. The only one what I can see (?) from
> the Lisp world is Clojure [2], which 1) I don't
> really care for, and 2) is on the "Out-of-date,
> abandoned and unfinished implementations" part
> of the list!

There are at least two other lisp-ish choices: Lua and JavaScript
there, and JS seems to be supported. How about using ClojureScript?
Or Python with Hy?

Hth,

--
Marcin Borkowski
http://mbork.pl

Emanuel Berg

не прочитано,
6 апр. 2018 г., 14:50:0706.04.2018
Marcin Borkowski wrote:

> There are at least two other lisp-ish
> choices: Lua and JavaScript there, and JS
> seems to be supported. How about using
> ClojureScript? Or Python with Hy?

Hold it, will you! I'm still not even getting
C to work, the most portable language,
remember ;)

JavaScript "lisp-ish" btw?

As for the others, you seem to think this is
a platform like any other. In theory, I suppose
it is just another machine running Debian.
But in practice, it isn't, and my experience
with C shows this.

Some of those combinations for example, I'm
unsure if that'd be any easier than compiling
CL thru Docker, and obviously that'd be much,
much cooler, almost computer history level! (Or
at least the "Computer Chronicles" if anyone
remembers that show.)

But don't let this dissuade you, get a box for
you academics work salary and try you as
well :) (Actually I wish that'd be true.
At least you're in good company on this list.
But hopefully you can afford one nonetheless,
or go to the CS department and borrow one -
make sure it is the EV3, not the old NXT ones
that should be very common on unis around the
world by now.)

Emanuel Berg

не прочитано,
8 апр. 2018 г., 02:06:3908.04.2018
> As for the others, you seem to think this is
> a platform like any other. In theory,
> I suppose it is just another machine running
> Debian. But in practice, it isn't, and my
> experience with C shows this.

OK, when I compiled the shared library on the
docker image, it ended up in /usr/local/lib,
and then ldconfig(8) was executed, however that
wasn't available on the robot so the binary
couldn't find the shared library! Rats!

Instead, I manually put the lib into /usr/lib
and it worked. So I retract the statement that
this platform should be anything more difficult
than anything else, and a UNIX expert would
probably have spotted that instantly. And it
does feel good I'm on the same level as the
UNIX experts, only it takes a couple of
extra days!

Anyway I'll return to this topic when I'm ready
for Lisp. Perhaps THAT will be difficult! :)

Marcin Borkowski

не прочитано,
9 апр. 2018 г., 15:53:2109.04.2018
– Emanuel Berg, help-gn...@gnu.org

On 2018-04-06, at 20:50, Emanuel Berg <moa...@zoho.com> wrote:

> JavaScript "lisp-ish" btw?

Why not?

Emanuel Berg

не прочитано,
9 апр. 2018 г., 17:02:1209.04.2018
Marcin Borkowski wrote:

>> JavaScript "lisp-ish" btw?
>
> Why not?

Because JavaScript is a shoddy-construction
web-programming scripting language with
a C++ syntax?

Marcin Borkowski

не прочитано,
10 апр. 2018 г., 00:28:2110.04.2018
– Emanuel Berg, help-gn...@gnu.org

On 2018-04-09, at 23:02, Emanuel Berg <moa...@zoho.com> wrote:

> Marcin Borkowski wrote:
>
>>> JavaScript "lisp-ish" btw?
>>
>> Why not?
>
> Because JavaScript is a shoddy-construction
> web-programming scripting language with
> a C++ syntax?

Hello, it's 2018 calling. Please update your calendars, it's no longer
1990s.

to...@tuxteam.de

не прочитано,
10 апр. 2018 г., 03:40:2610.04.2018
– help-gn...@gnu.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, Apr 09, 2018 at 11:02:09PM +0200, Emanuel Berg wrote:
> Marcin Borkowski wrote:
>
> >> JavaScript "lisp-ish" btw?
> >
> > Why not?
>
> Because JavaScript is a shoddy-construction
> web-programming scripting language with
> a C++ syntax?

Syntax, schmyntax.

Javascript is a Lisp soul damned to live in a strange body. It
shares all those things we love in Lisp, like

- first-class functions.
- untyped (or single-typed) lambda calculus
- (near-) homoiconicity (JSON anyone?)
- dynamic language.

And this is no coincidence. It's because it has deep roots
in Lisp. No other way could someone have put together this
language in 10 days [1] without being deeply rooted in Lisp

"Like many other languages, JavaScript took its
basic syntax from the C language, including
curly braces, semicolons, and reserved
words. It was to be a light, friendly version
of C with simpler semantics and better dynamic
memory characteristics. Because a typical
webpage's lifetime lasted from a few seconds
to a few minutes, JavaScript could take a
very simplified approach to concurrency and
memory management" [1]

And this strange, twisted body is...

"In 1995, Netscape Communications recruited
Brendan Eich with the goal of embedding the
Scheme programming language into its Netscape
Navigator. Before he could get started,
Netscape Communications collaborated with Sun
Microsystems to include in Netscape Navigator
Sun's more static programming language Java,
in order to compete with Microsoft for user
adoption of Web technologies and platforms.[9]
Netscape Communications then decided that
the scripting language they wanted to create
would complement Java and should have a similar
syntax, which excluded adopting other languages
such as Perl, Python, TCL, or Scheme. To
defend the idea of JavaScript against competing
proposals, the company needed a prototype. Eich
wrote one in 10 days, in May 1995" [2]

Java!

The only languages you can possibly prototype in ten
days are Forth, a Lisp and perhaps Tcl (which is "a
Lisp" turned inside out, actually).

Cheers

[1] https://www.computer.org/csdl/mags/co/2012/02/mco2012020007.pdf
[2] https://en.wikipedia.org/wiki/Javascript#History

- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlrMalUACgkQBcgs9XrR2kZengCePVGOg9IkI1swgRJQgcK4pcGO
zukAn1AwMz2IAl4rZux8c3LsnwD2pmE1
=m9o0
-----END PGP SIGNATURE-----

Emanuel Berg

не прочитано,
10 апр. 2018 г., 14:44:5310.04.2018
tomas wrote:

> The only languages you can possibly prototype
> in ten days are Forth, a Lisp and perhaps Tcl
> (which is "a Lisp" turned inside out,
> actually).

One can do a REPL Lisp in one day. I guess it
is one of the reasons for all the
Lisp dialects.

BTW why don't you write a book on
computer history?

As for JavaScript, Java, and Lisp, I suppose
you are right in the sense that
aluminum/aluminium, steel, and Aramid-Kevlar
are all materials.

to...@tuxteam.de

не прочитано,
10 апр. 2018 г., 15:55:3610.04.2018
– help-gn...@gnu.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Apr 10, 2018 at 08:44:50PM +0200, Emanuel Berg wrote:
> tomas wrote:
>
> > The only languages you can possibly prototype
> > in ten days are Forth, a Lisp and perhaps Tcl
> > (which is "a Lisp" turned inside out,
> > actually).
>
> One can do a REPL Lisp in one day. I guess it
> is one of the reasons for all the
> Lisp dialects.

Yes, if you know what you're doing...

> BTW why don't you write a book on
> computer history?

I fear that wouldn't be a good book -- but thanks for the flowers :)

> As for JavaScript, Java, and Lisp, I suppose
> you are right in the sense that
> aluminum/aluminium, steel, and Aramid-Kevlar
> are all materials.

Oh -- Java is quite a different kind of material...

Cheers
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlrNFqwACgkQBcgs9XrR2kZ/wACcCwkLHrKLeYxML3Lo9LwAdRVl
LGMAmgL2pYeNPF6SYzeJwEq3XkcXprcO
=7rww
-----END PGP SIGNATURE-----

Stefan Monnier

не прочитано,
10 апр. 2018 г., 17:06:5510.04.2018
– help-gn...@gnu.org
> The only languages you can possibly prototype in ten
> days are Forth, a Lisp and perhaps Tcl (which is "a
> Lisp" turned inside out, actually).

There are clearly others, such as Lua.


Stefan


Emanuel Berg

не прочитано,
10 апр. 2018 г., 17:26:5210.04.2018
If you are allowed to use tools, and I don't
see why not, a little example language isn't
difficult. Perhaps the first one you do isn't
exactly easy either but when you get into it
you can start industrial production with a new
language every week (with a very generous
definition of the word "new"!) Now why anyone
would ever want to do that is another thing...

Lua is from 1993, the word is Portugese for
"moon", but it has more exotic roots than that,
all the way from sunny and carefree Brazil!

Lua isn't well implemented for the Lego robot
tho:

Basic motor drivers are done - still to do:

* Support for stopping motors when the
object is garbage collected

* Support for matching attributes when
creating object instances

* Support for value property and binary
formatting to sensor devices

* LED and Button Support

* Power Supply scaling functions

* Framebuffer support [1]

[1] https://github.com/rhempel/ev3dev-lang-lua

Stefan Monnier

не прочитано,
10 апр. 2018 г., 17:39:3310.04.2018
– help-gn...@gnu.org
> * Support for stopping motors when the
> object is garbage collected

FWIW, this would be a typical example of ill-advised use of finalizers,
in my book.


Stefan


to...@tuxteam.de

не прочитано,
11 апр. 2018 г., 02:45:5011.04.2018
– help-gn...@gnu.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Apr 10, 2018 at 05:39:11PM -0400, Stefan Monnier wrote:
> > * Support for stopping motors when the
> > object is garbage collected
>
> FWIW, this would be a typical example of ill-advised use of finalizers,
> in my book.

:-)

Ah, old war stories come to mind. Like that old "enterprise" class
application in Java which relied on database connections being
closed whenever its parent object got garbage collected.

The app tended to work (for some value of "work") until management
decided to buy more RAM for the machine. Lots of more RAM. The app
started crashing (about once a day), and since "booting" the whole
thing took around half an hour, users were... hmmm.

Lots of cheerful debugging ensued. The result: since now the machine
had much more RAM, it didn't run into memory pressure that quickly,
meaning it hadn't to garbage collect as often, meaning it could
leave more stale DB connections lingering around meaning... the
application ran into the maximum licensed DB connections (did I
mention it was an Oracle DB, where you pay for everything)?

So yes, Stefan's short phrase above is worth careful consideration :)

Cheers
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlrNrxQACgkQBcgs9XrR2kYZlACeLvon/aFkO69JrHfmVriLXtsI
jvIAn1EMeMWtlPzXh1uz7RRX+w2C78my
=dDnj
-----END PGP SIGNATURE-----

0 новых сообщений