qur / gopy Goto Github PK
View Code? Open in Web Editor NEWIdiomatic Python bindings for Go
Home Page: http://gopy.qur.me
License: BSD 3-Clause "New" or "Revised" License
Idiomatic Python bindings for Go
Home Page: http://gopy.qur.me
License: BSD 3-Clause "New" or "Revised" License
Hey there,
I stumbled upon this project and it seems very interesting to me.
My current favorit language python teams up with my compiled choice golang.
But the last commit is kind of a long time ago (in github terms).
How about the future of this project?
Cheers
Christian
root@lairdnote-Parallels:/home/lairdnote/Go/src/Hello# gccgo -v
Using built-in specs.
COLLECT_GCC=gccgo
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.7/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.7.2-0ubuntu3' --with-bugurl=file:///usr/share/doc/gccgo-4.7/README.Bugs --enable-languages=c,c++,go --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --enable-targets=all --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-0ubuntu3)
http://gopy.qur.me/extensions/examples.html
import simple
simple.example("Hell", {12:True})
simple.so file is create ,
but i use python shell and test.py is have bug ,
root@lairdnote-Parallels:/home/lairdnote/Go/src/Hello# python test.py
Traceback (most recent call last):
File "test.py", line 1, in
import simple
ImportError: /usr/lib/gccgo/libgopy.ext.so: undefined symbol: libgo_math.math..import
I started an SVN checkout of gccgo
on my Mac and after 30 minutes I gave up on waiting. Is there a more sane way of installing? As of right now, I would say the friction is too great to get real use, but this project could be massively useful in speeding up code!
This might be related to Bug 57194.
go version: go version go1.3 linux/amd64
OS: Ubuntu 14.04 AMD 64 / Linux crusher 3.13.0-36-generic #63-Ubuntu SMP Wed Sep 3 21:30:07 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
breuer@crusher:~/Downloads/gopy-0.8.0$ dpkg-buildpackage
dpkg-buildpackage: source package gopy
dpkg-buildpackage: source version 0.8.0-1raring
dpkg-buildpackage: source distribution raring
dpkg-buildpackage: source changed by Julian Phillips <[email protected]>
dpkg-buildpackage: host architecture amd64
dpkg-source --before-build gopy-0.8.0
fakeroot debian/rules clean
dh clean
dh_testdir
dh_auto_clean
make[1]: Entering directory `/home/breuer/Downloads/gopy-0.8.0'
CLEAN
make[1]: Leaving directory `/home/breuer/Downloads/gopy-0.8.0'
dh_clean
dpkg-source -b gopy-0.8.0
dpkg-source: warning: no source format specified in debian/source/format, see dpkg-source(1)
dpkg-source: info: using source format `1.0'
dpkg-source: info: building gopy in gopy_0.8.0-1raring.tar.gz
dpkg-source: info: building gopy in gopy_0.8.0-1raring.dsc
debian/rules build
dh build
dh_testdir
dh_auto_configure
dh_auto_build
make[1]: Entering directory `/home/breuer/Downloads/gopy-0.8.0'
GCCGO types
TYPES types.sym
no debug info in ELF executable errno -1
fatal error: no debug info in ELF executable
runtime stack:
no debug info in ELF executable errno -1
panic during panic
make[1]: *** [types.sym] Error 3
make[1]: Leaving directory `/home/breuer/Downloads/gopy-0.8.0'
dh_auto_build: make -j1 returned exit code 2
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
I made an ebuild here : https://github.com/gbin/gbin-overlay/tree/master/dev-python/gopy
It seems to compile correctly but when I try to run the example from python I have :
gbin@sal ~/projects/testpygo » gopy test.go
gbin@sal ~/projects/testpygo » ipython
Python 2.7.3 (default, Mar 20 2013, 11:58:44)
Type "copyright", "credits" or "license" for more information.
IPython 0.13.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import simple
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-6de4b98437d9> in <module>()
----> 1 import simple
ImportError: /usr/lib/gccgo/libgopy.ext.so: undefined symbol: libgo_runtime.runtime.LockOSThread
If I look at the .so, indeed something is fishy, did I miss something at the link step ?
gbin@sal ~/projects/testpygo » ldd -r /usr/lib/gccgo/libgopy.ext.so
linux-vdso.so.1 (0x00007fff9c3fd000)
libgo.so.0 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/libgo.so.0 (0x00007ffe65fa1000)
libc.so.6 => /lib64/libc.so.6 (0x00007ffe65bf6000)
/lib64/ld-linux-x86-64.so.2 (0x00007ffe68ed0000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ffe659d9000)
libm.so.6 => /lib64/libm.so.6 (0x00007ffe656e3000)
libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/libgcc_s.so.1 (0x00007ffe654cd000)
undefined symbol: cgocallback (/usr/lib/gccgo/libgopy.ext.so)
undefined symbol: go.py..import (/usr/lib/gccgo/libgopy.ext.so)
undefined symbol: libgo_runtime.runtime.LockOSThread (/usr/lib/gccgo/libgopy.ext.so)
undefined symbol: simple_cgocallback (/usr/lib/gccgo/libgopy.ext.so)
undefined symbol: simple_cgocall (/usr/lib/gccgo/libgopy.ext.so)
hey, i'd like to call some code that has a frozenset, but i didn't see any good way to iterate it. is there an example?
Hey there,
playing around with it. I installed it within a docker container (ubuntu:13.10)
$ cat Dockerfile
###### Image providing goPy
FROM ubuntu:13.10
MAINTAINER "Christian Kniep <[email protected]>"
RUN apt-get update
RUN apt-get install -y aptitude vim
RUN aptitude upgrade -y
RUN echo "deb http://gopy.qur.me/ubuntu raring main" >> /etc/apt/sources.list
RUN apt-get update
RUN aptitude -o Aptitude::Cmdline::ignore-trust-violations=true install -y gopy golang
And I got this issue:
root@3c0085b12dec:~# cat simple.go
package simple
import (
"fmt"
"gopy"
)
func example(args *py.Tuple) (py.Object, error) {
fmt.Printf("simple.example: %v\n", args)
py.None.Incref()
return py.None, nil
}
func init() {
methods := []py.Method{
{"example", example, "example function"},
}
_, err := py.InitModule("simple", methods)
if err != nil {
panic(err)
}
}
root@3c0085b12dec:~#
root@3c0085b12dec:~# gopy -v simple.go
build: gccgo [-c -fPIC -o /tmp/gopy_986354972/module.o -I/usr/lib/gccgo -I/usr/local/lib/gccgo -g simple.go]
link: gcc [-fPIC -shared -o simple.so -g /tmp/gopy_986354972/module.c /tmp/gopy_986354972/module.o -L/usr/lib/gccgo -L/usr/local/lib/gccgo -lgo -lgopy -lgopy.ext -lpython2.7 -lpthread -static-libgcc]
root@3c0085b12dec:~# python -c 'import simple'
fatal error: DWARF underflow in .debug_info at 4
Any hint?
Christian
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.