Back in the day when both memory and clock cycles were very precious, it wasn't unknown to use self-modifying code as a performance optimisation trick. I did it at least once in the late 80s, when I was working on comms software that had to be as fast as possible in order to avoid missing incoming data.
There was a check that needed to be done on every byte - I think it was whether I was now processing graphics characters or not - but the check was taking valuable time, and the value didn't change very often.
So the most efficient way I found to do it was to wait until I got a "switch to/from graphics" byte in the input stream and then update the instruction at a given location to either be "unconditional jump to graphics routine" or a "no operation (NOP)", which passed straight through to the routine for normal characters.
It was a horrible hack, but it worked.
Thankfully, I've not felt the need to even consider this approach for the past 20 years.
https://news.ycombinator.com/item?id=12485205
I don't think SMC has ever been "relatively mainstream", at least after HLLs gained popularity over Asm. But in Asm, it still has its uses where a full JIT would be far too much overhead.
That's because of all the branch predictors, probably. ;)
It is mainstream now that it is integrated into Java, C#, etc.
It was considered esoteric 20 years ago. Haskell initially had the slogan "avoid success at all costs".
SQL, HTML, CSS were probably esoteric at some point.
HTML was regarded as too mundane to be interesting when it first came out - a lot of people working on hypertext at the time (early 90's) regarded it as a simplistic toy.
Perhaps a more interesting example is the MLs, which have been around far longer than Haskell and seem to be gaining popularity for implementating and transforming other languages (that was their original purpose, after all!).
Scheme's also managed to maintain a minor presence since the 70s, especially in education and as an extension/configuration language.
Five or so years ago it as an esoteric language for statisticians, which had been around forever (especially if you count the predecessor S language).
Now the IEEE ranks it the 5th(!) most important (or something?) language[1], and it's the fastest growing language on StackOverflow[2].
That's a pretty amazing change for a language which has few redeeming factors (ha!) as a language, apart from lots of very useful libraries.
[1] http://blog.revolutionanalytics.com/2016/07/r-moves-up-to-5t...
Duff's Device comes close. It was born out of a real engineering problem, but spread as esoterica and I'm sure I'm far from the only one to learn it as esoterica and later use it in production.
Personally I think it looks like a great opportunity for an interesting weekend.
Hoon is a programming language that uses two-character runes instead of reserved words. It's purely functional and vaguely Lisp-like. It compiles down to a minimal combinator-based virtual machine built entirely out of cons cells and bignums, where the only operator is addition. And yet throughout all of that, it's actually possible (and scarily easy) to code in, and I'm somehow fluent in it. That kinda scares me.
With GOTO, we can read a section of code and if it contains "GOTO N" then we know the execution will jump to location "N", so we can look up that location and keep reading. We have no idea if any other code will jump into the code we're currently reading, unless we search for "GOTO <location we're reading>".
COMEFROM is the opposite: when we're reading a section of code and we see "COMEFROM N", we know that the code at location "N" will jump to this section. We have no idea if the code we're reading will jump to somewhere else, unless we search for "COMEFROM <location we're reading>".
Despite being invented as a joke, this is very popular in mainstream programming, under the name "exception handling" ;)
I've heard tales of some of his code being absolutely unmaintainable. Guess I was wrong.