Fork me on GitHub
#clojure
<
2016-04-25
>
thug.nasty01:04:08

@argentum47: any particular reason why you decided with something other than jetty?

plexus07:04:15

Is there any way to have some kind of hook called whenever a new var is defined?

hiredman07:04:29

slamhound wasn't really written to be run over and over again in the same jvm

hiredman07:04:50

what you want to do is change the cache to be per run of slamhound, instead of global per jvm

hiredman07:04:15

the simplest way to do that is maybe making it dynamic and using binding

plexus07:04:05

the problem is that rescanning all namespaces can take really long on big projects

hiredman07:04:04

if you mutate namespaces your caches are going to be invalid

plexus07:04:29

Yes. Yes, they will be.

hiredman07:04:37

there is also a memoized function, which doesn't expose the cache

thiagofm13:04:44

Anyone know a way to get the exact context some line in the code happens to be(all vars, loaded modules etc) and wrap it in something which can be loaded somewhere else?

thiagofm13:04:39

Like debugging. Add a breakpoint there, get all the possible context, save it to a text file, load it somewhere else and debug it. Is it possible in clojure? If not, why?

sveri13:04:49

@thiagofm: Sounds like a great idea. I just wonder: 1. is that possible in a different language? 2. How would you handle to state stored in the browser client or in the database, for instance? I don't see a way to catch that, Not even starting to talk about some distributed setup.

thiagofm13:04:01

@sveri just state from the code itself, what the JVM has loaded, for example. Of course for some things it would break(like open connections with the db)

thiagofm13:04:50

@sveri: not that I know of. Ruby has "binding", but sadly there isn't too much effort to make everything marshallable, and you can't marshal binding.

thiagofm13:04:27

Perhaps it wouldn't work with some garbage collectors too. What I really wanted was a docker-like image of the current code being run.

thiagofm13:04:31

@sveri I have an idea, but to do it, I need a language that would have this feature. Maybe it could be a concept misconception by my part, but I think it should be possible to write a language that can do this

sveri13:04:31

I agree, everything is possible simple_smile Basically, it boils down to taking a memory dump of your process and somehow rebuild that.

sveri13:04:41

Why would you even want to containerize a breakpoint?

thiagofm13:04:08

@sveri: I have an idea of something that in my view would severely reduce cognitive load in programming, this feature would be an enabler. I'm still not sure about everything about it, but would be good to know a programming language that would let me have this starting point.

thiagofm13:04:49

@sveri, yes, exactly. You get what I want.

ghosss13:04:50

@thiagofm: This sounds like (though I have no experience with it to confirm) something Smalltalk does

sveri13:04:27

@thiagofm: I think you need to retain type information at runtime then, all at all it sounds hard to do, but yea, if its an enabler, and even if not. Trying out things is always cool simple_smile

ghosss13:04:42

Yeah, that's what I'm thinking of. See also this section of the Smalltalk article on Wikipedia: https://en.wikipedia.org/wiki/Smalltalk#Image-based_persistence > Smalltalk images are similar to (restartable) core dumps and can provide the same functionality as core dumps, such as delayed or remote debugging with full access to the program state at the time of error.

plexus13:04:20

I've heard stories though of old Smalltalkers. These images would evolve over time, and would be impossible to recreate, so you had this big mutable environment that you had to drag along all the time and hope you didn't mess up.

plexus13:04:56

basically the equivalent of "alright, your laptop is going in production"

turbopape13:04:40

Scheme’s continuations anybody ?

thiagofm13:04:54

@plexus: cool! At least the "it works on my machine" would be always a valid argument.

turbopape13:04:12

maybe you can achieve what you want with call/cc @plexus ?

thiagofm14:04:27

@turbopape: does scheme have an equivalent? I would rather try to do something in a functional programming language regarding that

turbopape14:04:00

try to look if call/cc can provide for what you are looking to do @thiagofm

turbopape14:04:04

These are first order citizens in every decent scheme

thiagofm14:04:40

@turbopape: that is cool! What about threading and connections(like db conns)?

turbopape14:04:16

I assume chicken, guile, racket etc… might have relevant libraries for this

turbopape14:04:41

last week guile had a new libary to do asynchronous computing, for instance...

turbopape14:04:11

And even , Many of these schemes have FFIs to let you reuse C (or evene Java) Libraries

turbopape14:04:39

but kawa (the JVM scheme) offers limited continuations...

thiagofm14:04:11

Looks like a good excuse to play more with racket

turbopape14:04:24

yes you definitely should...

thiagofm14:04:27

Racket has cc, right?

turbopape14:04:33

You know, I fell in love with schemes myself, sometimes I wish to make the jump and to do it full time

turbopape14:04:55

They didn’t enjoy as much hype as clojure did, and that’s too bad...

thiagofm14:04:37

So I have to specify the cc manually? Isn't there a way to have this all around the code?

turbopape14:04:35

I don’t know… But I tink you can wrap whatever you want in some form of call-with-XYZ

thiagofm14:04:35

Can I send you a private message so I can get a bit more specific about what I want to achieve without keeping the channel full of 1-1? simple_smile

seancorfield17:04:15

Any Component users who wouldn’t mind me picking their brains in a DM? I have a couple of specific questions — I’d hoped to catch @stuartsierra online at some point for a "definitive" answer but I figured polling other existing users would be worthwhile too...

sveri17:04:20

@seancorfield: What about #C0GQAAKA9 channel?

seancorfield17:04:40

I didn’t know there was one @sveri — thank you!

moxaj18:04:34

to anyone with core.async experience: can I trust the results of https://gist.github.com/moxaj/6b5830e04f141c57e4438722c2fe03ef? Will the measured overhead remain constant if executed from multiple go blocks?

leov21:04:34

um. noob question - why do we have clojure libs signed? lein deploy clojars forced me to sign it, and I'm not sure why - it is already protected by https and my login/password, right? what stops a person who can give you wrong .jar to sign it with his own key?

stuartsierra21:04:46

@moxaj: Channels use locking internally, so the time taken for channel operations will vary depending on how much contention there is for the channel.

andy.fingerhut23:04:14

@leov: Maybe nothing (not sure -- haven't checked). But if you found a problem with something they released later, you should easily be able to tell the one signed by @badguy vs. the one signed by @goodguys