# On Machine Learning and Programming Languages

**URL:** <https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574>\
**Category:** Machine Learning\
**Created:** [December 6, 2017, 5:17pm UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574 "2017-12-06T17:17:51Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![viralbshah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/viralbshah/32/54_2.png) [@viralbshah](https://discourse.julialang.org/u/viralbshah)\
**Post date:** [December 8, 2017, 4:04pm UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/21 "2017-12-08T16:04:53Z")

</div>

Markdown, ideally done as a PR to the julia blog would be the easiest way to get it going.

-viral

---

<div class="post-metadata">

**Author:** ![innerlee](https://avatars.discourse-cdn.com/v4/letter/i/b19c9b/32.png) [@innerlee](https://discourse.julialang.org/u/innerlee)\
**Post date:** [December 8, 2017, 4:22pm UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/22 "2017-12-08T16:22:31Z")

</div>

okay, working on it.  
ref [link](https://github.com/innerlee/julialang.github.com/blob/zz/blog/blog/_posts/2017-12-06-ml%26pl-cn.md)

---

<div class="post-metadata">

**Author:** ![viralbshah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/viralbshah/32/54_2.png) [@viralbshah](https://discourse.julialang.org/u/viralbshah)\
**Post date:** [December 8, 2017, 4:45pm UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/23 "2017-12-08T16:45:05Z")

</div>

Thank you!

-viral

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [December 8, 2017, 5:02pm UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/24 "2017-12-08T17:02:16Z")

</div>

> [@mauro3](#):
>
> My suspicious is that Chris cloned himself a few times. Even with Julia productive as it is, that is the only possible explanation!

I sure wish he could! Besides the great productivity of using Julia, and him being super smart, I think part of his success is attributable to how well he has inspired others to contribute to the project (much like Tom with Plots.jl, and Jeff and others with the Julia language!)

---

<div class="post-metadata">

**Author:** ![MikeInnes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mikeinnes/32/3656_2.png) [@MikeInnes](https://discourse.julialang.org/u/MikeInnes)\
**Post date:** [December 8, 2017, 6:41pm UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/25 "2017-12-08T18:41:31Z")

</div>

This is very cool!

---

<div class="post-metadata">

**Author:** ![rickhg12hs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rickhg12hs/32/5926_2.png) [@rickhg12hs](https://discourse.julialang.org/u/rickhg12hs)\
**Post date:** [December 8, 2017, 7:16pm UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/26 "2017-12-08T19:16:28Z")

</div>

> [@viralbshah](#):
>
> I personally think that many ML frameworks are slowly becoming more like programming languages, and something like Julia + native AD + Flux/KNet + GPU / other hardware codegen makes for a really compelling ML platform.

It really does seem compelling! Unfortunately I have no GPU but I need some CNNs… Flux doesn’t have them and Knet takes forever. Knet takes 1000’s of seconds _per_ training epoch on my I7 for its example MNIST CNN. TensorFlow.jl doesn’t pass it’s own MNIST tutorial. Mocha.jl and MXNet.jl seem to be the only ones that work. So for my projects I’ll need to use them or jump to Python/TensorFlow.

---

<div class="post-metadata">

**Author:** ![denizyuret](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/denizyuret/32/568_2.png) [@denizyuret](https://discourse.julialang.org/u/denizyuret)\
**Post date:** [December 11, 2017, 7:05pm UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/27 "2017-12-11T19:05:56Z")

</div>

See [https://github.com/ilkarman/DeepLearningFrameworks](https://github.com/ilkarman/DeepLearningFrameworks) for some benchmarks. Knet CNNs were never optimized for cpus. This is not a high priority because you can’t train anything serious on a cpu. Amazon has gpus for 10-20c an hour on spot price if you want to experiment

---

<div class="post-metadata">

**Author:** ![davidbp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidbp/32/463_2.png) [@davidbp](https://discourse.julialang.org/u/davidbp)\
**Post date:** [December 11, 2017, 7:38pm UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/28 "2017-12-11T19:38:41Z")

</div>

I think CPUs have a lot to offer, it is just that the competition in the CPU marked was almost non existent. Some frameworks (MXNET:129/25), even when the model is quite GPU friendly, are 4 times faster in a 4000$ gpu than in a 600$ CPU. What about using a 18 core xeon/16 core threadripper? I’m not sure results would be that different (if the code is optimized for both architectures). Nevertheless, the easier it is for scientist to swtich tools the better. The CPU/GPU war will continue and all companies will bring us more power for less price. If all of us use products from a single company (no matter which one) bad stuff is going to happen to the consumers.

---

<div class="post-metadata">

**Author:** ![denizyuret](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/denizyuret/32/568_2.png) [@denizyuret](https://discourse.julialang.org/u/denizyuret)\
**Post date:** [December 12, 2017, 4:09am UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/29 "2017-12-12T04:09:45Z")

</div>

Good point. I will look into other frameworks’ cpu kernels to see what  
tricks they pull. In the meantime I think 1080Ti goes for about 600USD 😉

---

<div class="post-metadata">

**Author:** ![RoyiAvital](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/royiavital/32/571_2.png) [@RoyiAvital](https://discourse.julialang.org/u/RoyiAvital)\
**Post date:** [December 12, 2017, 3:20pm UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/30 "2017-12-12T15:20:43Z")

</div>

I posted [above](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/17) on [Intel MKL DNN](https://github.com/01org/mkl-dnn).

Though they only guarantee optimization to Intel CPU it is a step forward from having only nVidia.  
Hopefully it will work reasonably good on AMD as well.

---

<div class="post-metadata">

**Author:** ![MikeInnes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mikeinnes/32/3656_2.png) [@MikeInnes](https://discourse.julialang.org/u/MikeInnes)\
**Post date:** [December 12, 2017, 4:02pm UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/31 "2017-12-12T16:02:53Z")

</div>

If anyone is interested in helping us wrap MKL DNN, or other good implementations, it’d certainly be a welcome addition. It would be great to ship these things with our ML packages where possible.

---

<div class="post-metadata">

**Author:** ![innerlee](https://avatars.discourse-cdn.com/v4/letter/i/b19c9b/32.png) [@innerlee](https://discourse.julialang.org/u/innerlee)\
**Post date:** [December 17, 2017, 2:59pm UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/32 "2017-12-17T14:59:48Z")

</div>

A preview of Chinese translation is [available here](https://innerlee.github.io/julialang/blog/2017/12/ml&pl-cn). Feedback are welcome! You can comment on [this pr](https://github.com/JuliaLang/julialang.github.com/pull/689) 😛

---

<div class="post-metadata">

**Author:** ![viralbshah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/viralbshah/32/54_2.png) [@viralbshah](https://discourse.julialang.org/u/viralbshah)\
**Post date:** [December 21, 2017, 3:56am UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/33 "2017-12-21T03:56:26Z")

</div>

Thanks to innerlee and reviewers, the post is live now.

[https://julialang.org/blog/2017/12/ml&pl-cn](https://julialang.org/blog/2017/12/ml&pl-cn)

Would be great to send it to Chinese language tech sites. I note that [csdn.net](http://csdn.net) carried our why Julia post. Some other suggestions are in the PR above.

---

<div class="post-metadata">

**Author:** ![Joshua\_Bowles](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joshua_bowles/32/4515_2.png) [@Joshua\_Bowles](https://discourse.julialang.org/u/Joshua_Bowles)\
**Post date:** [January 3, 2018, 3:17pm UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/34 "2018-01-03T15:17:03Z")

</div>

Wow. Than you for this blog post. I have been lamenting what seems like a standardization on Python in the ML/DL community (though it really seems more like historical accident than intentional engineering).

I’ve looked over F#, Go and Haskell for a decent combo of software engineering and mathematical computation. The story in Go is “train in Tensorflow, serve in go”… There are high quality and valiant efforts in Go to bring in data-science ([https://github.com/gonum](https://github.com/gonum), [http://www.pachyderm.io/](http://www.pachyderm.io/), [http://gopherdata.io/](http://gopherdata.io/))… F# has [https://fslab.org/getting-started/](https://fslab.org/getting-started/); haskell has [http://www.datahaskell.org/](http://www.datahaskell.org/)… but the general communities of these languages seem not to be oriented around (applied) math-based computation, and so these projects are led by a small dedicated minority.

I’m looking to start my own company and none of the languages I’ve mentioned seem “just right”…

I installed julia a long time ago (v 0.2.1) and tried out a basic tutorial. I just came back to it last night to experiment and I think it might be the right fit fro me. I’ve already enrolled in the Coursera Julia Scientific Programming: [https://www.coursera.org/learn/julia-programming](https://www.coursera.org/learn/julia-programming) and am super excited…

It seems like julia addresses many of these practical real world business concerns:

1. I don’t have a 16 hours a day only for development…
2. i can’t afford a buggy, slow, difficult, version-nightmare deployment;
3. I can’t be out on an island building core libraries
4. I can’t afford to spitball and release, only to come back and either re-write or spend countless hours figuring out how to improve performance/scalability of APIs.

In other words, it seems [please correct me if I’m wrong, sources and resource welcomed!]:

1a. julia is an easy enough language to be productive in [of course, subjective as this is…],  
2a. a good deployment story… naive expectation here…  
3a. again naive, but looking over all the packages seems like there is enough to get things built  
4a. another niave view… not sure what the real deploy story is …

My other concern is Type systems. From the bit of reading I did last night it seems like you could prototype quickly using no type declarations, but as you moved towards productionizing things you could begin to stablize by building up a more obviously typed program? Does that seem realistic?

Thanks again for the blog post.

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [January 3, 2018, 3:33pm UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/35 "2018-01-03T15:33:54Z")

</div>

> [@Joshua\_Bowles](#):
>
> 1. I can’t be out on an island building core libraries

> [@Joshua\_Bowles](#):
>
> 3a. again naive, but looking over all the packages seems like there is enough to get things built

It all depends on what you are trying to do in Julia. If you are dealing with strings, database access, data in different encodings (common with databases and CSV files), then you may end up like me, doing `#3`.  
Hopefully that situation will be better soon.

> [@Joshua\_Bowles](#):
>
> My other concern is Type systems. From the bit of reading I did last night it seems like you could prototype quickly using no type declarations, but as you moved towards productionizing things you could begin to stablize by building up a more obviously typed program? Does that seem realistic?

IMO, except for typing needed to correctly dispatch between different methods of the same function, for optimization purposes, or to handle differences such as between strings where code points are represented as a single code unit vs. one or more code units, then leave the type declarations off as much as possible for functions. Julia does a great job at inferring types, and generating very good code specialized for those types (which is why Julians concerned with performance talk a lot about type-stability 😉 )

For structs, there you do want to use concrete types for the fields if possible, and if not, parameterization is usually the best choice (also, for performance).

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [January 3, 2018, 3:49pm UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/36 "2018-01-03T15:49:57Z")

</div>

> [@ScottPJones](#):
>
> IMO, except for typing needed to correctly dispatch between different methods of the same function, for optimization purposes, or to handle differences such as between strings where code points are represented as a single code unit vs. one or more code units, then leave the type declarations off as much as possible for functions. Julia does a great job at inferring types, and generating very good code specialized for those types (which is why Julians concerned with performance talk a lot about type-stability 😉 )

The question is about typing for safety, not performance. Yes you can type for safety and you’ll get good errors, though note they are runtime instead of compile-time errors. In theory one could use the compiler tools to do some static analysis though, but I don’t know of anyone who has done that.

> [@Joshua\_Bowles](#):
>
> i can’t afford a buggy, slow, difficult, version-nightmare deployment;

This is the killer feature to me about Julia. Honestly, I don’t understand build structures well, and if `make` fails I scratch my head and Google. It makes C/Fortran/C++ a nightmare for me to use. But Julia packages and libraries can be Julia the whole way down, and so that gets rid of all installation nightmares. In fact, package installation problems only seem to happen when there’s a binary dependency! So yes, these reasons make Julia a “productive C++” to me instead of a “fast Python”.

---

<div class="post-metadata">

**Author:** ![Joshua\_Bowles](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joshua_bowles/32/4515_2.png) [@Joshua\_Bowles](https://discourse.julialang.org/u/Joshua_Bowles)\
**Post date:** [January 3, 2018, 4:00pm UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/37 "2018-01-03T16:00:09Z")

</div>

awesome, thanks.

I’ll clarify too: Not looking for a silver bullet here, no PL can do everything. What I’m specifically targeting here is that I’ll be processing a lot of airplane and airport and geo data, running the gambit on machine learning and deep learning techniques… I need/want the ability to write a backend API around my models… an API that can be used by other services (for example, a front end website).

I’m not looking to build websites with julia 😉 or crud apps. I need a great tool to build models, and way to serve those models via an API.

My current option is training with Python-Tensorflow, and then using the go API to tensorflow to serve the model as an API. (BTW, this bugs me cause now its a 3 language solution… python, c++, and go [and if you consider TF graphs as DSL or something like SQL then its 4-languages]).

I can easily bear the brunt of pre-processing data in go to overcome lack of support in julia (and of course contribute my own julia stuff…), but there is a critical mass of support that needs to be there to just get off the ground and it seems Julia already has that (for example, i needed to do some NLP 5 years ago and looked to go, but basic packages for statistics and matrix multiplication were not there so, i didn’t have the time to build those before building basic NLP libs too).

All in all, I’m psyched on julia, and think I can definitely make it work with what I’m doing.

thanks again

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [January 3, 2018, 4:02pm UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/38 "2018-01-03T16:02:41Z")

</div>

> [@ChrisRackauckas](#):
>
> The question is about typing for safety, not performance.

OK, that wasn’t clear to me. For us, productizing meant making sure we scaled as we expected, and for safety, adding types I would say that adding typing doesn’t really help, the only thing IMO that helps with dynamic languages such as Julia (and M/MUMPS/CachéObjectScript that I worked on before) is really thorough unit-tests, backed by coverage tools that ensure that at least you’ve tested all paths with your unit-tests.

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [January 3, 2018, 4:10pm UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/39 "2018-01-03T16:10:17Z")

</div>

> [@Joshua\_Bowles](#):
>
> I’m not looking to build websites with julia 😉 or crud apps.

Yeah - I don’t know many people who are (we are using Node.js and TypeScript I believe for UI).  
I do hope there will be some better support in the future for NLP in Julia, I think that’s a more promising field for Julia than as a language for building websites.  
We are doing all sorts of fun stuff in Julia, and although we’ve had to use other languages, and roll our own support for some core things we found lacking in Julia, we’ve been fairly pleased with it.

---

<div class="post-metadata">

**Author:** ![Joshua\_Bowles](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joshua_bowles/32/4515_2.png) [@Joshua\_Bowles](https://discourse.julialang.org/u/Joshua_Bowles)\
**Post date:** [January 3, 2018, 4:18pm UTC](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574/40 "2018-01-03T16:18:55Z")

</div>

nice.  
Yeah I am thinking here about type safety… But it’s also not something I’m dogmatic about. Rust/F#/Haskell has a lot of interesting things you can do with Types… but it’s kind of not clear how that equates into productivity, safety, and refactoring.

I think static type systems and/or static analysis is super important for the ML/DL future… but it’s kind of not obvious where that should happen (e.g., Python is dynamic typed, but TensorFlow has a static type system for building the graph… so it seems a matter of interpretation if that is overall “static”).

I’ve also deployed plenty of ruby on rails and python projects, so my sense of what is “easy” to deploy is definitely a bit more weathered than “put the binary out on the server”, from this perspective it seems julia deployment is good.

I look forward to moving through tutorials and trying out Knet/Flux

Thanks for the reply

[Previous page](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574.md?page=1)

[Next page](https://discourse.julialang.org/t/on-machine-learning-and-programming-languages/7574.md?page=3)
