141 karma · joined March 24, 2012
Currently I spend my spare time understanding and programming in Clojure and its implementation on the JVM.
Blog: http://devanla.com Linkedin: http://lnkd.in/zPja7t Twitter: https://twitter.com/grdvnl
> All in all, I guess this is the result of a company that has more money than they possibly know what to do with. I wonder how long this utopian "do no evil" culture can last. Wealth creates power, and power corrupts. And boy, have I seen a lot of power this last week.
> "May you live in interesting times."
Now, juxtapose that with the authors other recent post: https://social.clawhammer.net/blog/posts/2024-01-10-GoogleEx...
Interesting times in deed!
/s
This is a sincere question and would love to find good excuses to adopt OCaml as my primary language of choice.
Here is the option I have in my profile file. You can run this command inside the ipython session as well:
%autoreload 2
The times I have seen auto-reload fail is when there is lot of class creation magic going on or while dealing with global connection objects which sql alchemy might be creating. But, other than that it works very nicely.
As for me, before this course, learning a language was a mechanical process. I learn the syntax, learn some idioms and go with it. But, after this course, as the other commenter put it, I started learning every language as a set of features. That opens up a whole new world. For instance, when learning a new language, you seek out the features your are interested in and then figure out how that language lets you use it. For example, does a language support abstract data types, what paradigms of programming does it support, is it imperative or functional, lazy or strict, is the language supposed to be used as a bunch of statements or expressions, can common idioms be implemented as simple language functions or do I need the language to support it internally etc, does it support lambdas, does it do lexical or dynamic binding etc. The course also takes you through ML, Racket and Ruby and gradually exposes you through this concepts and in parallel explains what the trade-offs are as you give up once paradigm for another.
So, after the course, next time if you open up a beginners guide to any language, you will be seeking our answers to high level questions. The syntax to use will be learned automatically as you use those 'concepts'
Dan Grossman is a an excellent teacher. His passion for programming languages can be seen in his teachings. The homeworks are very relevant and helps you solidify the concepts. I am thankful to him for offering this course.
Hope this makes sense.
https://www.coursera.org/learn/programming-languages
I see that they have split the course into 2 parts.
There was a talk using similar examples which I think is very educational.
https://www.infoq.com/presentations/Y-Combinator
I wrote down the examples used in the video (given the poor quality of video) to help myself learn about the Y-Combinator
https://gist.github.com/gdevanla/9171085
Recently, I presented this topic to my team and wrote down a Python equivalent of this example.
https://gist.github.com/gdevanla/07a08d99e183f494d036c6d6fe6...
It is also important to note that apart from providing the ability to write imperative code, monads encapsulate computation. In my understanding, this is where their use shines. Getting to wrap values in such contexts in certain imperative languages could be tedious. Using a monad, one passes around the value within the context of the monad. There is a computation(aka context) that is associated with the value in the monad and that computation is performed before a value is yielded.
But, I agree with you that there are obscure operators scattered around the code base and I have to keep jumping away from that point to lookup what the particular operator means in that context.
I would love to encode the business logic into types. But, I am always afraid I might end up in type hell!
With the subclass approach you are required to implement a new class and essentially write repetitive code, or reuse existing functions. Reusing existing test methods does not provide good error reporting as I had stated earlier. It is late in the day. Shortly, I will try to post a gist example of what I am talking about, if you are still interested.
We have a class that has different methods that performs numerical analysis/computations of financial models. These methods need to be tested with different subsets of data. The number of combinations of tests and test-data are huge, whereas the 'testing code' is simple and repetitive. Having these tests in a loop is not useful due to way test errors get reported.
Therefore, we generate a test class using the meta classes, that creates 'test_*' methods that are eventually executed. With such methods in place, we have around 100 tests generated within less than 100 lines of code, without loosing the detailed error reporting in case of failing tests.
I am not a fan/employee of any of these companies. I am just putting the contribution into a different perspective.
http://www.grymoire.com/Unix/Awk.html
Also, check out the sed tutorial while you are there.
Without getting into emacs vs vim war, the author would be impressed in a bigger way once the emacs documentation is explored!