Comments (4)
I have no absolute recommendation, but here are some things to consider:
Is it safe to include scope-capture to our code base ?
- Forgetting a
(sc.api/spy ...)
call somewhere in your code is a fantastic way to get a memory leak, since each recorded scope gets saved in a global atom and won't get garbage-collected. - Of course, this issue might be less problematic if your program is typically short-lived and accumulating garbage can't do much harm.
- Personally, I'm very forgetful, so to guard against this sort of mistake I don't even include the dependency in production.
- You might make a different choice; just be careful, and consider using
sc.api/dispose-all!
to clean up after yourself.
Is there a way to dynamically load scope-capture ?
I guess the situation for scope-capture is the same as for any dependency-free Clojure library:
- Wherever you can get a REPL running, it's theoretically possible to load scope-capture dynamically (proof: you can just eval each source file in dependency order). In practice, depending on your tooling / setup, that might be more or less tedious. I reckon it works out-of-the-box in Cursive. I've never tried though.
- AFAICT, it's almost certainly impossible to do in advanced-compiled ClojureScript.
Does that answer your questions @viebel ?
from scope-capture.
I’ve never used it in production, but in staging yes. As long as it’s on the classpath when the process is started you can just repl in and require it from any namespace.
from scope-capture.
@vvvvalvalval : for completeness, other than a plain' ol mem leak (due to the atom), is there any other significant impact in terms of performance or correctness?
from scope-capture.
is there any other significant impact in terms of performance or correctness?
@vemv for performance, nothing I can think of - the sources of overhead are the effects of saving to the atom and logging.
For correctness, the main risk is that the sc.api/spy
macro does side-effects at macro-expansion. Some compilation toolchains may rely on the assumption that macro-expansion is purely functional, and thus avoid re-doing macro-expansion when you would like it to. That kind of stuff.
from scope-capture.
Related Issues (20)
- Scope-capture doesn't play nice when used in core.async's go-block HOT 4
- Add automated tests for (self-hosted) CLJS
- Spy logging interferes with compiled JS in CLJS HOT 9
- Disable prn of captured values at execution time HOT 4
- Alternate spy with less noisy defaults
- option for only spying downstream of some caller
- CompilerException java.lang.ClassNotFoundException: sc.api.from compiling:(sc/impl.cljc:171:9) HOT 2
- Working with shadow-cljs? HOT 2
- Capturing values in thread first or thread last statements HOT 2
- Cool discovery: you can nest `letsc`! HOT 2
- Request: alias for "most recent ID" HOT 3
- Support for naming code sites
- Error in tutorial HOT 1
- Capture scope only on exception HOT 3
- Non intrusive support for naming code sites: multi methods
- Shortcut to use the `last-ep-id` in `letsc`
- doucmnet possibility to inject into `core.ns` ?
- Not getting local-bindings as expected.
- How should i get the execution point and code site without using logs?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scope-capture.