caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] OCaml linting
@ 2012-11-17  1:43 Edgar Friendly
  2012-11-17  2:05 ` Wojciech Meyer
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Edgar Friendly @ 2012-11-17  1:43 UTC (permalink / raw)
  To: caml-list

I'm playing with Sublime Text 2, and find it has an interesting plugin 
to do active linting of a program under development.  What's the set of 
compiler options that will produce warnings/errors the quickest, for 
using ocamlc to quickly check for syntax and maybe even type errors in a 
partial program?  Does anyone already have a process for this under 
emacs, using auto-recompile or other plugins?

Thanks,
E.

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

* Re: [Caml-list] OCaml linting
  2012-11-17  1:43 [Caml-list] OCaml linting Edgar Friendly
@ 2012-11-17  2:05 ` Wojciech Meyer
  2012-11-17  8:35 ` Török Edwin
  2012-11-23 17:30 ` Philippe Wang
  2 siblings, 0 replies; 4+ messages in thread
From: Wojciech Meyer @ 2012-11-17  2:05 UTC (permalink / raw)
  To: Edgar Friendly; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 948 bytes --]

Hi,

In typerex there is an experimental extension that enables compilation in
background,called flymake.
With Omake, you can specify the -P flag, then it will keep polling for
inode events and rebuild what is needed.

On Saturday, November 17, 2012, Edgar Friendly <thelema314@gmail.com> wrote:
> I'm playing with Sublime Text 2, and find it has an interesting plugin to
do active linting of a program under development.  What's the set of
compiler options that will produce warnings/errors the quickest, for using
ocamlc to quickly check for syntax and maybe even type errors in a partial
program?  Does anyone already have a process for this under emacs, using
auto-recompile or other plugins?
>
> Thanks,
> E.
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

[-- Attachment #2: Type: text/html, Size: 1264 bytes --]

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

* Re: [Caml-list] OCaml linting
  2012-11-17  1:43 [Caml-list] OCaml linting Edgar Friendly
  2012-11-17  2:05 ` Wojciech Meyer
@ 2012-11-17  8:35 ` Török Edwin
  2012-11-23 17:30 ` Philippe Wang
  2 siblings, 0 replies; 4+ messages in thread
From: Török Edwin @ 2012-11-17  8:35 UTC (permalink / raw)
  To: caml-list

On 11/17/2012 03:43 AM, Edgar Friendly wrote:
> I'm playing with Sublime Text 2, and find it has an interesting plugin to do active linting of a program under development.  What's the set of compiler options that will produce warnings/errors the
> quickest, for using ocamlc to quickly check for syntax and maybe even type errors in a partial program?  

For syntax: camlp4o(.opt), for type errors: build a .cmi file (or .inferred.mli?)

> Does anyone already have a process for this under emacs, using auto-recompile or other plugins?

I don't use emacs, but under Vim you can use the syntastic plugin for syntax checks on file save (via camlp4o).
Or to get type errors set this: let g:syntastic_ocaml_use_ocamlbuild = 1

Best regards,
--Edwin

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

* Re: [Caml-list] OCaml linting
  2012-11-17  1:43 [Caml-list] OCaml linting Edgar Friendly
  2012-11-17  2:05 ` Wojciech Meyer
  2012-11-17  8:35 ` Török Edwin
@ 2012-11-23 17:30 ` Philippe Wang
  2 siblings, 0 replies; 4+ messages in thread
From: Philippe Wang @ 2012-11-23 17:30 UTC (permalink / raw)
  To: Edgar Friendly; +Cc: caml-list

On Sat, Nov 17, 2012 at 2:43 AM, Edgar Friendly <thelema314@gmail.com> wrote:
> I'm playing with Sublime Text 2, and find it has an interesting plugin to do
> active linting of a program under development.  What's the set of compiler
> options that will produce warnings/errors the quickest, for using ocamlc to
> quickly check for syntax and maybe even type errors in a partial program?
> Does anyone already have a process for this under emacs, using
> auto-recompile or other plugins?
>
> Thanks,
> E.

I use ocamlc -i (or ocamlopt -i) so that it type-checks and prints the
interface.
If you have several files (hence there are dependancies especially for
interfaces), as said by Török Edwin, you should generate .cmi files.
If you have an .mli file, ocamlc -c can generate the corresponding .cmi file.
If you don't have an .mli file, you can either generate it (with
ocamlc -i) or produce the .cmi file directly from the .ml file (ocamlc
-c or ocamlc -c).

If ocamlc -i takes time, I believe it means that you have either a
super large .ml file, or you have expressions that take time to
type-check.

Cheers,

-- 
Philippe Wang
   mail@philippewang.info

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

end of thread, other threads:[~2012-11-23 17:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-17  1:43 [Caml-list] OCaml linting Edgar Friendly
2012-11-17  2:05 ` Wojciech Meyer
2012-11-17  8:35 ` Török Edwin
2012-11-23 17:30 ` Philippe Wang

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).