unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Emacs and/or Lisp on Lego Mindstorms?
@ 2018-04-02  0:51 Emanuel Berg
  2018-04-05 10:31 ` Marcin Borkowski
       [not found] ` <mailman.11730.1522924324.27995.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 13+ messages in thread
From: Emanuel Berg @ 2018-04-02  0:51 UTC (permalink / raw)
  To: help-gnu-emacs

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Emacs and/or Lisp on Lego Mindstorms?
  2018-04-02  0:51 Emacs and/or Lisp on Lego Mindstorms? Emanuel Berg
@ 2018-04-05 10:31 ` Marcin Borkowski
       [not found] ` <mailman.11730.1522924324.27995.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 13+ messages in thread
From: Marcin Borkowski @ 2018-04-05 10:31 UTC (permalink / raw)
  To: Emanuel Berg; +Cc: help-gnu-emacs


On 2018-04-02, at 02:51, Emanuel Berg <moasen@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



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Emacs and/or Lisp on Lego Mindstorms?
       [not found] ` <mailman.11730.1522924324.27995.help-gnu-emacs@gnu.org>
@ 2018-04-06 18:50   ` Emanuel Berg
  2018-04-08  6:06     ` Emanuel Berg
                       ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Emanuel Berg @ 2018-04-06 18:50 UTC (permalink / raw)
  To: help-gnu-emacs

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.)

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Emacs and/or Lisp on Lego Mindstorms?
  2018-04-06 18:50   ` Emanuel Berg
@ 2018-04-08  6:06     ` Emanuel Berg
  2018-04-09 19:52     ` Marcin Borkowski
       [not found]     ` <mailman.11945.1523303599.27995.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 13+ messages in thread
From: Emanuel Berg @ 2018-04-08  6:06 UTC (permalink / raw)
  To: help-gnu-emacs

> 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! :)

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Emacs and/or Lisp on Lego Mindstorms?
  2018-04-06 18:50   ` Emanuel Berg
  2018-04-08  6:06     ` Emanuel Berg
@ 2018-04-09 19:52     ` Marcin Borkowski
       [not found]     ` <mailman.11945.1523303599.27995.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 13+ messages in thread
From: Marcin Borkowski @ 2018-04-09 19:52 UTC (permalink / raw)
  To: Emanuel Berg; +Cc: help-gnu-emacs


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

> JavaScript "lisp-ish" btw?

Why not?

-- 
Marcin Borkowski
http://mbork.pl



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Emacs and/or Lisp on Lego Mindstorms?
       [not found]     ` <mailman.11945.1523303599.27995.help-gnu-emacs@gnu.org>
@ 2018-04-09 21:02       ` Emanuel Berg
  2018-04-10  4:27         ` Marcin Borkowski
                           ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Emanuel Berg @ 2018-04-09 21:02 UTC (permalink / raw)
  To: help-gnu-emacs

Marcin Borkowski wrote:

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

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

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Emacs and/or Lisp on Lego Mindstorms?
  2018-04-09 21:02       ` Emanuel Berg
@ 2018-04-10  4:27         ` Marcin Borkowski
  2018-04-10  7:40         ` tomas
       [not found]         ` <mailman.11961.1523346023.27995.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 13+ messages in thread
From: Marcin Borkowski @ 2018-04-10  4:27 UTC (permalink / raw)
  To: Emanuel Berg; +Cc: help-gnu-emacs


On 2018-04-09, at 23:02, Emanuel Berg <moasen@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.

--
Marcin Borkowski
http://mbork.pl



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Emacs and/or Lisp on Lego Mindstorms?
  2018-04-09 21:02       ` Emanuel Berg
  2018-04-10  4:27         ` Marcin Borkowski
@ 2018-04-10  7:40         ` tomas
  2018-04-10 21:06           ` Stefan Monnier
       [not found]           ` <mailman.11985.1523394413.27995.help-gnu-emacs@gnu.org>
       [not found]         ` <mailman.11961.1523346023.27995.help-gnu-emacs@gnu.org>
  2 siblings, 2 replies; 13+ messages in thread
From: tomas @ 2018-04-10  7:40 UTC (permalink / raw)
  To: help-gnu-emacs

-----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-----



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Emacs and/or Lisp on Lego Mindstorms?
       [not found]           ` <86y3huaokd.fsf@zoho.com>
@ 2018-04-10 19:55             ` tomas
  0 siblings, 0 replies; 13+ messages in thread
From: tomas @ 2018-04-10 19:55 UTC (permalink / raw)
  To: help-gnu-emacs

-----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-----



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Emacs and/or Lisp on Lego Mindstorms?
  2018-04-10  7:40         ` tomas
@ 2018-04-10 21:06           ` Stefan Monnier
       [not found]           ` <mailman.11985.1523394413.27995.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 13+ messages in thread
From: Stefan Monnier @ 2018-04-10 21:06 UTC (permalink / raw)
  To: help-gnu-emacs

> 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




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Emacs and/or Lisp on Lego Mindstorms?
       [not found]           ` <mailman.11985.1523394413.27995.help-gnu-emacs@gnu.org>
@ 2018-04-10 21:26             ` Emanuel Berg
  2018-04-10 21:39               ` Stefan Monnier
  0 siblings, 1 reply; 13+ messages in thread
From: Emanuel Berg @ 2018-04-10 21:26 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier 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).
>
> There are clearly others, such as Lua.

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

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Emacs and/or Lisp on Lego Mindstorms?
  2018-04-10 21:26             ` Emanuel Berg
@ 2018-04-10 21:39               ` Stefan Monnier
  2018-04-11  6:45                 ` tomas
  0 siblings, 1 reply; 13+ messages in thread
From: Stefan Monnier @ 2018-04-10 21:39 UTC (permalink / raw)
  To: help-gnu-emacs

>       * 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




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Emacs and/or Lisp on Lego Mindstorms?
  2018-04-10 21:39               ` Stefan Monnier
@ 2018-04-11  6:45                 ` tomas
  0 siblings, 0 replies; 13+ messages in thread
From: tomas @ 2018-04-11  6:45 UTC (permalink / raw)
  To: help-gnu-emacs

-----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-----



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-04-11  6:45 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-02  0:51 Emacs and/or Lisp on Lego Mindstorms? Emanuel Berg
2018-04-05 10:31 ` Marcin Borkowski
     [not found] ` <mailman.11730.1522924324.27995.help-gnu-emacs@gnu.org>
2018-04-06 18:50   ` Emanuel Berg
2018-04-08  6:06     ` Emanuel Berg
2018-04-09 19:52     ` Marcin Borkowski
     [not found]     ` <mailman.11945.1523303599.27995.help-gnu-emacs@gnu.org>
2018-04-09 21:02       ` Emanuel Berg
2018-04-10  4:27         ` Marcin Borkowski
2018-04-10  7:40         ` tomas
2018-04-10 21:06           ` Stefan Monnier
     [not found]           ` <mailman.11985.1523394413.27995.help-gnu-emacs@gnu.org>
2018-04-10 21:26             ` Emanuel Berg
2018-04-10 21:39               ` Stefan Monnier
2018-04-11  6:45                 ` tomas
     [not found]         ` <mailman.11961.1523346023.27995.help-gnu-emacs@gnu.org>
     [not found]           ` <86y3huaokd.fsf@zoho.com>
2018-04-10 19:55             ` tomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).