top | item 19195239

Deep learning may need a new programming language

117 points| bobjordan | 7 years ago |venturebeat.com

124 comments

order
[+] xvilka|7 years ago|reply
What about Julia[1]? Seems like a perfect fit[2].

[1] https://julialang.org/

[2] https://juliacomputing.com/domains/ml-and-ai.html

[+] xuejie|7 years ago|reply
This is exactly what I thought as well. Julia is born for this use case.
[+] orbifold|7 years ago|reply
It is not typesave and doesn’t really support programming in the large. I think the best bet is something like Swift or Microsoft could come out with a C#/F# compatible thing.
[+] ovi256|7 years ago|reply
>Python ... the language forms the basis for Facebook’s PyTorch and Google’s TensorFlow frameworks

The state of journalism today ... their Github repo web pages show that there's more C++ than Python in both repos.

[+] throwawaymath|7 years ago|reply
To be fair, while that's true I think what's meant here is that Python is the language of choice for using Tensorflow and PyTorch. Probably no other language is used to interface with deep learning libraries and primitives as much as Python.
[+] sandGorgon|7 years ago|reply
This is the reason why swift for tensorflow initiative was started by Google - https://github.com/tensorflow/swift/blob/master/README.md

Facebook will obviously go its our own way. Given their investments in the JS ecosystem, im hoping they end up choosing Typescript for this.

[+] dtech|7 years ago|reply
Is Facebook adopting Typescript or are they still full-in on Flow, their own competing typed Javscript alternative?
[+] thecatspaw|7 years ago|reply
Im sorry, but this very much feels like a fluff piece. Yes we _may_ need a new programming language, or we may not.

Half of this article is about hardware, while only a small part of it is about programming languages.

> There are several projects at Google, Facebook, and other places to kind of design such a compiled language that can be efficient for deep learning, but it’s not clear at all that the community will follow, because people just want to use Python

Are the libraries not implemented in native code? The brief mention that python gets does not really detail what is wrong with it, aside from not beeing compiled I guess. But that is no issue if the libraries are native, so I dont see a reason to move away from python, let alone create a new programming language for it

[+] lugg|7 years ago|reply
You don't have to check baby's diaper to know they went number 2.

Python ML code is a bit of a joke. If you're any kind of semi professional developer who sees deep learning code for the first time and doesn't say "what the fuck would you do it like that for", I simply don't know what to tell you.

Im not saying a new language will fix this problem but some new primitives and idiomatic options protecting people from themselves probably wouldn't hurt the industry.

Likewise, something more ergonomic might actually improve onboarding new developers into the space.

[+] dan-robertson|7 years ago|reply
The libraries are native code in a similar sense to python being native code. The kernels are native and typically highly optimised but there is a possibility that better optimised kernels can be generated on the fly once the computational graph is known.
[+] amelius|7 years ago|reply
The main problem, imho, is that (for best performance) most libraries require the programmer to create a data flowgraph, and to think in terms of this graph. However, this is the perfect job for a compiler. In mainstrain compilers, dataflow analysis has traditionally been the task of the compiler, so it seems silly to break with this tradition. A new (compiled) language could bring us back on track.
[+] spinningslate|7 years ago|reply
I'd probably argue the opposite. Dataflow is a natural way to think about ML activities. The problem is that no mainstream languages offer dataflow as a first class construct; at best it's a set of libraries. That creates some impedance mismatch between intent and implementation. That compilers already do dataflow under the covers would hopefully mean that implementing a first-class dataflow language wouldn't be too hard.
[+] widforss|7 years ago|reply
It would be hilarious if everybody suddenly shifted to a Prolog implementation with ML functionality ¯\(°_o)/¯
[+] Kip9000|7 years ago|reply
There's already Nim (https://nim-lang.org/), which is Python like syntax and statically typed, with easy parallelisations etc already. What's lacking is the adoption as it wasn't hyped up. There's rarely a need to create yet another language and wait till it becomes mature and fixed all the issues with the eco system etc. If at all what's required is a way of translating all the Python libs to Nim or some similar effort.
[+] dunefox|7 years ago|reply
In my opinion, I'd rather see F# or Julia succeed.
[+] pts_|7 years ago|reply
Why did everyone dump C++? Oh wait, they didn't.
[+] pjmlp|7 years ago|reply
Depends on the context.

On GPGPU programming certainly not, in fact latest NVidia's hardware is designed explicitly for C++ workloads.

On GUI frameworks, C++ no longer has the spotlight on OS SDKs that it once had.

[+] risubramanian|7 years ago|reply
I wonder what he thinks about Julia. There are lots of projects to turn it into an "ML language".
[+] dunefox|7 years ago|reply
I think it was explicitly designed as an "ML Language" from the ground up already. Do you mean packages like Flux and KNet?
[+] anigbrowl|7 years ago|reply
I'd much rather a deep learning system that could handle simplified natural language and file operations, and then grow a network for specific tasks. Surely the point of AI is to liberate humans from having to write everything in code, and especially from needing to learn another language (which he fairly observes few people want to do).

I do everything flow-based these days. It's not the fastest way (and I also have the luxury of not having to please anyone but myself), but it allows me to only think about my domain problem instead of programming language issues.

[+] mark_l_watson|7 years ago|reply
Maybe not quite what you have in mind, but I have tried saving trained Keras models, loading them with Racket (a modern Scheme language), and implemented the required runtime. My idea was to encapsulate trained networks like ‘functions’ for use in other languages.
[+] codetrotter|7 years ago|reply
Could you tell a bit more about how you do FBP? I looked at it briefly in the past but haven’t tried it myself.
[+] henning|7 years ago|reply
Fortran is going to make a big comeback. I can feel it.
[+] pjmlp|7 years ago|reply
It already did kind of, after all it has all the modern goodies (modules, generics, oop) and was supported on CUDA since day one.

One of the major reasons why many researchers never cared for OpenCL.

[+] enriquto|7 years ago|reply
> Fortran is going to make a big comeback. I can feel it.

It is indeed one of the few existing languages appropriate for generic experimentation in numeric programming.

For example, computing the product of two matrices in C or Fortran is exactly as fast by writing three nested loops or by calling a library function. In python, julia, octave, etc, the difference is abysmal. This is a very sad state of affairs, that forces a mindset where you are allowed a limited toolset of fast operations and the rest are either slow or cumbersome. If you want to compute a variant of the matrix product using a slightly different formula, in Fortran it is trivial change, you just write the new formula inside the loop. But in python or julia you are stuck with either an unusably slow code or you have to write it in another language entirely.

"Vectorized" operations are cool, elegant, and beautiful. But they should not be the only tool available. As differential geometers often resort to coordinates to express their tensor operations, so should programmers be able to.

[+] tzhenghao|7 years ago|reply
We may need a programming language for DL, but I doubt it'll happen soon, if it even happens. Lindy effect working in favor of Python here, as many data scientists have prior "big data" experience in it, and typical software engineers from the "scripting/tooling" world.

People have been calling for the phaseout of C/C++, but even today's most popular DL frameworks have backends written in C++ in lieu of Rust.

[+] qwerty456127|7 years ago|reply
> Deep learning may need a new programming language that’s more flexible and easier to work with than Python

Whoever has imagination more rich than mine, how can a programming language can be easier than Python? What's difficult in it?

The only thing I find inconvenient in Python is you can't simply put every function (including every member functions of a class - that's what I would love to do) in a separate file without having to import every one of them manually.

[+] klmr|7 years ago|reply
Not generally easier but easier to express specific, complex concepts. Tensorflow does alright but it’s certainly not beyond improving.
[+] 4233456|7 years ago|reply
Read it again. He/She did not imply that Python is hard.

I do believe that he/she meant that they need way higher levels of abstraction than Python.

Let's say Python is current C, they want something X that's like Ruby in compare to current C.

[+] tjpnz|7 years ago|reply
>The only thing I find inconvenient in Python is you can't simply put every function (including every member functions of a class - that's what I would love to do) into separate file without having to import every one of them manually.

That strikes me as an anti-pattern although you could mimic this behaviour by exposing each one at the package level. Performance is likely to be terrible if you're working on anything sufficiently large.

[+] scriptkiddy|7 years ago|reply
> The only thing I find inconvenient in Python is you can't simply put every function (including every member functions of a class - that's what I would love to do) in a separate file without having to import every one of them manually.

When you create a .py file, the CPython interpreter treats it as a "module". You can basically treat a Python "module" as if it were a class because the global variables are automatically scoped unless you import them explicitly. You could actually write some code that would allow you to instantiate the entire module in the same manner you would instantiate a class. Though, I have no idea where this pattern would be useful.

[+] slack3r|7 years ago|reply
Yes. Deep Learning definitely needs a new programming language. Uber's Pyro is worth checking out. (https://eng.uber.com/pyro/)
[+] wenc|7 years ago|reply
Umm that's not a programming language as such, it's a probabilistic programming DSL built on top of Python/Pytorch. It's one level of abstraction up.
[+] thosakwe|7 years ago|reply
I’m not the biggest Python fan, but I can definitely tolerate it, as long as I have a decent way to use the models from another language.
[+] pi-victor|7 years ago|reply
i always thought Haskell would be amazing for this task.

but python is really popular and easy to grasp. you'll end up writing a new programming language and people would still use python in the end.

[+] kensai|7 years ago|reply
I thought that language was Julia.
[+] return0|7 years ago|reply
More likely a markup language