News for hackers. Stuff that matters.
Re:A tiling window manager written in Rust by kion on Wednesday December 17, 2014 @11:57AM (#8762994)
This is the sort of thing I hope to see a lot more of from Rust. Things that would traditionally be done in C/C++ moving to a new language with modern features. I'm very hopeful this trend will continue.
Re:A tiling window manager written in Rust by zellyn on Wednesday December 17, 2014 @12:58PM (#8763350)
I thought tiling window managers were traditionally written in Haskell :-p
Re:A tiling window manager written in Rust by lake99 on Wednesday December 17, 2014 @01:50PM (#8763616)
Re:A tiling window manager written in Rust by hedwall on Wednesday December 17, 2014 @01:15PM (#8763436)
WMII, dwm, awesome, i3 are all written in C (and Lua).
Re:A tiling window manager written in Rust by Igglyboo on Wednesday December 17, 2014 @01:52PM (#8763634)
He's making a joke about xmonad
Re:A tiling window manager written in Rust by pjmlp on Wednesday December 17, 2014 @03:04PM (#8764012)
The thing is, most languages can be used for writing a Window manager.

But since the alternatives to C and C++ kind of faded away from mainstream and they are anyway the UNIX system languages, most developers seldom look for alternatives.

With Rust, Go, D, Haskell, OCaml, .NET Native/Mono AOT, Java AOT compilers, hopefully developers will eventually realize that not everything needs to be coded in C or C++.

Re:A tiling window manager written in Rust by fspeech on Wednesday December 17, 2014 @04:09PM (#8764366)
Most non-C languages also come with GC/managed runtime whether you want it or not. So for someone who don't want that Rust could be a fitting choice.
Re:A tiling window manager written in Rust by pjmlp on Wednesday December 17, 2014 @04:15PM (#8764396)
Today yes. Not so 20 years ago.

Modula-2, Ada, Object Pascal were some of the alternatives without GC.

These are the ones I meant by "faded away".

Re:A tiling window manager written in Rust by Dewie on Wednesday December 17, 2014 @04:47PM (#8764556)
Last I checked the memory consumption of running xmonad (you know, written in Haskell) on my computer was a pittance; doesn't hog memory, and probably doesn't use enough memory to cause user-noticeable GC pauses.

Though if you're talking about applications in general, and not just WMs; yes, sure.

Re:A tiling window manager written in Rust by fspeech on Thursday December 18, 2014 @12:08AM (#8766053)
Yes it is more likely to be applicable to other apps other than WMs, but I also have integration in mind. So what if you want to write a WM like a library that can be used by whatever runtime a user may choose. Not sure that is a good idea but it sure would not be very portable if a GC must be carried inside the library. Memory consumption is not the only issue here.
Re:A tiling window manager written in Rust by Dewie on Thursday December 18, 2014 @06:10AM (#8766809)
If you were making a general point and not about WMs in particular, why didn't you say that to begin with?
Re:A tiling window manager written in Rust by codygman on Wednesday December 17, 2014 @10:32PM (#8765849)
Yeah, I've been using Xmonad for a couple years and it's just faithfully used very little memory and never crashed. Also, this is across 4-5 different laptops.
Re:A tiling window manager written in Rust by chriswarbo on Wednesday December 17, 2014 @05:19PM (#8764709)
Most languages can be used for writing most things; however, for X11 window managers in particular, all of the APIs are exposed as C libraries, so the C family has a natural advantage. Other languages need an interface to those C libraries, a more idiomatic wrapper on top, and then a window manager can be written.

I've played with the Xlib libraries in Haskell and it wasn't the prettiest code I've ever written ;)

Re:A tiling window manager written in Rust by burntsushi on Wednesday December 17, 2014 @08:13PM (#8765508)
Not in the Go ecosystem. :-) We have a real, pure (concurrent) X client protocol implementation: https://github.com/BurntSushi/xgb (and of course, a WM: https://github.com/BurntSushi/wingo, which is hybrid tiling and stacking, kind of like Xmonad meets Openbox). /shameless plug

Of course, it's not all moonpies and pennywhistles. XGB only supports basic extensions like RandR, Xinerama, Render and Composite. But it's missing Xinput and XKB (which are monstrous).

Re:A tiling window manager written in Rust by bentrevor on Wednesday December 17, 2014 @09:31PM (#8765712)
When I saw this article, I thought "I bet burntsushi wrote it". I've been learning a lot from reading your Go code lately.
Re:A tiling window manager written in Rust by burntsushi on Wednesday December 17, 2014 @10:06PM (#8765800)
Heh, thanks. I spent years of my life with X getting my perfect WM. I'm happy to say I got there. But I can't stomach much more of X. :-)
Re:A tiling window manager written in Rust by pjmlp on Thursday December 18, 2014 @03:36AM (#8766484)
I was actually looking for your code when I posted, but somehow forgot to refer to it in the end.

Good work!

Re:A tiling window manager written in Rust by pjmlp on Wednesday December 17, 2014 @05:43PM (#8764834)
This is what caused me eventually to move from Turbo Pascal to C++ during the Windows 3.1 time frame.

I started to get fed up with writing bindings to libraries not directly supported by Turbo Pascal and pure C was a no go for me.

Re:A tiling window manager written in Rust by fspeech on Thursday December 18, 2014 @12:16AM (#8766074)
I am a recent convert to C++ for the same reason (though not from Pascal but other high level languages like Prolog). I wrote my own Prolog interpreter with minimal footprint so I can still get an interactive prompt with a high level interface if I want to, but it is designed to be easy to expose C++ instead of the other way around.
Re:A tiling window manager written in Rust by Teckla on Wednesday December 17, 2014 @08:55PM (#8765634)
Java AOT compilers

Java AOT compilers? What Java AOT compilers?

I know about Excelsior JET ($$$$) and gcj (abandoned). Do you know of any free and good Java AOT compilers?

Re:A tiling window manager written in Rust by pjmlp on Thursday December 18, 2014 @03:34AM (#8766480)
I don't care if they are free or not. The point is that is technical feasible and they do exist.

Most commercial JVMs like IBM Websphere for Real Time, Aonix and JamaicaVM, just to cite three examples, do offer AOT compilation.

Java on IBM i mainframes is translated to the same bytecode used by C and C++ (yes I really mean bytecode not Assembly, IBM i has a kernel JIT).

Then you have RoboVM, CodenameOne, JikesRVM, SubstrateVM.

SubstrateVM is done by the same Oracle Labs working on Graal.

RoboVM is how LibGDX guys are targeting iOS.

And Oracle is changing the OpenJDK to eventually support AOT compilation.

http://openjdk.java.net/jeps/197

Currently the only free on that might suit you, in case you only care about UNIX environments is RoboVM.

Re:A tiling window manager written in Rust by Teckla on Thursday December 18, 2014 @01:36PM (#8768859)
Thanks for taking the time to respond!

I'd love a Java AOT compiler that produces native binaries with no additional dependencies. (I'd even be okay if, as a side effect, some Java features were not supported, making it technically not-Java.)

For small tools and utilities, the JVM requirement is quite onerous, especially when one does not know if the end user has Java installed, or if they do, what version.

Alas, the company I work for will not budget for a Java AOT compiler, and for my hobby programming, the commercial Java AOT compilers are far too expensive to justify.

I'll just keep hoping a good and free (or inexpensive) Java AOT compiler becomes available some day. I would even donate money and/or code if a serious project started.

Re:A tiling window manager written in Rust by pjmlp on Thursday December 18, 2014 @02:15PM (#8769080)
> For small tools and utilities, the JVM requirement is quite onerous, especially when one does not know if the end user has Java installed, or if they do, what version.

There some efforts in this direction with the OpenJDK.

As of Java 8 there is an application packager that brings everything together.

https://docs.oracle.com/javase/8/docs/technotes/guides/deplo...

And the size of the native runtime has been reduced.

http://openjdk.java.net/jeps/148

> I'll just keep hoping a good and free (or inexpensive) Java AOT compiler becomes available some day. I would even donate money and/or code if a serious project started.

If you are on GNU/Linux, Mac OS/X check RoboVM.

http://www.robovm.com/

Re:A tiling window manager written in Rust by Teckla on Thursday December 18, 2014 @02:07PM (#8769032)
I sincerely apologize, I just now noticed you've answered my same query on other threads.
Re:A tiling window manager written in Rust by colordrops on Wednesday December 17, 2014 @02:24PM (#8763799)
My understanding is that C++11 and eventually C++14 have plenty of modern language features. How does Rust compare?
Re:A tiling window manager written in Rust by dscrd on Thursday December 18, 2014 @05:48AM (#8766761)
A language is often not improved by adding features. Rust has a relatively clean slate (for now), which makes it a vastly better experience.
Re:A tiling window manager written in Rust by steveklabnik on Wednesday December 17, 2014 @04:52PM (#8764571)
While they introduce constructs that significantly increase the safety of C++ written with them, they still have edge cases due to the C++ committee's commitment to backwards compatibility.

So while C++ is certainly improving, Rust has a fundamental advantage in the safety department.

Re:A tiling window manager written in Rust by Dewie on Wednesday December 17, 2014 @04:48PM (#8764561)
Rust doesn't have C++98, C++ version "C with classes", and so on.

Less flippant answer; the usual arguments are that Rust is more memory safe, and hopefully less complex and with fewer gotchas compared to C++. It's still relatively complex - inherently, due to what it tries to do - but people seem to be of the opinion that it is much less complex than C++.