Author Topic: Small footprint script language; yalex  (Read 673 times)

0 Members and 1 Guest are viewing this topic.

Offline alexanderbrevigTopic starter

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: no
  • Musician, developer and EE hobbyist
    • alexanderbrevig.com
Small footprint script language; yalex
« on: March 11, 2019, 01:23:59 pm »
Hi everyone :)

I've been playing around with a small scripting language for my electronics projects.
Not every projects needs a scripting interface (some would rightfully argue no projects needs it) but I like having the ability to force states, read debug statuses etc.

https://github.com/AlexanderBrevig/yalex

I've used it on ATmega328, CC1310, nRF52 and STM32F1 and F4. Arduino sketch, typical embedded config.

The syntax is based on reverse polish notation, and will probably seem very strange if you've never seen that before. Here is an implementation of Fibonacci:
Code: [Select]
    :fibstep (R1R R2R + R3S pop R2R R1S pop R3R R2S pop R4R 1 + R4S pop rec)
    :rec (R4R R0R 1 + < 'fibstep _ select)
    :start (R0R 1 - R0S pop rec pop pop pop pop pop pop R3R)
    :fib (R0S 0 R1S 1 R2S 0 R3S 1 R4S R0R 3 < 1 'start select)
    10 fib
    55
There's a side by side explanation with C of that on the github.

Just wanted to make a post about it as I find it useful, and maybe one of you will too.
I am totally OK with those of you who thinks this is a total waste of time. I do not wholeheartedly disagree.
 

Offline dmills

  • Super Contributor
  • ***
  • Posts: 2093
  • Country: gb
Re: Small footprint script language; yalex
« Reply #1 on: March 11, 2019, 01:48:27 pm »
It's pretty much Forth!

Regards, Dan.
 
The following users thanked this post: alexanderbrevig


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf