RE: Arithmetic Expression Compiler
January 10, 2019 at 10:33 am
(This post was last modified: January 10, 2019 at 11:21 am by bennyboy.)
(January 10, 2019 at 8:16 am)FlatAssembler Wrote: But, let's be honest, when you are forced to write some part of the code in Assembly (like when you are writing a compiler), do you really worry about how efficient the code you write is? Or do you just write whatever gets the things done in fewer lines of code, even if that involves allocating 4 MB of stack just to get the next permutation of a string? In JavaScript, an equivalent code would take quite some time to execute even on modern computers, but if, you write that in Assembly or C, that would execute in an imperceptible amount of time. At least on my 12-year-old laptop, but probably not on low-powered chips...
The only time I wrote in assembly was: (1) when I wanted optimal speed for processing; (2) when I wanted to directly access things like drives and other peripherals. I was VERY concerned with efficiency, and at that time my comp's OS ran basic, which wasn't pre-compiled, so it saved tremendous CPU cycles.