freenode/#lisp - IRC Chatlog
Search
19:03:21
beach
refusenick: There is no reason to construct the full language from a subset of it. You can still have first-class global environments with appropriate sandboxing.
19:03:58
beach
refusenick: Also, CLOS is neither compiled nor interpreted. It is a specification of a bunch of protocols.
19:06:34
beach
refusenick: I use SICL first-class global environments for bootstrapping right now. That way I can isolate the host Common Lisp system from the SICL code that I am building. But in the final system, I plan to use first-class global environments to restrict access to internal code that could make the entire system unsafe.
19:06:36
beach
For example, the default environment will not let the user have access to the code generator of the compiler.
19:07:03
refusenick
beach: Doesn't it make optimization and reasoning about your code easier if it's built from a few composable core components?
19:07:23
refusenick
I'm not a functional programming zealot, but I appreciated Backus's line of argument.
19:08:49
beach
refusenick: That might be true, but it turns out to be extremely painful to restrict oneself to a language subset. I can't do it myself. And it makes maintenance very delicate because every module must have documentation about what subset it is allowed to be written in.
19:09:30
beach
refusenick: I am betting that the metacircular aspect of Common Lisp can be exploited in order to increase confidence in its correction.
19:09:35
refusenick
beach: You have much more experience with this than me (I have almost none - I've just read about it for now). Do tell.
19:10:32
beach
I am not sure what else to tell you. But there are two examples in our ELS paper on bootstrapping that shows the twisted code that is required if you must start with a subset.
19:10:42
refusenick
To me, Lisp's killer feature is how its semantic uniformity allows boilerplate composition to be conveniently hidden while still mapping surface syntax to operational semantics in a 1-to-1 fashion.
19:10:57
beach
It has to do with defining classes if you don't already have their metaclasses available.
19:11:33
refusenick
What about a prototype-based system? I've read about multiple dispatch systems built on prototypical objects.
19:12:13
beach
ebrasca: Doing it the other way is worse. Then you will very likely have the same information duplicated, so you have to make sure every occurrence is in sync.
19:12:54
beach
refusenick: Yes, that's me. But I don't recall having written anything about prototype systems.
19:14:19
refusenick
I think there was an academic paper, but it's been over 2 years since I seriously read into this.
19:14:33
beach
refusenick: I can write (defclass t () (:metaclass built-in-class)) in SICL. That is very metacircular, but on the other hand, the meaning is clear, and it is my job to make it operational, which is what the boot procedure is for.
19:15:31
refusenick
Would it make sense to define the image itself as a directed graph database of definitional dependencies on other objects, with restrictions on circularity?
19:16:58
beach
refusenick: But during bootstrapping, I build an acyclic graph, and then "tie the knot" (which is a paper I am working on).
19:19:04
beach
Not really. The thing is that the graph is best described as the result of the execution of Common Lisp code. Hence the bootstrapping procedure. Otherwise, one might have imagined just describing the graph as such. But that's not practical.
19:19:52
refusenick
If one has a graph of CLOS objects at runtime, can the set of them be separated into equivalence classes based on their relations to one another?
19:20:16
refusenick
There are optimization techniques such as supercompilation which symbolically execute code to optimize it. That might be a good fit.
19:20:33
beach
If you want to add a slot to a class, if you have a direct description of the graph, it would be impractical to edit it with confidence. But you can add a slot to a DEFCLASS form and rerun the boot procedure.
19:21:20
refusenick
It sounds like it's inching closer and closer to a database's functionality for maintaining consistency and such
19:21:24
beach
You can always define equivalence classes. But I doubt they would be semantically meaningful, other than the trivial relations.
19:21:46
refusenick
I don't know a terrible lot about CS and programming, certainly not databases, so feel free to correct me.
19:22:29
beach
I don't know much about databases either, other than the ones that are commonly used and that in my opinion do something that I absolutely do not want.
19:24:01
beach
Anyway, I'm off to spend time with my (admittedly small) family. I'll be back tomorrow morning (UTC+1). Feel free to join #sicl for more technical discussions about my design choices.
19:50:49
alandipert
refusenick i too perceive a lot of overlap with OOP/type systems and databases fwiw, i also find it an interesting thing to think about
20:10:10
scymtym
refusenick: https://github.com/sbcl/specializable/tree/master/src/prototype-specializer is one example of making a prototype-based system with (a slight superset of) CLOS. example is here: https://github.com/sbcl/specializable/blob/master/examples/prototype-specializer.lisp
20:24:44
lottaquestions
Hi all, I am new to lisp, and was going through someone else's code, and he appears to be instantiating an object of a class in a list without using the make-instance function. How does that work? I thought make-instance was mandatory when instantiating objects in CLOS
20:28:44
lottaquestions
Check out https://github.com/wzrdsappr/trading-core/blob/master/examples/backtesting-simulation.lisp
20:29:52
lottaquestions
(defparameter *agent-specs* `((simple-model :L 89) (channel-breakout-trend-following :fast-period 89 :slow-period 211) (envelope-moving-avg-trend-following :N 89 :width 3.2) (adaptive-moving-avg-trend-following :min-period 59 :max-period 126 :width-factor 3.2 :snr-factor 0.5) (fractal-ama-trend-following :max-period 200 :min-period
20:29:53
lottaquestions
10 :fractal-length 126) (opening-range-breakout :volatility-limit 1.5 :N 21) (range-projection-mean-reversion :N 34 :projection-interval :week) (swing-breakout :event-count 21 :expected-width 1.5 :price-extension 2.0) (swing-mean-reversion :event-count 21 :expected-width 2.0 :max-allowed-breakout 1.5)))
20:31:29
sjl_
https://github.com/wzrdsappr/trading-core/blob/master/examples/backtesting-simulation.lisp#L46 is where make-instance is called
20:42:40
jackdaniel
copec: it seems that imgui runs in the same process as ecl while emacs provides only swank connection
20:43:03
_death
copec: it's a C++ program that embeds ECL and has imgui and bindings for it.. it loads a lisp file, and the first thing that's done is to start a swank server, so I can connect using slime
20:43:40
_death
copec: it wouldn't be difficult to add a text editor and be "self contained" but for development emacs/slime is just too convenient :)
20:49:43
copec
I haven't attempted anything but simple FFI, how difficult was it to get ecl+imgui going?
20:49:44
_death
previously I used it with tic-80, if you want to see how easy it is to embed.. https://github.com/death/TIC-80
20:56:49
_death
copec: it's not difficult, but writing bindings by hand can be a bit boring so progress is slow.. a few functions every now and then, and it's about 80% complete now, I'd say
0:47:54
fengshaun
I've heard of common lisp's superior debuggability, and I've seen sbcl dropping me to a debugger to poke around. where should I go to learn things I don't know that I don't know. i.e. how to be super effective in debugging cl
0:48:19
fengshaun
I feel like there is a lot of stuff in CL's debug-land that I don't know is possible
0:52:30
pjb
fengshaun: there are different debuggers. Each implementation has its own. And there are debuggers that work with a lot of different implementations (eg. slime).
0:52:56
pjb
fengshaun: the best way would be to read the user manual of both the implementation and of slime (since I would advise you to use slime when possible).
0:53:37
fengshaun
any resources to give a quick overview of what's possible so I can go deep later as need arises?
0:53:38
pjb
fengshaun: also good, is to write your own debugging facilities. For example, I wrote a stepper (cl-stepper), since some implementation don't provide cl:step, and most do a crude job at it.
0:54:12
Xach
fengshaun: i think i use v and t on frames the most in the slime debugger. v jumps to the location of the error (if there is high enough debug at compile time) and t shows the value of local variables (ditto)
0:54:26
Xach
fengshaun: i haven't tried the stepper lately. i don't know if it works nicely for sbcl.
0:55:37
Xach
sly has a feature that looks neat called stickers but i didn't stick with it long enough to really get a feel for them
0:56:27
fengshaun
I was hoping for a shorter read than the user manual to get a feel for all features before diving deep
0:57:48
pjb
fengshaun: then just enter into the debugger (evaluate (break) in the slime REPL), and type C-h m
1:31:03
copec
dtrace allows an arbitrary level of inspection, it allows you to group cross-cutting concerns arbitrarily
1:34:00
p_l
I'm not sure about equivalent of dtrace helpers for dynamic generated code that isn't represented in binary's DWARF data
1:34:31
p_l
most of the time it's "dump a file named according to template X in /tmp that contains symbol data in this format"
2:23:43
pjb
p_l: you could patch a CL compiler to generate DWARF at the same time it generates code dynamically.
2:29:01
mister_m
i find myself wanting to traverse a list and use those list values to populate a hash table. My first instinct is to define a hash table in a let statement, and in the body of that statement have a dolist expression where i modify the hash table. Is there a better way to do this?
2:30:29
mister_m
I'd use a reduce perhaps in JS but I'm having a bit of trouble with CL's reduce in doing this
4:56:07
pjb
mister_m: if you like reduce go ahead! (reduce (lambda (h e) (setf (gethash (car e) h) (cdr e)) h) '((a . 1) (b . 2) (c . 3)) :initial-value (make-hash-table))
6:35:10
p_l
pjb: the linux perftools format is essentially "drop a file named after PID with table of `address:symbol name`". DWARF is only used for static data. DTrace OTOH had essentially a callback interface that you could implement top return the data