debugger for the browser-embedded python

242 views
Skip to first unread message

Lena Vasilyeva

unread,
Oct 8, 2011, 1:05:56 AM10/8/11
to Skulpt
Hi, I am a student at FEFU, Russia. And as a part of my course work
(you can see its code on https://github.com/elvslv/CourseWork) I am
working on the debugger for the browser-embedded python. I have chosen
Skulpt as embedded python compiler.
The main problem for me -- I don't know how I can set breakpoints. I
think I should find a way that allows me to stop the execution of
generated code, wait the events from the user interface and continue
the execution.

I suppose, using multithreading technology is good way for resolving
this problem.
For example, web workers. But as I see in skulpt sources, generated
code is executed using eval(). And I didn't find a way, how to use
workers in eval(). Do you know how I can do it? May be generated code
should be executed in different way? Unfortunately I haven't any idea
how realize it.

The second idea -- each time get the next command from skulpt and
execute commands one-by-one. I suppose it's more difficult than first
way, but I'm sure that it's possible to realize. Have you any idea how
I can get from skulpt the next executing command?

Lena Vasilyeva

unread,
Oct 10, 2011, 12:29:20 AM10/10/11
to Skulpt
and the secon question:
is there a way to use in skulpt source code javascript 1.7 commands
(yield, for example)?

Scott Graham

unread,
Oct 12, 2011, 12:40:43 PM10/12/11
to sku...@googlegroups.com
There's a similar problem in implementing generators, as generators need to "resumed" sort of like you're talking about doing. Perhaps looking at how that is done would be useful.

I think though, you might have better luck in looking at doing it as an extension on the browser side. For example, what do Firebug, WebKit Inspector, etc. do? I'm assuming they have some hooks into the javascript interpreter that would let you pause/resume execution. Maybe you could start there and adapt that to work with Python source instead of JS?

As for yield, I don't see any reason you couldn't modify the compiler to insert those in certain places (i.e. at the end of each statement or something).

Lena Vasilyeva

unread,
Oct 12, 2011, 11:20:16 PM10/12/11
to Skulpt
> As for yield, I don't see any reason you couldn't modify the compiler to
> insert those in certain places (i.e. at the end of each statement or
> something).
>
I tried to do it, but skulpt compiler fails with error -- "unknown
command". If I am right, skulpt js source code is interpreted using
closure compiler, and I suppose it doesn't support javascript 1.7.

manueld...@gmail.com

unread,
Aug 21, 2013, 12:20:52 AM8/21/13
to sku...@googlegroups.com
I have the same problem, could you solve it?

David Holmes

unread,
Aug 21, 2013, 12:30:28 AM8/21/13
to sku...@googlegroups.com
That doesn't sound right! ;)

The action of the Google Closure COMPILER is to run a bunch of sanity checks on the JavaScript source code and can optionally produce a minified version. Once that is done, the resulting code runs on whatever JavaScript engine you choose, usually in a Web Browser.


--
 
---
You received this message because you are subscribed to the Google Groups "Skulpt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skulpt+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Stuart Axon

unread,
Nov 21, 2013, 10:17:31 AM11/21/13
to sku...@googlegroups.com
Surely generating a source map would be the solution to this ?

Reply all
Reply to author
Forward
0 new messages