Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Chris Hecker <checker@d6.com>
To: brogoff@speakeasy.net
Cc: "caml-list@pauillac.inria.fr" <caml-list@pauillac.inria.fr>
Subject: Re: Module recursion (Was Re: [Caml-list] Re: Haskell-like   syntax)
Date: Mon, 17 Mar 2003 11:33:49 -0800	[thread overview]
Message-ID: <4.3.2.7.2.20030317110310.0451dfa0@localhost> (raw)
In-Reply-To: <Pine.LNX.4.44.0303170836240.29039-100000@grace.speakeasy.n et>


>I think any disagreement was more one of degree, in that my "pet 
>problem(s)" are not prioritized the same way yours are.

I actually don't see this as a "pet problem" thing.  I'm trying to write a 
real shipping application in ocaml (currently 13kloc and will probably be 
4x that at ship, not the largest app ever written to be sure, but certainly 
not a test app).  Not allowing recursion makes it harder to refactor and 
improve compile times, which is not a good thing for process (especially 
since the native compiler is a bit pokey (6x slower than a C++ compiler for 
same LOC last time I checked), and my app can't run bytecode because the 
framerate is too low).  It's also something that just flabbergasts 
professional C++ programmers when they look a caml...the concept that you 
can't break up a compilation unit any way you want to save compile time or 
to make it more readable is crazy to them, and they're right.

I've already committed to using caml for this project and will see my 
experiment through to ship, so these things are just "annoyances" that just 
go in the "cons" column in the article I'm going to write at the end.  For 
somebody not as committed to trying it as me, they're probably showstoppers 
and they'll decide not to use caml.

> > I think 80% of the problem for me would be solved by allowing recursive
>  function calls.
>The workaround Jacques provided should satisfy this need for now. What do 
>you think?

The "id" thing he showed?  That's just the same as doing a ref option and 
then stuffing the functions, isn't it?  Anyway, it's an ugly hack, it 
spreads knowledge of what one module needs from another explicitly into the 
interface, you have to explicitly type the forward functions, it requires 
an error-prone manual stuffing step, and there are order of initialization 
issues (which there aren't if you just allow functions to be called, and 
not arbitrary values) if I undertstand it correctly.  Basically, this 
workaround is not making a professional programmer looking at ocaml feel 
better about using it for large projects, in my opinion.

>I think that two records that refer to each other belong in the same 
>module :-)

The reason I didn't bother giving an example is that out of context any 
example can be "redesigned by the list" to not need it, or the list can 
claim that you can just shove things in the same module.  I think this is a 
case of good old "you don't need that" syndrome, which computer people fall 
prey to all the time.  Somebody's favorite thing doesn't support X, so many 
bytes will be sacrificed convincing the other person that they don't need 
X.  It's a pretty big waste of time, in my opinion.  The ability to have 
two types refer to each other is a totally reasonable thing to do, and if 
you agree that it's reasonable (which you seem to), then the ability to 
have them in different files is also reasonable by extension.  The 
limitation that they have to be in the same file is just that, a 
limitation.  It's not a feature leading to better design, or any other 
rationalization like that.

>I think the reference to function trick, augmented by a naming convention 
>(say, prefixing the funs with fwd_<funname>) and using higher order 
>polymorphism, as JG just showed, is an acceptable workaround for now.

Define "for now".  You have to decide when the workaround is doing more 
damage to the cause of making ocaml viable/more popular/whatever your goal 
is.  If it reduces pressure for a real solution, but you still have to 
explain the workaround with a straight face to every person who asks why 
their 4 line a.ml+b.ml example won't link with this fancy new "high level 
language" but their crappy C compiler can do it, then it's not clear to me 
that it's a win.

The other thing is that something crazy like the mixin modules thing will 
incur runtime overhead to do the module creation at init time, where you 
just don't need that to call functions, so there are arguments for adding 
this even if you plan to do mixins in the long run.  But anyway, I doubt 
I've convinced anybody on the other side of the fence.

Chris


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  parent reply	other threads:[~2003-03-17 19:38 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-06 23:27 [Caml-list] OCaml popularity Graham Guttocks
2003-03-10 20:43 ` Paul Steckler
2003-03-10 23:48 ` Gerd Stolpmann
2003-03-11  0:18   ` Brian Hurt
2003-03-17 23:49   ` Graham Guttocks
2003-03-11  1:43 ` Nicolas Cannasse
2003-03-11 10:23   ` Pierre Weis
2003-03-11 14:27     ` Guillaume Marceau
2003-03-11 16:16       ` David Brown
2003-03-11 16:47       ` [Caml-list] about -rectypes Christophe Raffalli
2003-03-12  2:32       ` [Caml-list] OCaml popularity Nicolas Cannasse
2003-03-12  3:55         ` Cross-platform GUI (was Re: [Caml-list] OCaml popularity) mgushee
2003-03-12 10:51         ` [Caml-list] OCaml popularity Alex Romadinoff
2003-03-12 18:24         ` Max Kirillov
2003-03-11 19:02     ` Graham Guttocks
2003-03-12 17:12       ` Richard W.M. Jones
2003-03-12 18:08         ` Alwyn Goodloe
2003-03-12 22:34           ` Michael Schuerig
2003-03-12 23:13             ` Martin Weber
2003-03-12 23:35               ` Michael Schuerig
2003-03-13  8:02                 ` Alessandro Baretta
2003-03-13 10:23                   ` Michael Schuerig
2003-03-12 23:35             ` Brian Hurt
2003-03-12 23:18         ` Daniel Bünzli
2003-03-12 23:47           ` Brian Hurt
2003-03-13  2:15         ` William Lovas
2003-03-13  3:44           ` Graham Guttocks
2003-03-13  9:31           ` Richard W.M. Jones
     [not found]           ` <20030313095232.GC347@first.in-berlin.de>
2003-03-13 20:50             ` William Lovas
2003-03-13 21:17               ` Oliver Bandel
2003-03-13 22:01                 ` Brian Hurt
2003-03-13 22:17                 ` Oliver Bandel
2003-03-14  6:33                 ` Michal Moskal
2003-03-14 11:50                   ` Markus Mottl
2003-03-14 15:38                     ` Oliver Bandel
2003-03-14 10:13               ` MikhailFedotov
2003-03-14 10:30                 ` Johann Spies
2003-03-13  8:09       ` Pierre Weis
2003-03-15  1:43     ` Tushar Samant
2003-03-15  8:19       ` Andreas Eder
2003-03-11 16:26   ` Fred Yankowski
2003-03-11 19:47     ` [Caml-list] OCaml popularity (long!) mgushee
2003-03-12 11:23       ` Diego Olivier Fernandez Pons
2003-03-30  5:59         ` Belated thanks (was Re: [Caml-list] OCaml popularity) Matt Gushee
2003-03-31 15:27           ` [Caml-list] Re: Belated thanks cashin
2003-04-01  8:22           ` Belated thanks (was Re: [Caml-list] OCaml popularity) Johann Spies
2003-03-12 20:41       ` [Caml-list] OCaml popularity (long!) Max Kirillov
2003-03-13  2:36         ` Haskell-like syntax (was: [Caml-list] OCaml popularity (long!)) Oleg
2003-03-13 18:33           ` [Caml-list] Re: Haskell-like syntax Max Kirillov
2003-03-14 19:30             ` Max Kirillov
2003-03-14 19:47               ` Max Kirillov
2003-03-14 20:01               ` Seth Kurtzberg
2003-03-14 20:34                 ` brogoff
2003-03-14 21:17                   ` Sebastien Carlier
2003-03-14 21:51                     ` brogoff
2003-03-15  2:27                 ` Max Kirillov
2003-03-15 10:58                   ` Markus Mottl
2003-03-15 15:52                     ` [Caml-list] globally valid symbols (was: Haskell-like syntax) Max Kirillov
2003-03-15 20:16                     ` [Caml-list] Re: Haskell-like syntax David Brown
2003-03-16  5:28                     ` Module recursion (Was Re: [Caml-list] Re: Haskell-like syntax) brogoff
2003-03-16 11:10                       ` Markus Mottl
2003-03-16 18:02                         ` brogoff
2003-03-16 18:34                           ` Markus Mottl
     [not found]                     ` <Pine.LNX.4.44.0303152112560.27230-100000@grace.speakeasy.n et>
2003-03-16  5:38                       ` Chris Hecker
2003-03-16 18:34                         ` brogoff
2003-03-17  2:20                           ` Jacques Garrigue
     [not found]                         ` <Pine.LNX.4.44.0303161020480.11736-100000@grace.speakeasy.n et>
2003-03-17  5:08                           ` Chris Hecker
2003-03-17 17:06                             ` brogoff
2003-03-17 19:01                               ` Ville-Pertti Keinonen
     [not found]                             ` <Pine.LNX.4.44.0303170836240.29039-100000@grace.speakeasy.n et>
2003-03-17 19:33                               ` Chris Hecker [this message]
2003-03-17 20:28                                 ` brogoff
     [not found]                                 ` <Pine.LNX.4.44.0303171145500.29039-100000@grace.speakeasy.n et>
2003-03-17 21:09                                   ` Chris Hecker
2003-03-19  2:34                                 ` [Caml-list] ocamlopt speed (was Re: Module recursion) Chris Hecker
2003-03-19 10:03                                   ` Michal Moskal
2003-03-19 10:38                                     ` Gerd Stolpmann
2003-03-19 20:36                                   ` Chris Hecker
2003-03-17  1:46                     ` [Caml-list] Re: Haskell-like syntax Nicolas Cannasse
2003-03-14 22:50               ` Oleg
2003-03-20 15:01                 ` Andreas Rossberg
2003-03-12 20:46       ` [Caml-list] Monads was OCaml popularity Christophe Raffalli
2003-03-13  0:03       ` [Caml-list] monads for dummies james woodyatt
2003-03-13  4:32         ` Christopher Quinn
2003-03-13 11:53         ` Christian Lindig
2003-03-12 18:59 ` [Caml-list] OCaml popularity Martin Weber
2003-03-12 20:24   ` Xavier Leroy
2003-03-13  8:57     ` [Caml-list] how to interface with integer Bigarrays using camlidl francois bereux
2003-03-13  9:36       ` Xavier Leroy
2003-03-13  0:42   ` [Caml-list] OCaml popularity Graham Guttocks

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4.3.2.7.2.20030317110310.0451dfa0@localhost \
    --to=checker@d6.com \
    --cc=brogoff@speakeasy.net \
    --cc=caml-list@pauillac.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox