Live data from Hacker News

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

github.com

11–20 of 52 posts

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

#11
post #6

The title says "JavaScript", but the file extension says ".ts". It doesn't look very Javascript to me. Can anyone clarify?

It's TypeScript! It is "a strict syntactical superset of JavaScript, and adds optional static typing to the language." [1], and compiles to standard JavaScript.

[1] https://en.wikipedia.org/wiki/TypeScript

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

#13
post #6

The title says "JavaScript", but the file extension says ".ts". It doesn't look very Javascript to me. Can anyone clarify?

I think it's worded in a way that's odd to developers that usually write code for multiple target languages.

What you type is usually considered what it's implemented in, not what it's compiled/transpiled to. The later is the target language, which there may be many.

This differentiation is required if you want to modify/read the code. You would almost certainly modify/read it in the language it was implemented in, and make it clear which language this is when sharing.

Maybe "...implemented in TS, targeting JS" or at least something more obvious like "...implemented in JS using TS".

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

#14
post #6

The title says "JavaScript", but the file extension says ".ts". It doesn't look very Javascript to me. Can anyone clarify?

It’s TypeScript. You can strip the annotations and type definitions and it’s pure JS. TS is typically ran on JS runtimes, hence why people consider TS programs to also just be JS program.

*not exactly, there’s a couple of features that map differently. But there's a 1:1 TS to JS conversion.

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

#16
post #6

The title says "JavaScript", but the file extension says ".ts". It doesn't look very Javascript to me. Can anyone clarify?

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

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

#17
post #16
post #6

The title says "JavaScript", but the file extension says ".ts". It doesn't look very Javascript to me. Can anyone clarify?

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

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

#18
post #6

The title says "JavaScript", but the file extension says ".ts". It doesn't look very Javascript to me. Can anyone clarify?

It's TypeScript! It is "a strict syntactical superset of JavaScript, and adds optional static typing to the language." [1], and compiles to standard JavaScript. [1] https://en.wikipedia.org/wiki/TypeScript

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

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

#19
post #18

Earlier quoted context omitted.

It's TypeScript! It is "a strict syntactical superset of JavaScript, and adds optional static typing to the language." [1], and compiles to standard JavaScript. [1] https://en.wikipedia.org/wiki/TypeScript

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

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

#20
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 just a more specific word. You can say all words are unnecessary because you can express the same thing using more words.
Post reply on HN