
Stopify – An experimental, web-based code editor - sjrd
http://www.stopify.org/
======
nomel
The VB6 IDE, in the 90's, had a great feature where you could arbitrarily drag
the execution point around. It was incredibly useful for basically zero
iteration time for development. Add a breakpoint, step over your code, and if
something went wrong, drag the execution point back a few lines, fix it, and
try again.

This seems like a holy grail for IDEs. Why was this feature lost in time, or
have I been using the wrong IDEs?

~~~
nly
This is called 'reversible debugging'. It's not lost. GDB can do this[0] and
there are commercial products on the market that can do it better[1]

[0]
[https://www.gnu.org/software/gdb/news/reversible.html](https://www.gnu.org/software/gdb/news/reversible.html)

[1] [https://undo.io/products/undodb/](https://undo.io/products/undodb/)

~~~
ahartmetz
There is also a free product that can do it better [http://rr-
project.org/](http://rr-project.org/)

------
jpolitz
It's worth noting that Stopify itself isn't an editor or IDE as the title
suggests.

Stopify is a JavaScript -> JavaScript compiler, implemented as a Babel
transform, that enables pausing and restarting control operators for
JavaScript programs.

A lot of the comments note the rich history of systems for debugging and
execution control. Stopify's goal is to enable those kinds of systems,
efficiently, _while constrained by the browser 's execution model_.

~~~
throwaway2016a
WOW. I was not interested at all in this the way that the title implied but
now that you describe what it actually does, this does indeed look useful.

The first line of the description should probably be scrapped. The interesting
bit about this is not at all the fact there is an editor. Maybe it should be
mentioned as a footnote but not as the lead-in.

~~~
skrishnamurthi
Yep. We're fixing that now.

~~~
enum
Fixed and added a little FAQ. :)

------
johnhenry
Very cool project, though I fear that the awesomeness of the project may
become lost due to people confusing the title with "Spotify" or "Shopify".

~~~
skrishnamurthi
Sure, but the name is half the fun. (-:

~~~
johnhenry
But like 4 times the confusion ;).

------
yeukhon
I read Spotify.

I am not sure if this is a good thing at all, sorry, just don't think it's a
good thing.

~~~
justboxing
I read Shopify.

> it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny
> iprmoetnt tihng is taht the frist and lsat ltteer be at the rghit pclae...
> it doesn't matter in what order the letters in a word are, the only
> important thing is that the first and last letter be at the right place

Source: [https://www.mrc-
cbu.cam.ac.uk/people/matt.davis/cmabridge/](https://www.mrc-
cbu.cam.ac.uk/people/matt.davis/cmabridge/)

~~~
corobo
Yeah I did too. I thought it was going to be a paypalsucks about Shopify

------
djsumdog
It makes me a little happy inside that Scala is the language it demos first.

------
saagarjha
The C++ example overflows int on most platforms. You may want to change your
example!

~~~
sbaxter
Thanks for pointing that out! (I'm one of the developers)

I've logged an issue.

------
goldenkey
So it just splits the code up into setImmediate/setTimeout calls?

~~~
skrishnamurthi
Just? What do you think the callbacks are that you supply to those calls?

~~~
goldenkey
evalNextLine which would call the interpreter.

~~~
enum
Stopify is a JS-to-JS compiler. It performs a lot better than a JS-in-JS
interpreter could.

------
juancampa
This is very interesting. How much slow is the execution compared to regular
javascript?

~~~
enum
It depends on the source language. We have done extensive benchmarking. For
example, on Python the median slowdown is 1.4x. PyJS doesn't use all of
JavaScript's features and we can exploit that to improve performance. Our
worst slowdown is when the source language is JavaScript itself because we
can't make simplifying assumptions. (Median slowdown is 20x.)

These are slowdowns on a cheap ChromeBook. We also have results from the four
major browsers on a desktop machine.

~~~
skrishnamurthi
But note that the Stopify portion is completely optional and composes onto the
end of an existing JavaScript compiler. So you can offer a faster-but-no-
stopification mode versus a slower-but-with-stopification mode. While modes
can be annoying, the point is that you don't have to be forced to pay this
price due to the Stopify infrastructure. In contrast, a language like Pyret
has the stopification built into its back-end, so you always pay the price
(for now), whether you want it or not.

------
lwansbrough
I believe this is called "time travel debugging" in the Microsoft world. I use
it all the time with C#/TS in VS.

Since the name sucks, maybe a renaming based off the concept of time travel is
a better choice?

~~~
skrishnamurthi
It's not time-travel debugging.

------
simooooo
Too close to Spotify

------
true_religion
I am confused. It says this is a "JavaScript-to-JavaScript" compiler, but none
of the selectable languages are Javascript?

~~~
enum
All the selectable languages compile to JavaScript. Stopify takes that
JavaScript output and makes programs stoppable, steppable, etc. Therefore,
each demo is a composition of two compilers: (1) a third-party X-to-JS
compiler and (2) Stopify, which compiles JS to stoppable JS.

------
gf263
It was hack day at shopify today, was thinking this was a project from that

