Hacker News new | past | comments | ask | show | jobs | submit login
Stopify – An experimental, web-based code editor (stopify.org)
96 points by sjrd on Dec 8, 2017 | hide | past | favorite | 48 comments



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?


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

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


There is also a free product that can do it better http://rr-project.org/



I think one of the recent Visual Studio 2017 updates added this. I think they called it'time travel debugging'



In C# and visual studio you can do it. I think C++ also has edit and continue in VS.


how is this different from just setting an earlier breakpoint? what does dragging matter other than us?


You got to change a line and execute the change without having to wait for the function to be called again.


you can do this in pycharm by setting a breakpoint and opening up the debug console and sending a line to the console. i agree it's very useful


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.


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.


Yep. We're fixing that now.


Fixed and added a little FAQ. :)


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".


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


But like 4 times the confusion ;).


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.


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/


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


Funny enough, I had a hard time reading that because the word choice is different from what I'm used to.


FW: FW: FW: FW: You won’t believe this!!


First I read Spotify then I read Shopify.

So...

- Name does not describe what the product does

- Name is easily confused with other brands

- Name sounds more like a SaaS/PaaS product than a widget

Personally I would think of a different name.


By the way, the name describes the product _exactly_. The infrastructure enables stopping functionality in JavaScript programs. It stop-ifies them. Hence Stopify.


Y'all, the primary goal is meant to be a compiler infrastructure, not a user-facing product. The reason we have the demo site set up is to show people that the infrastructure composes with a bunch of existing compilers pretty seamlessly. In a perfect world, Stopification is integrated into the existing compiler back-ends and this site essentially disappears. So stop worrying about the name.


I automatically assumed it had something to do with Spotify. Maybe an adblocker?


I read stupefy.


I read Shopify..


ugh .. Shopify ..that just makes me think of their terrible terrible liquid templates.


Wow I forgot about those. Templating in general sucks, it’s just so hard to create something that makes a program accessible and has safety for user generated content.


Same


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


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


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

I've logged an issue.


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


Not really. Naively doing something like that will kill performance, not to mention that you have to be really careful not to mess up inserting setTimeout calls.

Stopify reifies the runtime stack and occasionally yields to the browser through a setTimeout call. Once the yields back control, it can restore the stack and resume computation.


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


evalNextLine which would call the interpreter.


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


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


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.


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.


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?


It's not time-travel debugging.


Too close to Spotify


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


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.


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




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: