Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: What do we have to do to resuscitate micro Perl? I want Circuit Perl NOW!

by afoken (Canon)
on Mar 03, 2018 at 16:15 UTC ( #1210286=note: print w/replies, xml ) Need Help??


in reply to What do we have to do to resuscitate micro Perl? I want Circuit Perl NOW!

"Real programmers can write assembly code in any language."

-- Larry Wall

I write embedded code for a living, and because it can be fun. While I technically write in C, the way I write code is clearly affected by Perl. So far, C was sufficient for all projects. Yes, C has sove very nasty corners and edge cases, but so does Perl. You need to know them and the ways to write safe code. Yes, I would like to see some more features in C, but that won't happen any time soon.

One of our next projects will have a way to run "programs" (note the quotes!) on a microcontroller system. We thought of having a small interpreter, but any interpreter would offer far too many features. After all, the "programs" are just sets of a few parameters that are played back in fixed order at run time. The user can adjust the parameters, and name those sets. Nothing more than an array of structs per program. No call, no goto, no if, no stack.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^2: What do we have to do to resuscitate micro Perl? I want Circuit Perl NOW!
by karlgoethebier (Monsignor) on Mar 04, 2018 at 15:33 UTC
    "...No call, no goto, no if, no stack."

    Hard life. Any example(s) available for further enlightenment?

    Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

      Any example(s) available for further enlightenment?

      No, sorry. Confidential information.

      But if the device was a MIDI player, you could adjust playback speed, volume, pitch, and repeat count for each folder of MIDI files stored in ROM. "Programs" would be composed of the playback settings and a folder name. You could have a "program" named "sad" that plays one ROM folder slowly, in a low pitch and at a low volme. And a "program" named "happy" that plays the same folder much quicker, louder and faster.

      "...No call, no goto, no if, no stack."

      Hard life.

      Well, not for us. ;-) And to stay with the MIDI player example, you could select a folder of MIDI files to be played, but they would always be played in the same order.

      Yes, this looks crazy. But trust me, the device won't be a MIDI player. And when it is used as intended, those restrictions make perfectly sense.

      The users don't want to change the play order. Being able to modify the "playback" settings is sufficient for them. So they do not need call, goto, if or a stack.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
        "Confidential information...the device won't be a MIDI player... no goto, no if, no stack"

        Thanks. I begin to see it clearly now. May be it's a low budget missile or so. As an alternative i suggest this. Best regards, Karl

        «The Crux of the Biscuit is the Apostrophe»

        perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1210286]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2019-12-06 02:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (154 votes). Check out past polls.

    Notices?