<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-7452498035721787043</id><updated>2007-05-08T22:15:21.012-07:00</updated><title type='text'>CS92SI: Explorations on OCaml</title><link rel='alternate' type='text/html' href='http://cs92si.stanford.edu/'></link><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7452498035721787043/posts/default'></link><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://cs92si.stanford.edu/atom.xml'></link><author><name>David Hall</name></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7452498035721787043.post-4793379622676052154</id><published>2007-05-08T22:14:00.000-07:00</published><updated>2007-05-08T22:15:21.042-07:00</updated><title type='text'>Another Good OCaml Resource</title><content type='html'>There's a good collection of various OCaml tutorials available at &lt;a href="http://www.ocaml-tutorial.org/"&gt;http://www.ocaml-tutorial.org/&lt;/a&gt;. Worth a look.</content><link rel='alternate' type='text/html' href='http://cs92si.stanford.edu/2007/05/another-good-ocaml-resource.html'></link><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7452498035721787043/posts/default/4793379622676052154'></link><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7452498035721787043/posts/default/4793379622676052154'></link><author><name>Peter Pawlowski</name></author></entry><entry><id>tag:blogger.com,1999:blog-7452498035721787043.post-444716977712486294</id><published>2007-04-30T22:30:00.000-07:00</published><updated>2007-04-30T22:35:24.155-07:00</updated><title type='text'>An Article about OCaml</title><content type='html'>There's a new article by Yaron Minsky of Jane Street Capital fame (a Wall Street firm which uses OCaml extensively) in an (informal) online journal on functional programming called the Monad.Reader. You can check it out &lt;a href="http://www.haskell.org/haskellwiki/The_Monad.Reader#Latest_Issue"&gt;here&lt;/a&gt;. Just to tempt you, he at one point asserts:&lt;br /&gt;&lt;br /&gt;"It has been my experience and the experience of most of the OCaml programmers I’ve known that the ob ject system in OCaml is basically a mistake."&lt;br /&gt;&lt;br /&gt;Glad to hear that we're not alone.</content><link rel='alternate' type='text/html' href='http://cs92si.stanford.edu/2007/04/article-about-ocaml.html'></link><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7452498035721787043/posts/default/444716977712486294'></link><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7452498035721787043/posts/default/444716977712486294'></link><author><name>Peter Pawlowski</name></author></entry><entry><id>tag:blogger.com,1999:blog-7452498035721787043.post-5268498770489705204</id><published>2007-04-25T16:53:00.000-07:00</published><updated>2007-04-25T17:02:06.126-07:00</updated><title type='text'>The O Factor</title><content type='html'>And now for this week's challenge. At &lt;a href="http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora142.html#toc206"&gt;one point&lt;/a&gt;, the O'Reilly book warns: "A type constraint may make public a method declared with attribute &lt;b&gt;private&lt;/b&gt;." Construct an example that demonstrates this pitfall.</content><link rel='alternate' type='text/html' href='http://cs92si.stanford.edu/2007/04/o-factor.html'></link><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7452498035721787043/posts/default/5268498770489705204'></link><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7452498035721787043/posts/default/5268498770489705204'></link><author><name>Peter Pawlowski</name></author></entry><entry><id>tag:blogger.com,1999:blog-7452498035721787043.post-5526103477110707013</id><published>2007-04-20T21:50:00.000-07:00</published><updated>2007-04-20T21:58:07.005-07:00</updated><title type='text'>Optional Assignment 3</title><content type='html'>Hey everyone,&lt;br /&gt;&lt;br /&gt;For the next assignment, write an mli for your DAWG or trie to suppress unwanted globals. Then, write a wrapper module around the Set module so that it behaves the same way. Run some speed tests to see which one is faster.&lt;br /&gt;&lt;br /&gt;Finally, convert your DAWG/trie to be more generic so that it can operate on types of arbitrary data. Your dawg should look something like:&lt;br /&gt;&lt;br /&gt;module type WordType =&lt;br /&gt;    sig&lt;br /&gt;        type t&lt;br /&gt;       (* what other operations you need? Suffix? Equality? Common subsequence?*)&lt;br /&gt;    end&lt;br /&gt;&lt;br /&gt;module DAWG = functor (W : WordType) -&gt;&lt;br /&gt;struct&lt;br /&gt;    type t&lt;br /&gt;    val create_dawg: unit -&gt; t&lt;br /&gt;   (* etc *)   &lt;br /&gt;end</content><link rel='alternate' type='text/html' href='http://cs92si.stanford.edu/2007/04/optional-assignment-3.html'></link><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7452498035721787043/posts/default/5526103477110707013'></link><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7452498035721787043/posts/default/5526103477110707013'></link><author><name>David Hall</name></author></entry><entry><id>tag:blogger.com,1999:blog-7452498035721787043.post-2896400333839190887</id><published>2007-04-14T19:01:00.000-07:00</published><updated>2007-04-14T19:08:33.382-07:00</updated><title type='text'>Crack at Python 3000</title><content type='html'>This is a funny crack that Erich found somewhere. It's in reference to Guido's attack on a few core Lisp (and also ML) functions that he wants to remove from the next generation of Python. (&lt;a href="http://lambda-the-ultimate.org/node/587"&gt;http://lambda-the-ultimate.org/node/587&lt;/a&gt; for information.)&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;br /&gt;      The Fate Of LAMBDA in PLT Scheme v300&lt;br /&gt;                                or&lt;br /&gt;                 Lambda the Ultimate Design Flaw&lt;br /&gt;&lt;br /&gt;About 30 years ago, Scheme had FILTER and MAP courtesy of Lisp hackers who missed them from their past experience.  To this collection, Scheme added a lexically-scoped, properly-functioning LAMBDA.  But, despite of the PR value of anything with Guy Steele's name associated with it, we think these features should be cut from PLT Scheme v300.&lt;br /&gt;&lt;br /&gt;We think dropping FILTER and MAP is pretty uncontroversial; (filter P S) is almost always written clearer as a DO loop (plus the LAMBDA is slower than the loop).  Even more so for (map F S).  In all cases, writing the equivalent imperative program is clearly beneficial.&lt;br /&gt;&lt;br /&gt;Why drop LAMBDA?  Most Scheme users are unfamiliar with Alonzo Church (indeed, they don't even know that he was related to Guy Steele), so the name is confusing; also, there is a widespread misunderstanding that LAMBDA can do things that a nested function can't -- we still recall Dan Friedman's Aha! after we showed him that there was no difference!  (However, he appears to have since lapsed in his ways.) Even with a better name, we think having the two choices side-by-side just requires programmers to think about their program; not having the choice streamlines the thought process, and Scheme is designed from the ground up to, as much as possible, keep programmers from thinking at all.&lt;br /&gt;&lt;br /&gt;So now FOLD.  This is actually the one we've always hated most, because, apart from a few examples involving + or *, almost every time we see a FOLD call with a non-trivial function argument, we have to grab pen and paper and imagine the *result* of a function flowing back in as the *argument* to a function.  Plus, there are *more* arguments coming in on the side!  This is all absurdly complicated.  Because almost all the examples of FOLD we found in practice could be written as a simple loop with an accumulator, this style should be preferred, perhaps with us providing a simple helper function to abstract away the boilerplate code.  At any rate, FOLD must fold.&lt;br /&gt;&lt;br /&gt;--The PLT Scheme Team&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;-- David</content><link rel='alternate' type='text/html' href='http://cs92si.stanford.edu/2007/04/crack-at-python-3000.html'></link><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7452498035721787043/posts/default/2896400333839190887'></link><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7452498035721787043/posts/default/2896400333839190887'></link><author><name>David Hall</name></author></entry><entry><id>tag:blogger.com,1999:blog-7452498035721787043.post-8249205810939851645</id><published>2007-04-11T22:24:00.000-07:00</published><updated>2007-04-11T22:35:37.707-07:00</updated><title type='text'>DAWG Assignment</title><content type='html'>The purpose of the second assignment is to allow you to play with some of OCaml's imperative features, while further increasing your exposure to the language. The high level idea is to build a trie to store a list of words and then enable searching of this data structure. For those feeling more ambitious, the next step would be to convert the trie into a DAWG by merging common suffixes.&lt;br /&gt;&lt;br /&gt;Your program should:&lt;br /&gt;* Prompt for a filename&lt;br /&gt;* Read all the word from that file&lt;br /&gt;* Build the trie and/or DAWG&lt;br /&gt;* Allow the user to query the data structure&lt;br /&gt;&lt;br /&gt;Statistics about node counts (especially for the DAWG) would be neat, too.&lt;br /&gt;&lt;br /&gt;For those interested in the value restriction mentioned in class today, there's a paper by entitled &lt;span style="font-style: italic;"&gt;Simple Imperative Polymorphism&lt;/span&gt; by Andrew Wright which describes the various issues associated with static typing and imperative programming. It's available &lt;a href="http://www.cs.rice.edu/CS/PLT/Publications/Scheme/lasc95-w.ps.gz"&gt;here&lt;/a&gt; in the handy-dandy ps.gz format (please let me know if you can locate a PDF).</content><link rel='alternate' type='text/html' href='http://cs92si.stanford.edu/2007/04/dawg-assignment.html'></link><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7452498035721787043/posts/default/8249205810939851645'></link><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7452498035721787043/posts/default/8249205810939851645'></link><author><name>Peter Pawlowski</name></author></entry><entry><id>tag:blogger.com,1999:blog-7452498035721787043.post-5002648557070185643</id><published>2007-04-09T23:15:00.000-07:00</published><updated>2007-04-09T23:35:11.053-07:00</updated><title type='text'>Syllabus</title><content type='html'>As loosely outlined the first day of class, here's the syllabus for the quarter. Suggestions for changes are welcome!&lt;br /&gt;&lt;br /&gt;April 4: Introduction and OCaml Crash Course&lt;br /&gt;April 11: The Functional and Imperative Sides of OCaml&lt;br /&gt;April 18: The Module System&lt;br /&gt;April 25: OCaml Objects&lt;br /&gt;May 2: Types in OCaml: Polymorphism and Inference&lt;br /&gt;May 9: Concurrency in OCaml&lt;br /&gt;May 16: Interfacing OCaml with C&lt;br /&gt;May 23: ocamlp4, the debugger, and other cool tools&lt;br /&gt;May 30: Guest Speaker! (TBA)&lt;br /&gt;June 6: Final Presentations</content><link rel='alternate' type='text/html' href='http://cs92si.stanford.edu/2007/04/syllabus.html'></link><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7452498035721787043/posts/default/5002648557070185643'></link><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7452498035721787043/posts/default/5002648557070185643'></link><author><name>Peter Pawlowski</name></author></entry><entry><id>tag:blogger.com,1999:blog-7452498035721787043.post-1914892487441769565</id><published>2007-03-21T15:40:00.000-07:00</published><updated>2007-03-21T16:36:52.509-07:00</updated><title type='text'>Welcome!</title><content type='html'>Welcome to CS92SI: Explorations on OCaml! Over the next quarter, we hope to expose you to the wonderful goodness that is OCaml, a modern programming language which beautifully melds the functional and the imperative (and which is widely used among those working in program analysis, CS theory, and finance). A complete syllabus will be posted soon, but the high bit is that we'll cover topics like pattern matching, type inference, the module &amp; object systems, and the OCaml preprocessor (ocamlp4). Our principle hope, however, is that you'll walk away from the class with a sufficient theoretical understanding of the language to know when it shines, along with enough practical exposure to be able to apply it in these situations.&lt;br /&gt;&lt;br /&gt;The most important bit of administrivia is that we'll be meeting on &lt;span style="font-weight: bold;"&gt;Wednesday afternoons from 1:15-2:30 in Herrin T195&lt;/span&gt; (that's the other Biology building, right next to Gilbert). This course is being offered through the Student Initiated Courses (SIC) program, which means it's a one-unit P/NC course which can't be counted towards a degree (except as an activity unit). That said, the class will surely be a great deal of fun. We look forward to seeing you there!</content><link rel='alternate' type='text/html' href='http://cs92si.stanford.edu/2007/03/welcome.html'></link><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7452498035721787043/posts/default/1914892487441769565'></link><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7452498035721787043/posts/default/1914892487441769565'></link><author><name>Peter Pawlowski</name></author></entry></feed>