3 ms·
Eager Evaluation is pretty cool! It will help me discover APIs a lot easier. I have two questions about this: 1) what happens when evaluating is going to take
by msoad 8y ago
Eager Evaluation is pretty cool! It will help me discover APIs a lot easier. I have two questions about this:
1) what happens when evaluating is going to take a lot longer that usual?
2) why the arguments list hint is using Flow syntax for optional (question mark before argument name)?
- kiliancs 8y agohttps://developers.google.com/web/updates/2018/05/devtools#eagerevaluation https://developers.google.com/web/updates/2018/05/devtools#e...: > DevTools does not eager evaluate if the expression causes side effects.
- euyyn 8y agoLong-running doesn't imply with side effects.
- inglor 8y ago> 1) what happens when evaluating is going to take a lot longer that usual? Just checked: It evaluates it in another thread - and around 1e6 actions it stops evaluating. There is no noticeable slowdown in the devtools.
- gcommer 8y ago> 1) what happens when evaluating is going to take a lot longer that usual? There's a 500ms timeout (but only when it thinks there may be side effects? https://github.com/ChromeDevTools/devtools-frontend/blob/03fbafe6e82d43a79a5b0e23d52329638491ae3d/front_end/object_ui/JavaScriptAutocomplete.js#L55 https://github.com/ChromeDevTools/devtools-frontend/blob/03f... )
- lomnakkus 8y agoAside: It's kind of amusing that "side effects" seems to have become a synonym for "effects". Usually "effects" are things you want to happen, whereas "side effects" are things you don't necessarily want to happen (although they may ultimately prove beneficial.) If one's type system actually models "effects" as first-class entites -- e.g via monads or capabilities -- then suddenly the distinction becomes much clearer. In typical imperative languages like JS, C or C++ it's clear as mud. Of course, given that the browser'js JS engine is a VM unto itself it can just speculatively run everything until there's an "effect" and then 'roll back' (or remove the CoW data that was produced) so as to make it unobservable. This is ingenious practical engineering.