For instance, what are your options on Windows or Mac? And are the languages you can do this with limited to Ruby, Python, or Javascript?
Learn a Programming Language Faster by Copying Unix
11–20 of 110 posts
Re: Learn a Programming Language Faster by Copying Unix
#12This is a brilliant idea, and may I suggest that one takes it slightly further than just implementing the core functionality, and aiming for a complete clone (optional parameters and all) with a few enhancements. Indeed, for a further ego boost, why not also benchmark the performance of your versions against the performance of the native utilities? You never know, your new clone might end up being the new 'less' to t…
Re: Learn a Programming Language Faster by Copying Unix
#13Can someone give a non-expert way of going about this learning method? For instance, what are your options on Windows or Mac? And are the languages you can do this with limited to Ruby, Python, or Javascript?
Windows doesn't have many of the basic Unix tools, but you can still implement them using your programming language of choice (how great). No, you're not limited to these three languages. I only meant in the article that these three are probably the easier to copy Unix with, for their scripting nature.
Re: Learn a Programming Language Faster by Copying Unix
#14Rodrigo, I thought you should know that when browsing your site on an iPhone 4, the header overlapped the index. That wasn't a great description, so here is a screenshot: http://db.tt/7grTPHsL You also cannot zoom in, which made it very hard to read.
I'll change it. Thank you very much for reporting the problem. It now allows you to zoom in. I'll take more time to fix the header, tho.
Thanks man.
Re: Learn a Programming Language Faster by Copying Unix
#15Can someone give a non-expert way of going about this learning method? For instance, what are your options on Windows or Mac? And are the languages you can do this with limited to Ruby, Python, or Javascript?
Since a Raspberry Pi is only $35 or $50 with enough stuff to program it, that is one way to get started. Of course taking an older tossed of PC and installing Linux on it works too (which can often be done for free if there are businesses around)
Re: Learn a Programming Language Faster by Copying Unix
#16Can someone give a non-expert way of going about this learning method? For instance, what are your options on Windows or Mac? And are the languages you can do this with limited to Ruby, Python, or Javascript?
One of the simplifying assumptions that is built into this idea is that the input and output to the program are simple streams ( a file, a terminal ). Not surprisingly that makes things a lot less complex so you can focus on the programming. Since a Raspberry Pi is only $35 or $50 with enough stuff to program it, that is one way to get started. Of course taking an older tossed of PC and installing Linux on it works t…
Re: Learn a Programming Language Faster by Copying Unix
#17Re: Learn a Programming Language Faster by Copying Unix
#18Re: Learn a Programming Language Faster by Copying Unix
#19For a purely functional language like Haskell, this would not be a very good advice. Any kind of I/O would involve monads and other imperative constructs. Better implement an algorithm involving trees or graphs to better appreciate a functional language.
main = interact id
This is a slightly crude implementation of cat in Haskell. As you can see, it is replete with scary monad plumbing that gets in the way of the actual functionality (copying stdin to stdout).I would explain further and implement more than what the blog post suggested but there's already a book (Real World Haskell) that does this with a number of other Unix commands.
Re: Learn a Programming Language Faster by Copying Unix
#20Can someone give a non-expert way of going about this learning method? For instance, what are your options on Windows or Mac? And are the languages you can do this with limited to Ruby, Python, or Javascript?
As for which languages, this actually seems like it would be useful for learning any language that has reasonable ways of interacting with IO streams. Off the top of my head:
Ruby, Python, Javascript (node.js), Perl, Java, C#, Scala, Clojure, C, C++, Go, etc.