User loginNavigation |
LtU ForumProper Library Versioning no longer NP-CompleteLong time no see. Your inspiring comments in Review NP-complete Library Versioning Problem and especially encouragement like
made me think about possible solutions. One of them was the suggested adherence to backward compatibility, however as that is not always possible, I searched more. As a result I came to idea of complete module repositories. As far as I can tell (and prove) they seem to eliminate the NP-Completeness of the general problem. However I have to admit I am not absolutely sure. This is a new, just born formalization (although I suspected this is the case for a while) and it might be even less consistent than the previous NP-Complete proof. It would not be wise to mix them together. Thus I am starting new thread to isolate your comments from the previous claim. Please comment on Proper Library Versioning no longer NP-Complete proof. Thanks. Apple "adds closures to C" in Mac OS X 10.6(via Ars Technica's review of Mac OS X 10.6) Apple's version of GCC in Snow Leopard, its new operating system, has a C extension that looks like closures. I'm not sure whether to be marveled that C programs will get lambdas, or appalled that someone will have to figure out manual memory allocation bugs in these. It seems like Apple is moving towards LLVM for its compiler toolchain, and I imagine this extension requires the use of LLVM. Transactional Memory versus Locks - A Comparative Case StudyDr. Victor Pankratius is scheduled to give a talk this Friday at UT Austin entitled, "Transactional Memory versus Locks - A Comparative Case Study". The presentation is here, a technical report is forthcoming. The study is a side-by-side comparison of Transactional Memory with traditional multi-thread programming; general features of the study are:
If anyone knows more, or can go to the presentation, I would like to hear more. (I am posting his to the forum since I cannot find a detailed description other than the presentation.) Computer Code as a Medium for Human CommunicationA psychologist looks at Programming Languages:
Computer Code as a Medium for Human Communication: Are Programming Languages Improving? Review NP-complete Library Versioning ProblemWhile investigating the relationship between modules, their versions and mutual dependencies I came across one hard problem: Given a repository of modules (like the one provided by maven), select such configuration of the module versions so all their dependencies are satisfied. After a little bit of thinking I concluded that this is NP-complete problem. I have even written down a proof. Computer Science/Mathematical NotationsI was just reading this paper from the home page http://pauillac.inria.fr/~fpottier/slides/fpottier-2007-05-linear-bestiary.pdf and realized I can't remember the meaning of many of the symbols after not using them for some time. Is there a reference somewhere that explains these symbols. I'm finding it hard to locate one. Thank you. Accumulating Types in C#PartI: Code:
namespace TypePiling
{
using System.Text;
using System;
using System.IO;
public static class Ex
{
public static Tuple<T, U> Glue<T, U>(this T t, U u)
{
return new Tuple<T, U> { First = t, Second = u };
}
}
public class Tuple<T, U>
{
public T First { get; set; }
public U Second { get; set; }
public override string ToString()
{
var result = new StringBuilder();
if (this.First != null) result.Append(string.Format("{0}", this.First.ToString()));
if (this.Second != null) result.Append(string.Format(", {0}", this.Second.ToString()));
return string.Format("{{ {0} }}", result.ToString().TrimStart(',').Trim());
}
}
public static class Test
{
public static void Test1()
{
var i = 10;
var g0 = i.Glue("Hi");
var g1 = g0.Glue((byte)0xFF);
var g2 = g1.Glue(100.0);
var g3 = g2.Glue('A');
var g4 = g3.Glue((float)1000);
using (var sw = new StreamWriter("output.txt"))
{
sw.WriteLine(g0);
sw.WriteLine(g1);
sw.WriteLine(g2);
sw.WriteLine(g3);
sw.WriteLine(g4);
sw.Flush();
}
System.Diagnostics.Process.Start("output.txt");
}
}
}
This code does what I want and g4 will be: This is my first problem; as you see I do that by put previous value and next value in a new container. So previous values are pile down in First. I want them be piled up in Second, so g4 should be: I it possible in C# 3.5? If not why? Part II:
public static Tuple<T, Tuple<U, V>> Glue<T, U, V>(this Tuple<T, U> t, V v)
{
return new Tuple<T, Tuple<U, V>> { First = t.First, Second = t.Second.Glue(v) };
}
This should do it in a recursive manner. Let see what is the out put: What? What happened at step 3? Sure the compiler recognized { Hi, 255 } as Tuple<string, byte>; but why the first version of Glue executed not the second one, overloaded for a Tuple<T, U>? Is this something about generics in C#? After all implementing tuples in a statically strongly typed manner without compiler support (internal or by a macro system) is pointless, I know. But from this pointless try I have touched another problem: In C# I can not have real accumulated types, but just parametrized types which does not provide enough tools for composition. Thanks in advance Why determinism matters in language design.In the recent set of discussion on functions vs procedures a reference was made to the ADA language design choice neither to ban side effects in functions nor specify the order of evaluation of expressions. So let me explain why this upsets me. Thus thanks to our indecision coupled with human incompetence of the average programmer.. if you run a large program on a different compiler, or a different version of the same compiler, or with different optimization settings.... expect different results. If you look at large modern commercial software systems... a large chunk of the cost (even worse schedule time) is in testing and retesting. Mostly our test department goes hunting in areas where we have introduced change. However, bad language design choices as made by the Ada design team add to the need for us to say to the test department... "Ah, we've had to change X (where X is one of that list above), so anything is possible. Sorry, you have to retest everything." This can easily result in the vast proportion of the cost of a release being in the test phase. Which can be devastating to the release date schedule, as they are _always_ on the critical path. (Final test comes after everything else is done and dusted) Determinism SHOULD feature highly as a design criteria for language designers. Yes, programmers shouldn't code bugs.... but get real. In very large industrial systems there are hundreds even tens of thousands of bugs in shipped systems. Thus it is important that wherever possible, even if the program is just plain rong, different compilers, compiler versions, optimizer settings and memory layout, wherever possible produce the _same_ tested and accepted wrong behaviour. Obviously it will not always be possible. Obviously wherever possible defects should be prevented from being written, defects should be detected and fixed. But simple language design choices that "prematurely optimize" by destroying determinism cost millions. Determinism matters. limit and colimitI have been reading about limits and colimits in Category Theory. Is it the case they are both universal arrows from a functor to the coresponding diagonal functor? FP, auto-generated code..I read that one of the big things about F.P is the ability to reason about programs/prove them; is there also much more scope for code-generation.. automatically filling in the gaps after manually transforming one part of a system lets say you have a known datastructure X and some known function F my question is, in the functional programming world is there the ability to auto-generate 'H' given 'F' & 'G' (i guess even the ability to verify manually written functions fit the bill would be usefull) has this sort of thing been used in practice to solve any real word problems, at what level of complexity.. Any pointers for things to read up on along these lines. |
Browse archives
Active forum topics |
Recent comments
9 weeks 1 day ago
9 weeks 1 day ago
9 weeks 1 day ago
9 weeks 2 days ago
9 weeks 5 days ago
9 weeks 5 days ago
9 weeks 6 days ago
10 weeks 2 hours ago
10 weeks 3 hours ago
10 weeks 3 hours ago