<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>ByteLabs: Category Hacking and Computers</title>
    <link>http://blog.solaris.bytelabs.org/articles/category/hacking-and-computers</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>additions to a vast pool of entropy by Igor and Ines</description>
    <item>
      <title>Existential Datatypes</title>
      <description>&lt;p&gt;A nice &lt;a href="http://okmij.org/ftp/Computation/Existentials.html"&gt;article&lt;/a&gt; by Oleg Kiselyov about &lt;a href="http://okmij.org/ftp/Computation/Existentials.html"&gt;Existential Datatypes&lt;/a&gt;. Enjoy!&lt;/p&gt;</description>
      <pubDate>Thu, 11 Sep 2008 01:38:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:9827b27b-5918-4821-ba24-38b7aa99b518</guid>
      <author>igor</author>
      <link>http://blog.solaris.bytelabs.org/articles/2008/09/11/existential-datatypers</link>
      <category>Hacking and Computers</category>
    </item>
    <item>
      <title>foldl.com - foldr.com</title>
      <description>If you are functional programmer you surely have used &lt;a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v%3Afoldr"&gt;foldr&lt;/a&gt; or &lt;a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v%3Afoldl"&gt;foldl&lt;/a&gt; before. By accident I found out that &lt;a href="http://osteele.com/"&gt;Oliver Steele&lt;/a&gt; registered the following domains:
	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://foldl.com/"&gt;http://foldl.com/&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://foldr.com/"&gt;http://foldr.com/&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;:-)&lt;/p&gt;</description>
      <pubDate>Thu, 21 Aug 2008 21:44:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:01aad929-bab3-4159-80e1-4b19931fe388</guid>
      <author>igor</author>
      <link>http://blog.solaris.bytelabs.org/articles/2008/08/21/foldl-com-foldr-com</link>
      <category>Fun Stuff</category>
      <category>Hacking and Computers</category>
    </item>
    <item>
      <title>Complexity of Type Reconstruction</title>
      <description>&lt;p&gt;Again I would like to draw an interesting example from Benjamin Pierce&amp;#8217;s book &lt;a href="http://www.cis.upenn.edu/~bcpierce/tapl/index.html"&gt;Types and Programming Languages&lt;/a&gt; that is originally due to &lt;a href="http://portal.acm.org/citation.cfm?id=101856.101870"&gt;Kfoury, Tiuryn, and Urzyczyn&lt;/a&gt;. The following Haskell program is well typed but takes a very long time to typecheck:&lt;/p&gt;


&lt;code&gt;&lt;pre&gt;module Main (main) where
main =
 let f0 = \x -&amp;gt; (x,x)
     f1 = \y -&amp;gt; f0 (f0 y)
     f2 = \y -&amp;gt; f1 (f1 y)
     f3 = \y -&amp;gt; f2 (f2 y)
     f4 = \y -&amp;gt; f3 (f3 y)
     f5 = \y -&amp;gt; f4 (f4 y)
 in
 f5 (\z -&amp;gt; z)
&lt;/pre&gt;&lt;/code&gt;
It has long been believed that type-checking programs in languages that allow for let-polymorphism appears to be &amp;#8220;essentially linear&amp;#8221; in the size of the input program. It therefore came as a surprise that its worst-case complexity is still exponential as the above example demonstrates ;-)</description>
      <pubDate>Sun, 10 Aug 2008 13:17:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:0a23a4c6-8110-477a-9f3c-e855ddb592eb</guid>
      <author>igor</author>
      <link>http://blog.solaris.bytelabs.org/articles/2008/08/10/complexity-of-type-reconstruction</link>
      <category>Fun Stuff</category>
      <category>Hacking and Computers</category>
    </item>
    <item>
      <title>Playing with Rank-N Types</title>
      <description>The following shows some dummy Haskell example code that demonstrates the usage of rank-n types:
&lt;pre&gt;&lt;code&gt;{-# LANGUAGE RankNTypes #-}
module Main (main) where
-- g1: identity function
-- GHC implicitely quantifies it to: forall a. a -&amp;gt; a
g1 :: a -&amp;gt; a
g1 x = x
-- g2: Rank2Type
g2 :: (forall a. a -&amp;gt; a) -&amp;gt; (Bool, Char)
g2 f = (f True, f 'a')
-- g3: Rank3Type
g3 :: ((forall a. a -&amp;gt; a) -&amp;gt; (Bool, Char)) -&amp;gt; (Char, Bool)
g3 f = (\x -&amp;gt; (snd x, fst x)) (f g1)
-- g4: Rank4Type
g4 :: (((forall a. a -&amp;gt; a) -&amp;gt; (Bool, Char)) -&amp;gt; (Char, Bool)) -&amp;gt;
         (Bool, Char)
g4 f = (\x -&amp;gt; (snd x, fst x)) (f g2)

main :: IO ()
main = do
  putStrLn "Rank-2 Example:" 
  putStrLn . show . fst . g2 $ g1
  putStrLn . show . snd . g2 $ g1
  putStrLn "Rank-3 Example:" 
  putStrLn . show . fst . g3 $ g2
  putStrLn . show . snd . g3 $ g2
  putStrLn "Rank-4 Example:" 
  putStrLn . show . fst . g4 $ g3
  putStrLn . show . snd . g4 $ g3
&lt;/code&gt;&lt;/pre&gt;

 If you want to see more &amp;#8216;useful&amp;#8217; examples have a look at the paper &lt;a href="http://research.microsoft.com/~simonpj/papers/higher-rank/putting.pdf"&gt;Practical Type Inference for Arbitrary-Rank Types&lt;/a&gt;.</description>
      <pubDate>Sun, 10 Aug 2008 12:51:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:488c2a29-77c7-4c9f-8e1e-e7a1843f8766</guid>
      <author>igor</author>
      <link>http://blog.solaris.bytelabs.org/articles/2008/08/10/playing-with-rank-n-types</link>
      <category>Hacking and Computers</category>
      <category>Haskell</category>
      <category>Types</category>
    </item>
    <item>
      <title>Predicative vs. Impredicative Polymorphism and Type Reconstruction</title>
      <description>&lt;p&gt;The polymorphism of &lt;a href="http://en.wikipedia.org/wiki/System_F"&gt;System F&lt;/a&gt; is often called &lt;strong&gt;impredicative&lt;/strong&gt;. A definition is called &lt;strong&gt;impredicative&lt;/strong&gt; if it involves a quantifier whose domain includes the very thing being defined. For example in &lt;a href="http://en.wikipedia.org/wiki/System_F"&gt;System F&lt;/a&gt;, the type variable X in the type T = &amp;forall;X. X &amp;rarr; X ranges over all types, including T itself (so that, for example, we can instantiate a term of type T at type T, yielding a function from T to T).[6]&lt;/p&gt;


	&lt;p&gt;The polymorphism found in ML is called &lt;strong&gt;predicative&lt;/strong&gt;, because the range of type variables is restricted to monotypes (i.e. quantifier-free types), which do not contain quantifiers.&lt;/p&gt;


	&lt;p&gt;When talking about type reconstruction the previous definitions are important. There is a growing &amp;#8220;[...] need for ever more expressive type system features, 
most of which threaten the decidability and practicality of Damas-Milner type inference.  One such feature is the ability to write functions with higher-rank types&#8212;that is, functions  that take polymorphic functions as their arguments.&amp;#8221;[1]&lt;/p&gt;


	&lt;p&gt;Complete type inference is known to be undecidable for higher-rank (impredicative) 
type systems. This post serves as a reference for type reconstruction in the presence of polymorphism in higher-rank type systems.&lt;/p&gt;


	&lt;p&gt;[1] &lt;a href="http://research.microsoft.com/~simonpj/papers/higher-rank/putting.pdf"&gt;Practical type inference for arbitrary-rank types&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;[2] &lt;a href="http://en.wikibooks.org/wiki/Haskell/Polymorphism"&gt;Haskell/Polymorphism&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;[3] &lt;a href="http://docforge.com/wiki/Type_polymorphism#Rank_Restrictions"&gt;Type Polymorphism &amp;#8211; DocForge&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;[4] &lt;a href="http://en.wikipedia.org/wiki/Polymorphism_(computer_science"&gt;Type Polymorphism -Wikipedia&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;[5] &lt;a href="http://en.wikipedia.org/wiki/System_F"&gt;System F &amp;#8211; Polymorphic/Second-Order Lambda Calculus&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;[6] &lt;a href="http://www.cis.upenn.edu/~bcpierce/tapl/index.html"&gt;Types and Programming Languages&lt;/a&gt; [p.360]&lt;/p&gt;</description>
      <pubDate>Sun, 10 Aug 2008 11:29:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:f5ccb877-e3c8-4aa9-9c13-50fb50320f5a</guid>
      <author>igor</author>
      <link>http://blog.solaris.bytelabs.org/articles/2008/08/10/predicative-vs-impredicative-polymorphism-and-type-reconstruction</link>
      <category>Hacking and Computers</category>
      <category>Types</category>
    </item>
    <item>
      <title>Mac OS X Leopard - GHC workaround for missing '_environ' symbol</title>
      <description>&lt;p&gt;If you managed to compile the latest darcs version of &lt;span class="caps"&gt;GHC&lt;/span&gt; (6.9.20080720 in my case) on Mac &lt;span class="caps"&gt;OS X&lt;/span&gt; Leopard, then there is a good chance that you ran into the &lt;a href="http://www.haskell.org/pipermail/glasgow-haskell-users/2007-December/013690.html"&gt;following problem&lt;/a&gt;. I have opened a &lt;a href="http://hackage.haskell.org/trac/ghc/ticket/2458"&gt;ticket&lt;/a&gt; with a &lt;a href="http://hackage.haskell.org/trac/ghc/ticket/2458"&gt;solution&lt;/a&gt; proposal.&lt;/p&gt;


	&lt;p&gt;It&amp;#8217;s not the cleanest solution but it works. Good luck!&lt;/p&gt;</description>
      <pubDate>Mon, 21 Jul 2008 16:01:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:38faf3ed-5a9d-4e8a-9c1c-3140e82b8bb3</guid>
      <author>igor</author>
      <link>http://blog.solaris.bytelabs.org/articles/2008/07/21/mac-os-x-leopard-ghc-workaround-for-missing-_environ-symbol</link>
      <category>Hacking and Computers</category>
    </item>
    <item>
      <title>HBURG 1.1.2 Released</title>
      <description>&lt;p&gt;After loads of refactoring work a &lt;a href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hburg-1.1.2"&gt;new version&lt;/a&gt; of &lt;a href="http://www.bytelabs.org/hburg.html"&gt;&lt;span class="caps"&gt;HBURG&lt;/span&gt;&lt;/a&gt; has been released. If you have &lt;a href="http://hackage.haskell.org/trac/hackage/wiki/CabalInstall"&gt;cabal install&lt;/a&gt; you can easily get it by executing the following commands:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt; $ cabal update
 $ cabal install hburg&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Of course you can also use the instructions provided &lt;a href="http://www.bytelabs.org/hburg.html"&gt;here&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Notable changes:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Completely refactored back-end&lt;/li&gt;
		&lt;li&gt;Automated integration tests via &lt;a href="http://www.bytelabs.org/hburg/Test.hs"&gt;Test.hs&lt;/a&gt;. Execute tests by running:&lt;/li&gt;
	&lt;/ul&gt;


&lt;pre&gt;&lt;code&gt; $ runghc Test.hs clean configure build test&lt;/code&gt;&lt;/pre&gt;

	&lt;ul&gt;
	&lt;li&gt;The example &lt;strong&gt;Java&lt;/strong&gt; compiler that demonstrates HBURGs usage has also been revised and updated. See &lt;a href="http://www.bytelabs.org/hburg.html"&gt;HBURGs homepage&lt;/a&gt; for more information on the example compiler.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;I am actively working on a &lt;strong&gt;C#&lt;/strong&gt; back-end so you can use &lt;span class="caps"&gt;HBURG&lt;/span&gt; to generate a code generator for a compiler written in &lt;strong&gt;C#&lt;/strong&gt;. This should come in handy for the advanced compiler course at the &lt;a href="http://www.ssw.uni-linz.ac.at/Teaching/Lectures/UB2/index.html"&gt;&lt;span class="caps"&gt;SSW&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Thu, 26 Jun 2008 19:15:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:19cd5a79-4550-44e6-bf91-719491c670cc</guid>
      <author>igor</author>
      <link>http://blog.solaris.bytelabs.org/articles/2008/06/26/hburg-1-1-2-released</link>
      <category>Diploma Thesis</category>
      <category>Hacking and Computers</category>
    </item>
    <item>
      <title>Repair Time Machine after Migration to New Mac</title>
      <description>&lt;p&gt;&lt;a href="http://www.apple.com/macosx/features/timemachine.html"&gt;Time Machine&lt;/a&gt; associates backups with the &lt;a href="http://en.wikipedia.org/wiki/MAC_address"&gt;&lt;span class="caps"&gt;MAC&lt;/span&gt; address&lt;/a&gt; of your computer. Thus if you migrate your Time Machine backup to a new Mac Computer, you can&amp;#8217;t resume backups where you left off. The following &lt;a href="http://www.macosxhints.com/article.php?story=20080128003716101"&gt;article&lt;/a&gt; should help to remedy the problem.&lt;/p&gt;</description>
      <pubDate>Mon, 19 May 2008 08:42:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:c72b0d49-a5cc-4970-8e4c-b71e9a9d2e65</guid>
      <author>igor</author>
      <link>http://blog.solaris.bytelabs.org/articles/2008/05/19/repair-time-machine-after-migration-to-new-mac</link>
      <category>Hacking and Computers</category>
    </item>
    <item>
      <title>Crazy Patent Claims</title>
      <description>&lt;p&gt;My dad discovered &lt;a href="http://www.patentstorm.us/patents/6876314-claims.html"&gt;the following patent claim&lt;/a&gt;. Compare this with my &lt;a href="http://www.bytelabs.org/hburg.html"&gt;diploma thesis&lt;/a&gt;. Does that ring a bell ;-)&lt;/p&gt;</description>
      <pubDate>Tue, 19 Feb 2008 08:11:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:eb58119d-6d3c-4d85-9797-65f760bebd6a</guid>
      <author>igor</author>
      <link>http://blog.solaris.bytelabs.org/articles/2008/02/19/crazy-patent-claims</link>
      <category>Fun Stuff</category>
      <category>Hacking and Computers</category>
    </item>
    <item>
      <title>My First Book</title>
      <description>&lt;p&gt;My diploma thesis has &lt;a href="http://de.bookbutler.com/do/bookCompare?searchFor=3836461587&amp;#38;searchIn=de&amp;#38;amountIn=eur&amp;#38;shipTo=at"&gt;been published as book&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Amongst many other bookstores I found these quite cool:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://www.buecher.de/shop/Buecher/Automatic-Code-Generation-Using-Dynamic-Programming/Boehm-Igor/products_products/detail/prod_id/23467579/"&gt;Buecher.de&lt;/a&gt; has a nice page about it.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/3836461587/ref=nosim/bookbutlercom-20"&gt;Amazon.com&lt;/a&gt; and &lt;a href="http://www.amazon.de/exec/obidos/tg/detail/offer-listing/-/3836461587/all"&gt;Amazon.de&lt;/a&gt; has it as well.&lt;/li&gt;
	&lt;/ul&gt;</description>
      <pubDate>Mon, 18 Feb 2008 23:35:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:65be1b85-558f-4cbf-9c97-08a465ae8599</guid>
      <author>igor</author>
      <link>http://blog.solaris.bytelabs.org/articles/2008/02/18/my-first-book</link>
      <category>University of Edinburgh</category>
      <category>University of Linz</category>
      <category>Hacking and Computers</category>
    </item>
  </channel>
</rss>
