Live data from Hacker News

I Wrote a Compiler

blog.singleton.io

1–10 of 78 posts

Re: I Wrote a Compiler

#3
I thought a compiler, with no adjective or caveat, should turn a HLL into machine language. Isn't what this describes—turning BASIC into Go—more accurately described as a "pseudocompiler" or "Go compiler" or somesuch? I know Emacs is always said to have a "bytecode compiler" that processes Elisp code, not a "compiler" per se. Am I mistaken?

Re: I Wrote a Compiler

#4
post #3

I thought a compiler, with no adjective or caveat, should turn a HLL into machine language. Isn't what this describes—turning BASIC into Go—more accurately described as a "pseudocompiler" or "Go compiler" or somesuch? I know Emacs is always said to have a "bytecode compiler" that processes Elisp code, not a "compiler" per se. Am I mistaken?

The standard term for this kind of compiler is "transpiler", afaik.

Here's the Wikipedia page for such things, which also taught me several other names for them:

https://en.m.wikipedia.org/wiki/Source-to-source_compiler

Re: I Wrote a Compiler

#5
post #3

I thought a compiler, with no adjective or caveat, should turn a HLL into machine language. Isn't what this describes—turning BASIC into Go—more accurately described as a "pseudocompiler" or "Go compiler" or somesuch? I know Emacs is always said to have a "bytecode compiler" that processes Elisp code, not a "compiler" per se. Am I mistaken?

So, if he had invoked go for you would it be a compiler? Another definition is that it translates a source language into a target language.

Re: I Wrote a Compiler

#6
>The original authors of yacc were Mike Lesk and Eric Schmidt - yes that Eric Schmidt.

Incorrect, they were authors of lex. yacc was authored by Stephen Johnson.

Surprising to me is all the authors are still around, even though the tools are over 50 years old!. Shows how young computer science field is.

Re: I Wrote a Compiler

#7
post #3

I thought a compiler, with no adjective or caveat, should turn a HLL into machine language. Isn't what this describes—turning BASIC into Go—more accurately described as a "pseudocompiler" or "Go compiler" or somesuch? I know Emacs is always said to have a "bytecode compiler" that processes Elisp code, not a "compiler" per se. Am I mistaken?

What would you call TypeScript’s tsc, which translates TS to JS? Microsoft would say it’s a compiler: https://code.visualstudio.com/docs/typescript/typescript-com...

Re: I Wrote a Compiler

#8
post #3

I thought a compiler, with no adjective or caveat, should turn a HLL into machine language. Isn't what this describes—turning BASIC into Go—more accurately described as a "pseudocompiler" or "Go compiler" or somesuch? I know Emacs is always said to have a "bytecode compiler" that processes Elisp code, not a "compiler" per se. Am I mistaken?

Strictly speaking it's a transpiler, but honestly the delta between the target language (Go) and the source language (BASIC) is very fluffy and wooly, from what I remember from my PL theory days the distinction was always fuzzy enough that people used whatever term felt right to them.

An example off the top of my head — Chicken Scheme (call-cc.org) calls itself a compiler but it's target language is C

Re: I Wrote a Compiler

#9
>The original authors of yacc were Mike Lesk and Eric Schmidt - yes that Eric Schmidt.

I don't know if it's worth mentioning, but the author of the post is David Singleton, the former CTO of Stripe. I almost hadn't noticed until I saw the domain.

Re: I Wrote a Compiler

#10

>The original authors of yacc were Mike Lesk and Eric Schmidt - yes that Eric Schmidt. I don't know if it's worth mentioning, but the author of the post is David Singleton, the former CTO of Stripe. I almost hadn't noticed until I saw the domain.

I worked ~4 layers underneath him when he led Android Wear at Google, and every year or two that happens to me, and it puts a smile on my face. Gotta have love of the game to do this at that level.

IIRC, and man, maybe I'm making it up, but, lore was he always made time on a regular schedule to hack.

Usually 1 layer from the bottom isn't coding so much anymore.

(oddly, I didn't realize he was *CTO* of Stripe until a few months back, when his new thing with Hugo Barra was announced)

Post reply on HN