Skip to content

Instantly share code, notes, and snippets.

@agrimm
Created September 13, 2009 10:40
Show Gist options
  • Save agrimm/186146 to your computer and use it in GitHub Desktop.
Save agrimm/186146 to your computer and use it in GitHub Desktop.
For some reason, this is incomplete. Try http://pastie.org/616080
[agrimm@computer_name ~]$ cd ruby/haskell/Hubris/
[agrimm@computer_name Hubris]$ git status
# On branch master
nothing to commit (working directory clean)
[agrimm@computer_name Hubris]$ ruby /usr/local/bin/rake
(in /home/agrimm/ruby/haskell/Hubris)
mkdir: cannot create directory `/home/agrimm/.hubris_cache': File exists
find: `/home/agrimm/bin': No such file or directory
creating Makefile
C->Haskell Compiler, version 0.16.0 Crystal Seed, 24 Jan 2009
build platform is "i386-linux" <1, True, True, 1>
mkdir: cannot create directory `/home/agrimm/.hubris_cache': File exists
find: `/home/agrimm/bin': No such file or directory
creating Makefile
..FFFFFFFFFF**FF.F
Pending:
Target can overwrite old functions (Haven't decided proper semantics)
./spec/language_spec.rb:31
Target can insert the same code into two ruby modules (rejig identifiers to include module in stubs)
./spec/language_spec.rb:45
1)
'Target sings like a golden bird when you treat it right, aw yeah' FAILED
expected no Exception, got #<HaskellError: ghc build failed /usr/local/bin/ghc-6.11.20090907 -Wall --make -dynamic -fPIC -shared /tmp/working_source.hs -lHSrts-ghc6.11.20090907 -L/usr/local/lib/ghc-6.11.20090907 -no-hs-main -optl-Wl,-rpath,/usr/local/lib/ghc-6.11.20090907 -o ~/.hubris_cache/libworking_266e262055362889fa95d8e269c0d441.so stubs.c ./lib/rshim.c ./lib/RubyMap.hs -I/usr/lib/ruby/1.8/i386-linux -I./lib
output:
error:
/tmp/working_source.hs:7:7:
Could not find module `Foreign':
Perhaps you haven't installed the "dyn" libraries for package `base'?
Use -v to see a list of the files searched for.
-- COMPILED WITH ghc
{-# LANGUAGE ScopedTypeVariables, FlexibleInstances, ForeignFunctionInterface, UndecidableInstances #-}
-- import Foreign.Ptr()
import RubyMap
import Prelude hiding (catch)
import Control.Exception(SomeException, evaluate, catch)
import Foreign(unsafePerformIO)
main :: IO ()
main = return ()
working :: RValue -> RValue
working_external :: Value -> Value -> Value
working_external _mod x = unsafePerformIO $
(evaluate (toRuby $ working $ fromRuby x))
`catch` (\y -> throwException (show (y::SomeException)))
foreign export ccall "working_external" working_external :: Value -> Value -> Value
working _ = T_FIXNUM (1+2)>
./spec/basic_ops_spec.rb:36:
2)
HaskellError in 'Target handles booleans'
ghc build failed /usr/local/bin/ghc-6.11.20090907 -Wall --make -dynamic -fPIC -shared /tmp/my_negate_source.hs -lHSrts-ghc6.11.20090907 -L/usr/local/lib/ghc-6.11.20090907 -no-hs-main -optl-Wl,-rpath,/usr/local/lib/ghc-6.11.20090907 -o ~/.hubris_cache/libmy_negate_eeef6c1a446d73f19e537b6cba509846.so stubs.c ./lib/rshim.c ./lib/RubyMap.hs -I/usr/lib/ruby/1.8/i386-linux -I./lib -Werror
output:
error:
/tmp/my_negate_source.hs:7:7:
Could not find module `Foreign':
Perhaps you haven't installed the "dyn" libraries for package `base'?
Use -v to see a list of the files searched for.
-- COMPILED WITH ghc
{-# LANGUAGE ScopedTypeVariables, FlexibleInstances, ForeignFunctionInterface, UndecidableInstances #-}
-- import Foreign.Ptr()
import RubyMap
import Prelude hiding (catch)
import Control.Exception(SomeException, evaluate, catch)
import Foreign(unsafePerformIO)
main :: IO ()
main = return ()
my_negate :: RValue -> RValue
my_negate_external :: Value -> Value -> Value
my_negate_external _mod x = unsafePerformIO $
(evaluate (toRuby $ my_negate $ fromRuby x))
`catch` (\y -> throwException (show (y::SomeException)))
foreign export ccall "my_negate_external" my_negate_external :: Value -> Value -> Value
my_negate T_FALSE = T_TRUE
my_negate T_NIL = T_TRUE
my_negate _ = T_FALSE
./spec/../lib/hubris.rb:194:in `ghcbuild'
./spec/../lib/hubris.rb:143:in `inline'
./spec/../lib/hubris.rb:169:in `call'
./spec/../lib/hubris.rb:169:in `inline'
./spec/basic_ops_spec.rb:42:
3)
HaskellError in 'Target handles doubles'
ghc build failed /usr/local/bin/ghc-6.11.20090907 -Wall --make -dynamic -fPIC -shared /tmp/triple_source.hs -lHSrts-ghc6.11.20090907 -L/usr/local/lib/ghc-6.11.20090907 -no-hs-main -optl-Wl,-rpath,/usr/local/lib/ghc-6.11.20090907 -o ~/.hubris_cache/libtriple_9de70fae887197e4805392b942290777.so stubs.c ./lib/rshim.c ./lib/RubyMap.hs -I/usr/lib/ruby/1.8/i386-linux -I./lib
output:
error:
/tmp/triple_source.hs:7:7:
Could not find module `Foreign':
Perhaps you haven't installed the "dyn" libraries for package `base'?
Use -v to see a list of the files searched for.
-- COMPILED WITH ghc
{-# LANGUAGE ScopedTypeVariables, FlexibleInstances, ForeignFunctionInterface, UndecidableInstances #-}
-- import Foreign.Ptr()
import RubyMap
import Prelude hiding (catch)
import Control.Exception(SomeException, evaluate, catch)
import Foreign(unsafePerformIO)
main :: IO ()
main = return ()
triple :: RValue -> RValue
triple_external :: Value -> Value -> Value
triple_external _mod x = unsafePerformIO $
(evaluate (toRuby $ triple $ fromRuby x))
`catch` (\y -> throwException (show (y::SomeException)))
foreign export ccall "triple_external" triple_external :: Value -> Value -> Value
triple (T_FLOAT a) = T_FLOAT (a*3.0)
./spec/../lib/hubris.rb:194:in `ghcbuild'
./spec/../lib/hubris.rb:143:in `inline'
./spec/../lib/hubris.rb:169:in `call'
./spec/../lib/hubris.rb:169:in `inline'
./spec/basic_ops_spec.rb:56:
4)
HaskellError in 'Target handles nils too'
ghc build failed /usr/local/bin/ghc-6.11.20090907 -Wall --make -dynamic -fPIC -shared /tmp/give_me_a_nil_source.hs -lHSrts-ghc6.11.20090907 -L/usr/local/lib/ghc-6.11.20090907 -no-hs-main -optl-Wl,-rpath,/usr/local/lib/ghc-6.11.20090907 -o ~/.hubris_cache/libgive_me_a_nil_07b7b03086f7bcc345cd1cf4ab640285.so stubs.c ./lib/rshim.c ./lib/RubyMap.hs -I/usr/lib/ruby/1.8/i386-linux -I./lib
output:
error:
/tmp/give_me_a_nil_source.hs:7:7:
Could not find module `Foreign':
Perhaps you haven't installed the "dyn" libraries for package `base'?
Use -v to see a list of the files searched for.
-- COMPILED WITH ghc
{-# LANGUAGE ScopedTypeVariables, FlexibleInstances, ForeignFunctionInterface, UndecidableInstances #-}
-- import Foreign.Ptr()
import RubyMap
import Prelude hiding (catch)
import Control.Exception(SomeException, evaluate, catch)
import Foreign(unsafePerformIO)
main :: IO ()
main = return ()
give_me_a_nil :: RValue -> RValue
give_me_a_nil_external :: Value -> Value -> Value
give_me_a_nil_external _mod x = unsafePerformIO $
(evaluate (toRuby $ give_me_a_nil $ fromRuby x))
`catch` (\y -> throwException (show (y::SomeException)))
foreign export ccall "give_me_a_nil_external" give_me_a_nil_external :: Value -> Value -> Value
give_me_a_nil _ = T_NIL
./spec/../lib/hubris.rb:194:in `ghcbuild'
./spec/../lib/hubris.rb:143:in `inline'
./spec/../lib/hubris.rb:169:in `call'
./spec/../lib/hubris.rb:169:in `inline'
./spec/basic_ops_spec.rb:63:
5)
HaskellError in 'Target handles strings'
ghc build failed /usr/local/bin/ghc-6.11.20090907 -Wall --make -dynamic -fPIC -shared /tmp/my_reverse_source.hs -lHSrts-ghc6.11.20090907 -L/usr/local/lib/ghc-6.11.20090907 -no-hs-main -optl-Wl,-rpath,/usr/local/lib/ghc-6.11.20090907 -o ~/.hubris_cache/libmy_reverse_8d50f73a603eb91f63d56d4a415adc32.so stubs.c ./lib/rshim.c ./lib/RubyMap.hs -I/usr/lib/ruby/1.8/i386-linux -I./lib
output:
error:
/tmp/my_reverse_source.hs:7:7:
Could not find module `Foreign':
Perhaps you haven't installed the "dyn" libraries for package `base'?
Use -v to see a list of the files searched for.
-- COMPILED WITH ghc
{-# LANGUAGE ScopedTypeVariables, FlexibleInstances, ForeignFunctionInterface, UndecidableInstances #-}
-- import Foreign.Ptr()
import RubyMap
import Prelude hiding (catch)
import Control.Exception(SomeException, evaluate, catch)
import Foreign(unsafePerformIO)
main :: IO ()
main = return ()
my_reverse :: RValue -> RValue
my_reverse_external :: Value -> Value -> Value
my_reverse_external _mod x = unsafePerformIO $
(evaluate (toRuby $ my_reverse $ fromRuby x))
`catch` (\y -> throwException (show (y::SomeException)))
foreign export ccall "my_reverse_external" my_reverse_external :: Value -> Value -> Value
my_reverse (T_STRING s) = T_STRING $ Prelude.reverse s
./spec/../lib/hubris.rb:194:in `ghcbuild'
./spec/../lib/hubris.rb:143:in `inline'
./spec/../lib/hubris.rb:169:in `call'
./spec/../lib/hubris.rb:169:in `inline'
./spec/basic_ops_spec.rb:69:
6)
HaskellError in 'Target handles BigInts'
ghc build failed /usr/local/bin/ghc-6.11.20090907 -Wall --make -dynamic -fPIC -shared /tmp/big_inc_source.hs -lHSrts-ghc6.11.20090907 -L/usr/local/lib/ghc-6.11.20090907 -no-hs-main -optl-Wl,-rpath,/usr/local/lib/ghc-6.11.20090907 -o ~/.hubris_cache/libbig_inc_e941ff7a2d840cd6d72b5d9a36fbcec8.so stubs.c ./lib/rshim.c ./lib/RubyMap.hs -I/usr/lib/ruby/1.8/i386-linux -I./lib -Werror
output:
error:
/tmp/big_inc_source.hs:7:7:
Could not find module `Foreign':
Perhaps you haven't installed the "dyn" libraries for package `base'?
Use -v to see a list of the files searched for.
-- COMPILED WITH ghc
{-# LANGUAGE ScopedTypeVariables, FlexibleInstances, ForeignFunctionInterface, UndecidableInstances #-}
-- import Foreign.Ptr()
import RubyMap
import Prelude hiding (catch)
import Control.Exception(SomeException, evaluate, catch)
import Foreign(unsafePerformIO)
main :: IO ()
main = return ()
big_inc :: RValue -> RValue
big_inc_external :: Value -> Value -> Value
big_inc_external _mod x = unsafePerformIO $
(evaluate (toRuby $ big_inc $ fromRuby x))
`catch` (\y -> throwException (show (y::SomeException)))
foreign export ccall "big_inc_external" big_inc_external :: Value -> Value -> Value
big_inc (T_BIGNUM i) = T_BIGNUM $ i + 1
big_inc _ = T_NIL
./spec/../lib/hubris.rb:194:in `ghcbuild'
./spec/../lib/hubris.rb:143:in `inline'
./spec/../lib/hubris.rb:169:in `call'
./spec/../lib/hubris.rb:169:in `inline'
./spec/basic_ops_spec.rb:75:
7)
HaskellError in 'Target doubles an int in Haskell-land'
ghc build failed /usr/local/bin/ghc-6.11.20090907 -Wall --make -dynamic -fPIC -shared /tmp/mydouble_source.hs -lHSrts-ghc6.11.20090907 -L/usr/local/lib/ghc-6.11.20090907 -no-hs-main -optl-Wl,-rpath,/usr/local/lib/ghc-6.11.20090907 -o ~/.hubris_cache/libmydouble_80de6a0ddda6b8ba1f454a9e38867916.so stubs.c ./lib/rshim.c ./lib/RubyMap.hs -I/usr/lib/ruby/1.8/i386-linux -I./lib
output:
error:
/tmp/mydouble_source.hs:7:7:
Could not find module `Foreign':
Perhaps you haven't installed the "dyn" libraries for package `base'?
Use -v to see a list of the files searched for.
-- COMPILED WITH ghc
{-# LANGUAGE ScopedTypeVariables, FlexibleInstances, ForeignFunctionInterface, UndecidableInstances #-}
-- import Foreign.Ptr()
import RubyMap
import Prelude hiding (catch)
import Control.Exception(SomeException, evaluate, catch)
import Foreign(unsafePerformIO)
main :: IO ()
main = return ()
mydouble :: RValue -> RValue
mydouble_external :: Value -> Value -> Value
mydouble_external _mod x = unsafePerformIO $
(evaluate (toRuby $ mydouble $ fromRuby x))
`catch` (\y -> throwException (show (y::SomeException)))
foreign export ccall "mydouble_external" mydouble_external :: Value -> Value -> Value
mydouble (T_FIXNUM i) = T_FIXNUM (i + i)
./spec/../lib/hubris.rb:194:in `ghcbuild'
./spec/../lib/hubris.rb:143:in `inline'
./spec/../lib/hubris.rb:169:in `call'
.%2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment