Live data from Hacker News

3D graphics rendering pipeline. Implemented in JavaScript. Run in a terminal

github.com

21–30 of 52 posts

Re: 3D graphics rendering pipeline. Implemented in JavaScript. Run in a terminal

#22

Earlier quoted context omitted.

It's always "from one language to another", sometimes the destination is machine language. The output is generally not meant to be meant to be human-readable in any case. "Transpile" is an ugly and unnecessary word, please don't push it as "more correct".

It's just a more specific word. You can say all words are unnecessary because you can express the same thing using more words.

"Transpilation" and "compilation" describe the exact same concept. From user's perspective, readable code is translated into runnable code. From theoretical perspective, code in a more complex language is translated into a less complex language while preserving semantics. From a compiler writer's perspective, it's a totem pole of compilers, with at least one middle-level language usually. Plenty of people use the term "compiles to JavaScript" to describe languages like TS or Elm. It's just some overly pedantic people insist on the term "transpile" when the target is also, in a completely unrelated way, used to write code directly by a significant number of contemporary programmers.

Re: 3D graphics rendering pipeline. Implemented in JavaScript. Run in a terminal

#23

what's the point of rendering into a terminal? why not use a raster framebuffer?

As far as I can see the terminal rendering is one of the main points that's showcased with this project. Sure you could do this with a raster framebuffer, but that's been done loads of times. The fact that it looks this good in a terminal is marvelous imho.

Re: 3D graphics rendering pipeline. Implemented in JavaScript. Run in a terminal

#24

Earlier quoted context omitted.

It's just a more specific word. You can say all words are unnecessary because you can express the same thing using more words.

"Transpilation" and "compilation" describe the exact same concept. From user's perspective, readable code is translated into runnable code. From theoretical perspective, code in a more complex language is translated into a less complex language while preserving semantics. From a compiler writer's perspective, it's a totem pole of compilers, with at least one middle-level language usually. Plenty of people use the ter…

Transpile is a superset or compile just like typescript is a superset of JavaScript. Transpile implies translating but not into a less complex language but rather onto a similar runtime. So typescript is dynamic just like JavaScript, and they share much of their semantics. So transpile means compile but onto a similar runtime with similar runtime semantic behavior.

Re: 3D graphics rendering pipeline. Implemented in JavaScript. Run in a terminal

#25

Earlier quoted context omitted.

It's just a more specific word. You can say all words are unnecessary because you can express the same thing using more words.

"Transpilation" and "compilation" describe the exact same concept. From user's perspective, readable code is translated into runnable code. From theoretical perspective, code in a more complex language is translated into a less complex language while preserving semantics. From a compiler writer's perspective, it's a totem pole of compilers, with at least one middle-level language usually. Plenty of people use the ter…

> "Transpilation" and "compilation" describe the exact same concept.

No I think transpile implies compiling from one level of abstraction to another similar level of abstraction, which is quite different in theory and practice to compiling to a much lower level of abstraction. It's a useful word to have in your communication toolbox.

Re: 3D graphics rendering pipeline. Implemented in JavaScript. Run in a terminal

#26
post #18

Earlier quoted context omitted.

A more correct word for converting code from one programming language into another is "transpile".

It's always "from one language to another", sometimes the destination is machine language. The output is generally not meant to be meant to be human-readable in any case. "Transpile" is an ugly and unnecessary word, please don't push it as "more correct".

> It's always "from one language to another“

Hmmm, sometimes it’s “from one version of a language to another version of the same language”. As is the case with Babel[0] and JavaScript.

[0] https://babeljs.io/

Re: 3D graphics rendering pipeline. Implemented in JavaScript. Run in a terminal

#27
post #16

Earlier quoted context omitted.

.ts comes from TypeScript, which is just JavaScript but with compile-time-checked types (and some other goodies) added on top. TS is really popular now, I don't think any sane dev would start a new project today in plain JS instead of TS.

That's huge hyperbole there. Plenty of projects are started in JS today. It's still wise to provide typings to your user base if you're publishing a library, whether or not you're using TS under the hood.

I agree with parent that while people will still start JS projects today they'd probably be better off with TS.

Re: 3D graphics rendering pipeline. Implemented in JavaScript. Run in a terminal

#29
post #4

This is code is very clean... someone should add this to a list of very nice codebases to read.

I agree. Does anyone know how they achieve the alignment of all the ‘=‘ signs? Perhaps a VSCode extension?

SublimeText has the AlignTabs extension which can do this.

Re: 3D graphics rendering pipeline. Implemented in JavaScript. Run in a terminal

#30

Earlier quoted context omitted.

"Transpilation" and "compilation" describe the exact same concept. From user's perspective, readable code is translated into runnable code. From theoretical perspective, code in a more complex language is translated into a less complex language while preserving semantics. From a compiler writer's perspective, it's a totem pole of compilers, with at least one middle-level language usually. Plenty of people use the ter…

> "Transpilation" and "compilation" describe the exact same concept. No I think transpile implies compiling from one level of abstraction to another similar level of abstraction, which is quite different in theory and practice to compiling to a much lower level of abstraction. It's a useful word to have in your communication toolbox.

I agree with your overall definition. In fact, the dictionary definition of compile does also suggest that you are transforming to a 'lower level' so, in strictness, there is a need for a word to fill the void that you suggest transpile provides.

But I do wonder about the actual usefulness of the distinction. If someone says that they compile Typescript to Javascript, I'm not sure that anyone is going to be confused about what is meant, even if violates the letter of the dictionary definition.

Ultimately, english is fluid and is always correct as long as those in communication are able to understand each other. For transpile to be a useful word in the toolbox, there must be a circumstance where compile cannot be used to convey the same idea. When might that be?

Post reply on HN