Re: [Caml-list] questions
I'll answer the questions that I can... On Tuesday 24 March 2009 19:42:40 John Prince wrote: > I'm new to ocaml and coming (most recently) from ruby, so I was wondering > if there are equivalents to some of the things that I find handy in ruby: You may find the OCaml Beginners mailing list hosted by Yahoo to be more productive for simple questions. > 2) Is there something like 'ri' in ocaml? (commandline access to basic > documentation) I highly recommend ocamlbrowser but it is not CLI. > 3) Is there consensus on the best/fastest xml parser? I use XML-Light whenever it can handle it (it supports only a small part of XML but is very easy to use) and PXP otherwise. You might also check out the well-reputed Expat bindings but I have not tried them. > Where is the message archive located? For this list, here: http://caml.inria.fr/pub/ml-archives/caml-list/index.en.html > Is it searchable? Google indexes it well. > Can someone point me to the best resource(s) for newbies? Start at the community OCaml tutorial wiki and search the links therein. http://www.ocaml-tutorial.org/ There is some interesting propaganda here: http://www.ffconsultancy.com/ocaml/benefits/ > I have been reading through what's out there, but its always nice to get a > recommendation. Two beginners books are my own "OCaml for Scientists" and Tim Rentsch's "The Objective CAML Programming Language". Hopefully Jason Hickey's book will be published this year. -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] questions
John Prince a écrit : > 4) What kind of YAML support is there? I've seen an ad-hoc writeup to > read in JSON in an ocaml program, but I'm much more familiar with YAML. http://ocaml-syck.sourceforge.net/ It is packaged in Debian. I've never used it, though... Cheers, -- Stéphane ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] questions
On Tue, Mar 24, 2009 at 01:42:40PM -0600, John Prince wrote: > 1) Is there something comparable to RSpec (i.e., behavior driven > development)? A recommendation on which testing module to use? Possibly ounit? To be honest test-driven development is more useful with dynamic languages, because the compilers for those languages pick up so few errors. In OCaml the compiler is much more thorough, and by the time your program "passes" the compiler, it's bug free! (Well, that's the theory anyhow :-) > 2) Is there something like 'ri' in ocaml? (commandline access to basic > documentation) I usually use this low-tech but very effective solution: cd $(ocamlc -where) less .mli One catch is that the first letter in is lowercase, whereas module names themselves start with an uppercase letter. eg: unix.mli vs Unix > 3) Is there consensus on the best/fastest xml parser? There are certainly several to choose from :-) > 4) What kind of YAML support is there? I've seen an ad-hoc writeup to read > in JSON in an ocaml program, but I'm much more familiar with YAML. ocaml-syck (not used it). For JSON use json-wheel and/or json-static. I've recently become a fan of s-expressions because it's ridiculously easy to write s-expressions from any other language and then import those directly into OCaml data structures. (See the sexplib library / syntax extension). I have been "liberating" a lot of data from Python programs this way. http://ocaml-syck.sourceforge.net/ http://martin.jambon.free.fr/json-wheel.html http://www.ocaml.info/home/ocaml_sources.html#sexplib310 > Where is the message archive located? Is it searchable? Google ... > Can someone point me to the best resource(s) for newbies? I have been > reading through what's out there, but its always nice to get a > recommendation. You should definitely join the ocaml_beginners mailing list. INRIA have beginners' resources here: http://caml.inria.fr/resources/index.en.html I maintain this site, along with dozens of external contributors: http://www.ocaml-tutorial.org/ Scroll down for plenty of external links ... Rich. -- Richard Jones Red Hat ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] questions
Le 25 mars 09 à 01:17, Richard Jones a écrit : 3) Is there consensus on the best/fastest xml parser? There are certainly several to choose from :-) If you intend to parse real (in the sense not under your own editing control) xml documents the choice shrinks down drastically. For pure caml solutions I'll suggest you either pxp or xmlm but I'm biaised. In any case you'll find a list of alternatives here [1] Best, Daniel [1] http://caml.inria.fr/cgi-bin/hump.fr.cgi?sort=0&browse=49 ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] questions
On Tue, 2009-03-24 at 13:42 -0600, John Prince wrote: > 2) Is there something like 'ri' in ocaml? (commandline access to > basic documentation) There's nothing out-of-the-box. In OCaml Batteries Included, you can use #man. So #man "print";; will open your web browser with the documentation of "print". Cheers, David -- David Teller-Rajchenbach Security of Distributed Systems http://www.univ-orleans.fr/lifo/Members/David.Teller « Ce matin Un crétin A tué un chercheur. » (air connu) Latest News of French Research: System being liquidated. Researchers angry. ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] questions
Thanks for all the helpful responses! They are greatly appreciated. --John ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] questions
2009/3/24 John Prince > I'm new to ocaml and coming (most recently) from ruby, ... > Can someone point me to the best resource(s) for newbies? I have been > reading through what's out there, but its always nice to get a > recommendation. > I also started learning OCaml this year. Here's my personal experience and recommendations on tutorial that are freely available: Begin with 20 min reading at Wikipedia to get some context of the lang as perceived by programers in general: • http://en.wikipedia.org/wiki/Ocaml The following are quality material, that you can get hands on experience as a intro, each worth about 8 hours of study: • Ocaml for Scientists, by Jon Harrop, chapter 1 free: http://www.ffconsultancy.com/products/ocaml_for_scientists/chapter1.html • “Introduction to Caml” by Scott Smith of Johns Hopkins U. A lecture note. http://www.cs.jhu.edu/~scott/pl/lectures/caml-intro.html The above 2 are similar. Once you did the above, you might want a full length tutorial, treating major aspects of the lang in some detail. Here's 2 i found available: • Developing Applications With Objective Caml, By Emmanuel Chailloux - Pascal Manoury - Bruno Pagano at: http://caml.inria.fr/pub/docs/oreilly-book/html/index.html • Introduction to Objective Caml, by Jason Hickey, 2008. (draft) http://www.cs.caltech.edu/courses/cs134/cs134b/book.pdf Currently, i'm still reading chapter 2 of the Emmanuel book. Started to read Jason too. (i like concurrently reading multiple references) I also started to write my own. Expect it to be in some usable form in a year. It is written for practical programers, and those from so-called “scripting” lang background (e.g. php, perl, python, javascript, Mathematica, newlisp, tcl, ruby), and with the view point that prog langs are primarily syntax (i.e. a computatable math notation.). • OCaml Basics http://xahlee.org/ocaml/ocaml_basics.html --- the following are the most visible ocaml tutorials, but are low quality, blog like, full of misleading characterizations, irrevelancies, misleading comparisons. The type that you'd spend hours on and got more confused, regardless whether you are a expert logician or expert industrial programer. These tutorial's quality and nature are similar to the ones you'd find of the freely bundled official tutorials from perl, java, or even haskell. Typically written as a revised diary of learning experiences by student programers, or by academicians who are llliterate in technical writing. • intro to ocaml, from official site http://caml.inria.fr/pub/docs/manual-ocaml/manual003.html • “Objective CAML Tutorial”, most cited tutorial on the web http://www.ocaml-tutorial.org/ There are 3 or so more ocaml tutorials i've looked on the web, from the first page of google search with word “ocaml tutorial”. I don't think they are not worth your time. - I'd be good if the ocaml managers perhaps thru some arrangement, to borrow Jon Harrop's chapter 1, or other quality sources, in replacement of the tutorial on the official site. Because, a quailty tutorial bundled with the official release has great impact. The official tutorial makes the first impression of the lang for most people. Xah ∑ http://xahlee.org/ ☄ ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] questions
the following are the most visible ocaml tutorials, but are low quality, blog like, full of misleading characterizations, irrevelancies, misleading comparisons. The type that you'd spend hours on and got more confused, regardless whether you are a expert logician or expert industrial programer. These tutorial's quality and nature are similar to the ones you'd find of the freely bundled official tutorials from perl, java, or even haskell. Typically written as a revised diary of learning experiences by student programers, or by academicians who are llliterate in technical writing. • intro to ocaml, from official site http://caml.inria.fr/pub/docs/manual-ocaml/manual003.html • “Objective CAML Tutorial”, most cited tutorial on the web http://www.ocaml-tutorial.org/ There are 3 or so more ocaml tutorials i've looked on the web, from the first page of google search with word “ocaml tutorial”. I don't think they are not worth your time. - I'd be good if the ocaml managers perhaps thru some arrangement, to borrow Jon Harrop's chapter 1, or other quality sources, in replacement of the tutorial on the official site. Because, a quailty tutorial bundled with the official release has great impact. The official tutorial makes the first impression of the lang for most people. Xah There must be some reason why the manual and other materials on the official site are of such poor quality. I've thought a bit about it, and the only reason I see is that the authors do not have a feel for what it takes to learn/understand/use that language. They obviously know it all through, but that's still far removed from being able to explain it to someone else. I don't know, of course, how it is that one understands something "well" yet is not able to explain it to somebody else. To me, that's very fragile knowledge. I always thought that deep understanding implies an ability to extract what's important, and to lead the other person from some "basics" (whatever they may be) to the conclusion. Some experience in imperative languages can be perhaps expected of the OCaml beginners. But the manual, the official tutorial, and even ocaml-tutorial, fall short of being really useful - for me. Personally, I found them next to useless, but that perhaps has to do with my own shortcomings. Books that lag behind the current release's features are not all that great either -- you find a book that's a good match to your needs, and then, after a while, find that you miss on a lot of good stuff that's not mentioned in the book. I have two examples of such books: Jon's book, and Marcelo DiPierro's web2py book. Both are very good books because the authors have a feel for what it takes to understand what they talk about. Yet both miss out on some newer features of OCaml and web2py, respectively -- features that would be best explained by the very same authors! Cheers, Kuba ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] questions
Kuba Ober wrote: > There must be some reason why the manual and other materials on the > official site are of such poor quality. I've thought a bit about it, and > the only reason I see is that the authors do not have a feel for what it > takes to learn/understand/use that language. They obviously know it all > through, but that's still far removed from being able to explain it to > someone else. I don't know, of course, how it is that one understands > something "well" yet is not able to explain it to somebody else. To me, > that's very fragile knowledge. I always thought that deep understanding > implies an ability to extract what's important, and to lead the other > person from some "basics" (whatever they may be) to the conclusion. I can see one reason: like many other French OCaml programmers, I learned OCaml at school (it was in 1998). French teachers don't rely heavily on a book. There is however one book that covers the essentials, "Le Langage Caml" by Weis and Leroy, which despite using the Caml Light dialect is the most enlightening programming book I've ever got to read. For the rest, there is the reference manual of OCaml and plenty of source code all around the web. I think that's why there is not much more incentive to write a complete "replace-the-teacher" text book on OCaml written by the core OCaml developers, who are mostly a French team. Besides, it's a lot of work and doesn't make money. Of course there are now a few great books and tutorials on OCaml in English, none of them having an official status. Martin -- http://mjambon.com/ ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] questions
> There must be some reason why the manual and other materials on the > official site are of such poor quality. I've thought a bit about it, and > the only reason I see is that the authors do not have a feel for what it > takes to learn/understand/use that language. They obviously know it all > through, but that's still far removed from being able to explain it to > someone else. I don't know, of course, how it is that one understands > something "well" yet is not able to explain it to somebody else. To me, > that's very fragile knowledge. Because we are autistic morons who lack your rock-solid knowledge, if I properly catch your (rather insulting) drift? At the very least, you're confusing "to be able" with "to intend to". The "tutorial" part of the OCaml reference manual was a quick job targeted at readers who already know functional programming and just want a quick overview of what's standard and what's different in OCaml. Maybe that shouldn't be titled "tutorial" at all. Teaching functional programming in OCaml to beginners is a rather different job, for which they are plenty of good books already. Most of them happen to be in French for various reasons: O'Reilly's refusal to publish the English translation of the Chailloux-Manoury-Pagano book; the Hickey-Rentsch controversy, etc. But, yes, some talented teachers invested huge amounts of time in writing good intro to Caml programming books. Don't brush their efforts aside. One last word to you, that Xah Lee troll, and anyone else on this list: if you're not happy with the existing material, write something better. Everyone will thank you and you'll get to better appreciate the difficulty of the task. - Xavier Leroy ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] questions
On Tuesday 31 March 2009 14:37:05 Kuba Ober wrote: > There must be some reason why the manual and other materials on the > official site are of such poor quality. FWIW, I think the OCaml manual is superb and under-appreciated. > Jon's > book, and Marcelo DiPierro's web2py book. Both are very good books > because the authors have a feel for what it takes to understand what > they talk about. Yet both miss out on some newer features of OCaml and > web2py, respectively -- features that would be best explained by the > very same authors! My work is driven by profit, of course, and I believe it is substantially more profitable to publish new books on related fringe topics where there is little or no competition (e.g. F#, Scala, Clojure) rather than write a second edition of an existing book like OCaml for Scientists. I am currently writing another F# book but only because we do not publish one yet. After that, I'll probably turn to another language but that may very well be HLVM if I can develop it quickly enough... -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] questions
Hi, When M. Ober say the official material is of poor quality. i am French and really surprise. I saw Xavier Leroy teach caml at the CNAM in france, and he know how to teach. The official document is not an ocaml curse, that's right. (The inria is not pay for that ) I totally agree that it would be pleasant to have more documentation on Ocaml, especially if you don't have ocaml lesson. The reader are a little like you M. Ober, they like good quality and when a book is not as good as they like, they have the same reaction as you. I am disappointed because it is not the better encouragement. Different views and usages of the language seems to me better than too few. I will be happy to read article or book from you Sincerely Gilles FALCON Xavier Leroy a écrit : There must be some reason why the manual and other materials on the official site are of such poor quality. I've thought a bit about it, and the only reason I see is that the authors do not have a feel for what it takes to learn/understand/use that language. They obviously know it all through, but that's still far removed from being able to explain it to someone else. I don't know, of course, how it is that one understands something "well" yet is not able to explain it to somebody else. To me, that's very fragile knowledge. Because we are autistic morons who lack your rock-solid knowledge, if I properly catch your (rather insulting) drift? At the very least, you're confusing "to be able" with "to intend to". The "tutorial" part of the OCaml reference manual was a quick job targeted at readers who already know functional programming and just want a quick overview of what's standard and what's different in OCaml. Maybe that shouldn't be titled "tutorial" at all. Teaching functional programming in OCaml to beginners is a rather different job, for which they are plenty of good books already. Most of them happen to be in French for various reasons: O'Reilly's refusal to publish the English translation of the Chailloux-Manoury-Pagano book; the Hickey-Rentsch controversy, etc. But, yes, some talented teachers invested huge amounts of time in writing good intro to Caml programming books. Don't brush their efforts aside. One last word to you, that Xah Lee troll, and anyone else on this list: if you're not happy with the existing material, write something better. Everyone will thank you and you'll get to better appreciate the difficulty of the task. - Xavier Leroy ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] questions
FALCON Gilles RD-RESA-LAN wrote: I totally agree that it would be pleasant to have more documentation on Ocaml, especially if you don't have ocaml lesson. Yes and No. The problem can be felt in PHP, where you see "anyone" witing "anything". So, yes, there should be more documents on Ocaml, but the problem is: Only inexperienced users have time to write down some "learning notes". The real Gurus are all overbooked... It's also my wish to see some documentation, but on the other hand, I dont want it to fall into PHP fashion. Great dilemma... -- Chef de projet chez Vectoris Phone: +261 33 11 207 36 System: xUbuntu 8.10 with almost all from package install http://www.google.com/search?q=mihamina+rakotomandimby ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] questions
I saw Xavier Leroy teach caml at the CNAM in france, and he know how to teach. Just for the record: I never lectured at CNAM, but probably you're thinking of Pierre Weis, who taught a great "programming in Caml" course there for several year. That course was the main starting point for our book "Le langage Caml". Regards, - Xavier Leroy ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] questions
Well his praise still applies: I did take a course in which Xavier Leroy taught and it was crystal clear. I was also very impressed by Didier Remy who came only once. It also helps that the core O'caml is based on ml which uses a very clear and regular semantic. Till On Wed, Apr 1, 2009 at 9:13 AM, Xavier Leroy wrote: >> I saw Xavier Leroy teach caml at the CNAM in france, and he know how >> to teach. > > Just for the record: I never lectured at CNAM, but probably you're > thinking of Pierre Weis, who taught a great "programming in Caml" > course there for several year. That course was the main starting > point for our book "Le langage Caml". > > Regards, > > - Xavier Leroy > > ___ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] questions
I have also learned ocaml with "Le Langage Caml" and I really enjoyed this book (it was one of the first book on language programming that I rode). It might a be a good idea to update the content of this book and to translate it into ocaml/english :-) Thomas 2009/3/31 Martin Jambon > Kuba Ober wrote: > > There must be some reason why the manual and other materials on the > > official site are of such poor quality. I've thought a bit about it, and > > the only reason I see is that the authors do not have a feel for what it > > takes to learn/understand/use that language. They obviously know it all > > through, but that's still far removed from being able to explain it to > > someone else. I don't know, of course, how it is that one understands > > something "well" yet is not able to explain it to somebody else. To me, > > that's very fragile knowledge. I always thought that deep understanding > > implies an ability to extract what's important, and to lead the other > > person from some "basics" (whatever they may be) to the conclusion. > > I can see one reason: like many other French OCaml programmers, I learned > OCaml at school (it was in 1998). French teachers don't rely heavily on a > book. There is however one book that covers the essentials, "Le Langage > Caml" > by Weis and Leroy, which despite using the Caml Light dialect is the most > enlightening programming book I've ever got to read. For the rest, there is > the reference manual of OCaml and plenty of source code all around the web. > > I think that's why there is not much more incentive to write a complete > "replace-the-teacher" text book on OCaml written by the core OCaml > developers, > who are mostly a French team. Besides, it's a lot of work and doesn't make > money. > > Of course there are now a few great books and tutorials on OCaml in > English, > none of them having an official status. > > > Martin > > -- > http://mjambon.com/ > > ___ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] questions
Hi, When M. Ober say the official material is of poor quality. i am French and really surprise. I saw Xavier Leroy teach caml at the CNAM in france, and he know how to teach. The official document is not an ocaml curse, that's right. (The inria is not pay for that ) I have given recently one example of how the information about a simple topic -- lists -- is rather arbitrarily split up and distributed across different portions of the manual. It seems that same could be said of almost any other randomly chosen basic topic (arrays, types, pattern matching, etc). I don't think that's how you write good manuals, but that's merely my opinion, and the only way I can explain it better is to give examples of what I consider good manuals, which I did in the post I mentioned. I totally agree that it would be pleasant to have more documentation on Ocaml, especially if you don't have ocaml lesson. Having or not having OCaml lessons is pretty much irrelevant here. Your assumption here is, perhaps, that you remember everything you are taught. When you're an occasional user, like I am, I constantly forget, and that amplifies any shortcomings in the manual, as I have to deal with them repeatedly. Of course I then write down some notes, and look there first, but this does not affect the manual. There are many similar ways things can be done in ML-like languages. Understanding of the underlying methodology is one thing, but OCaml is a concrete implementation and if I forget a way some particular thing is done, it doesn't help much that I have general knowledge of that thing. I still must look it up :) The reader are a little like you M. Ober, they like good quality and when a book is not as good as they like, they have the same reaction as you. I am disappointed because it is not the better encouragement. Different views and usages of the language seems to me better than too few. Encouragement to whom? I'm trying to discuss facts, if that's so bothersome then I can't really help it. My motive is not to offend anyone nor to diminish the excellent work otherwise done by the OCaml team. I'm trying to understand why the manual is so bad -- that's all. I know the realities of life, and that sometimes things cannot be done perfectly even if one so wishes -- I went down that road many times. That's just how it is, I know. What I didn't expect is the religious fervor of the replies -- it's an interesting thing to observe and learn about! Cheers, Kuba ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] questions
On Apr 1, 2009, at 8:59 AM, Mihamina Rakotomandimby (R12y) wrote: FALCON Gilles RD-RESA-LAN wrote: I totally agree that it would be pleasant to have more documentation on Ocaml, especially if you don't have ocaml lesson. Yes and No. The problem can be felt in PHP, where you see "anyone" witing "anything". So, yes, there should be more documents on Ocaml, but the problem is: Only inexperienced users have time to write down some "learning notes". The real Gurus are all overbooked... It's also my wish to see some documentation, but on the other hand, I dont want it to fall into PHP fashion. Great dilemma... I generally agree, although the guru term is perhaps overused. I figure people do what they find enjoyable -- if someone who's very good at OCaml simply doesn't enjoy explaining it in the form of a manual or whatnot, there's no helping that, and it's surely understandable! Cheers, Kuba ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] questions
Hello, On Tue, Mar 31, 2009 at 16:44, Martin Jambon wrote: > There is however one book that covers the essentials, "Le Langage Caml" > by Weis and Leroy, which despite using the Caml Light dialect is the most > enlightening programming book I've ever got to read. I heartily agree. It's ability to show you how to make a grep or a simple compiler in a few pages of OCaml and explanations is really an enlightenment. Probably one of the best computer book I ever read. Unfortunately, this book is out of print and hard to find. Yours, d. ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] questions
On Wednesday 01 April 2009 20:13:41 David MENTRE wrote: > Unfortunately, this book is out of print and hard to find. Incidentally, if anyone out there is still sitting on such a (good) book I'd be interested in publishing it for them. The result won't be as cheap as an O'Reilly because our overheads are higher but at least it would actually get published. Alternatively, I can tell anyone exactly what they'd need to get started self-publishing and they could do it themselves. -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re : [Caml-list] questions
Isn't the book written in French? (I mean "Le langage Caml"...). It could be nice to translate it in English, at least to have a larger base of readers, and adapt the examples from Caml Light to Objective Caml (I don't know how much the syntaxes differ though) just my two cents, Cheers Matthieu - Message d'origine > De : Jon Harrop > À : caml-list@yquem.inria.fr > Envoyé le : Mercredi, 1 Avril 2009, 21h27mn 25s > Objet : Re: [Caml-list] questions > > On Wednesday 01 April 2009 20:13:41 David MENTRE wrote: > > Unfortunately, this book is out of print and hard to find. > > Incidentally, if anyone out there is still sitting on such a (good) book I'd > be interested in publishing it for them. The result won't be as cheap as an > O'Reilly because our overheads are higher but at least it would actually get > published. Alternatively, I can tell anyone exactly what they'd need to get > started self-publishing and they could do it themselves. > > -- > Dr Jon Harrop, Flying Frog Consultancy Ltd. > http://www.ffconsultancy.com/?e > > ___ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] questions
Xavier Leroy schrieb: > Maybe that shouldn't be titled "tutorial" at all. The manual has been a known PR disaster for ages. http://caml.inria.fr/pub/ml-archives/caml-list/2002/10/72ebe64a56c256607772b32ceb58197d.en.html - Florian. ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: Re: [Caml-list] questions
Hi Xavier Leroy, On Mar 31, 2009 9:31am, Xavier Leroy wrote: One last word to you, that Xah Lee troll, and anyone else on this list: if you're not happy with the existing material, write something better. Everyone will thank you and you'll get to better appreciate the difficulty of the task. although there are several good tutorials, but i think it is important that the bundled official tutorial should be one that is good. By “good” here, i mean, it gives a simple overview of the syntax, and a simple overview, such as how to do arithmetic, basic types, if then else, true false issues, a couple example of most used data types such as list and n-tuple and records, how to define a function, how to call a library. Jon's, and Scott's tutorial are both in this format and i think is very suitable: • Ocaml for Scientists, by Jon Harrop, chapter 1 free: http://www.ffconsultancy.com/products/ocaml_for_scientists/chapter1.html • “Introduction to Caml” by Scott Smith of Johns Hopkins U. A lecture note. http://www.cs.jhu.edu/~scott/pl/lectures/caml-intro.html I only started learning OCaml, but my current notes at: http://xahlee.org/ocaml/ocaml_basics.html is also in this format. I don't know if Jon'd be willing to lend his chapter 1 to be the official bundled tutorial. (would you Jon?) My guess is that Scott would easily offer his too. (No implication that anyone should offer this, of course.) If any official ocaml people wishes, feel free to start with mine as the bundled tutorial. I'm sure with minor editing by you experts, it would be very suitable. I'm often wrong. (^_^); But i think a simple, example based, very brief, tutorial, using concrete code examples, such as the above ones, with a slight emphasize on syntax (so first timers gets a sense of what exactly to type), would be a great first introduction. It'd helpful to imperative programers as well as functional programers experienced with other functional langs. If this is bundled and sanctioned with the official manual, it'd open up ocaml to many people who otherwise may not have had time to search for the right tutorial. (i hope) Xah ∑ http://xahlee.org/ ☄ ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: Re : [Caml-list] questions
Hello, On Wed, Apr 1, 2009 at 22:23, Matthieu Wipliez wrote: > Isn't the book written in French? (I mean "Le langage Caml"...). Yes. > It could be nice to translate it in English, at least to have a larger base > of readers, and adapt the examples from Caml Light to Objective Caml (I don't > know how much the syntaxes differ though) The syntax is very close for the subset of Caml used in the book. However, judging from the lack of availability of this book even in French, there might an issue in the agreement between the authors (Leroy & Weis) and the publisher. I'm suspecting the authors are unable to re-publish the book elsewhere. Yours, david ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: Re : [Caml-list] questions
Isn't the book written in French? (I mean "Le langage Caml"...). It could be nice to translate it in English, at least to have a larger base of readers, and adapt the examples from Caml Light to Objective Caml (I don't know how much the syntaxes differ though) It's perhaps a good way to lean French -- reading about something that interests you. One can easily get amazed as to how many french words or stems found their way into English :) Cheers, Kuba ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] Questions concerning modules as first-class values
Hello, 2010/6/2 Dario Teixeira > - > | | 0-arity | n-arity (n>0) | > - > | Valueish | value | function | > | | | | > | Moduleish | module| functor | > - > I disagree with your terminology. Below is the one I use: - > | | 0-arity | n-arity (n>0) | > - > | Value | constant| function | > | | || > | Module | structure | functor| > - > > Second, does the promotion of modules to first-class values also extend to > higher-order modules, ie, functors? > If I well understood what Alain Frisch and Xavier Leroy explained, modules (including both structures and functors) become first class value: structures may be converted to records and functors to functions; and conversely. But I let more informed person confirm this. -- Julien ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] Questions concerning modules as first-class values
Hi, > I disagree with your terminology. Below is the one I use: > > -- > | | 0-arity | n-arity (n>0) | > -- > | Value | constant | function | > | | | | > | Module | structure | functor | > -- This terminology is indeed better. But note that since modules are now first-class "values", the word "value" itself becomes ambiguous. I'm not trying to be picky; I think that having clear, unambiguous terminology is essential to properly convey a message, particularly to beginners. > If I well understood what Alain Frisch and Xavier Leroy explained, > modules (including both structures and functors) become first class > value: structures may be converted to records and functors to functions; > and conversely. But I let more informed person confirm this. I am not sure about the implementation details, but at least syntax-wise I did not get the impression that structures would be converted to records. What do you mean, exactly? Cheers, Dario Teixeira ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] Questions concerning modules as first-class values
On 06/02/2010 03:43 PM, Julien Signoles wrote: If I well understood what Alain Frisch and Xavier Leroy explained, modules (including both structures and functors) become first class value: structures may be converted to records and functors to functions; and conversely. But I let more informed person confirm this. Not really. What you describe is the internal compilation strategy for modules (structures -> records; functors -> functions), which did not change with the introduction of 1st class modules. What's possible in OCaml 3.12 is to turn a module (be it a structure or a functor) into a "package", which is a first-class value. A package is just the wrapper around a module that makes it a first-class value. In particular, a package that wraps a structure (resp. a functor) is *not* converted to a record (resp. a function). What you can with a package: - whatever you can do with a first-class value (pass it to a function, store it in a data structure, etc); - unwrap it back into the underlying module. We've been using first-class modules for more than one year at LexiFi and we have never found a use for packing functors into first-class values, but I've no doubt people will find some. In particular, this allows the program to decide at runtime (given an environment variable or a command-line argument) to use some particular (functorized) implementation of a data structure over another. Alain ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] Questions concerning modules as first-class values
On Wed, Jun 02, 2010 at 06:28:07PM +0200, Alain Frisch wrote: > In particular, this allows the program to decide at runtime (given > an environment variable or a command-line argument) to use some > particular (functorized) implementation of a data structure over > another. Is it possible to marshal and unmarshal these packages? That might be a nice way to implement a plug-in architecture. -- Eric Cooper e c c @ c m u . e d u ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] Questions concerning modules as first-class values
On 02/06/2010 19:36, Eric Cooper wrote: Is it possible to marshal and unmarshal these packages? Yes, this is possible, but: 1. Extremely dangerous: there is no runtime type-checking. If you marshal a module, you need to unmarshal it to the same package type, exactly (no coercion allowed). 2. Rather useless: the code for functions within modules is not marshaled (as for regular functions). If you marshal a module that define functions, you need to unmarshal it in the same program. > That might be a nice way to implement a plug-in architecture. Given the points above, I don't think so! Alain ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] Questions concerning modules as first-class values
From: Alain Frisch > On 02/06/2010 19:36, Eric Cooper wrote: >> Is it possible to marshal and unmarshal these packages? > > Yes, this is possible, but: > > 1. Extremely dangerous: there is no runtime type-checking. If you > marshal a module, you need to unmarshal it to the same package type, > exactly (no coercion allowed). > > 2. Rather useless: the code for functions within modules is not > marshaled (as for regular functions). If you marshal a module that > define functions, you need to unmarshal it in the same program. > >> That might be a nice way to implement a plug-in architecture. > > Given the points above, I don't think so! While marshalling of first-class modules is indeed not a good idea, I think that dynamic loading of first-class modules might provide a nice plug-in architecture. For instance, you can easily build a list of such plug-ins, with an uniform interface, and add elements to this list through dynamic loading. They can even expose internal data, with an abstract type. There is however a difficulty if you want to save and load data used by these plugins uniformly. Namely, even if all these plugins expose some data with a type "t", the "t" is actually going to be different in each, and the type system will enforce it. This is good, but it will be seen as different for the same plugin in a different run of the same application. So you need to do some standard hacking around, having unique ids for each plugin, and some magic to recover the data. Otherwise this seems a nice approach, easier than using objects, since objects don't let you expose internal data of different types. (Well, actually you can probably do this with objects too, using a polymorphic method to encoding existential types in CPS style, but this is going to be costly and not very natural.) Jacques Garrigue ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] Questions concerning modules as first-class values
On 04/06/2010 03:34, Jacques Garrigue wrote: For instance, you can easily build a list of such plug-ins, with an uniform interface, and add elements to this list through dynamic loading. They can even expose internal data, with an abstract type. Indeed! That's basically our primary use of first-class modules at LexiFi. Our application maintains several sets of extensible notions (like "instruments" or "models") and it can load plugins which can register new such objects. Roughly speaking, each instrument is represented as a first-class module of type (module S) which looks like: module type S = sig type t(* the type of parameters for the instruments *) val t: t ttype(* a dynamic representation of the type t *) val name: string (* name to identify this instrument, presented in a menu to the end-user *) val run: t -> contract (* build a fresh contract, which is a notion independent from the instrument *) type attrs (* the type of attributes for this instrument *) val attrs: attrs ttype (* dynamic representation of attrs *) val compute: t -> contract -> attrs (* calculate attributes from initial parameters and a contract with history *) (* ... *) end The idea is that each instrument defines a number of abstract types (parameters, attributes) and operations on these types. It also exports values that gives the concrete structural representation of these abstract types (the 'a ttype components above) to enable generic operations such as automatic generation of GUI for showing/editing values of these types, or safe marshaling. These "type" values can be derived automatically from the actual type definitions (either with a syntax extension, or with a compiler modification in our case). Alain ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs