|
|
Subscribe / Log in / New account

A tiny Python called Snek

A tiny Python called Snek

Posted Jan 23, 2020 11:20 UTC (Thu) by ceplm (subscriber, #41334)
Parent article: A tiny Python called Snek

Hasn’t he just reinvented Lua? I mean for the small embedded hardware, that should be it, shoudln't it?


to post comments

A tiny Python called Snek

Posted Jan 23, 2020 12:10 UTC (Thu) by dgm (subscriber, #49227) [Link] (1 responses)

I'm not sure if Lua (or eLua) could be made to run on the target platform without reimplementing the interpreter.

A tiny Python called Snek

Posted Jan 31, 2020 20:35 UTC (Fri) by simcop2387 (subscriber, #101710) [Link]

It's not generally possible with the default ATMEGA328 processors on arduinos. Porting the code and everything generally works fine and is easy to do but the real problem is the lack of memory on them, only 2KB of RAM. That causes a number of problems for LUA to do anything non-trivial due to the way the VM and everything works. That said I use a cortex m3 + lua to run my christmas lights. You don't need much more ram for it to suddenly be useful, about 4K seems to be the spot in my experience, and the 32kb on the arm processor I use is obviously morebetter.

A tiny Python called Snek

Posted Jan 23, 2020 20:53 UTC (Thu) by keithp (subscriber, #5140) [Link] (3 responses)

The main goal of the Snek project was to build a small, easy to teach language that would be useful later on. To me, that meant doing something based on Python.

My daughter took an introductory programming class as part of her geology degree. The class used Python, but most of the time was spent learning things also in Snek. Most of the examples and classwork would run (unchanged) using Snek instead of Python.

A tiny Lua for Arduino-scale machines could be a fun project though. Our robotics program teaches students three languages (Snek, Logo and ROBOLAB) and lets them choose which language to use for further work. When the OS 9 Macs needed to run Logo are no longer available, we'll need to find something new...

A tiny Python called Snek

Posted Jan 23, 2020 21:13 UTC (Thu) by ceplm (subscriber, #41334) [Link] (2 responses)

> When the OS 9 Macs needed to run Logo are no longer available, we'll need to find something new...

What’s wrong with UCB Logo? https://en.wikipedia.org/wiki/Logo_(programming_language)

A tiny Python called Snek

Posted Jan 24, 2020 6:06 UTC (Fri) by keithp (subscriber, #5140) [Link] (1 responses)

There's lots of potentially interesting languages to teach new programmers, but our program focuses on building robots (with Lego components!), which means having hardware to connect the computer with motors and sensors. Finding hardware that can do that turns out to be non-trivial.

When the old Macintosh machines stop working, the interface hardware will no longer have anything to connect to. Those use a proprietary serial protocol hooked up to the original Macintosh serial ports. Maybe those interfaces could be connected to a modern machine?

For Snek, I had hoped to use existing Arduino-compatible hardware, but couldn't find any integrated boards capable of driving 9V motors and servos. So I ended up building my own, which has resulted in a Crowd Supply campaign... Somehow this feels a lot like yak shaving.

A tiny Python called Snek

Posted Jan 30, 2020 11:30 UTC (Thu) by Wol (subscriber, #4433) [Link]


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds