Towards a native windows GUI

Joe Armstrong (AL/EAB) <>
Thu Aug 18 10:58:35 CEST 2005


Hi Serge,

    Let me be clear, What I want to do is *simplify* GUI programming - reduce GUI
programming to understanding a small number of well-defined primitives.

    I am well-aware that the Win32 GDI has a large number of procedures (or as David Hopwood say, "thousands") that do mysterious things.

    What I want to know is "is there a small sub-set of these procedures" that
I can write a simple GUI with?

    The historical development of GUI programs seems to me to be like this:

	1) There were no GUIs
	2) Some very simple 2-D graphics API's emerged
	3) Simple GUI's with window, mice, keyboard, etc emerged.
 	4) Complex libraries to make programming type 3 GUIs emerged
	5) The libraries became so complicated that nobody could understand them
	   an so IDE's and GUI designing programs were invented, that spat out 
	   code containing library calls for the complex libraries in 4)

    It seems to me that things went wrong at stage 4 - the very fact that you *need*
a IDE/wizard/whatever to write the code for you seems the underlying structure is
too complicated.

	There is a trade-off involved here:

	Suppose I have a very simple library, and programming language, say like this:

	Win = mkWin(X, Y, W, H),
	Button = Win !! {addButton, X1, Y1, W1, H1},
	Button ! {addtext, "Press me"},
	Button ! {onClick, fun() -> ... end},

	Etc. (like my ex11 :-) - then you can learn the language quickly and produce
ugly but functional GUIs very quickly, and I can build dynamic GUIS.

      With GUI builders - the learning curve is steeper, interfacing to Erlang is
painful, and forget dynamic GUIS.

      The trade-off is "Easy to program = Ugly GUI" vs. "Difficult to program = Nice GUI".

	Suppose we (say) implement an Erlang interface to GTK (there seem to be
at least 3 of these), then the following problems seem to occur:

	a) The interface library won't build in my environment
	  (it worked fine on the developers machine but particular combination of
	   shared libraries/OS etc. needed differs on my machine)
	b) I have to learnt the GTK programming model in order to write a GUI
	  (and is that fun? - no)
	c) The result is non-portable
	   (ie the target machine must have performed a) successfully)

	What I'd like to experiment with are simple libraries using only the X protocol
or the Win32 API - where the programming language is pretty much as above.

	I realize that this will not make beautiful GUIS but they will be easy to 
program and portable. 

/Joe


	
	

    




> -----Original Message-----
> From: Serge Aleynikov [mailto:]
> Sent: den 17 augusti 2005 16:57
> To: Joe Armstrong (AL/EAB)
> Cc: 
> Subject: Re: Towards a native windows GUI
> 
> 
> Hi Joe,
> 
> Joe Armstrong (AL/EAB) wrote:
> > Programming a GUI as a collection of parallel processes is 
> very easy. But programming
> > a GUI as a single sequential process is very difficult.
> 
> As much as we all like concurrent functional programming, I think it 
> would be unfair to reject the merit of the modern Windows 
> OO-based IDE 
> tools (like Visual Studio .NET, Borland JBuilder, Borland 
> Delphi, MONO 
> IDE /that supports multiple platforms/, etc).   Even though they are 
> based on a single process model, they streamline GUI 
> development quite a 
> bit, and given the fact that they are backed up by the key software 
> monsters, the GUI programming community is quite used to these tools, 
> and is very productive.
> 
> Writing GUI in Erlang would also require to have some kind of IDE 
> (likely also written in Erlang) that would automate creation of GUI 
> layouts and interactions with widgets.  Without such an IDE GUI 
> programming would be very tidious and time consuming.
> 
>  From the academic point of view modeling GUI as parallel 
> processes is 
> definitely a very interesting excersize, but if that turns 
> out a viable 
> solution, would the open-source community build an IDE for it, and be 
> willing to evolve and support such product (which I imagine 
> would not be 
> very simple)?  Would it make Erlang any more popular if it had a GUI 
> support and IDE?
> 
> Serge
> 
> 



More information about the erlang-questions mailing list