Author Topic: There is something special with interpreters on bare metal  (Read 1574 times)

0 Members and 1 Guest are viewing this topic.

Online RoGeorgeTopic starter

  • Super Contributor
  • ***
  • Posts: 6213
  • Country: ro
There is something special with interpreters on bare metal
« on: March 20, 2021, 03:52:10 pm »
Tested MicroPython on ESP8266, and it almost felt like ZX81 or a ZX Spectrum with BASIC.   8)

There is something very rewarding when using an interpreter on bare metal, not sure why it feels like that.  I'm not new to Python, and not new to microcontrollers, but when combined the two it's different.  I don't think it's strictly related to Python, because it felt very similar with how BASIC was on home computers or on a BasicStamp MCU.

Strange that Lua on the same ESP8266 doesn't seem that nice.  Maybe because I never used Lua before.

It looks like there are three requirements to get that special dopamine kick:
1. - interpreted language
2. - runs on bare metal
3. - easy to use

Anybody else noticed how nice an interpreter running on bare metal is, with no OS and no compile/upload involved?

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: There is something special with interpreters on bare metal
« Reply #1 on: March 20, 2021, 04:09:41 pm »
Tested MicroPython on ESP8266, and it almost felt like ZX81 or a ZX Spectrum with BASIC.   8)

There is something very rewarding when using an interpreter on bare metal, not sure why it feels like that.  I'm not new to Python, and not new to microcontrollers, but when combined the two it's different.  I don't think it's strictly related to Python, because it felt very similar with how BASIC was on home computers or on a BasicStamp MCU.

Strange that Lua on the same ESP8266 doesn't seem that nice.  Maybe because I never used Lua before.

It looks like there are three requirements to get that special dopamine kick:
1. - interpreted language
2. - runs on bare metal
3. - easy to use

Anybody else noticed how nice an interpreter running on bare metal is, with no OS and no compile/upload involved?

Every good tool have it's use and obviously you can get satisfaction during use of such :) Thou do not get overexcited because there is no such thing as universal tool. There will be many cases where compile/upload is better solution for someone else to get satisfaction :D
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: There is something special with interpreters on bare metal
« Reply #2 on: March 23, 2021, 04:45:28 pm »
Back when 8085s were king, I did a lot of development work.  One of my favorite tools was Palo Alto Tiny Basic which implemented an integer Basic that was pretty much ideal for prototyping.  Features could be added for specific IO devices.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: There is something special with interpreters on bare metal
« Reply #3 on: March 23, 2021, 05:44:59 pm »
Interpreter on microcontroller is very useful when rapid changes of software is part of the job. One (but not only) example - control of scientific experiment. Sometimes it is much easier to let scientist just change variables in the actual code, most likely write code himself rather than hire programmer to build extremely flexible software which inevitably will be obsolete before even finished.
 

Offline JohnnyMalaria

  • Super Contributor
  • ***
  • Posts: 1154
  • Country: us
    • Enlighten Scientific LLC
Re: There is something special with interpreters on bare metal
« Reply #4 on: March 23, 2021, 05:59:52 pm »
Tested MicroPython on ESP8266, and it almost felt like ZX81 or a ZX Spectrum with BASIC.   8)

There is something very rewarding when using an interpreter on bare metal, not sure why it feels like that.

I understand - I get the same feeling with a project I'm developing on a Zynq system, although it's not interpreted. I have a number of "peripherals" built on the FPGA such as controller an external DDS, ADC, programmable analog bandpass filters, programmable clock generator etc.

I've written a simple C program that accepts commands via the terminal to the Zynq. Each one can have its own particular arguments and it behaves/feels like running commands in a bash terminal - except I know it isn't :) and that I know exactly what is going on behind the scenes. It definitely reminds me of POKEing numbers into various parts of my ZX-81 RAM and seeing what happened.
 

Offline MadTux

  • Frequent Contributor
  • **
  • Posts: 785
Re: There is something special with interpreters on bare metal
« Reply #5 on: March 24, 2021, 05:21:40 pm »
It's probably just like an extreme CISC processor, ie  MicroPython instructions are converted into RISC ยต-instruction routines, basically the same instruction set that the ESP8266 understands.
Only difference is that the interpreter decodes the MicroPython instructions on hardware level instead on software level.

Don't think that you'll get much differences as a user, apart the memory/CPU resources that are saved by the the hardware level interpreter....
 

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 3915
  • Country: gb
Re: There is something special with interpreters on bare metal
« Reply #6 on: March 24, 2021, 06:46:39 pm »
Back when 8085s were king

I have never played with it, was the 8085 a kind of 8080 with a built-in serial and minimal external circuits?
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 3915
  • Country: gb
Re: There is something special with interpreters on bare metal
« Reply #7 on: March 24, 2021, 06:50:41 pm »
Anybody else noticed how nice an interpreter running on bare metal is, with no OS and no compile/upload involved?

I have here a couple of circuits for a radio-telescope, they have a Forth interpreter built-into setup the working environment in a way that looks similar to the OpenForth you can find on a PowerMac computer.

Mever played with it yet, but it's a true interpreter and it's able to manage ADC, DAC, powermeters, and stepper motors.
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline MarkR42

  • Regular Contributor
  • *
  • Posts: 139
  • Country: gb
Re: There is something special with interpreters on bare metal
« Reply #8 on: March 25, 2021, 11:50:38 am »
Yes it is super satisfying, to be able to knock up something like an ad-hoc signal generator with a few lines of Python.

The esp8266 is not the best chip to do it; it's not really got enough ram and that is quickly exhausted if you try to do networking.

But Micropython on the esp32 or pi pico are great!
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 4795
  • Country: pm
  • It's important to try new things..
Re: There is something special with interpreters on bare metal
« Reply #9 on: March 25, 2021, 12:43:42 pm »
Back when 8085s were king

I have never played with it, was the 8085 a kind of 8080 with a built-in serial and minimal external circuits?
Reading this thread makes me pretty nostalgic :)
I built my first uC on 8085, then w/ Z80, then ZX81, ZX Spectrum, .. etc.. etc..
8085 is 5V only, crystal clock gen on the chip, with a simple serial and 1 or 2 diffs around interrupts..

« Last Edit: March 25, 2021, 12:46:23 pm by imo »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf