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
possible to get rid of longjmp and setjmp?
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
  6 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
 
illume  
View profile  
 More options Feb 24 2009, 5:03 am
From: illume <ren...@gmail.com>
Date: Tue, 24 Feb 2009 02:03:51 -0800 (PST)
Local: Tues, Feb 24 2009 5:03 am
Subject: possible to get rid of longjmp and setjmp?
hi,

setjmp and longjmp cause super sad panda misery for me.

They make it hard to use threads with tinypy, and also cause troubles
with cpython ctypes... and I can imagine, it'd make it harder to embed
tinypy in some systems too.

They are currently used for exception handling, but maybe we can do
exception handling a different way?

Maybe we could take some inspiration from python exceptions?
    http://docs.python.org/c-api/exceptions.html

cheers,


 
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.
Harry Roberts  
View profile  
 More options Feb 24 2009, 9:15 am
From: Harry Roberts <harry.robe...@midnight-labs.org>
Date: Tue, 24 Feb 2009 14:15:47 +0000
Local: Tues, Feb 24 2009 9:15 am
Subject: Re: [tinypy] possible to get rid of longjmp and setjmp?
Aww, nobody wants a sad panda.

Anyway, yes it's possible to remove setjmp/longjmp stuff as long as
the status of `tp->ex` is checked after each tp_call (or anything else
that could invoke an exception) and then manually call tp_handle.

This could be done at the end of tp_step I suppose, and you'd have to
modify _tp_run to exit gracefully...

tp_handle could be yanked out too, allowing anybody to write their on handler?

Regards,
 - Harry Roberts

2009/2/24 illume <ren...@gmail.com>:


 
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.
illume  
View profile  
 More options Feb 26 2009, 6:50 pm
From: illume <ren...@gmail.com>
Date: Thu, 26 Feb 2009 15:50:42 -0800 (PST)
Local: Thurs, Feb 26 2009 6:50 pm
Subject: Re: possible to get rid of longjmp and setjmp?
Cool.

We could maybe have a little wrapper function/macro...

tp_chk(tp_call());

Which would check the error conditions, call tp_handle and return from
the current function if there was a problem.

There's 71 tp_raise calls in tinypy that I could find.

Is that the least intrusive way to do it?

On Feb 25, 1:15 am, Harry Roberts <harry.robe...@midnight-labs.org>
wrote:


 
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.
Donny Viszneki  
View profile  
 More options Mar 24 2009, 9:40 am
From: Donny Viszneki <donny.viszn...@gmail.com>
Date: Tue, 24 Mar 2009 06:40:39 -0700 (PDT)
Local: Tues, Mar 24 2009 9:40 am
Subject: Re: possible to get rid of longjmp and setjmp?
On Feb 24, 6:03 am, illume <ren...@gmail.com> wrote:

> setjmp and longjmp cause super sad panda misery for me.

Hi everyone, I'm new to tinypy, just heard of it on the SWIG mailing
list, and it sounds completely awesome! (I have always been enamored
with the Lua VM, but I hate the Lua language, love Python, and have
always wanted the sandboxing features I have read tinypy has!

Being a newb, I am inclined to ask this: I read that tinypy is
stackless -- so why does would it need to use setjmp/longjmp for
*anything*?


 
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.
Donny Viszneki  
View profile  
 More options Mar 24 2009, 10:49 am
From: Donny Viszneki <donny.viszn...@gmail.com>
Date: Tue, 24 Mar 2009 07:49:48 -0700 (PDT)
Local: Tues, Mar 24 2009 10:49 am
Subject: Re: possible to get rid of longjmp and setjmp?
Looking more closely, it looks like tinypy is *not* stackless, it just
has a separate C stack! What gives! You can't call this stackless!

On Mar 24, 9:40 am, Donny Viszneki <donny.viszn...@gmail.com> wrote:


 
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.
Donny Viszneki  
View profile  
 More options Mar 24 2009, 11:00 am
From: Donny Viszneki <donny.viszn...@gmail.com>
Date: Tue, 24 Mar 2009 08:00:53 -0700 (PDT)
Local: Tues, Mar 24 2009 11:00 am
Subject: Re: possible to get rid of longjmp and setjmp?
On Mar 24, 10:49 am, Donny Viszneki <donny.viszn...@gmail.com> wrote:

> Looking more closely, it looks like tinypy is *not* stackless, it just
> has a separate C stack! What gives! You can't call this stackless!

What am I thinking? Please disregard...

 
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 »