
I Accidentally Some Machine Learning – My Story of a Month of Learning Elixir - fredwu
http://fredwu.me/post/147855522498/i-accidentally-some-machine-learning-my-story-of
======
hartator
> About a month ago I was in-between jobs - I had two weeks to rest up,
> recharge and get ready for my new job. So I thought, I should use those two
> weeks to learn something new.

After this, people are still wondering why developers earn $100,000+ salaries.

~~~
dimgl
I don't get it.

~~~
fucking_tragedy
Developers get paid market price for their labor, right now employers pay them
above median salary, some commenter on HN wants to point out a correlation
between this particular developer's choice to spend their time to learn a new
skill and their current market valuation suggesting that the latter follows
from the former.

~~~
rckclmbr
Agreed, welders for example spend a lot of their spare time working on side
projects, learning new ways of welding, etc. Carpenters spend a lot of time on
family and friends home projects. There is no correlation between a
programmers willingness to learn and the median salary for the industry

~~~
kapv89
There is. Programming is a non-linear field, while welding is a linear one,
unless you become a successful welding-artist.

~~~
rckclmbr
If you ask welders, there is definitely an art to it. Check out /r/welding
sometime.

------
zitterbewegung
Why did Python get a bunch of mschine learning frameworks but ruby has little
or nothing ? Was it because scientists just started to use Python more ?

~~~
Mekkanox
It was a combination of:

1) The language was created by a researcher (Guido Van Rossum) at a research
facility in the Netherlands [1]

2) Network effect - as more machine learning researchers and engineers in
academia used it, the need for a language that could integrate with FORTRAN
with similar performance came about, which lead to NumPy, SciPy, etc.

3) The language itself is pretty simple to grasp. There's multiple ways in
Ruby itself to do something, while in Python there's at most one way to do
something. Anecdotal - a lot of researchers I've worked with care more about
the usability and ease of adoption of a language, compared to the
expressivity.

[1]
[https://en.wikipedia.org/wiki/Python_(programming_language)#...](https://en.wikipedia.org/wiki/Python_\(programming_language\)#History)

~~~
saghm
Not disagreeing with the relative simplicity of Python compared to Ruby, but
the degree to which the Python community is adamant that there is always only
one way to do something has always baffled me. What about `map` versus a list
comprehension, or `glob` vs `os.path`? Obviously Python has pretty clear
standards about what the correct way to do something in the language is, but I
feel like the persistent claim that there's always exactly one way to do
something can range from oversimplified, misleading, or just plain wrong.

~~~
gary_bernhardt
Extreme pro-Python statements about "one way to do it" are usually made by
relative newcomers who are caught up in their enthusiasm for purity. (This
exuberance is natural, and is a big part of the language adoption cycle.)
Extreme anti-Python statements about "one way to do it" are usually made by
outsiders viewing Python through accounts given by enthusiastic newcomers.
This exuberant-newcomers-vs-skeptical-outsiders dichotomy isn't representative
of the actual Python culture, which is much more sensible and practical than
all of this implies. If you go to PyCon and attend talks by long-time Python
folks, you won't find them advocating anything like blind adherence to "one
way to do it".

To get specific, the wording in PEP 20 is: "there should be one, and
preferably only one, obvious way to do it". Note that the dominant idea here
is that there should exist _some_ obvious way. It's merely _preferable_ that
there be only one way. Again: this is sensible, but it's not good fodder for
newcomers craving purity, or for detractors craving straw men.

PEP 20 itself is often elevated to religious levels of importance, as if it
were a design document that served as a blueprint for the design of Python.
It's absolutely not that; it was written by Tim Peters (not Guido!) fully
eight years after Python's first release. Here's the original email that Tim
sent to comp.lang.python on 4 June, 1999:
[https://groups.google.com/d/msg/comp.lang.python/B_VxeTBClM0...](https://groups.google.com/d/msg/comp.lang.python/B_VxeTBClM0/L8W9KlsiriUJ).
Note how he finishes: "If the answer to _any_ Python design issue isn't
obvious after reading those -- well, I just give up <wink>." Tim is very
particular about his winks, and that's not even a <0.5 wink> or a <0.9 wink>,
but a full, unqualified <wink>.

To put all of those pieces together: (1) we have a short, tongue-in-cheek
document written after-the-fact. (2) It's misinterpreted as a design document
for an entire language and ecosystem. (3) A secondary portion of one of its
points is misinterpreted to be the entirety of the point. (4) This is done by
exuberant newcomers and skeptical detractors who don't accurately represent
the Python culture as a whole. This is why you get the impression that the
community is adamant about "one way to do it". It's a reasonable extrapolation
from the visible evidence, but it's not true.

~~~
saghm
Thanks, that's a very clear and well thought out explanation. I'll make sure
not to take the skeptical detracting too far in the future!

------
di4na
Interestingly, i think most of your speed on Stemmer come from using
String.replace_suffix, which use binary pattern matching instead of regex.

Nice learning :)

~~~
kkirsche
I wonder if the new regexp code in Ruby 2.4 would address some of that

~~~
fredwu
Author here. When I was benchmarking my library against a ruby one, I did
actually try the ruby one on 2.4. Interesting findings are:

\- Switching from =~ to Regex.match? did not yield significant speed
improvement

\- Without any changes though, 2.4.0-preview1 ran the stemming in 19s,
compared to the 25s on 2.3.1.

The ruby stemmer I used is this one:
[https://github.com/NeilNjae/porter2stemmer](https://github.com/NeilNjae/porter2stemmer)

------
vonnik
The headline is missing the word "Did" after "Accidentally", both on HN and on
the post itself.

~~~
susan_hall
All your base are belong to us.

Sometimes typos lead to memes.

~~~
eggy
Sometimes memes lead to people learning incorrect grammar (as I beat down my
former benevolent grammar dictator within).

------
tschellenbach
Does anybody know of a good benchmark between Elixer, GO and Scala?

~~~
andruby
Over a year ago, there was a benchmark of web frameworks. It compares the
performance of frameworks written in Elixir, Go, Java, Node and Ruby.

[https://gist.github.com/omnibs/e5e72b31e6bd25caf39a](https://gist.github.com/omnibs/e5e72b31e6bd25caf39a)

~~~
david-given
That's really interesting --- how come Elixir does so well? I thought that the
BEAM VM was good for concurrency and reliable systems, but wasn't so great at
raw number crunching compared to the JVM and compiled code?

~~~
qaq
it's web framework benchmark there is no number crunching

