Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Newbie questions
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
James King  
View profile  
 More options Mar 5 2012, 3:33 pm
From: James King <prometheus.0...@gmail.com>
Date: Mon, 5 Mar 2012 12:33:58 -0800 (PST)
Local: Mon, Mar 5 2012 3:33 pm
Subject: Newbie questions
Hi,

I've been watching the Shedskin project for a while and decided to
give it a whirl last night. It's pretty cool, but I can't seem to
follow the tutorial on calling external C/C++ functions. As I
understand, I would have to first write a template for my 'stuff' (C/C+
+) module, and then fill in the blanks after shedskin generates the
cpp file?

What about in a situation where I already have C/C++ code? Or I want
to call an existing C/C++ library and use it within Shedskin?

In particular, I was wondering how one might write (now, or maybe in
future Shedskin releases..) Python code that could run as a cpython
interpreted script (and call C/C++ code via ctypes for example) and
also have that code work under shedskin when it gets compiled to C++.

Also, as a separate question -- is there a plan to ever have [some]
support for eval or exec?

Thanks for your help!
-James


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Dufour  
View profile  
 More options Mar 8 2012, 6:00 pm
From: Mark Dufour <mark.duf...@gmail.com>
Date: Fri, 9 Mar 2012 00:00:47 +0100
Local: Thurs, Mar 8 2012 6:00 pm
Subject: Re: Newbie questions
hi james,

my apologies for the delayed reply.

> I've been watching the Shedskin project for a while and decided to
> give it a whirl last night. It's pretty cool, but I can't seem to
> follow the tutorial on calling external C/C++ functions. As I
> understand, I would have to first write a template for my 'stuff' (C/C+
> +) module, and then fill in the blanks after shedskin generates the
> cpp file?

yes. to be sure, I just followed the steps outlined in the
documentation, and this still seems to work. do these steps work for
you, or what kind of problem do you run into..?

> What about in a situation where I already have C/C++ code? Or I want
> to call an existing C/C++ library and use it within Shedskin?

I'm afraid this currently requires you to write a manual "bridge" in
lib/, similar as to what happens in the 're' module, for example:
lib/re.py provides just enough python code to perform type inference,
and lib/re.?pp manually calls into libpcre.

> In particular, I was wondering how one might write (now, or maybe in
> future Shedskin releases..) Python code that could run as a cpython
> interpreted script (and call C/C++ code via ctypes for example) and
> also have that code work under shedskin when it gets compiled to C++.

I have no experience with ctypes, so I can't say if it's possible to
statically determine all or most types for a program that uses it..
but if this is possible, I guess shedskin should be able to support it
(to some degree perhaps).

> Also, as a separate question -- is there a plan to ever have [some]
> support for eval or exec?

perhaps seriously restricted versions of these, but not the real
thing, since it's fundamentally impossible to determine statically
what happens when you execute some arbitrary string..

thanks for your questions!
mark.
--
http://www.youtube.com/watch?v=E6LsfnBmdnk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pʀoмᴇтнᴇυs 0x01  
View profile  
 More options Mar 8 2012, 6:30 pm
From: Pʀoмᴇтнᴇυs 0x01 <prometheus.0...@gmail.com>
Date: Thu, 8 Mar 2012 16:30:59 -0700
Local: Thurs, Mar 8 2012 6:30 pm
Subject: Re: Newbie questions

Hi Mark, thanks for getting back to me!

I'm still experimenting with using python with other languages, so I didn't
get a chance to test out the example for C/C++ code yet, but I guess what I
would want to do later would be to write a bridge between a C/C++ library
and shedskin generated code. The potential for a restricted version of
eval/exec is also great to hear as well!

I wish I could contribute in some way, but I'm still in the middle of my
studies and I'm not anywhere near the level of expertise needed to help on
this kind of project. I appreciate your work though, and I think it's great
stuff!

-James


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »