[sdiy] Programming Language of choice

Chris Juried cjuried at yahoo.com
Mon Feb 29 13:21:19 CET 2016


Excellent, Gordon. I started to research Forth and it seems like a great language to add into my bag of tools. Ultimately, I am looking for the most effective, versatile language(s) for embedded systems. I gather between C, Assembly, Python and Forth, I should have a respectable capacity of knowledge to work with. Sincerely,   
  Chris Juried  
Audio Engineering Society (AES) Member  
InfoComm-Recognized AV Technologist
http://www.JuriedEngineering.com (Juried Engineering, LLC.)

This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any distribution or copying of this email, and any attachments thereto, is strictly prohibited. If you have received this email in error, please immediately notify me at (754) 300-9972 and permanently delete the original and any copy of any e-mail and any printout thereof.


      From: Gordonjcp <gordonjcp at gjcp.net>
 To: synth-diy at dropmix.xs4all.nl 
 Sent: Monday, February 29, 2016 3:50 AM
 Subject: Re: [sdiy] Programming Language of choice
   
On Sun, Feb 28, 2016 at 09:13:18PM +0000, Chris Juried wrote:
> Hi Tom,
> That was my speculation as well. I have heard of others integrating Python scripts into their C code. Does that make sense? Sincerely,   
>   Chris Juried  

Not quite but you can write C code and give it Python bindings.  That lets you d speed-critical stuff in C but then use it just like any other Python functions - I did this for my software-defined radio project, although I never got the Python bindings into a state where I was happy to show it to the general public.

There's also Lua, which was pretty much designed to be used as an embedded scrpting language within a larger program.  That finds a lot of use in video games where the game engine is written in a language like C or C++ and the actual functionality is scripted in Lua.  You can even get a compiler to turn Lua into "progs.dat" for Quake, replacing the QuakeC gameplay library with one re-written by clever people in Lua.

For fast stuff like audio processing, C or assembler is pretty much the only way.  C++ is not a good fit for microcontrollers, even large ones - it's fine in PCs where you have infinite RAM and disk storage.  The largest microcontrollers have maybe a few hundred kilobytes of RAM, but modern PCs have as much as a few hundred *megabytes* of RAM, or even more ;-)

If, on the other hand, you want to learn something new for the fun of it, you should look at how Forth works, possibly by looking at JonesForth which runs on a PC.  There you've got a complete high-level language that is completely self-hosting once you've written about a dozen "words" comprising a couple of kilobytes of assembler - small enough to write and assemble by hand.  A lot of old Sun kit used Forth as part of the OpenBoot bootloader because it was so ridiculously easy to get it working on SPARC processors.  Anything that lets you implement two stacks and has a fairly quick indexed addressing mode ought to do it.  The 6809 CPU is another chip that's remarkably suitable for Forth, as is the PDP11 and 68000.

-- 
Gordonjcp MM0YEQ
_______________________________________________
Synth-diy mailing list
Synth-diy at dropmix.xs4all.nl
http://dropmix.xs4all.nl/mailman/listinfo/synth-diy

  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://synth-diy.org/pipermail/synth-diy/attachments/20160229/5e3e40c8/attachment.htm>


More information about the Synth-diy mailing list