1

The main two I am considering for my CNC are sending commands through GCODE or Python as the language communicated. I know higher level languages tend to be slower but was wondering how much.

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
  • 2
    For a CNC, which language you use shouldn't matter at all, because the CPU shouldn't be the bottleneck. – Charles Duffy Dec 02 '20 at 06:05
  • 1
    ...which is to say, any reasonable language+hardware combination should be able to generate instructions faster than the mill can execute those instructions. – Charles Duffy Dec 02 '20 at 06:07
  • Thanks, I figured sensor speed should be the limiting factor anyway seeing as it can only read 10 khz a second meanwhile the chip can do 500 – Patrick Manser Dec 02 '20 at 06:08
  • 1
    If you're dealing with a smaller microcontroller the above analysis won't always hold, but it's easy and cheap to just put a larger device in place. Hook up a $10 Raspberry Pi that runs Python to generate the GCODE to send to the microcontroller and you have way more CPU than you'll need. – Charles Duffy Dec 02 '20 at 06:11
  • 1
    BTW, if you're curious for some practical numbers about how idiomatic code written in different languages performs, see https://julialang.org/benchmarks/ – Charles Duffy Dec 02 '20 at 06:14

1 Answers1

0

The answer is too long for a StackOverflow answer.

If you're interested in looking at real world data see this repo: https://github.com/davepl/Primes

Dave has tests and videos about those tests if you really want to get in to it.

HackSlash
  • 4,944
  • 2
  • 18
  • 44