caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Nicely written Caml/OCaml code to read.
@ 2011-04-13 20:40 Create Software
  2011-04-14  7:32 ` Denis Berthod
  2011-04-14  9:12 ` Vincent Aravantinos
  0 siblings, 2 replies; 8+ messages in thread
From: Create Software @ 2011-04-13 20:40 UTC (permalink / raw)
  To: caml-list

Hi all,

I'll be taking exams at the end of the year (starting in a week, actually), which include programming / informatics 
tests. The language used in these exams is Caml Light (you guessed right: grandes écoles).

I've done a lot of programming in previous years, but I didn't know Caml/OCaml before high school -- I come from a mixed 
C++/C# world, with drops of Python here and there.

In developing my skill in other languages, I always found that reading good code at some point was a great boost to the 
beauty and cleanness of the programs I wrote. Usually, every language has it's own conventions, best practices, and I 
think you can usually learn a lot by reading well-written, nicely-crafted code.

So here's my question: **which code would you recommend to read?**

(As a side note, I'm not really interested (at least in the very short term) in anything on the object-oriented side of 
the language, since the notions used at the exam are limited to the elements available in Caml Light.)

I've tried batteries and Jane street core/ext-core libraries, but the former has extremely few comments, and the latter 
is too widely optimized to be enjoyable to read (Jane street's map function is 30 lines long due to loop unrolling).

Anything that deals with trees or finite state automata gets extra brownie points =) (and +2 if Gabriel Scherer answers)

Thanks for your help!
Clément.

-- 
Create Software - Open source, lightweight, and efficient software - @createsoftware <http://twitter.com/createsoftware>
http://createsoftware.users.sourceforge.net - http://synchronicity.sourceforge.net

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Nicely written Caml/OCaml code to read.
  2011-04-13 20:40 [Caml-list] Nicely written Caml/OCaml code to read Create Software
@ 2011-04-14  7:32 ` Denis Berthod
  2011-04-14  8:43   ` Create Software
  2011-04-14  9:12 ` Vincent Aravantinos
  1 sibling, 1 reply; 8+ messages in thread
From: Denis Berthod @ 2011-04-14  7:32 UTC (permalink / raw)
  To: caml-list

Hi,

Some years ago, when I was a student, I found the code of Gérôme 
Vouillon's LWT library enlightning (LWT is now part of the Ocsigen project).
Even if a great part of the concepts are OCaml only I recall that there 
is a Fibonacci heap implementation that might be a good example of list 
manipulation.

Cheers,

Denis

Le 13/04/2011 22:40, Create Software a écrit :
> Hi all,
>
> I'll be taking exams at the end of the year (starting in a week, 
> actually), which include programming / informatics tests. The language 
> used in these exams is Caml Light (you guessed right: grandes écoles).
>
> I've done a lot of programming in previous years, but I didn't know 
> Caml/OCaml before high school -- I come from a mixed C++/C# world, 
> with drops of Python here and there.
>
> In developing my skill in other languages, I always found that reading 
> good code at some point was a great boost to the beauty and cleanness 
> of the programs I wrote. Usually, every language has it's own 
> conventions, best practices, and I think you can usually learn a lot 
> by reading well-written, nicely-crafted code.
>
> So here's my question: **which code would you recommend to read?**
>
> (As a side note, I'm not really interested (at least in the very short 
> term) in anything on the object-oriented side of the language, since 
> the notions used at the exam are limited to the elements available in 
> Caml Light.)
>
> I've tried batteries and Jane street core/ext-core libraries, but the 
> former has extremely few comments, and the latter is too widely 
> optimized to be enjoyable to read (Jane street's map function is 30 
> lines long due to loop unrolling).
>
> Anything that deals with trees or finite state automata gets extra 
> brownie points =) (and +2 if Gabriel Scherer answers)
>
> Thanks for your help!
> Clément.
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Nicely written Caml/OCaml code to read.
  2011-04-14  7:32 ` Denis Berthod
@ 2011-04-14  8:43   ` Create Software
  2011-04-14  9:07     ` Denis Berthod
  0 siblings, 1 reply; 8+ messages in thread
From: Create Software @ 2011-04-14  8:43 UTC (permalink / raw)
  To: Denis Berthod; +Cc: caml-list

On Apr. 14, 2011, Denis Berthod <denis.berthod@gmail.com> wrote:
> Hi,
>
> Some years ago, when I was a student, I found the code of Gérôme Vouillon's LWT library enlightning (LWT is now part of
> the Ocsigen project).
> Even if a great part of the concepts are OCaml only I recall that there is a Fibonacci heap implementation that might be
> a good example of list manipulation.

Cool! Can you point me to the file? I couldn't find the Fibonacci heap part.

Thanks!

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Nicely written Caml/OCaml code to read.
  2011-04-14  8:43   ` Create Software
@ 2011-04-14  9:07     ` Denis Berthod
  0 siblings, 0 replies; 8+ messages in thread
From: Denis Berthod @ 2011-04-14  9:07 UTC (permalink / raw)
  To: caml-list

Indeed, since the last time I look at the code a lot of work has been 
put in this library and it's now far more complex than the initial version.
The fibonacci heap example can have been removed at some point.

Denis

Le 14/04/2011 10:43, Create Software a écrit :
> On Apr. 14, 2011, Denis Berthod <denis.berthod@gmail.com> wrote:
>> Hi,
>>
>> Some years ago, when I was a student, I found the code of Gérôme 
>> Vouillon's LWT library enlightning (LWT is now part of
>> the Ocsigen project).
>> Even if a great part of the concepts are OCaml only I recall that 
>> there is a Fibonacci heap implementation that might be
>> a good example of list manipulation.
>
> Cool! Can you point me to the file? I couldn't find the Fibonacci heap 
> part.
>
> Thanks!
>


-- 
Denis Berthod
LexiFi
denis.berthod@lexifi.com
+33 (0)1 41 10 02 67


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Nicely written Caml/OCaml code to read.
  2011-04-13 20:40 [Caml-list] Nicely written Caml/OCaml code to read Create Software
  2011-04-14  7:32 ` Denis Berthod
@ 2011-04-14  9:12 ` Vincent Aravantinos
  2011-04-14 10:35   ` Create Software
  1 sibling, 1 reply; 8+ messages in thread
From: Vincent Aravantinos @ 2011-04-14  9:12 UTC (permalink / raw)
  To: Create Software; +Cc: caml-list


Le 13 avr. 11 à 22:40, Create Software a écrit :

> So here's my question: **which code would you recommend to read?**

> (...)
> I've tried batteries and Jane street core/ext-core libraries, but  
> the former has extremely few comments, and the latter is too widely  
> optimized to be enjoyable to read (Jane street's map function is 30  
> lines long due to loop unrolling).

Did you try just reading the standard library?
It implements standard notions and is not too optimized ;-)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Nicely written Caml/OCaml code to read.
  2011-04-14  9:12 ` Vincent Aravantinos
@ 2011-04-14 10:35   ` Create Software
  0 siblings, 0 replies; 8+ messages in thread
From: Create Software @ 2011-04-14 10:35 UTC (permalink / raw)
  To: Vincent Aravantinos; +Cc: caml-list

On Apr. 14, 2011, Vincent Aravantinos <vincent.aravantinos@gmail.com> wrote:
>
> Le 13 avr. 11 à 22:40, Create Software a écrit :
>
>> So here's my question: **which code would you recommend to read?**
>
>> (...)
>> I've tried batteries and Jane street core/ext-core libraries, but the former has extremely few comments, and the
>> latter is too widely optimized to be enjoyable to read (Jane street's map function is 30 lines long due to loop
>> unrolling).
>
> Did you try just reading the standard library?
> It implements standard notions and is not too optimized ;-)

I did, but I'm searching for something a bit more commented, and perhaps also somewhat more complex =)
Clément.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Nicely written Caml/OCaml code to read.
@ 2011-04-14 11:59 "Mark Adams"
  0 siblings, 0 replies; 8+ messages in thread
From: "Mark Adams" @ 2011-04-14 11:59 UTC (permalink / raw)
  To: createsoftware, caml-list

Hi Clement,

My HOL Zero program may be of interest to you.  It's a theorem prover (i.e.
a program for performing mathematical proof), but don't let that put you
off!  It's written in about 8,000-9,000 non-blank/non-comment lines of
OCaml, and is heavily commented, nicely formatted and implemented in a
straightforward style.  I've tried to make it as easy as possible for others
to understand the implementation (the idea is that people will then trust
that the proofs it performs are correct), and it comes with a glossary
explaining background terminology about theorem provers.  There is no use of
Object-Oriented, there is only a little optimisation (to do basic sensible
things regarding tail recursion, etc) and it has a simple implementation of
trees.

    http://www.proof-technologies.com/holzero.html

To run it, you'll need a Unix-like operating system with bash, OCaml and
Camlp5.

There is even a $100 bountry reward if you manage to find a fundamental flaw
in the mathematical soundness of the program!

Mark Adams
Proof Technologies Ltd


on 13/4/11 9:40 PM, Create Software <createsoftware@users.sourceforge.net>
wrote:

> Hi all,
>
> I'll be taking exams at the end of the year (starting in a week,
actually),
> which include programming / informatics
> tests. The language used in these exams is Caml Light (you guessed right:
> grandes écoles).
>
> I've done a lot of programming in previous years, but I didn't know
> Caml/OCaml before high school -- I come from a mixed
> C++/C# world, with drops of Python here and there.
>
> In developing my skill in other languages, I always found that reading
good
> code at some point was a great boost to the
> beauty and cleanness of the programs I wrote. Usually, every language has
> it's own conventions, best practices, and I
> think you can usually learn a lot by reading well-written, nicely-crafted
> code.
>
> So here's my question: **which code would you recommend to read?**
>
> (As a side note, I'm not really interested (at least in the very short
term)
> in anything on the object-oriented side of
> the language, since the notions used at the exam are limited to the
elements
> available in Caml Light.)
>
> I've tried batteries and Jane street core/ext-core libraries, but the
former
> has extremely few comments, and the latter
> is too widely optimized to be enjoyable to read (Jane street's map
function
> is 30 lines long due to loop unrolling).
>
> Anything that deals with trees or finite state automata gets extra brownie
> points =) (and +2 if Gabriel Scherer answers)
>
> Thanks for your help!
> Clément.
>
> --
> Create Software - Open source, lightweight, and efficient software -
> @createsoftware <http://twitter.com/createsoftware>
> http://createsoftware.users.sourceforge.net -
> http://synchronicity.sourceforge.net
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa-roc.inria.fr/wws/info/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
>
>
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Nicely written Caml/OCaml code to read.
@ 2011-04-14  8:25 Denis Berthod
  0 siblings, 0 replies; 8+ messages in thread
From: Denis Berthod @ 2011-04-14  8:25 UTC (permalink / raw)
  To: caml-list


Hi,

Some years ago, when I was a student, I found the code of Gérôme
Vouillon's LWT library enlightning (LWT is now part of the Ocsigen project).
Even if a great part of the concepts are OCaml only I recall that there
is a Fibonacci heap implementation that might be a good example of list
manipulation.

Cheers,

Denis

Le 13/04/2011 22:40, Create Software a écrit :
>  Hi all,
>
>  I'll be taking exams at the end of the year (starting in a week,
>  actually), which include programming / informatics tests. The language
>  used in these exams is Caml Light (you guessed right: grandes écoles).
>
>  I've done a lot of programming in previous years, but I didn't know
>  Caml/OCaml before high school -- I come from a mixed C++/C# world,
>  with drops of Python here and there.
>
>  In developing my skill in other languages, I always found that reading
>  good code at some point was a great boost to the beauty and cleanness
>  of the programs I wrote. Usually, every language has it's own
>  conventions, best practices, and I think you can usually learn a lot
>  by reading well-written, nicely-crafted code.
>
>  So here's my question: **which code would you recommend to read?**
>
>  (As a side note, I'm not really interested (at least in the very short
>  term) in anything on the object-oriented side of the language, since
>  the notions used at the exam are limited to the elements available in
>  Caml Light.)
>
>  I've tried batteries and Jane street core/ext-core libraries, but the
>  former has extremely few comments, and the latter is too widely
>  optimized to be enjoyable to read (Jane street's map function is 30
>  lines long due to loop unrolling).
>
>  Anything that deals with trees or finite state automata gets extra
>  brownie points =) (and +2 if Gabriel Scherer answers)
>
>  Thanks for your help!
>  Clément.
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-04-14 11:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-13 20:40 [Caml-list] Nicely written Caml/OCaml code to read Create Software
2011-04-14  7:32 ` Denis Berthod
2011-04-14  8:43   ` Create Software
2011-04-14  9:07     ` Denis Berthod
2011-04-14  9:12 ` Vincent Aravantinos
2011-04-14 10:35   ` Create Software
2011-04-14  8:25 Denis Berthod
2011-04-14 11:59 "Mark Adams"

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).