pocho | 1 Jun 19:23
Picon
Gravatar

Building and working with slate


Hi, I've been trying to install and use slate, and run throug some
problems. I was able to solve some of them but need help to take care
of others. First of all, I tested it in two platforms: Win XP and
Ubuntu 9.04 inside a VirtualBox. I'd like to share the experience
because I think it might be useful for others. I used the lastest
version from git in both cases.

here the path diverges..

for windows.

1 - tried to open src/vm/windows.sln solution with visual studio 2005,
but didn't work because sln is from vs 2008.
    so, went to http://sourceforge.net/projects/vspc/ and converted to
the version I have.
2 - opened the solution and tried to compile (after downloading
http://code.google.com/p/msinttypes/) but failed. There were various
problems:
     vc complained about inlines. Solved that adding this to slate.h

#define SLATE_INLINE inline
#ifdef _MSC_VER
#define snprintf _snprintf
#undef inline
#define inline __inline
#endif

	also complained about some local variables that weren't defined at
top of the scope, so I moved them.
	at last, had link errors for each inline function, the problem was
that in order to link with them they had to be in the .h, so I moved
every SLATE_INLINE to slate.h.

After doing that I was able to compile and start slate. It took me
some time to realize that i had to download the image from google's
project, I think that should be better documented.

Then I tried to use gtk in slate, but failed. To do this, I downloaded
GTK all-in-one bundle from this place: http://www.gtk.org/download-windows.html.
Then configured VS paths: added gtk/include/gtk-2.0, glib-2.0, gtk/lib/
gtk-2.0/include gtk/lib/glib-2.0/include to includes and gtk/lib to
libraries, also had to add gtk/bin to path and the place were I
downloaded msinttypes to includes because gtk needed it. After that I
created three dll projects in VS: gtk-wrapper, gdk-wrapper and glib-
wrapper. Each of them had only it's corresponding .c file found in src/
plugins. Compiled them to three dlls that placed in cslatevm/lib. Here
came the problem I couldn't solve:
 I tried to load gtk with the command specified in README:

	load: 'src/ui/gtk/demo.slate'

It was all good but then complained:

slate[2]> load: 'src/ui/gtk/demo.slate'.
 Loading P'src/ui/gtk/demo.slate'
  Loading P'src/ui/gtk/init.slate'
   Loading P'src/ui/gdk/init.slate'
    Loading P'src/ui/glib/init.slate'
     Loading P'src/lib/wordarray.slate'
     Loading P'src/ui/glib/lib.slate'
Library glib-wrapper was successfully loaded.
Debugging: ConnectionFailed traitsWindow
Backtrace (method @ source):
frame: 0        [defaultHandler] @ src/core/condition.slate:289
frame: 1        [tryHandlers] @ src/core/condition.slate:79
frame: 2        [signal] @ src/core/condition.slate:31
frame: 3        [connectionFailure] @ src/lib/extlib.slate:37
frame: 4        [enable] @ src/lib/extlib.slate:216
frame: 5        [open] @ src/core/external.slate:67
frame: 6        [functionNamed:] @ src/lib/extlib.slate:103
frame: 7        [functionNamed:returning:from: &callFormat:] @ src/lib/
extlib.slate:114
frame: 8        [(arity: 1)] @ src/lib/extlib.slate:194
frame: 9        [do:] @ Nil
frame: 10       [installMethodsForSigs:on: &nameTransformer:
&argumentFormats:] @ src/lib/extlib.slate:190
frame: 11       [enable] @ src/lib/extlib.slate:434
frame: 12       [evaluateIn: &optionals:] @ src/mobius/syntax.slate:
180
frame: 13       [(arity: 1)] @ src/lib/module.slate:212
frame: 14       [applyWith:] @ src/core/method.slate:6
frame: 15       [do:] @ src/core/stream.slate:150
frame: 16       [run] @ src/lib/module.slate:205
frame: 17       [(arity: 0)] @ src/lib/module.slate:188
frame: 18       [handlingCases:] @ src/core/condition.slate:64
frame: 19       [process:] @ src/lib/module.slate:180
frame: 20       [(arity: 1)] @ src/lib/module.slate:253
frame: 21       [applyWith:] @ src/core/method.slate:6
frame: 22       [(arity: 0)] @ src/core/external.slate:282
frame: 23       [sessionDo:] @ src/core/external.slate:275
frame: 24       [(arity: 0)] @ src/lib/module.slate:253
frame: 25       [load: &in: &verbose: &showLoadMessage:] @ src/lib/
module.slate:242
frame: 26       [load: &in: &verbose: &showLoadMessage:] @ src/lib/
module.slate:232
frame: 27       [evaluateIn: &optionals:] @ src/mobius/syntax.slate:
180
frame: 28       [(arity: 1)] @ src/lib/module.slate:212
frame: 29       [applyWith:] @ src/core/method.slate:6
frame: 30       [do:] @ src/core/stream.slate:150
frame: 31       [run] @ src/lib/module.slate:205
frame: 32       [(arity: 0)] @ src/lib/module.slate:188
frame: 33       [handlingCases:] @ src/core/condition.slate:64
frame: 34       [process:] @ src/lib/module.slate:180
frame: 35       [(arity: 1)] @ src/lib/module.slate:253
frame: 36       [applyWith:] @ src/core/method.slate:6
frame: 37       [(arity: 0)] @ src/core/external.slate:282
frame: 38       [sessionDo:] @ src/core/external.slate:275
frame: 39       [(arity: 0)] @ src/lib/module.slate:253
frame: 40       [load: &in: &verbose: &showLoadMessage:] @ src/lib/
module.slate:242
frame: 41       [load: &in: &verbose: &showLoadMessage:] @ src/lib/
module.slate:232
frame: 42       [evaluateIn: &optionals:] @ src/mobius/syntax.slate:
180
frame: 43       [(arity: 1)] @ src/lib/module.slate:212
frame: 44       [applyWith:] @ src/core/method.slate:6
frame: 45       [do:] @ src/core/stream.slate:150
frame: 46       [run] @ src/lib/module.slate:205
frame: 47       [(arity: 0)] @ src/lib/module.slate:188
frame: 48       [handlingCases:] @ src/core/condition.slate:64
frame: 49       [process:] @ src/lib/module.slate:180
frame: 50       [(arity: 1)] @ src/lib/module.slate:253
frame: 51       [applyWith:] @ src/core/method.slate:6
frame: 52       [(arity: 0)] @ src/core/external.slate:282
frame: 53       [sessionDo:] @ src/core/external.slate:275
frame: 54       [(arity: 0)] @ src/lib/module.slate:253
frame: 55       [load: &in: &verbose: &showLoadMessage:] @ src/lib/
module.slate:242
frame: 56       [load: &in: &verbose: &showLoadMessage:] @ src/lib/
module.slate:232
frame: 57       [evaluateIn: &optionals:] @ src/mobius/syntax.slate:
180
frame: 58       [(arity: 1)] @ src/lib/module.slate:212
frame: 59       [applyWith:] @ src/core/method.slate:6
frame: 60       [do:] @ src/core/stream.slate:150
frame: 61       [run] @ src/lib/module.slate:205
frame: 62       [(arity: 0)] @ src/lib/module.slate:188
frame: 63       [handlingCases:] @ src/core/condition.slate:64
frame: 64       [process:] @ src/lib/module.slate:180
frame: 65       [(arity: 1)] @ src/lib/module.slate:253
frame: 66       [applyWith:] @ src/core/method.slate:6
frame: 67       [(arity: 0)] @ src/core/external.slate:282
frame: 68       [sessionDo:] @ src/core/external.slate:275
frame: 69       [(arity: 0)] @ src/lib/module.slate:253
frame: 70       [load: &in: &verbose: &showLoadMessage:] @ src/lib/
module.slate:242
frame: 71       [load: &in: &verbose: &showLoadMessage:] @ src/lib/
module.slate:232
frame: 72       [evaluateIn: &optionals:] @ src/mobius/syntax.slate:
180
frame: 73       [(arity: 1)] @ src/lib/module.slate:212
frame: 74       [applyWith:] @ src/core/method.slate:6
frame: 75       [do:] @ src/core/stream.slate:150
frame: 76       [run] @ src/lib/module.slate:205
frame: 77       [(arity: 0)] @ src/lib/module.slate:188
frame: 78       [handlingCases:] @ src/core/condition.slate:64
frame: 79       [process:] @ src/lib/module.slate:180
frame: 80       [(arity: 1)] @ src/lib/module.slate:253
frame: 81       [applyWith:] @ src/core/method.slate:6
frame: 82       [(arity: 0)] @ src/core/external.slate:282
frame: 83       [sessionDo:] @ src/core/external.slate:275
frame: 84       [(arity: 0)] @ src/lib/module.slate:253
frame: 85       [load: &in: &verbose: &showLoadMessage:] @ src/lib/
module.slate:242
frame: 86       [load: &in: &verbose: &showLoadMessage:] @ src/lib/
module.slate:232
frame: 87       [evaluateIn: &optionals:] @ src/mobius/syntax.slate:
180
frame: 88       [(arity: 0)] @ src/lib/repl.slate:155
frame: 89       [on:do:] @ src/core/condition.slate:43
frame: 90       [(arity: 0)] @ src/lib/repl.slate:147
frame: 91       [handlingCases:] @ src/core/condition.slate:64
frame: 92       [interpretHook:] @ src/lib/repl.slate:42
frame: 93       [(arity: 0)] @ src/lib/repl.slate:139
frame: 94       [enter] @ src/lib/repl.slate:135
frame: 95       [start &resource:] @ src/lib/repl.slate:185
frame: 96       [start] @ src/mobius/prelude.slate:38
frame: 97       [(arity: 0)] @ Nil
The following condition was signaled:
Could not look up symbol 'g_type_name' in DLL 'glib-wrapper'The error
was: No se encontrĂ³ el proceso especificado. (Trad: Couldn't find the
specified process).

So I don't know what to do next, I would appreciate your help.

All this was in order to make it work in Windows XP, now let's start
with Ubuntu. I have to say it was easier here. I had a clean install
of Ubuntu 9.04 set up in a virtual machine.

from console did make. I think it worked seamleasly. tried to open the
image, but ark denied, so used command line

bunzip2 slate.little.32.image.bz2

tried to run slate with that image, forgot the -i and had a lot of
errors. It took me some time to realize I was missing the -i in
command line, maybe a warning would have been fine! Opened the image,
everything fine. Then I tryied gtk.
did cd src/plugins. make. Had to install gtk-dev in ubuntu because it
was needed. Also, libtool was missing and I had to install it. Ran
make again and worked for gtk (despite it failed for something related
to llvm).

Then openened the image and did

	load: 'src/ui/gtk/demo.slate'

It took a while to load everything but worked like a charm. After some
testing I saved the image and quit. Now, when I try to open the image
again, it crashes. Here is the output I got:

$> gdb slate
(gdb) r -i slate8.image

Starting program: /home/javier/st/cslatevm/slate -i slate8.image
[Thread debugging using libthread_db enabled]
Old Memory size: 419430400 bytes
New Memory size: 10485760 bytes
Image size: 15330856 bytes
Defining function 'invokeDebugger' on: 'Condition traits'
[New Thread 0xb7d936c0 (LWP 6892)]

(process:6892): GLib-GObject-CRITICAL **: /build/buildd/glib2.0-2.20.1/
gobject/gtype.c:2458: initialization assertion failed, use
IA__g_type_init() prior to this function

(process:6892): GLib-CRITICAL **: g_once_init_leave: assertion
`initialization_value != 0' failed

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7d936c0 (LWP 6892)]
0x9cbd913f in gtk_text_buffer_get_selection_bound ()
   from /usr/lib/libgtk-x11-2.0.so.0
(gdb) bt
#0  0x9cbd913f in gtk_text_buffer_get_selection_bound ()
   from /usr/lib/libgtk-x11-2.0.so.0
#1  0x0804b878 in applyExternalLibraryPrimitive (oh=0xb7b83008,
    fnHandle=0x9e2197e4, argsFormat=0x9f8b422c, callFormat=0x1,
resultFormat=0x7,
    argsArr=0x9e238248) at external-library.c:358
#2  0x0805ad0b in prim_applyExternal (oh=0xb7b83008, args=0xbfa66888,
arity=6,
    opts=0x0, resultStackPointer=23384) at primitives.c:1326
#3  0x08050179 in send_to_through_arity_with_optionals
(oh=0xb7b83008,
    selector=0x9ecfc458, args=0xbfa66888, dispatchers=0xbfa66888,
arity=6,
    opts=0x0, resultStackPointer=23384) at interpreter.c:370
#4  0x0805102e in interpret (oh=0xb7b83008) at interpreter.c:741
#5  0x0805eeab in main (argc=3, argv=0xbfa66ff4, envp=0xbfa67004) at
vm.c:217
(gdb)

After that I couldn't reuse the image so tried again with a blank one.
Loaded Gtk again, and saved another image. Now this seems to work but
each time I reopen slate it thakes a looooong time to load gtk which
is a big pain.

Well, that's all I could test. Do you think you can help me solve the
problems in Windows and/or Linux?

Thanks.
   Pocho.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "slate-language" group.
To post to this group, send email to slate-language <at> googlegroups.com
To unsubscribe from this group, send email to slate-language+unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/slate-language?hl=en
-~----------~----~----~----~------~----~------~--~---


Gmane