News for hackers. Stuff that matters.
Re:Esoteric Topics in Computer Programming (2002) by no_protocol on Friday September 16, 2016 @04:02AM (#12512561)
Can someone provide examples of programming forms, practices, or languages intentionally born esoteric that eventually turned mainstream? Nothing from this page popped out to me. It seems like sometimes an idea is so odd that it gets widespread attention just due to its oddness.
Re:Esoteric Topics in Computer Programming (2002) by prof_hobart on Friday September 16, 2016 @05:58AM (#12512907)
There's at least one on that list that's (at least in my experience) gone from relatively mainstream to esoteric - self-modification.

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.

Re:Esoteric Topics in Computer Programming (2002) by userbinator on Friday September 16, 2016 @07:03AM (#12513150)
That eventually turned into JITs, and it's still a very powerful technique for tight loops on modern processors, although the pipeline means the benefit happens with more iterations than on the old non-pipelined/cacheless CPUs. It can even be done across multiple cores, as I coincidentally explained here a short while ago:

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.

Re:Esoteric Topics in Computer Programming (2002) by pklausler on Friday September 16, 2016 @12:38PM (#12515241)
Very long ago, before index registers were a fancy new feature for the cool kids, one would modify the address fields of load/store instructions in order to stride through memory or traverse a list.
Re:Esoteric Topics in Computer Programming (2002) by jakub_h on Friday September 16, 2016 @01:14PM (#12515553)
> Thankfully, I've not felt the need to even consider this approach for the past 20 years.

That's because of all the branch predictors, probably. ;)

Re:Esoteric Topics in Computer Programming (2002) by qznc on Friday September 16, 2016 @05:05AM (#12512749)
Does Funtional Programming qualify?

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.

Re:Esoteric Topics in Computer Programming (2002) by chriswarbo on Friday September 16, 2016 @08:50AM (#12513619)
To clarify, the Haskell quote is usually parsed as 'avoid "success at all costs"', rather than 'avoid "success" at all costs'. Part of its rising popularity is probably the infrastructure work; despite the rough edges of Cabal and friends, I struggle to imagine what it must have been like before them!

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.

Re:Esoteric Topics in Computer Programming (2002) by arethuza on Friday September 16, 2016 @07:06AM (#12513161)
Functional programming was definitely pretty esoteric when I learned about it during a CS degree in the mid 1980s!

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.

Re:Esoteric Topics in Computer Programming (2002) by jakub_h on Friday September 16, 2016 @01:40PM (#12515773)
It's still a simplistic toy, albeit a highly formalized one nowadays.
Re:Esoteric Topics in Computer Programming (2002) by nl on Friday September 16, 2016 @07:59AM (#12513384)
R

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...

[2] http://jkunst.com/r/what-do-we-ask-in-stackoverflow/

Re:Esoteric Topics in Computer Programming (2002) by zeveb on Friday September 16, 2016 @01:17PM (#12515577)
FWIW I was using R to produce Unix system-utilisation charts about 15 years ago — I never thought it was particularly esoteric.
Re:Esoteric Topics in Computer Programming (2002) by fit2rule on Friday September 16, 2016 @05:02AM (#12512739)
Object Oriented Programming? I'm only half-kidding/-serious, btw. But it seems to me that there are a lot of things that become mainstream after an initial bump of esoteria .. React? Lua? Isn't this sort of the norm for new technologies ..
Re:Esoteric Topics in Computer Programming (2002) by SonOfLilit on Friday September 16, 2016 @05:15AM (#12512773)
Javascript? j/k

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.

Re:Esoteric Topics in Computer Programming (2002) by taneq on Friday September 16, 2016 @07:18AM (#12513209)
If you're going to list Duff's Device, we should also mention Carmack's fast square root (despite it not actually being invented by Carmack). I dunno if you'd call it mainstream but for a while there it was in every wannabe game engine coder's repertoire.
Re:Esoteric Topics in Computer Programming (2002) by qwertyuiop924 on Friday September 16, 2016 @07:37AM (#12513291)
Yeah, you should really call it SGI's FastInvSqrt. It's still a pretty cool hack.
Re:Esoteric Topics in Computer Programming (2002) by yiyus on Friday September 16, 2016 @05:12AM (#12512765)
UNIX was born as what you could consider a relatively esoteric response to the more popular MULTICS project. Same with B/C and BCPL. But I think that considering C and UNIX esoteric is a bit of a stretch, taking into account that they were developed at Bell Labs and almost everything related with computers could be considered esoteric back then.
Re:Esoteric Topics in Computer Programming (2002) by SonOfLilit on Friday September 16, 2016 @07:57AM (#12513378)
Oh, I forgot the most prominent one as of late: Urbit, which started as a functional esoteric language with a Martian aesthetic... written by a guy famous for... other things... and... somehow hopped on the blockchain gravy train? last I heard it was... auctioning address space? for surprisingly large amounts of money?
Re:Esoteric Topics in Computer Programming (2002) by chc4 on Friday September 16, 2016 @01:37PM (#12515752)
Urbit is probably one of my favorite things. The language is insane. The base virtual machine it runs on is insane. The entire stack rewrites everything for the sake of doing everything perfectly. It redefines whatever it wants. And somehow, it's actually usable.

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.

Re:Esoteric Topics in Computer Programming (2002) by jbpetersen on Friday September 16, 2016 @12:01PM (#12514926)
Even within the blockchain space it's still quite esoteric.

Personally I think it looks like a great opportunity for an interesting weekend.

Re:Esoteric Topics in Computer Programming (2002) by chriswarbo on Friday September 16, 2016 @12:06PM (#12514973)
INTERCAL is famous for having a COMEFROM instruction, as an inverse of GOTO.

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" ;)

Re:Esoteric Topics in Computer Programming (2002) by kd0amg on Friday September 16, 2016 @03:58PM (#12516870)
Exception handling requires some piece of code to actually throw the exception though. A more thorough instantiation of the idea would be aspect-oriented programming.
Re:Esoteric Topics in Computer Programming (2002) by SonOfLilit on Friday September 16, 2016 @05:18AM (#12512782)
There was some unix utility (`yes`?) that was implemented on many systems as an empty shell script. I read about in in an HN comment, can't remember which.
Re:Esoteric Topics in Computer Programming (2002) by pdkl95 on Friday September 16, 2016 @05:34AM (#12512822)
Possibly ":" (do nothing successfully) before it was a shell builtin?
Re:Esoteric Topics in Computer Programming (2002) by oct on Friday September 16, 2016 @07:10AM (#12513178)
I think you're thinking of `true`.
Re:Esoteric Topics in Computer Programming (2002) by SonOfLilit on Friday September 16, 2016 @05:17AM (#12512779)
Oh, and I wrote small web apps in Camping.rb. Working with _why's code was a great pleasure, especially in those rare cases when the documentation wasn't good enough and I had to dig through the code.
Re:Esoteric Topics in Computer Programming (2002) by qwertyuiop924 on Friday September 16, 2016 @07:38AM (#12513295)
Yeah, that squares with what I've heard about _why: Great ideas, not-so-great code.
Re:Esoteric Topics in Computer Programming (2002) by SonOfLilit on Friday September 16, 2016 @07:55AM (#12513371)
Nononononono. The documentation was great, the times where I had to read the code were rare, and they were a pleasure. His code is not always the most pragmatic or straightforward, but it is packed with beauty, and I much prefer it to digging through heaps of very readable, character-less code.
Re:Esoteric Topics in Computer Programming (2002) by qwertyuiop924 on Friday September 16, 2016 @07:59AM (#12513382)
Ah.

I've heard tales of some of his code being absolutely unmaintainable. Guess I was wrong.

Re:Esoteric Topics in Computer Programming (2002) by pmoriarty on Friday September 16, 2016 @09:31AM (#12513817)
Every language and every practice that is now popular was once obscure.
Re:Esoteric Topics in Computer Programming (2002) by no_protocol on Friday September 16, 2016 @09:57AM (#12513993)
Sure, but most weren't designed to be intentionally indecipherable or obtuse.
Re:Esoteric Topics in Computer Programming (2002) by myst on Friday September 16, 2016 @05:22AM (#12512796)
C++