ぱたへね

はてなダイアリーはrustの色分けができないのでこっちに来た

Gauche-tk

驚くべき早さで Gauche-tk ができてました。
https://github.com/shirok/Gauche-tk

早速サンプルを動かしてみましたが、やっぱり環境の違いのためか上手く動きませんでした。OSはWindows7(64bit)、Tcl/Tkのバージョンは、ActiveState ActiveTcl 8.5.10.1.295062 と CygwinのTcl/Tk 8.5.11-1です。

mingw32版

ソース button.scm

;; simple button example
(use tk)
(wish-path "c:/Tcl/bin/wish.exe")
(with-module tk (set! *tk-debug* #t))
(tk-init '())
(tk-button '.b :text "Click me" :command (^[] (print "Yeah!")))
(tk-pack '.b)
(tk-mainloop)

実行結果

c:\home\scm2exe\target_sample\path_scm>gosh -V
Gauche scheme shell, version 0.9.2 [utf-8], i686-pc-mingw32
c:\home\scm2exe\target_sample\path_scm>gosh button.scm
> gauche__tk__do button .b -text "Click me" -command "gauche__tk__callback 1 "
gosh: "error": unbound variable: $

Cygwin版の結果

ソース button_cyg.scm

;; simple button example
(use tk)
(wish-path "/bin/wish")
(with-module tk (set! *tk-debug* #t))
(tk-init '())
(tk-button '.b :text "Click me" :command (^[] (print "Yeah!")))
(tk-pack '.b)
(tk-mainloop)

実行結果

Natsutani@Natsutani-PC ~/scm2exe/target_sample/path_scm
$ gosh -V
Gauche scheme shell, version 0.9.2 [utf-8,pthreads], i686-pc-cygwin
Natsutani@Natsutani-PC ~/scm2exe/target_sample/path_scm
$ gosh button_cyg.scm
      0 [main] gosh 14968 C:\cygwin\usr\local\bin\gosh.exe: *** fatal error - unable to remap \\?\C:\cygwin\usr\local\lib\gauche-0.9\0.9.2\i686-pc-cygwin\util--match.dll to same address as parent: 0x490000 != 0x5B0000
Stack trace:
Frame     Function  Args
0028B148  6102796B  (0028B148, 00000000, 00000000, 00000000)
0028B438  6102796B  (6117EC60, 00008000, 00000000, 61180977)
0028C468  61004F1B  (611A7FAC, 6124A80C, 00490000, 005B0000)
End of stack trace
      0 [main] gosh 11472 fork: child 14968 - died waiting for dll loading, errno 11
gosh: "system-error": fork failed: Resource temporarily unavailable