caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* A small footprint GUI for OCaml
@ 2007-05-26 22:09 Alexsandro Soares
  2007-05-27 14:52 ` [Caml-list] " Eric Cooper
  0 siblings, 1 reply; 2+ messages in thread
From: Alexsandro Soares @ 2007-05-26 22:09 UTC (permalink / raw)
  To: lista OCaml

My collaborators and I wrote a small footprint graphics.cmxa based GUI for OCaml.  It works well on Windows, but not so well on Linux. In fact, in most Linux installations the program turns out to be unbearably slow; to make it usable, I am forced to use powerful and well tuned video cards. However, if I compile the program on  Windows, and use CEDEGA, I am able to run it on Linux.  I would appreciate if members of the list take a look at the sources, and make suggestion to run the program on Linux. You can download the sources from

http://www.discenda.org/ocaml/bed.zip

After downloading, you can compile it thus:

ocamlopt graphics.cmxa wid.ml nw.ml -o nw

If you run the program, and click on a tab (for instance, on the "blabla" tab), you will find yourself on a Emacs like editor. You can type text, and use Emacs commands, like:

1-- Ctrl-b  : Back step
2-- Ctrl-f  : Step forward
3-- Ctrj-j  : Break a line
4-- Ctrl-p : Previous line
5-- Ctrl-n : Next line
6-- Ctrl-d : Delete a char
7-- Ctrl-q : Toggle Backspace from backerase to backstep
8-- Ctrl-e : Beginning of line
9-- Ctrl-a : End of line
10-- Esc-space + Esc w : Put text between mark and point in the kill ring.
11-- Ctrl-y : yank
12-- Ctrl-w Ctrl-s : Save buffer
13-- Ctrl-w Ctrl-w <file name> : Save as
14-- Ctrl-x Ctrl-f : Visit file
15-- Ctrl-t : Execute OCaml funcion on text
16-- Ctrl-r : Toggle between result of the execution and original text

There are two kinds of text. One is just a text. The other is a data entry form. Please test the program on Linux, and make suggestion about how to change it in order to make it run as well on Linux as on Windows.


__________________________________________________
Fale com seus amigos  de graça com o novo Yahoo! Messenger 
http://br.messenger.yahoo.com/


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

* Re: [Caml-list] A small footprint GUI for OCaml
  2007-05-26 22:09 A small footprint GUI for OCaml Alexsandro Soares
@ 2007-05-27 14:52 ` Eric Cooper
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Cooper @ 2007-05-27 14:52 UTC (permalink / raw)
  To: caml-list, lista OCaml

On Sat, May 26, 2007 at 03:09:43PM -0700, Alexsandro Soares wrote:
> My collaborators and I wrote a small footprint graphics.cmxa based
> GUI for OCaml.  It works well on Windows, but not so well on
> Linux. In fact, in most Linux installations the program turns out to
> be unbearably slow; to make it usable, I am forced to use powerful
> and well tuned video cards.

I tried your program briefly and noticed (using a load monitor) that
it was constantly using CPU cycles even when it should be idle.  So I
ran it under "strace" and saw that it was continually reading data
from the connection to the X server.  This occurs inside a signal
action, probably triggered by a timer interrupt.

Compare that to a real Emacs process, which is almost always in a
blocking select() system call when idle.

I haven't looked at your source code, or the Graphics implementation,
but I conclude that you need to find a way to block, rather than poll,
for input events.

-- 
Eric Cooper             e c c @ c m u . e d u


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

end of thread, other threads:[~2007-05-27 14:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-26 22:09 A small footprint GUI for OCaml Alexsandro Soares
2007-05-27 14:52 ` [Caml-list] " Eric Cooper

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