r/javascript • • Mar 30 '18

TensorFlow.js

https://js.tensorflow.org/
471 Upvotes

101 comments sorted by

View all comments

101

u/CiezkiBorsuk Mar 30 '18

we are actively working on creating node.js bindings to the TensorFlow C API

This makes me so happy, because when they are done I lose the last reason to ever use Python in my life ^-^

30

u/2Punx2Furious Mar 30 '18

You don't like Python?

75

u/gavrocheBxN Mar 30 '18

I like Python but I love TypeScript

6

u/SamSlate Mar 30 '18

what can you do with type you can't with vanilla? (serious question)

82

u/aaaqqq Mar 30 '18

refactor large code bases with impunity

1

u/ProcrastinatingNow Mar 30 '18

You could technically do that with flow. But seeing as you have transpile whether you use flow or TS, I guess it’s down to preference.

Edit: actually I forgot that flow supports type hints in comments. So you might be able to get away with vanilla JS but static type analysis.

14

u/aaaqqq Mar 30 '18

I was responding to ts vs vanilla not ts vs flow. Flow is good (that's what I use at work) but its tooling sucks.

TS also supports type hints via jsdocs. But then if you're using comments/jsdocs to add types, why not just use TS/Flow

5

u/[deleted] Mar 30 '18

Doesn’t typescript have the ability to read jsdoc style comments as well? Thought I remembered hearing that on a podcast a while back

1

u/[deleted] Mar 31 '18

Yes, it does.

3

u/sethetter_ Mar 31 '18

Personally, the choice of TypeScript over Flow is mostly due to a more developed community, better tooling, more consistently defined types across many open source libraries, etc. Flow is amazing, but tooling and community are incredibly important.

0

u/[deleted] Mar 30 '18

[deleted]

4

u/SamSlate Mar 30 '18

weird, I've never had an issue with js' loose types, but i hear a lot of criticism for js on the type system..

5

u/SahinK Mar 31 '18

Amazing intellisense. Autocompletions for everything. No need to keep checking documentation or stackoverflow to find out what methods are available to you or what arguments to pass to an API. No easily avoidable runtime errors. Much easier to read and understand other people's code.

I would never go back to plain JavaScript.

1

u/SamSlate Apr 01 '18

ok, that is pretty nice.

6

u/2Punx2Furious Mar 30 '18

Nothing really, as far as I know TypeScript just compiles to regular JavaScript.

It just has some helpful features to make your life easier.

29

u/calsosta Mar 30 '18

Why do you want an easy life?

4

u/2Punx2Furious Mar 30 '18

Life is hard enough as it is.

I like some challenge, but I value time more.

2

u/fizzy_tom Mar 30 '18

What value does time give you?

1

u/2Punx2Furious Mar 30 '18

I'd say everything.

Everything I can do takes some time, it is a limited, valuable, and probably non-renewable resource.

1

u/LordDrakota Apr 05 '18

I like an easy life, but it seems that using TS in React is a huge time sink to just set up everything with Redux, Redux-thunk and company. This is holding me back to just use TS all the time.

3

u/CiezkiBorsuk Mar 30 '18

what can you do with vanilla that you can't do with TS?

1

u/Velfi Mar 31 '18

"1" + 2 == "12"

1

u/CiezkiBorsuk Mar 31 '18

If you really care about this use case, sleep sound: this is perfectly valid TS.