News for hackers. Stuff that matters.
Re:What do people mean when they say “transpiler”? by Stratoscope on Sunday September 03, 2017 @04:42AM (#15160347)
Back in the mid-80s, I frequented BIX (the BYTE Information eXchange). There was a discussion group for the C programming language, and someone mentioned this new C++ language. I naively asked, "C++? That's a preprocessor, isn't it?" I was thinking of the original Cfront, of course, which translated C++ to C.

Bjarne Stroustrup jumped in and gently chewed me out: "The Cfront compiler is not a preprocessor! It is a full-fledged compiler just like any other. Sure, it uses C as the compilation target right now, but it won't always be that way. It could generate native code, but compiling to C let us get up and running more quickly and on more hardware architectures than we could if we targeted machine code right away."

(Those weren't his exact words, but definitely the gist of it. Some things like this stick in your mind.)

If "compiler" was good enough for Bjarne, it's definitely good enough for me.

Now jumping ahead to the present, consider Kotlin. Its compiler can target JVM bytecode and JavaScript, and they're working on native support using LLVM for the final code generation pass.

Is Kotlin a transpiler when it targets JavaScript, and only a true compiler when it targets the JVM or native code?

It just seems like a silly distinction. Why bother having a separate name? A compiler is a compiler.

Re:What do people mean when they say “transpiler”? by snarfy on Sunday September 03, 2017 @06:46AM (#15160761)
It is silly. I think part of it is simply a cultural divide between old school C programmers and young front end web developers.

There used to be two spaces after a period, oxford commas, and 'literally' meant 'as it was written'. Languages change (for better or worse). Kids these days.

Re:What do people mean when they say “transpiler”? by Stratoscope on Sunday September 03, 2017 @07:14AM (#15160840)
Hey, you're welcome on my lawn any time.

Some years ago I went on an editing binge on Wikipedia, finding a bunch of templates that "misused" the phrase "due to" and changed them to "because of". As we all know, you must get this right:

"The flight delay was due to bad weather."

vs.

"The flight was delayed because of bad weather."

but never:

"The flight was delayed due to bad weather."

The next day, someone reverted all my changes and asked, "Mike, have you looked at a dictionary lately?"

Oops.

In that moment I was enlightened: I realized I could care less.

I even leave out the Oxford comma as often as I use it. In fact I leave out a lot of commas I used to put in.

But there is one case where the Oxford comma is still necessary. If you leave it out of this joke it ruins it:

"There are two hard problems in computer science: naming things, cache expiration, and off by one errors."

Re:What do people mean when they say “transpiler”? by gumoro on Sunday September 03, 2017 @08:10AM (#15161028)
> I realized I could care less.

I see what you did there. Well done.

Re:What do people mean when they say “transpiler”? by e12e on Sunday September 03, 2017 @10:36AM (#15161614)
Webster doesn't mention any change in use, simply:

"care less : not to care — used positively and negatively with the same meaning <I could care less what happens> <I couldn't care less what happens>"

¯\_(ツ)_/¯

Re:What do people mean when they say “transpiler”? by styfle on Sunday September 03, 2017 @08:26PM (#15164782)
I could or couldn't care less.

The material is very flammable or inflammable.

https://www.merriam-webster.com/words-at-play/flammable-or-i...

English is confusing.

Re:What do people mean when they say “transpiler”? by taneq on Sunday September 03, 2017 @11:35AM (#15161949)
The first doesn't mean the same as the second, though. O.o
Re:What do people mean when they say “transpiler”? by e12e on Sunday September 03, 2017 @11:55AM (#15162087)
(On the off-chance you're not being tounge in cheek): No, "used positively and negatively with the same meaning", as in the two differently phrased idioms mean the same thing:

http://www.dictionary.com/e/could-care-less/

http://www.slate.com/blogs/lexicon_valley/2016/04/05/the_rea...

https://xkcd.com/1576/ (!)

Re:What do people mean when they say “transpiler”? by vorg on Sunday September 03, 2017 @03:15PM (#15163262)
> the different intonations used in saying “I couldn’t care less” versus “I could care less.” [dictionary.com link]

> people who say “I could care less” are omitting the first part: “Like I could care less,” [Slate link]

These quotes seem to sum up those links.

Re:What do people mean when they say “transpiler”? by e12e on Sunday September 03, 2017 @12:06PM (#15162149)
I suppose, these days, for the sake of clarifying that I'm being sarcastic, I should just start saying: "I cloud care less".
Re:What do people mean when they say “transpiler”? by taneq on Sunday September 03, 2017 @12:25PM (#15162250)
To be perfectly honest, I'm kind of 50/50 between a genuine vexation with "could care less" being semantically wrong, and a cheerful agreement that usage defines meaning. The world's inconsistent and so occasionally, in response, am I. :P
Re:What do people mean when they say “transpiler”? by Asooka on Sunday September 03, 2017 @02:04PM (#15162845)
Just use I'd'nt careless.
Re:What do people mean when they say “transpiler”? by rz2k on Sunday September 03, 2017 @09:28AM (#15161315)
Though it could simply mean the realization that one can choose to care less about prescriptive language rules
Re:What do people mean when they say “transpiler”? by gumoro on Sunday September 03, 2017 @07:12PM (#15164514)
Yes I think that's exactly what Stratoscope meant, and it was funny because that expression is a classic language peeve, as it is an illogical deformation (of the phrase "I couldn't care less") that is becoming the norm... but in that situation it made perfect sense. So I was showing appreciation for that nice touch.
Re:What do people mean when they say “transpiler”? by Stratoscope on Sunday September 03, 2017 @10:17PM (#15165214)
Even funnier, when I wrote that I actually did just intend it in the sense of "could care less" and "couldn't care less" meaning the same thing. It was an example of how I had been too fussy about language rules.

But now that you've explained it, I see it works the other way too!

"Finally I learned to care less about these kinds of language rules."

There is something delicious about two seemingly contradictory phrases that mean the same thing, and one phrase that can mean two opposite things.

Re:What do people mean when they say “transpiler”? by songshu on Sunday September 03, 2017 @08:31AM (#15161099)
Cache invalidation. Cache expiration is easy.
Re:What do people mean when they say “transpiler”? by Stratoscope on Sunday September 03, 2017 @01:55PM (#15162788)
Thank you! That's what I get for trying to tell a joke at 2AM...
Re:What do people mean when they say “transpiler”? by __float on Sunday September 03, 2017 @02:40PM (#15163052)
Can you explain why the "never" was even "wrong"? That seems totally fine to me, and I don't understand why you would think otherwise.
Re:What do people mean when they say “transpiler”? by Stratoscope on Sunday September 03, 2017 @02:46PM (#15163090)
No, I can't explain it. It was just an arbitrary rule I was taught as a kid - and that was quite some time ago! There was never a reason given for it, just one of many rules we were supposed to remember.

A lot of other people were taught the same rule, but hopefully they've realized as I finally did that it just doesn't matter.

Here are some interesting discussions from both sides of the fence:

https://www.google.com/search?q=due+to+because+of

Joseph Emonds argued in the paper "Grammatically Deviant Prestige Constructions" that the underlying reason for some of these arbitrary distinctions was as a social class signifier: if you used "correct" grammar it helped indicate to others that you were a member of a more prestigious class:

http://fine.me.uk/emonds

Re:What do people mean when they say “transpiler”? by mcphage on Sunday September 03, 2017 @08:11AM (#15161033)
> 'literally' meant 'as it was written'

Literally has been used to mean figuratively for well over 100 years. (If I wasn't on my phone I'd paste in a list of usages from famous literature going back 150 years or so, that I have stored on my computer)

That's one of the big issues with prescriptivism—often the person making or enforcing the prescriptions has no idea of what the truth actually is. Especially in language, but it crops up in software as well.

Re:What do people mean when they say “transpiler”? by dhimes on Sunday September 03, 2017 @09:50AM (#15161398)
You are correct about the word "literally," but I am in the camp that feels we should proceed cautiously in such matters. Just because a published professional got away with a mistake or made a deliberate artistic choice in 1905 doesn't mean it should become mainstream usage. When the word "literally" can mean, casually, either "literally" or "figuratively" then it ceases to have any real meaning. The figurative use is best when used with extreme obvious hyperbole. For me to say "I care enough about this post that I am literally standing up right now" when I am, indeed, sitting down, should be seen as a mis-use that weakens the word. Done frequently and it introduces avoidable entropy into language.

See also: enormity.

We really do need to take some care here or else we'll soon be spelling "lose" as "loose." Although that particular issue is probably coming from non-native speakers, it's being picked up and used by others and may eventually become accepted. That will not ease our ability to communicate.

Re:What do people mean when they say “transpiler”? by mannykannot on Sunday September 03, 2017 @11:20AM (#15161853)
The first time I saw 'enormity' used as a synonym of 'vastness', it was as if I had stumbled while walking, as nothing in the text up to that point indicated anything bad happening. 'Enormity', however, invites misunderstanding, and it would be better if it were retired, though that is not going to happen.
Re:What do people mean when they say “transpiler”? by Stratoscope on Sunday September 03, 2017 @02:30PM (#15163001)
Yeah, when I see that so often it makes me think I am loosing my mind.

Wait, maybe that's a good thing: "loose" (v): to free from restraint, to make less rigid, tight, or strict. (M-W)

Here's an odd one for you. Many of my younger friends say "on accident" instead of "by accident", e.g. "He didn't mean to do that. It was on accident."

It bugs me to no end; it just seems wrong.

But it's surprisingly logical: after all, we say "on purpose", so why not "on accident" for the opposite?

I don't think I will start saying or writing it that way, though!

Re:What do people mean when they say “transpiler”? by dhimes on Monday September 04, 2017 @09:17AM (#15168000)
I noticed a lot of what was illogical about English became apparent when I started interacting with students and professors who had different native tongues.
Re:What do people mean when they say “transpiler”? by abiox on Sunday September 03, 2017 @01:03PM (#15162512)
> When the word "literally" can mean, casually, either "literally" or "figuratively" then it ceases to have any real meaning.

i don't think i can agree here, at least not with the gist. in a sense, words already don't have 'real meaning' (they're just noises or scribbles depending on the medium), their meaning or communicative value is bestowed by their actual use in a specific language, place, time, etc.

if you mean to say that we can't communicate the non-figurative sense of 'literally', consider: when someone whines 'you mean figuratively, not literally', this necessarily implies that the complainer understood what was said. if they can comprehend this distinction, it would seem utility remains and the complaint is informed mostly by a resistance to change (imo).

> We really do need to take some care here or else we'll soon be spelling "lose" as "loose."

this seems like a separate issue. the words 'lose' and 'loose' are not being used interchangeably (afaik); my sense of it is that it's just an issue of transcription because the spelling is extremely similar.

Re:What do people mean when they say “transpiler”? by dhimes on Monday September 04, 2017 @09:26AM (#15168051)
I would suggest that if someone "whines" 'you mean figuratively, not literally' that they may be double-checking (depends on context of course). Or perhaps the complaint may be due to the fact that the complainer does not know that "literally" can mean "figuratively."

I agreed that the word "literally" can be used figuratively, but this use needs to be obvious- kind of like pronouns. I personally prefer to avoid that use because I am not a particularly talented wordsmith.

Re:What do people mean when they say “transpiler”? by mcphage on Sunday September 03, 2017 @02:29PM (#15162994)
> doesn't mean it should become mainstream usage

Perhaps, but what I'm arguing is something slightly different: that the idea "literally used to only mean literally but recently it started being used to mean figuratively" is a myth.

Re:What do people mean when they say “transpiler”? by dhimes on Monday September 04, 2017 @09:30AM (#15168090)
You are correct. I am whining about something like that happening, and noting that while correct its use (obvious hyperbole) is subtle and not one that many who use it that way pick up on.
Re:What do people mean when they say “transpiler”? by hanbura on Sunday September 03, 2017 @09:46AM (#15161377)
I have prescriptivist tendencies, but I agree that "It has to be that way because it's always been that way" is a stupid argument.

I'm simply of the opinion that language that leads to misunderstanding is bad. That's why I correct anyone who I suspect to use the word "literally" for the opposite of its meaning, and why I use Oxford commas.

I also like when the meaning of a sentence is inferable by only knowing the words and simple grammar rules. That's why I hate "could of" or "I could care less".

I will also roll my eyes if you ask me to use double spaces after a period. That rule was born from a technical limitation that's long gone.

In essence I think that conserving ancient rules and meanings is just one branch of prescriptivism, and it's unfair to judge everything prescriptivist based on that one radical branch.

Re:What do people mean when they say “transpiler”? by skrebbel on Sunday September 03, 2017 @12:43PM (#15162393)
I like that you used the Oxford comma in the sentence about it.
Re:What do people mean when they say “transpiler”? by tedunangst on Sunday September 03, 2017 @09:09AM (#15161242)
People need to spend more time reading real books and less time reading made up rules.
Re:What do people mean when they say “transpiler”? by GlennS on Sunday September 03, 2017 @09:35AM (#15161337)
'Transpiler' is an ugly smushword though. I hope it dies.
Re:What do people mean when they say “transpiler”? by moo360 on Sunday September 03, 2017 @01:10PM (#15162550)
I don't know if I'm right or not but I tend to use the word "transpiler" to talk about something that transforms into the same language as before.

So for example Babel is a transpiler since it turns JavaScript into JavaScript - it just allows you to use certain features (usually of a later version, or a draft) in earlier versions. So I write es8 and use babel to turn it into es5 compatible javascript, I'd call that transpiling.

However, sticking with JavaScript, I'd say that coffeescript -> javascript is compilation since coffeescript is not the same language and very syntactically different.

So I guess converting one language into another syntactically different language is a compiler. While converting a language into the same language but transforming specific parts for whatever reason (such as interop or backwards compat) is a transpiler.

That's how I tend to think of it anyway.

But I agree, probably could just use compiler for all of them, especially if not using it means added ambiguity.

Re:What do people mean when they say “transpiler”? by icebraining on Sunday September 03, 2017 @06:18AM (#15160666)
I'd say a transpiler is a specific type of compiler. But yeah, it's not clear if the extra name is really useful.
Re:What do people mean when they say “transpiler”? by astrodust on Sunday September 03, 2017 @02:06PM (#15162859)
A "compiler" translates code from one form to another, and while historically that other form is machine code, ther's no requirement that this is the case: Java translates to JVM bytecode.

People get upset when told Ruby is a "compiled" language, as technically the code is compiled into bytecode, because overall this is in the context of an interpreted language. Things do get blurry when it boils down to JVM bytecode in JRuby, which then goes on to have a JIT pass done on it...

Even the CPU itself "compiles" the incoming instructions into internal ops. It's translating code into code.

It's compilers all the way down.

Re:What do people mean when they say “transpiler”? by tom_mellior on Sunday September 03, 2017 @01:58PM (#15162805)
Many other people in this thread are saying this too, but they all define the "specific" characteristics of a "transpiler" differently :-)
Re:What do people mean when they say “transpiler”? by owebmaster on Sunday September 03, 2017 @07:51AM (#15160970)
> Is Kotlin a transpiler when it targets JavaScript, and only a true compiler when it targets the JVM or native code?

I'd say Kotlin is a language with different implementations, like clojure, ruby and others.

Re:What do people mean when they say “transpiler”? by mannykannot on Sunday September 03, 2017 @11:10AM (#15161806)
Does Kotlin have an abstract specification, or is it defined by a reference implementation?
Re:What do people mean when they say “transpiler”? by abdulhaq on Sunday September 03, 2017 @01:38PM (#15162690)
RIP Byte