Ada implementation of an X Window System Server (1989)
1–10 of 41 posts
Re: Ada implementation of an X Window System Server (1989)
#2https://news.ycombinator.com/item?id=17056516
Hasn't somebody reimplemented X11 in JavaScript/canvas/websockets yet?
There was an X11 server for Lisp Machines! Not sure who wrote it, but it was probably written inside or at least nearby the X Consortium, and I remember Robert Scheifler used it regularly.
https://news.ycombinator.com/item?id=6864364
"For example the TI Explorer Lisp Machine came with an X11 server written in Lisp. On my Symbolics Lisp Machine I used the usual MIT X11 server written in C - this was possible because the Symbolics Lisp machine had a C compiler." -lispm
John Steinhart wrote XTool, a nice snappy reimplementation of X11 on top of SunView! ;)
https://web.archive.org/web/20171105150953/https://minnie.tu...
https://news.ycombinator.com/item?id=15325226
>XTool was very small and fast compared to the X sample server because I wrote the server from scratch. I think that I'm the only person to write an X server outside of the X Consortium. One of the things that I learned by doing it was that the X Consortium folks were wrong when they said that the documentation was the standard, not the sample server. There were significant differences between the two.
>The only really worthwhile thing about X was the distributed extension registration mechanism. All of the input, graphics and other crap should be moved to extension #1. That way, it won't be mandatory in conforming implementations once that stuff was obsolete. As you probably know, that's where we are today; nobody uses that stuff but it's like the corner of an Intel chip that implements the original instruction set. As an aside, I upset many when working on OpenDoc for Apple and saying the same thing there.
>The atom/property mechanism allows clients to allocate memory in the server that can never be freed. Some way to free memory needs to be added.
>The bit encodings should be part of a separate language binding, not part of the functional description.
>Had he done some real design work and looked at what others were doing he might have realized that at its core, X was a distributed database system in which operations on some of the databases have visual side-effects. I forget the exact number, but X includes around 20 different databases: atoms, properties, contexts, selections, keymaps, etc. each with their own set of API calls. As a result, the X API is wide and shallow like the Mac, and full of interesting race conditions to boot. The whole thing could have been done with less than a dozen API calls.
Re: Ada implementation of an X Window System Server (1989)
#3My bet is that OpenBSD's X server has a far better security design, as the server itself no longer runs as root. The aggressive free() also exposed use-after-free bugs never before seen, and OpenBSD has superior mitigations for rop gadget abuse, aslr everywhere, and other exploits beyond the imagination of 1989.
The paper documents problems of Ada, particularly in linking to C (where the use of void * pointer casts was particularly difficult for Ada's type system), and that the Ada implementation had nearly double the lines of code as the C reference.
In the days of 1989, the fastest CPUs were under 100MHz. It is unlikely that any of this code could be salvaged for a modern server, but the accomplishment is interesting.
Re: Ada implementation of an X Window System Server (1989)
#4I posted this earlier about John Steinhart's XTool (here it is with updated links): https://news.ycombinator.com/item?id=17056516 Hasn't somebody reimplemented X11 in JavaScript/canvas/websockets yet? There was an X11 server for Lisp Machines! Not sure who wrote it, but it was probably written inside or at least nearby the X Consortium, and I remember Robert Scheifler used it regularly. https://news.ycombinator.com/i…
Re: Ada implementation of an X Window System Server (1989)
#5This server appears to have been closed source, and I assume the source is lost. My bet is that OpenBSD's X server has a far better security design, as the server itself no longer runs as root. The aggressive free() also exposed use-after-free bugs never before seen, and OpenBSD has superior mitigations for rop gadget abuse, aslr everywhere, and other exploits beyond the imagination of 1989. The paper documents probl…
Re: Ada implementation of an X Window System Server (1989)
#6This server appears to have been closed source, and I assume the source is lost. My bet is that OpenBSD's X server has a far better security design, as the server itself no longer runs as root. The aggressive free() also exposed use-after-free bugs never before seen, and OpenBSD has superior mitigations for rop gadget abuse, aslr everywhere, and other exploits beyond the imagination of 1989. The paper documents probl…
I'll point out to others in the audience: this is largely an artifact of Ada syntax being more verbose, and Ada programming practice favouring longer and more explanatory identifiers compared to C (where a lot of code looks like line noise). For example, see this post and compare the size of the C code vs. the equivalent Ada code:
Re: Ada implementation of an X Window System Server (1989)
#7This server appears to have been closed source, and I assume the source is lost. My bet is that OpenBSD's X server has a far better security design, as the server itself no longer runs as root. The aggressive free() also exposed use-after-free bugs never before seen, and OpenBSD has superior mitigations for rop gadget abuse, aslr everywhere, and other exploits beyond the imagination of 1989. The paper documents probl…
The code could easily be converted to later Ada versions and use C.Pointers where necessary (triple pointers), but void * are easy enough to handle now with an access to null record with convention => C.
Re: Ada implementation of an X Window System Server (1989)
#8This server appears to have been closed source, and I assume the source is lost. My bet is that OpenBSD's X server has a far better security design, as the server itself no longer runs as root. The aggressive free() also exposed use-after-free bugs never before seen, and OpenBSD has superior mitigations for rop gadget abuse, aslr everywhere, and other exploits beyond the imagination of 1989. The paper documents probl…
>the Ada implementation had nearly double the lines of code as the C reference I'll point out to others in the audience: this is largely an artifact of Ada syntax being more verbose, and Ada programming practice favouring longer and more explanatory identifiers compared to C (where a lot of code looks like line noise). For example, see this post and compare the size of the C code vs. the equivalent Ada code: https://…
Re: Ada implementation of an X Window System Server (1989)
#9Re: Ada implementation of an X Window System Server (1989)
#10This server appears to have been closed source, and I assume the source is lost. My bet is that OpenBSD's X server has a far better security design, as the server itself no longer runs as root. The aggressive free() also exposed use-after-free bugs never before seen, and OpenBSD has superior mitigations for rop gadget abuse, aslr everywhere, and other exploits beyond the imagination of 1989. The paper documents probl…
What do you mean by that? Is there an overview somewhere about "aggressive free()" that I can read?