OT: Programming Languages

Nov 01, 2024 Last reply: 1 year ago 55 Replies

Most certainly. I first measured the complexity of computer languages in the says when Ada83 first emerged in the mid 1980s, long before the object-oriented stuff emerged. The competition was K&R C.

People knew that Ada was far more complicated than C, but exactly how can one quantify such a slippery thing as "complexity" (whatever that means)?

In those days, we used DEC VAX/VMS computers, and DEC had well-regarded compilers for both C and Ada83, so I measured the total file footprint in bytes on the disk of the two compilers (and their libraries), and Ada83 was ten times the size of the C compiler.

Now this Ada83 compiler was unable to do anything except pass the formal acceptance test for Ada83 compilers, while the C compiler was in wide use, so the true ratio had to exceed ten when the Ada compiler matured.

C++ was emerging around then, and the Ada community was forced to respond - their answer was Ada95. One assumes that it is a factor larger and more complex than Ada83, and that it too grew as it matured.

You are probably able to weigh the various compilers, allowing us to quantify the offerings of today.

These programmers would likely hurt themselves if allowed to use a hex calculator without close supervision. So better find better programmers.

Sounds like a good argument for running machine code right on the iron

- no annoying obscuring layers.

Joe Gwinn

That's no surprise. I can remember one or two other occasions when I thought I had a brilliant way to do it but someone else came up with a better way. I don't specifically mean sinewave oscillators.

The last circuit of my own had both an n fet and a p fet. I found that by adding a capacitor from one gate to the other (to try to cancel the unwanted signals in opposite phase) I could get the unwanted gate signal below 100uV. I then had harmonics approaching 60dB down except one at 50dB (I think 2KHz). Not brilliant but not bad.

There are some useful pointers here:

formatting link
particular where it says "Done properly, a JFET can provide distortion performance that is as good or better than a lamp or thermistor."

Perhaps I'll concentrate on how to make the FET behave as a voltage variable resistor over the widest possible range.

I also what to look into what I meant by crud and non crud mode in LTSpice. This mysterious effect can depend on things such as which specific computer is used and how long is specified before collecting simulation data. You can see it in the gate voltage after startup. It looks a bit like a PLL hunting and eventually locking but it doesn't happen at startup, it happens after seconds. So I'll need to be able to post some pictures to show that. I'll get to that.

Is there an easy way to remove a DC offset from a simulation trace so that my n and p gate signals can be superimposed after startup?

Like YASP? Quite useful, in fact.

Jeroen Belleman

Sorry, that should be YACC, not YASP.

Jeroen Belleman (who has seen too many software tools starting with 'YA'.)

Most compilers these days are smart enough to move loop invariants outside of a loop and then dispose of the loop. You must have side effects in any code that you want to benchmark. Optimisers can be

*really* smart about rearranging code for maximum performance by avoiding pipeline stalls. Only the very best humans can match them now.

Every now and then you stumble upon a construct that on certain platforms is unreasonably fast (2x or 4x). Increasingly because it has vectorised a loop on the fly when all go faster stripes are enabled.

Precision timers and benchmarking tools are available on most platforms no need to use a stop watch unless you enjoy watching paint dry.

If the compiler can see that is true you could still get caught out.

I can really trust a stopwatch or an oscilloscope. 5 seconds spent measuring a loop time won't ruin my day.

The compiler can't know if I have grounded a pin.

Hi Edward, I've been messing around with a real-life WB oscillator - the busted one I originally posted about. AFAIK, everyone else here has just been simming them, so I thought it might be useful if I provided some detail that others may have overlooked. The thing that stands out in my experiments in replacing the broken thermistor with a pot and attempting to twiddle for the optimum sine wave is just how close the waveform has to get to collapsing from insufficient feedback in order to get a nice sine wave. It's a knife-edge adjustment to get it right and then of course, with constantly shifting temperatures it goes out of adjustment again within a few seconds. But the sweet spot for the best waveshape is

*just* a whisker above collapse. HTH.

You certainly can and many people have. Quite how good the code is another matter, though. I have no info on that aspect but would welcome any others may have.

Steve Gibson of grc.com is heavily into PDP-8s and his site has a good selection of info on 'em if anyone's interested.

Price?

Well it's all exactly what you would expect because as was previously pointed out, a gain of 1.0000000001 (with as many 0s as you want) will grow to limiting but a gain of 0.99999999999 (with as many 9s as you want) will die to nothing. So in any real circuit you must constantly control the gain so that never goes into limiting and never dies. Yes this will usually be a knife-edge thing.

If you try to do this manually then the slightest change in anything (supply voltage, temperature, humidity, wind direction, Halloween) will tip it one way or another.

Pure sine waves are surprisingly difficult to generate for this reason. Real analogue hardware just doesn't want to do it naturally (unless the frequency is so high that the next harmonic is barely noticed or easy to filter). It would much rather produce a square (limited) wave or nothing at all.

Indeed. And that's why it's really quite remarkable that this tiny passive device enables the generation of such spectrally pure sinewaves; an 'ancient' technology that still holds a candle in the digital world of today.

I can't say I've read much on "ancient technology" since my early teen years. WH Smiths was full of literature such as "the unexplained" at the time.

These days it's even harder to filter nonsense from useful information but this page seems reasonable:

formatting link
Particularly where it says "Done properly, a JFET can provide distortion performance that is as good or better than a lamp or thermistor."

Yes, I already copied this link from your earlier post on the subject. Many thanks indeed.

Over a decade ago I hand optimized some vector code on the CELL processor. I then compiled some C++ code doing the same operations in nested loops with vector optimization turned on. The compiler was faster by a cycle when they found a load that could be done in parallel that I had missed.

I didn't bother doing assembler code after that.

Jan Panteltje and Cursitor Doom are a very small - and poorly informed - element of our community.

That they both agree is evidence that the proposition is probably flawed.

Yes. You can add a trace to a display which you define as an algebraic function of other traces. If you know what the offset is in volts (or amps for current traces) you can put that into the expression as a constant.

Of course it is.That's why Wein bridges need a non-linear element that can be adjust to get the gain exactly right and keep it there.

There is but Cursitor Doom doesn't know it.

They can generate tolerably spectrally pure sine waves if engineered in with sufficient expertise, which is pretty thin on the ground.

It's not an area where digital technology has a lot to offer. Today's word isn't exactly digital either - every system has a analog front end.

And Cursitor Doom hasn't a clue about that.

Even SDR?

True enough, Bill. I've not yet encountered capacitors.

Not necessarily. You could have a linear component set up in such a way that it performs non-linearly.

Yeah, still haven't heard of capacitors.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required