LtU Forum

Stealing language features for fun and profit in Ruby

Hi all, I haven't used Ruby much yet, but I was happy to see this entertaining article about how to enable some language features common in Haskell, ML, Lisp and others (Pattern-matching, S-expressions).

If It's not Nailed Down, Steal it

Linspire chooses Haskell as preferred language

This is a couple of weeks old, but significant enough that I think many on LtU will be interested. From the Debian Haskell mailing list:
The OS team at Linspire, Inc. would like to announce that we are standardizing on Haskell as our preferred language for core OS development.

We are redoing a bunch of our infrastructure using Haskell as our common standard language. Our first task is redoing our Debian package builder (aka autobuilder) in Haskell.  Other tools such as ISO builders, package dependency checkers are in progress. The goal is to make a really tight simple set of tools that will let developers contribute to Freespire, based on Debian tools whenever possible. Our hardware detector, currently in OCaml, is on the block to be rewritten as well.

There are four of us using Haskell, all CCed on this message.  All of us have been using functional languages for quite some time.  At Linspire, our choices have been OCaml and Haskell. David Fox wrote the hardware detector in OCaml and is now porting it to Haskell.  Jeremy Shaw has been doing various utilities in Haskell for several years.  Sean Meiners recently wrote an application for managing his recipe collection and is now hooked.  I am porting our CD build procedure from OCaml to Haskell.

We are interested in many other uses of Haskell.  The recent discussion about Haskell as a shell interests greatly, for example, as we have all suffered through years of bash code.  We'd also like to make some Haskell bindings for Qt and KDE, though at the moment we don't have a good plan to tackle that problem efficiently.

To date, Linspire (formerly Lindows) has focused on polishing Linux for the consumer market.  I mentioned Freespire, above.  We announced Freespire recently (www.freespire.org).  Essentially it is a more open, developer friendly version of Linspire.  http://freespire.org/about/vision and http://freespire.org/support/faqs have good overviews.  Access through apt, open-source CNR client and many other good things.

I mention Freespire because some of our colleagues were concerned that using Haskell would isolate us from the larger community of developers and make it hard to find new employees skilled in Haskell, should we need to.  From our perspective, functional programming makes us more effective and we think that getting even a few people who know Haskell hacking with us is a better combination than lots of Perl and bash.  I'm not sure I expect anyone on this list to disagree, but still I'd love to hear your thoughts on the subject.

Also, Linspire is based on Debian. We've talked a little with John Goerzen who announced his missingH library here a while back.  We've imported it and expect to pass updates back to him as well as any other libraries and tools that he would be interested in includng in the Debian archive.  Also, it seems there are quite a few other libraries out there which are either not debianized or stale, but perhaps that is because I haven't fully caught up with what people on this list have done.  If there isn't a cron job running somewhere that updates an archive with Cabalized libraries and apps, we would like to help set one up.

I will be at Debconf from Sunday, May 14 through Tuesday evening.  If anyone on this list is there, I would love to chat and see how we can help each other.

Clifford Beshers <clifford.beshers at linspire.com>
OS Team Lead
Linspire, Inc.

Backwards debugging

I just came accross UndoDB, which allows stepping backwards through a program. It reminds me of the Objective Caml debugger.

Outside of these more complex tools, I find it easy to look back in program execution when I use recursion rather than mutation and a stack trace is available.

What other languages or language tools allow looking backwards in program execution?

Segmentation Fault

During a 1 user Solaris test the CMS(Central Management Server) crashed. The core file was generated at 2AM, so you check the machine on which the database was running. You find an event logs that says "MS SQL Server: unknown error" and it was generated at around 2AM. You then extract the thread stacks from the core file, and you see that a thread had a segmentation fault (SIGSEGV). At the top of the stack you see that the thread was executing some Database Subsystem code of ours.

Question: What do you think is the most likely cause of the segmentation fault and why?

haXe 1.0

There's been a lot of activity with Javascript generators lately, with project such as Google Web Toolkit or Links. haXe is an OO language with high-level features (polymorphism, type inference, structural subtyping, iterators) meant to program the Web. It targets three platforms : Javascript, Neko (for the server side) and Flash.

Instead of taking an approach to isolate a "common feature set", haXe has a common standard library but also give access to each platform "native" library. Some classes can be supported on several platforms by using conditional-compilation with platform-specific code. For example haXe includes some optional libraries that can be used for example to do transparent synchronous or asynchronous communications between the platforms (called Remoting).

haXe 1.0 was released a few days ago on http://haxe.org. The haXe compiler is entirely written in OCaml.

Orca chosen as default Syllable scripting language

Orca (an open-source Rebol-like language) has been chosen as the default scripting language for the Syllable operating system, according to "The Rebol Week" site -
http://rebolweek.blogspot.com/

There have been attempts at creating open-source Rebol-like languages in the past - most notably, Freebell and R-sharp. However, both of those projects have been dormant/dead for some time.

Those interested in trying out Orca can find it here -
http://sourceforge.net/projects/urlan

To build it, you will need "m2", available here -

http://wsrebol.sourceforge.net

Orca now looks like it will become the most successful and most widely-used of the open-source Rebol-like languages. Good luck to its developer ("wickedsmoke") and the Syllable team!

Continuations and MicroThreads on Mono

Continuations and MicroThreads on Mono is a modification of the Mono VM to implement...Continuations and MicroThreads!

Question about Lazy-ness and algorithmic runtime analysis

Consider the following Haskell-ish functions: (I'm not actually gonna type them into hugs or anything so forgive any syntactical errors)

naiveMin [x]  = x
naiveMin x:xs = if x < y then x else y where y = naiveMin xs

qsort []   = []
qsort x:xs = qsort [ a | a <- xs, a < x] ++ [x] ++ qsort [ b | b <- xs, b >= x ]

lazyMin xs = head (take 1 (qsort xs))

Now what I'm asking is, if we have lazy evaluation semantics, in the lazyMin function, when we call qsort, will the only part that gets evaluated be

qsort [ a | a <- xs, a < x]

or possibly at most:

qsort [ a | a <- xs, a < x] ++ [x]

since we are only taking 1 element from the list. Does this mean it's runtime is O(n), like naiveMin? Are we using lazy evaluation to complete change how much code gets run from outside the function? I'm guessing the answer is probably yes, which also kind of turned on the light-bulb as far as the usefulness of lazy evaluation goes. (Oh yeah you can have an infinite list, but um, so what?). I just want to make sure I'm not missing anything here.

Ethnographic Study of Copy and Paste Programming Practices in OOPL

From the abstract:

When programmers develop and evolve software, they frequently copy and paste (C&P) code from an existing code base, or sources such as web pages or documentation. We believe that programmers follow a small number of well defined C&P usage patterns when they program, and understanding these patterns would enable us to design tools to improve the quality of software.

I noticed this paper in the references of a (draft) paper on subtext, which is a project previously discussed on LtU. I think that this is interesting from a language design perspective and couldn't find a previous discussion on LtU. (I'll defer my other comments (read: critique) to a later post - if any.)

Google Web Toolkit

Google has released a new web toolkit. The possible significant item for LtU is the Java-to-Javascript compiler that is one of the central components of the toolkit. I am unconvinced of the value of coding in java rather than in javascript. However, the marketing folks have been thinking along the same lines as some of the threads here on LtU with respect to static type checking, code completion, etc. Maybe some of the static fans could comment on this?

cheers,
Jess

XML feed