Monthly Archives: September 2013

As part of the functional programming journey started with Elixir, I’m learning Scala too. Right now, coursera is offering a online course of Scala lectured by the language-designer Mr. Odersky. It’s a nice one with structured instruction videos and problem sets for working out.

I just briefly scratched the surface of the feature sets, but it seems nicely organized language. It has both functional and object oriented modeling and the interaction with Java assets. The feature set sounds practical and grammer is simple and matured, compared with the yet growing status of the Elixir.

The above video talks about the preferable usage of the language by comparisons. It represents the different types of coding styles derived from both the functional and object-oriented world. It’s interesting.

One more trial on dynamo along with exfirebase, in addition to the previous PostgreSQL version. Firebase’s json-based object manipulation is pretty much flexible. After some refinements on exfirebase side, the model access became relatively simpler, though the router part still has duplications.

A note about the DELETE/PUT methods. HTML form does not support PUT/DELETE of HTTP/REST verbs, and Rails/Sinatra uses Rack::MethodOverride middleware to override the method to the one in “_method” parameter.

Though the Dynamo doesn’t provide this overriding feature, it has Filters framework to provide middleware-like service chain. A simple filter logic to rewrite the conn.method as follows worked nicely.

As part of the Elixir study, I tried to write a simple project on Dynamo. Mostly, Routers on Dynamo worked nicely with the DSL-like get/post macros.

Also, I played around the ecto database wrapper on PostgreSQL DB as a backend service. Though the functionality is still limited, it’s well organized and the usage is simple enough. As in the readme, if REST API helper or DB migration is implemented, it would be a good candidate for a simple web application backend.

One concern I had is Dynamo seems not support the PUT/DELETE method on HTTP using HTML form. The above project workarounds it using jQuery’s $.ajax method for sending DELETE, but it may be one missing point compared with rails or sinatra for a simple REST app.

As part of the study on Elixir’s dynamo application, I just tried to create a simple one. Basic features just worked fine, though parameter handling is a little cumbersome. Also, heroku deployment was easily completed using the custom toolbelt. For a data storage, it uses exfirebase.

Functional reactive programming (FRP) is a programming paradigm for reactive programming using the building blocks of functional programming.

I haven’t heard the word FRP before, but the concept sounds interesting. The data is manipulated based on the events rather than procedural updates of variables. The data can flow like the way Excel functions works.

Maybe, along with the surge of JavaScripts, reactive (or event-driven) programming paradigm is getting popular. AngularJS’s double-binding is pretty much declarative data definitions, though it may not be the functional one under the hood.

An introduction of Elixir at Erlang conference. The interesting point of Elixir is that it’s very well designed for utilizing the Erlang’s VM assets, as indicated in this presentation and other documents. Recently, lightweight languages built on top of virtual machines are getting popular. Major one would be JVM, but Erlang’s strong concurrency model is very unique and compelling.

At around 17:00, web-server performance is being compared with Sinatra and Express.js, which discusses about the performance advantage of utilizing Erlang’s pattern-matching feature. Grammatically, Elixir is designed as similar as ruby, and native ruby has strong meta-programming power as Elixir’s macro provides. But, this performance benefit would be an key factor on Elixir/Erlang.

VM technologies are getting more interesting, and there’re so many JVM-based languages. Also, RubyMotion has gained popularity through the Ruby’s powerful expression and native performance through LLVM byte-codes. Asm.js is an another interesting project as a kind of VM technology. Need to keep watching.

Last week, I was working on a coveralls.io binding for Elixir. It’s getting more fun to find something to write using Elixir. Its entire toolsets are still limited compared with other popular languages (JavaScript, Ruby, etc.), but the underlying Erlang’s wide-range libraries helps a lot.

This uses Erlang’s cover library, and it works mostly well on Elixir. It can return the module definition (Elixir.XXX) and source code (*.ex) relationship along with test-coverage by combining with “mix test”. I haven’t been able to fully understand how this translation is working, but it would be one good indicator that Elixir is well wrapped around Erlang’s concept at very low-level. It’s pretty much interesting that it’s achievable by changing the language representation like Ruby, from the Erlang’s a little tricky grammer.

Still there’s a lot to learn, but this kind of writing is a nice workout for getting closer, I hope.

I was watching a couple of videos about Linus Torvalds, like the above ones. Linus is somewhat famous for vocal outrage on the kernel discussion, but he makes pretty much calm and insightful Q&A sessions.

Still, strong words are sometimes used, but it seems mostly very-nice (I was only knowing the outrage part). Good open source projects are famous for having benevolent dictator, and he would be an good example.

As similar as his Programming Elixir book, it is pretty much well organized. A nice introduction for the Elixir.

The future is functional
The future is concurrent

The above statement (around 2:10) is interesting. Recently, languages which have these aspects are gathering attention. Along with JavaScript, Golang, Scala and Elixir/Erlang would be gaining popularities. Ruby also has concurrent models (through Fibre or etc.), but Elixir/Erlang’s built-in functional paradigm feels like changing the way of programming.

As discussed in the presentation (around 18:00), fibonacci definition is a good explanation of concise and declarative expression of Elixir.