hey,
so my current dev environment is xmonad + emacs + gambit; this is about to become xmonad + jedi + gambit; but I'd prefer to have my window manager be running on gambit too
so ... is there anyone else out there also interested in this? we can probably start out with something like scwm or sawmill and hack it to run on gambit ... or if you're really good with x11, we can even start with some thing leaner
let me know if there's interest
thanks!
(mainly interested in this as a hobby project)
Afficher les réponses par date
2009/2/19 lowly coder lowlycoder@huoyanjinjing.com:
hey,
so my current dev environment is xmonad + emacs + gambit; this is about to become xmonad + jedi + gambit; but I'd prefer to have my window manager be running on gambit too
so ... is there anyone else out there also interested in this? we can probably start out with something like scwm or sawmill and hack it to run on gambit ... or if you're really good with x11, we can even start with some thing leaner
let me know if there's interest
thanks!
(mainly interested in this as a hobby project)
No offense intended, but I think re-implementing window managers in Haskell/Scheme/<current language of choice> seems a bit Not-Invented-Here syndrome-ish. If it ain't broke, don't fix it - since there's lots of other interesting things to fix/create.
Not that there's anything wrong with making a window manager with Gambit, or anything.
Oisín
No offense taken. I'm interested as this is a step closer to the "lisp machine"; if I can have my entire dev environment be scheme based, and be able to dynamically edit the code for my dev environment on the fly, I think magical things I can not yet imagine will happen.
On Wed, Feb 18, 2009 at 6:17 PM, Oisín Mac Fhearaí denpashogai@gmail.comwrote:
2009/2/19 lowly coder lowlycoder@huoyanjinjing.com:
hey,
so my current dev environment is xmonad + emacs + gambit; this is about
to
become xmonad + jedi + gambit; but I'd prefer to have my window manager
be
running on gambit too
so ... is there anyone else out there also interested in this? we can probably start out with something like scwm or sawmill and hack it to run
on
gambit ... or if you're really good with x11, we can even start with some thing leaner
let me know if there's interest
thanks!
(mainly interested in this as a hobby project)
No offense intended, but I think re-implementing window managers in Haskell/Scheme/<current language of choice> seems a bit Not-Invented-Here syndrome-ish. If it ain't broke, don't fix it - since there's lots of other interesting things to fix/create.
Not that there's anything wrong with making a window manager with Gambit, or anything.
Oisín
No offense intended, but I think re-implementing window managers in Haskell/Scheme/<current language of choice> seems a bit Not-Invented-Here syndrome-ish. If it ain't broke, don't fix it - since there's lots of other interesting things to fix/create.
I'm currently using stumpWM (a tiling WM written in Common Lisp), and I find it quite nice to be able to add code on the fly to the WM, and to be able to extend it in Lisp rather than in some configuration file with its own syntax. I'd compare it to emacs for extensibility. Debugging is also (probably, I've never had to try) much easier since you can simply use slime to connect to the running WM.
Of course, having a window manager running with Gambit would be even better. SCWM (Scheme Constraints Window Manager) could be a nice starting point, but does not seem to have been updated since 2000.
Vincent
2009/2/19 Vincent St-Amour stamourv@iro.umontreal.ca:
No offense intended, but I think re-implementing window managers in Haskell/Scheme/<current language of choice> seems a bit Not-Invented-Here syndrome-ish. If it ain't broke, don't fix it - since there's lots of other interesting things to fix/create.
Yes and no. The WM is one of your most intimate connections to the system and there's a lot to be said for what you learn in writing one. That said:
I'm currently using stumpWM (a tiling WM written in Common Lisp), and I find it quite nice to be able to add code on the fly to the WM, and to be able to extend it in Lisp rather than in some configuration file with its own syntax. I'd compare it to emacs for extensibility.
Which is exactly my point. And you can learn an awful lot about UI design (at least how *you* like to relate to the machine) from hacking on a properly extensible WM. Such as:
Of course, having a window manager running with Gambit would be even better. SCWM (Scheme Constraints Window Manager) could be a nice starting point, but does not seem to have been updated since 2000.
And SCWM was the proximate cause for me to learn Scheme. I had become interested in Lisps through hacking on emacs and wanted a WM that was similarly flexible. SCWM's death has been a great disappointment to me, it was a great WM. But I don't think you'll find its code is a good starting point. For one, it was pretty intimately tied into the Guile of the time - which sucked; and it also did a lot of work in C - which also sucked. A fresh start using Gambit's excellent FFI for connecting to the X11 libraries would be the way to go about it. On the other hand SCWM could be a goo candidate for design-level reuse.
But the gripping hand is that you will have to rewrite it from scratch. That's not a small job, but it's also not huge.
david
What C code base is good to start with?
(I'm familiar with Gambit's FFI -- wrapped parts of OpenCV for my own use). However, I don't know about X11 to "just write one from scratch".
Thanks!
On Wed, Feb 18, 2009 at 10:47 PM, David Rush kumoyuki@gmail.com wrote:
2009/2/19 Vincent St-Amour stamourv@iro.umontreal.ca:
No offense intended, but I think re-implementing window managers in Haskell/Scheme/<current language of choice> seems a bit Not-Invented-Here syndrome-ish. If it ain't broke, don't fix it - since there's lots of other interesting things to fix/create.
Yes and no. The WM is one of your most intimate connections to the system and there's a lot to be said for what you learn in writing one. That said:
I'm currently using stumpWM (a tiling WM written in Common Lisp), and I find it quite nice to be able to add code on the fly to the WM, and to be able to extend it in Lisp rather than in some configuration file with its own syntax. I'd compare it to emacs for extensibility.
Which is exactly my point. And you can learn an awful lot about UI design (at least how *you* like to relate to the machine) from hacking on a properly extensible WM. Such as:
Of course, having a window manager running with Gambit would be even better. SCWM (Scheme Constraints Window Manager) could be a nice starting point, but does not seem to have been updated since 2000.
And SCWM was the proximate cause for me to learn Scheme. I had become interested in Lisps through hacking on emacs and wanted a WM that was similarly flexible. SCWM's death has been a great disappointment to me, it was a great WM. But I don't think you'll find its code is a good starting point. For one, it was pretty intimately tied into the Guile of the time - which sucked; and it also did a lot of work in C - which also sucked. A fresh start using Gambit's excellent FFI for connecting to the X11 libraries would be the way to go about it. On the other hand SCWM could be a goo candidate for design-level reuse.
But the gripping hand is that you will have to rewrite it from scratch. That's not a small job, but it's also not huge.
david
GPG Public key at http://cyber-rush.org/drr/gpg-public-key.txt _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
IMO, all you care for is examples of small WMs written in C talking to X11. Write that core functionality as FFIs for gambit and the rest is all you. Rat Poison and fluxbox are really small, ~20kloc afair, and relatively easy to read. Take a look at them. Or look at the source of your wm of choice.
Pavel P.S. In the end you will end up having to familiarize yourself with the various X11 libraries anyway. That's probably gonna be the worse part.
On Wed, Feb 18, 2009 at 11:20 PM, lowly coder lowlycoder@huoyanjinjing.com wrote:
What C code base is good to start with?
(I'm familiar with Gambit's FFI -- wrapped parts of OpenCV for my own use). However, I don't know about X11 to "just write one from scratch".
Thanks!
On Wed, Feb 18, 2009 at 10:47 PM, David Rush kumoyuki@gmail.com wrote:
2009/2/19 Vincent St-Amour stamourv@iro.umontreal.ca:
No offense intended, but I think re-implementing window managers in Haskell/Scheme/<current language of choice> seems a bit Not-Invented-Here syndrome-ish. If it ain't broke, don't fix it - since there's lots of other interesting things to fix/create.
Yes and no. The WM is one of your most intimate connections to the system and there's a lot to be said for what you learn in writing one. That said:
I'm currently using stumpWM (a tiling WM written in Common Lisp), and I find it quite nice to be able to add code on the fly to the WM, and to be able to extend it in Lisp rather than in some configuration file with its own syntax. I'd compare it to emacs for extensibility.
Which is exactly my point. And you can learn an awful lot about UI design (at least how *you* like to relate to the machine) from hacking on a properly extensible WM. Such as:
Of course, having a window manager running with Gambit would be even better. SCWM (Scheme Constraints Window Manager) could be a nice starting point, but does not seem to have been updated since 2000.
And SCWM was the proximate cause for me to learn Scheme. I had become interested in Lisps through hacking on emacs and wanted a WM that was similarly flexible. SCWM's death has been a great disappointment to me, it was a great WM. But I don't think you'll find its code is a good starting point. For one, it was pretty intimately tied into the Guile of the time - which sucked; and it also did a lot of work in C - which also sucked. A fresh start using Gambit's excellent FFI for connecting to the X11 libraries would be the way to go about it. On the other hand SCWM could be a goo candidate for design-level reuse.
But the gripping hand is that you will have to rewrite it from scratch. That's not a small job, but it's also not huge.
david
GPG Public key at http://cyber-rush.org/drr/gpg-public-key.txt _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
lowly coder wrote:
so my current dev environment is xmonad + emacs + gambit; this is about to become xmonad + jedi + gambit; but I'd prefer to have my window manager be running on gambit too
so ... is there anyone else out there also interested in this? we can probably start out with something like scwm or sawmill and hack it to run on gambit ... or if you're really good with x11, we can even start with some thing leaner
As far as off-the-shelf xlib libraries go, consider the library that comes with JazzScheme; I think the Jedi itself is proof that the bindings are robust enough. :-) Another option is the 'xlib' egg in Chicken.
lowly coder wrote:
so my current dev environment is xmonad + emacs + gambit; this is about to become xmonad + jedi + gambit; but I'd prefer to have my window manager be running on gambit too
so ... is there anyone else out there also interested in this? we can probably start out with something like scwm or sawmill and hack it to run on gambit ... or if you're really good with x11, we can even start with some thing leaner
I'm surprised nobody has mentioned the orion wm. It's written in Scsh. Look it up sometime; the code is interesting.
Ed
lowly coder wrote:
so my current dev environment is xmonad + emacs + gambit; this is about to become xmonad + jedi + gambit; but I'd prefer to have my window manager be running on gambit too
so ... is there anyone else out there also interested in this? we can probably start out with something like scwm or sawmill and hack it to run on gambit ... or if you're really good with x11, we can even start with some thing leaner
DWM consists of a single C file. Check out the size:
/tmp/dwm-5.4.1 # wc -l dwm.c 1729 dwm.c
So here's another approach. Port that to Chicken/xlib (I think it's the easiest off the shelf library). It's less than 2000 lines... If there are no unforseen hicups, this is a weekend project.
Ed
lowly coder wrote:
so my current dev environment is xmonad + emacs + gambit; this is about to become xmonad + jedi + gambit; but I'd prefer to have my window manager be running on gambit too
so ... is there anyone else out there also interested in this? we can probably start out with something like scwm or sawmill and hack it to run on gambit ... or if you're really good with x11, we can even start with some thing leaner
Eduardo Cavazos wrote:
DWM consists of a single C file. Check out the size:
/tmp/dwm-5.4.1 # wc -l dwm.c 1729 dwm.c
So here's another approach. Port that to Chicken/xlib (I think it's the easiest off the shelf library). It's less than 2000 lines... If there are no unforseen hicups, this is a weekend project.
Er... I don't wanna mislead anyone so let me clarify.
I took a closer look at the code in 'dwm.c'. A straight port using R5RS+xlib would probably take longer than a weekend. :-)
In order to do it in a weekend (Hmmm.... call it wm48? :-)) you'd need some facilities in Scheme (perhaps some macros, an object system, or both) to conveniently express alot of the terse idioms of C. The 'dwm' author is a great hacker and gets alot done in very little space. So a naive port to Scheme would cause an explosion in lines.
With the right abstractions there might be a reduction in lines.
One area which makes a naive conversion to Scheme non-trivial (or at least very verbose) is X structs. Consider this function from 'dwm.c':
---------------------------------------------------------------------- void configurenotify(XEvent *e) { XConfigureEvent *ev = &e->xconfigure;
if(ev->window == root && (ev->width != sw || ev->height != sh)) { sw = ev->width; sh = ev->height; updategeom(); updatebar(); arrange(); } } ----------------------------------------------------------------------
Assigning 'sw' in many Scheme xlib bindings (including Gambit's) would look like:
(set! sw (XConfigureEvent-width ev))
This line:
if(ev->window == root && (ev->width != sw || ev->height != sh))
has two struct accesses and one set. So the naive Scheme would probably take up at least 3 lines. :-)
So that's one area where you'd might want some extra abstraction machinery.
Ed
lowly coder wrote:
so my current dev environment is xmonad + emacs + gambit; this is about to become xmonad + jedi + gambit; but I'd prefer to have my window manager be running on gambit too
so ... is there anyone else out there also interested in this? we can probably start out with something like scwm or sawmill and hack it to run on gambit ... or if you're really good with x11, we can even start with some thing leaner
Eduardo Cavazos wrote:
Er... I don't wanna mislead anyone so let me clarify.
I took a closer look at the code in 'dwm.c'. A straight port using R5RS+xlib would probably take longer than a weekend. :-)
In order to do it in a weekend (Hmmm.... call it wm48? :-)) you'd need some facilities in Scheme (perhaps some macros, an object system, or both) to conveniently express alot of the terse idioms of C.
OK. I like to put my hack where my mouth is so, behold, Cons WM :
http://proteus.freeshell.org/cons-wm-2009-03-02.png
Not much to look at eh? :-)
The source:
http://proteus.freeshell.org/_cons-wm-a.scm
It's running in Ypsilon. The code is loosely modeled on DWM. Currently clocking in at 370 lines. Lot's of low hanging fruit... Currently a fun proof of concept. It shows that with the right abstractions, you can port an Xlib program like dwm to Scheme and not have the code blow up too much.
"cons wm" because it's simple like a cons cell. ;-)
Ed
This is awesome. Thanks!
On Mon, Mar 2, 2009 at 10:07 PM, Eduardo Cavazos wayo.cavazos@gmail.comwrote:
lowly coder wrote:
so my current dev environment is xmonad + emacs + gambit; this is
about to
become xmonad + jedi + gambit; but I'd prefer to have my window manager
be
running on gambit too
so ... is there anyone else out there also interested in this? we can probably start out with something like scwm or sawmill and hack it to
run on
gambit ... or if you're really good with x11, we can even start with
some
thing leaner
Eduardo Cavazos wrote:
Er... I don't wanna mislead anyone so let me clarify.
I took a closer look at the code in 'dwm.c'. A straight port using R5RS+xlib would probably take longer than a weekend. :-)
In order to do it in a weekend (Hmmm.... call it wm48? :-)) you'd need some facilities in Scheme (perhaps some macros, an object system, or both) to conveniently express alot of the terse idioms of C.
OK. I like to put my hack where my mouth is so, behold, Cons WM :
http://proteus.freeshell.org/cons-wm-2009-03-02.png
Not much to look at eh? :-)
The source:
http://proteus.freeshell.org/_cons-wm-a.scm
It's running in Ypsilon. The code is loosely modeled on DWM. Currently clocking in at 370 lines. Lot's of low hanging fruit... Currently a fun proof of concept. It shows that with the right abstractions, you can port an Xlib program like dwm to Scheme and not have the code blow up too much.
"cons wm" because it's simple like a cons cell. ;-)
Ed _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
2009/3/4 lowly coder lowlycoder@huoyanjinjing.com:
This is awesome. Thanks!
No it's not. Awesome is http://awesome.naquadah.org/ :)
You might also like tinywm http://paste.lisp.org/display/19072 that has a terrific common lisp version.
P!