freenode/#lisp - IRC Chatlog
Search
14:26:21
jeosol_
anyone following AWS summit in NY. It will be nice to see how CL plays into most of these. As a single developer, I am trying to see how I get my apps to scale if I get to that step
14:31:58
jeosol_
jmercouris: thanks for your input about running my remote jobs. I saw it but could not respond back. My use case is a bit crazy, something between running in slime and running jobs on LINUX command line after launching SBCL
14:33:22
jeosol_
So what I do normally, I have a monitor on one side with code, and some linux terminals. Since I am testing different configs, I usually create a new defun, and just run it on the a linux terminal.
14:37:14
jeosol_
JuanDuagherty: Sorry I didn't make that clear enough, but yes, AWS -> Amazon Web Services
14:38:10
JuanDaugherty
most 'apps' don't even have parallelization opportunities other than serving many users and that's highly routinized by such places and various pkgs now
14:40:48
JuanDaugherty
they do have some offerings in those categories, i'd be surprised if they use lisp though
14:41:05
jeosol_
I have had interests in Gabor Melis AI/ML library and the CLML library, and wanted to pick these up. Latter still have issues with license. For Gabor's code, I made small changes to work in a recent SBCL license,
14:41:37
jeosol_
I trained the model on my linux box, it was taking over two days to train and I killed the job. I think Gabor said he used GPU machines
14:42:14
jeosol_
Yes, Juan, they have several offerings. I think it is mostly C++, Python and Java based on the low-level frameworks
14:42:46
jeosol_
JuanDuagherty: Yes, that is the plan eventually, take up the code there and if I can things to improve
15:01:40
jeosol_
JuanD ...: I didn't get your lparallel comment, it was probably from a different conversation
15:13:51
jeosol_
I will like to discuss with folks running lisp related applications on the web. Even when using other language frameworks around the core engine in lisp.
15:21:03
jeosol_
The intent was to connect and not discuss that here. I do understand the focus of this forum.
15:23:04
JuanDaugherty
based on what I've looked at since we started talking, as far as common lisp is concerned lparallel still seems the default choice, imo anyway
15:24:09
jeosol_
Like I said, I am just looking for users with similar issues as I am facing so we can share ideas. Intent was not to discuss that here ..
15:39:00
beach
Here is an idea: When I compile SICL code to HIR on SBCL, the functions created would be subclasses of STANDARD-FUNCALLABLE-OBJECT. I would have a slot in that subclass that contains a "code object".
15:39:07
beach
The code object would have information about mappings from source locations to values of the "program counter" in the form of a place in the HIR code. It would also have tables that map HIR locations to other HIR locations for various debugger stepping functions.
15:39:19
beach
At strategic points in the HIR code, I generate code to interrogate a hash table to determine whether the current thread runs under the control of the debugger. If so, it further interrogates to determine whether it is at a breakpoint.
15:39:20
beach
If so, it waits on a semaphore that is associated with the thread. The debugger uses the code object to find source location for the breakpoint. The debugger can set more breakpoints, and it then signals on the semaphore to make the application thread continue its execution.
15:46:20
TMA
beach: ordinary debuggers use hardware breakpoints (interrupt when program counter is equal to this value) or just modify the code to "interrupt now"; I think you might achieve the one-thread debuggee, other thread runs the same code with duplicating the debugged code with breakpoints (so as the HW not to triger and to have modifiable copy)
15:47:35
TMA
beach: the only caveat is that (funcall (symbol-function XXX) ...) equivalent machinery needs to use the debugee code if one is available
15:48:12
beach
TMA: Not sure I follow. But I can't use hardware breakpoints here, because I don't want to dig deep into SBCL to find out low-level details.
15:49:07
jeosol_
jmercouris: thanks for the info. It seems my recent issues are out of focus for this forum. I'll need to follow up later.
15:49:56
beach
TMA: I also don't want to modify the code, even though it might be possible to not break in some situations.
15:51:38
TMA
beach: I see. With those two additional conditions other debuggers are not subjected to, you do not have much options except to instrument the code heavily as per your design.
15:52:22
beach
Yes, that decision was already made. This suggestion was about actually running and debugging SICL code inside SBCL.
15:54:58
beach
TMA: By instrumenting the code this way, in the final system I can trivially debug system code like SYMBOL-VALUE without having the system die on me. And I can debug the debugger.
15:56:43
beach
Hardware breakpoints may work in the final system. But I need to figure out how to avoid stopping when the thread is not debugged.
16:24:57
beach
What's the name of that library that provides a uniform way of examining backtraces across implementation?
16:27:49
Xach
on the internet, it can be difficult to distinguish ironic stupidity from legitimate stupidity
16:28:30
beach
What I would need for my suggested debugging interface is to get to the function object that is executing in a particular stack frame.
18:12:21
pfdietz2
I read this paper on mutation testing at Google. I was surprised to see one of the 7 languages involved was Common Lisp. https://ai.google/research/pubs/pub46584
22:26:09
whartung
I dunno if he’s hacking anything right now, but he apparently drifted over to Python a long time ago.
23:45:14
drduck
Can anyone speak on if there are any differences in the hot reload capabilities SLIME provides lisp compared to that of which an IDE provides java?
23:55:01
whartung
I don’t know exactly what slime does, but we know what CL can do. Basically the REPL, “LOAD”, and “COMPILE”. All of those impact the environment in subtle, different ways (which I can’t detail, only knowing that there’s differences.)
23:55:53
whartung
and the symbol table is simply one aspect of the global environment, but an important one.
23:56:19
whartung
the SYMBOLS remain (unless they’re specifically unintern’ed), but what they reference changes.
23:58:15
whartung
no, since (normally), Lisp continues do dereference stuff through symbols (when they have global scope), then you have dynamic changes to a running system. This can clearly be adjusted trhough efficiency hints and stuff like that, but at the high level, if you have (defun x () (print “hello world”)), and something calls (x), if you later do (defun x () (print “goodbye world”)), that existing reference x will now say “goodbye” instead of “hello
23:59:22
whartung
So, that’s what SLIME does, is it “simply” updates the global environment, and then the chips fall where they may.
0:00:04
whartung
I recall, long ago, with Franz lisp, running multi-threaded, having a routine that was just running (x) in a loop, and seeing it go from “hello” to “goodbye” when I re-defun’d x. “Hazah!”
0:00:25
whartung
(And here we splash in more disclaimers abou thte global environment and threading and yada yada)
0:01:13
whartung
But we also know, that this is more of the first class concept in the system and the language. It’s “supposed” to do this. Even to the point the CLOS has a protocol for changing class instances in flight.
0:01:51
whartung
when you add slot new-slot to an CLOS class, you can write code to properly update that for existing instances of that class. Pretty snazzy.
0:02:28
whartung
You first have to appreciate that with Java, we like to think all about classes, and think clases are king and such.
0:04:59
whartung
If you try to, say, reload a JSP in a web container, that’s a diffrent problem. That creates a new class from the JSP, and swaps out the old one that’s mapped by the URL of the JSP. So, when you hit test.jsp, it just loads the new class, not the old one.
0:06:04
whartung
That’s much more of a hack. It why the reloads aren’t always successful. It’s one thing to reload the class of, say, a web controller. Something that has, you know, one instance. Big deal.
0:06:33
whartung
It’s another to reload the class of, say, a JPA Entity, like Employee, that you happen to have 10,000 instances cached.
0:08:25
drduck
So full feature dynamic reloading in lisp is by design and it's a hack -- also sometimes only partially works -- in java?
0:08:40
whartung
Java can’t “update” instances. it can’t add slots to old classes. And, depending on how the class was redefined, your cached objects may well no longer be of the “same class”. If the new class has a different class loader, then when “new code” tries to cast “new Employee” from a instance of “old employee” that’s in the cache (and Java ALWAYS casts under the hood), it’ll fail. “CLass Cast Exception”, because Employee is no lon
0:09:02
whartung
It’s much more of a first class concept (with all the warts and caveats) in Lisp than it is in Java.
0:09:08
drduck
I wish I could comprehend a little better what that actually means in a freshman-esque case study.
0:09:32
whartung
It means that redefining dynamic elements in a runtime system is not always simple.
0:10:19
whartung
Lisp, out of the box, is dynamic at the price of performance. Lisp can be made “faster” through declarations that limit the flexibily.
0:10:48
whartung
For example, the CL package is specifically defined by the standard to really not have the dynamicity of other Lisp code.
0:11:13
whartung
Consider the “+” function, nobody on the planet wants to invoke a function call for +. It’s just crazy.
0:11:42
whartung
so, (+ 1 1) isn’t really a function call when it’s been compiled. Redefining “+” isn’t going to work like redefining X would, right?
0:12:02
whartung
but that’s why the CL package is specifically exempted, so the compiler can do reasonable stuff.
0:13:01
whartung
Runtime systems make a lot of assumptions, Java assumes that’s its really in a pretty static environment. The CLassLoader is the barrier that helps boundary the dynamic behavior.
0:13:44
whartung
when you load a web app, Tomcat will create a new ClassLoader, and THAT loads in your web app and it’s classes and stuff.
0:14:18
whartung
When you undeploy the webapp, the classloader gets destroyed, and that’s the link in the chain that keeps your app in memory. With that gone, the GC marches through and kills everything
0:15:06
whartung
but out of the box, Java doesn’t really like the underlying structure of its classes to change. The ClassLoader give Java a lot of dynamic behavior.
0:15:25
whartung
But changing class structure in flight is not one of them. Rather, they want you to toss away the old, and brin gin the new
0:15:42
whartung
but there goes not just your class, but the 10,000 cached Employee instances as well.
0:16:34
drduck
what happenes to the 10,000 cached Employee instances in common lisp in this scenario?
0:16:49
whartung
but that’s also because most of the use cases are folks updating application logic, changing a web controller, or some other “mostly” stateless bit of code.
0:19:26
whartung
you can see that when the structure was changed, the NEW print routine for q was unhappy
0:24:13
whartung
so, here, we see that CLOS is actually telling us that it’s not updating the instances in this case
0:24:36
whartung
but notice the different message when we try to access ‘d between when we redefined the classes
0:25:05
whartung
I’d have to dig a bit to find an example that uses the clos redefinition protocol — see if that works
0:30:22
whartung
now, for the CLOS implementaion in CLISP, in theory the structure is supposed to updated when the class is redefined, apparently by default CLISP doesn’t support that.
0:30:45
whartung
but the fundamental point is that the two environments live with two different base assumptions.
0:31:18
whartung
Java is a static world, and while it can easily handle loading new classes, it’s not really set up to allow them to change, especially structurally.
0:31:48
whartung
when an IDE reloads classes, it’s doing a magic trick that may well not always work. It sometimes works.
0:32:41
Bike
the semantics are that when you redefine a class, instances of that class are updated (i.e. turned into instances of the new class) some point prior to you accessing one of their slots. and the update process is a generic function you can customize.
0:32:41
whartung
Personally, I don’t use it in Java. I don’t trust it, and I’d rather have things take longer, and work consistently, than things be faster and be inconsistent. I hate going after some strange bug that “goes away” when the image is restarted.
0:34:59
whartung
no, it doesn’t that’s the point. If you have some Singleton out there reference a class that’s reloaded…who knows what happens.
0:36:10
whartung
And, sorry, at this point I have to do my own magic trick and disappear. Hope this was helpful.
0:36:31
whartung
In summary, the reloading mostly works in Java, just don’t be surprised if it bites you at times.
0:37:21
whartung
if you’re chaning just logic, it’s much better than if you’re changing structure in java
1:40:25
skidd0
how do you (use-package) or its equiv to load a package (to-do) along with all sub-packages (to-do.lists)
1:45:35
skidd0
so is there a way i can use a single (use-package) for all the many packages in my system?
1:46:43
Bike
but, you could have one package that exports everything interesting from multiple packages.