freenode/#lisp - IRC Chatlog
Search
10:44:46
shrdlu68
hjudt_: Easiest thing to do is probably to inspect the traffic with something like wireshark
13:33:28
flip214
Shinmera: any ETA for ELS registration? No need to hurry, just curious. (And HR wants to know ;)
13:42:27
AeroNotix
Zhivago: your thing about temporary processes and making per-function calls in those slightly reminds me of Erlang.
13:43:06
AeroNotix
in Erlang each function is executed in its own "process" which is not a unix process but an actor within the beam vm. Each process has its own GC and GC happens in isolation from every other process.
14:34:15
AeroNotix
but each function is always executed within a process and all processes are executing concurrently
14:34:18
White_Flame
right, that's an ambiguous implication that to me read as a function gets its own unique process
14:35:05
AeroNotix
since a function cannot be executed outside of a process, there's not much difference unless you understood that each invocation creates a new process for the function to execute in
14:36:49
White_Flame
however, in some of the lisp machines, you could allocate fixed-size regions to work with, and then throw away the region after you were done
14:37:29
AeroNotix
spawn_opts could be used to allocate a heap of your choosing and the process could die when you're done
14:37:44
AeroNotix
I forget if you can disable gc for an individual process but with the right spawn_opts perhaps it's possible
14:37:53
White_Flame
one thing (of quite a few) that I hated about Erlang is that you couldn't sic multiple processes to scan through a single large immutable shared data structure
14:39:53
White_Flame
yeah, ETS wuldn't work. Parallelizing multiple processes to scan a single data structure would be done for optimization; shifting all that into an ETS database form would kill speed & serialize it
14:40:50
White_Flame
right, and taht would be terrible for a fine-grained tree data structure, where you can very quickly traverse it in RAM normally
14:41:08
fe[nl]ix
on recent CPUs it tends to be a severe speed disadvantage to access large(ish) data structures from multiple threads
14:41:23
White_Flame
but in any case, I spent 2-3 years deep in Erlang. It's a great language to learn from, but I certainly don't use it anymore by intent :)
14:41:39
fe[nl]ix
especially if those threads are running on different cores on different NUMA nodes
14:42:10
AeroNotix
fe[nl]ix: you can lock schedulers to cores in Erlang but it still would present the issues you're talking about
14:42:24
White_Flame
fe[nl]ix: yeah, nowadays you really have to manage affinity & such if you're doing that level of optmization
14:43:28
AeroNotix
It's a garbage language itself, imho but nothing comes close for very simple concurrency and structuring concurrent applications
14:43:58
White_Flame
bad syntax, SSA got in the way of editing, very static model of the supervisor configuration which is at odds with dynamic application servers & runtime services, no parallelization of shared structures as mentioned above, etc
14:44:08
White_Flame
however, it has been quite a few years in the meantime, so I don't know how erlang has progressed
14:45:32
fe[nl]ix
White_Flame: in many cases it's significantly faster to pin the pages of the data structure on a NUMA node, assign it to a worker thread pinned on the same node and have the other threads enqueue work requests
14:45:34
White_Flame
automatic load balancing & reconfiguration, uploading new dynamically loaded services
14:46:07
fe[nl]ix
so the data structure is only accessed from a single thread and the shared access is on the work queue
14:46:19
White_Flame
yes, but at least at the time it always ended up in throwing away everything OTP provided and trying to do it yourself with the provided lower level mechanisms
14:47:12
White_Flame
erlang was also part of a heterogeneous system, so our stuff wasn't purely defined in erlang assumptions
14:47:59
White_Flame
it's been too long to recall the exact specifics with the supervisor definitions, but each time we had to figure out what number or setting to put into those defintiions, we always wanted them to be calculated predicates, not fixed values
14:49:02
AeroNotix
those are definitely static still, but a relup/code reload can reconfigure them but probably not the way you want to do it
14:49:36
White_Flame
but in any case, our conclusion was that erlang woudl work great for statically defined systems (like telecom platforms, incidentally), but for dynamically defined systems just didn't play well enough
14:50:03
White_Flame
the underlying systems coudl do all that, but OTP was built around too many assumptions of static definition
14:50:05
AeroNotix
it'd be interesting if the restart strats could take a function atom which would recalculate the restart strategy when a child pid restarted
14:50:55
AeroNotix
but it comes down to whether you could recalculate it quick enough on demand (latency of calculating impeding restart) the lack of shared data would hinder that too. Since if you had shared data you could recalculate it elsewhere and update a variable it could access
15:12:07
dtornabene
curious if anyone has done any audio processing in CL, specifically eating an mp3 and doing analysis on the stream??
15:21:30
Shinmera
I don't know what analysis you want to do on audio data, but you just get a buffer of floats in any case. From there on out you can do whatever with it.
15:22:18
dtornabene
cool! thanks for the reply I acutally just found some of your own stuff from googling
15:22:46
Shinmera
I'm mostly concerned with real-time processing, which may or may not be in your area.
15:24:29
dtornabene
not so much, no. I'd like to do some similarity of sound analysis, similar in some ways to what echonest does with beat and melody comparisons
15:24:57
dtornabene
i have a ton of mp3s, like to filter out some sounds and compare others, and go from there
15:25:52
dtornabene
thanks again for the pointers, it seems like in terms of libraries its a "there be dragons" kind of situation as use cases can get specialized really quickly
15:56:53
dtornabene
thank you very much, this is very much "journey of a thousand miles begins with a single step" territory for me...
16:07:41
angelo
please help, I wrote a project with 4 nested loop, quickload cannot load eventually dropped in the debugger for stack overflow! Thanks
16:12:55
Guest16495
when doing curses development with cl-charms i want my application to handle ctrl-c as an input, but the sbcl repl intercepts it and interrupts the program. is there a way to avoid this?
16:27:10
sjl
note that if you're running SBCL with something like rlwrap, this may cause problems. When using cl-charms I run SBCL directly without rlwrap or anything else around it.
16:32:18
sjl
for built-in stuff in the cl package, you can probably just dump all the symbols into a big file for rlwrap to look at
16:32:45
sjl
but if you want (defun foo () 1) and then be able to tab-complete foo, that's gonna be a lot more involved
16:33:06
dtornabene
the snippet of code I'm using in conjunction with rlwrap is supposed to do that already but doesn't and I've been too lazy to debug it
16:34:52
dtornabene
hold on, I'll find the link to the code I'm using, its from a well known lisp hacker
16:35:22
sjl
anyway, this is my rlwrap config for lisp repls https://bitbucket.org/sjl/dotfiles/src/default/bin/rlwrap-lisp
17:07:19
Shinmera
And once libraries start using it, convincing LW/Franz to add them would probably be easier.
17:13:12
jmercouris
I don't know, and that's one of the reasons I picked SBCL first, not even joking
17:13:25
AeroNotix
whoman: "The name "Steel Bank Common Lisp" is a reference to Carnegie Mellon University Common Lisp from which SBCL forked: Andrew Carnegie made his fortune in the steel industry and Andrew Mellon was a successful banker.
17:14:56
White_Flame
yep, CCL has had better mac & win support, and GUI things. CLISP has been easy to port. ECL is embeddable, etc
17:16:14
pfdietz_
The SBCL fork was a bit daring because build time was an issue back then and SBCL had to compile things twice. Now the build time is almost negligible.
17:16:15
phoe
also CLISP has a very (un)fortunate name because it shares its first name with C(ommon )Lisp
17:16:19
AeroNotix
I believe clasp is complete. I remember the author making a big deal about it being complete in here a few months/years ago
17:16:34
AeroNotix
when I first started I thought CLISP was the only implementation exactly because it was called CLISP
17:17:34
pfdietz_
Clasp is not quite fully gelled but much work is being done. I plan to abuse it horribly when given the go ahead.
17:18:07
AeroNotix
I don't understand the reasonsing behind clasp. "Interoperability between cl and c++" can't you achieve that with FFI?
17:18:13
jmercouris
phoe: It's too bad there's no ecosystem of apps such that one could actually run mezzano as their main OS
17:18:24
phoe
well, clasp has its own kind of C interoperability - it doesn't "just" interface with already compiled C libraries, it compiles C code with LLVM into something that already has Lisp interoperability.
17:18:40
jmercouris
AeroNotix: I don't think someone would embark on such a large project if they didn't examine the obvious :D
17:19:14
pfdietz_
Clasp could enable exploitation of fancy compiler optimizations for loops and such. Good for numerical work.
17:19:29
Bike
clasp also lets you manipulate C++ objects in lisp, have lisp classes that are subclasses of C++ ones, stuff like that
17:19:35
jmercouris
I wish there were implementation independent extensions to other languages like CFFI
17:20:15
phoe
but I wasn't doing it to write proper c or c++, I was doing this to illustrate C++ name mangling
17:20:25
TMA
phoe: declaring it otherwise is undefined behavior in hosted enviroment (hosted == libc available)
17:21:10
jmercouris
Bike: I wouldn't know, I'm not a language expert or anything, but I think simplified bridges could be written with IPC and a child instance
17:21:35
jmercouris
Bike: like I can envision how to make a VERY naieve lisp to python bridge with IPC
17:22:13
AeroNotix
jmercouris: remember about the wankery? You'd invoke their wrath doing it that way
17:22:20
random-nick
afaik there used to be a project that provides lisp and python interoperability by interpreting python
17:23:00
Bike
yeah. well, the more general cause is that a lot of science code is written in fortran
17:24:05
jmercouris
I thought it was reserved for assembler languages with a simple line by line format
17:25:38
edgar-rft
Just simply punch cards until they lose their teeth and speak with a Lisp - voila
17:27:25
pfdietz_
Punch 'A' and it prints A on the column and punches the code for A below it in holes.
17:27:37
TMA
https://en.wikipedia.org/wiki/Punched_card https://en.wikipedia.org/wiki/File:FortranCardPROJ039.agr.jpg
17:27:52
whoman
whoa... we sure went some way beyond morse code eh!! http://www.orosk.com/wp-content/uploads/2016/11/PUNCH-CARD-1.jpg
17:28:16
Bike
in the fortran one you can see it written on top in the original letters, as pfdietz said.
17:29:15
Bike
i have an old punch card i found in a library at home, but i've never used a reader or anything.
17:31:28
pfdietz_
llvm for interop but also to exploit optimization passes written by others for llvm.
17:33:22
Bike
the main problem with clasp right now is that it takes a lot of resources to build, and the compiler is slow.
17:33:35
jmercouris
I have a thinkpad x series with 2gb of ram and 20gb of hard disk, I can do literally all of my work on there
17:33:39
whoman
AeroNotix: by avoiding anything that uses ram. (eg. i've installed 32bit firefox on 64bit os)
17:34:31
jmercouris
s/freebs/freebsd, though it might as well be freebs with all of the manuals you'll spend reading :D
17:48:40
whoman
aagghh! one of my besties went to poland. never got a chance to meet her when she lived 2hrs away and known her for years. take me with you so i can find a monastery and a place to get ram
17:51:52
Bike
this is just about the only context i can imagine "mines" referring to a pleasant locale
17:52:15
AeroNotix
There's a uranium mine that's not too too far from krakow too if you want it there
18:00:01
serviteur
Tesla should start to be profitable, before using all the US money in doing fake pic of a tesla car in space
19:23:43
comborico1611
Would (format t "~{~{~a:~10t~a~}~%~%~}" *db*) VERSUS (format t "~{~{~a:~10t~a~%~}~%~}" *db*) produce the same output?
19:28:29
phoe
comborico1611: the stuff between ~{ and ~} gets repeated for each element in the iteration.
19:28:47
phoe
unless you put a ~^ somewhere in there. this will short-circuit if the list you are iterating on has no more elements.
19:31:32
aeth
Here's the reference for format, which is *not* the hyperspec page for format. http://www.lispworks.com/documentation/HyperSpec/Body/22_c.htm
19:32:19
phoe
https://www.hexstreamsoft.com/articles/common-lisp-format-reference/format-directives/
19:32:49
_death
(defpackage :c (:export :/u)) (defvar c:/u (make-synonym-stream '*standard-output*)) (format c:/u "uh-oh~%")
19:40:52
stacksmith
comborico1611: I've solved many problems in my dreams. On occasions the problems existed only in my dreams. This is more of a #lispcafe discussion.
19:43:58
fourier
fe[nl]ix: looking at travis it fails in master branch as well, am i missing something?
19:45:20
fourier
fe[nl]ix: this pull request merged and broke the builds https://github.com/osicat/osicat/pull/21
19:54:50
fe[nl]ix
fourier: first though, if there are fields specific to OSX just add the conditional definitions in the same struct
20:00:08
fourier
fe[nl]ix: that all would be nice to read in the comment to my pr so i wouldn't need to wait a couple of weeks and prepare to abandon it
20:15:43
jack_rabbit
Does anyone know, is there a reason HUNCHENTOOT::ACCEPTOR-SHUTDOWN-P is not exported?
20:16:58
phoe
Other than https://github.com/edicl/hunchentoot/blob/6e7f810626cfd34918c27f64b13a868fa6c58c3e/acceptor.lisp#L130 that is.
20:18:15
jack_rabbit
It's a flag to signal shutdown. I don't need the (setf ...) but it would be nice to check if the acceptor is shut down or not.
20:19:37
phoe
jack_rabbit: you seem to be right. I say, open an issue stating this, or a PR right away that exports the symbol.
20:19:59
phoe
It might not be a good idea to export the symbol because this makes it possible to use SETF on it.
20:20:28
phoe
Better make a new function, ACCEPTOR-ALIVE-P, that calls that accessor and returns it value.
20:21:32
jack_rabbit
Sort of makes sense. Although the ability to export readers but not writers would be useful.
20:22:24
phoe
Which then makes no sense because suddenly you have (foo bar) but (setf (foo2 bar) 42)
20:22:58
phoe
So the workaround is to explicitly define new functions that call the reader. (Or the writer.)
20:24:25
jack_rabbit
Yes, I understand. I just meant it would be useful to be able to export a symbol without allowing the setf, but I understand that that doesn't really make sense with the semantics of export.
20:25:43
phoe
You could *theoretically* define your own custom SETF expander that, unless the value of *PACKAGE* is something predefined, signals an error instead of being called. This way it would only execute inside your packages, and for everyone else it'll throw them into debuggers.
20:26:30
flip214
phoe: the runtime value of *package* has nothing to do with the compile-time package...
20:27:25
phoe
_death: kind of, but I like to think of exported symbols as the interface of a package. It's pointless for me to export a symbol that the programmer is not allowed to use.
20:27:54
phoe
flip214: this is a totally crazy and not serious idea and anyone implementing it should be thrown into the bowels of ##c.
20:28:53
jack_rabbit
The other question, then, is whether I need to obtain the lock. Some accesses to that slot are surrounded by '(with-lock-held ((acceptor-shutdown-lock acceptor))'
20:29:01
phoe
(defmethod (setf foo) (new-value) (if (eq *package :my-package) (set-slot new-value) (error "...")))
20:29:48
_death
phoe: but that's case where you want the symbol to be used, just not in a certain way
20:30:44
jack_rabbit
Is there danger to reading a value without the lock? I'm not sure about CL semantics for read/write races. I'm ok if the value isn't totally up-to-date, but don't want to raise an error.
20:31:11
phoe
_death: yep, but I like to think of symbols as being usable either-or. the moment you have ambiguity, you're going to have false bug reports.
20:31:57
phoe
they most likely are not because SLOT-VALUE-USING-CLASS needs to be called, or something.
20:32:08
jack_rabbit
phoe, That's all I'm wondering. Will I ever get an error on a read if there's a simultaneous write?
20:33:19
_death
(defun phoe:bug () (nonphoe:feature)) ;; symbols can be used in ways that we might disapprove of, but not everybody bothers with package locks and weird runtime checks and such.. erik naggum once had a nice post..
20:33:19
phoe
jack_rabbit: as far as I understand that Hunchentoot code, you are free to hold (acceptor-shutdown-lock acceptor) inside your custom reader.
20:34:25
phoe
jack_rabbit: as far as I understand this, if you are able to call STOP at any moment, which captures that lock for a moment, then you should be able to call a reader at any moment, which does the same thing.
20:34:32
jack_rabbit
phoe, Yes, I think so, from my reading. I was just wondering if it was necessary. It seems to only obtain the lock if it's modifying accessor-requests-in-progress
20:35:02
phoe
jack_rabbit: unless you are sure reading is atomic, you should use that lock. And I can bet $5 that it is not atomic.
20:35:15
phoe
See https://github.com/edicl/hunchentoot/blob/6e7f810626cfd34918c27f64b13a868fa6c58c3e/acceptor.lisp#L319 for the thing that I mean.
20:35:26
_death
the post btw is https://www.xach.com/naggum/articles/3103318695270771@naggum.no.html
20:35:29
aeth
Bike: In case you're wondering, about "maybe something can deal with it as a constant who knows", it looks like both SBCL and CCL deal with classes/structs with a make-load-form that calls make-load-form-saving-slots as constants. i.e. compile time initialization, trivially small disassembly, almost instant runtime when calling the function, saved in the FASL, etc.
20:36:09
jack_rabbit
phoe, In that case, I'll just take the safe route and obtain the lock. There's no real harm if it's unnecessary.
20:36:21
jack_rabbit
phoe, There are read accesses without the lock, however: https://github.com/edicl/hunchentoot/blob/6e7f810626cfd34918c27f64b13a868fa6c58c3e/acceptor.lisp#L447
20:36:29
Bike
almost instant runtime when calling the function is obvious, it's load time, not run time
20:37:06
aeth
Bike: at the very least, large parts of the object are stored in the FASL in SBCL. I see NUL-padded strings (utf-32?)
20:38:00
aeth
Bike: in SBCL, the initialize-instance :after isn't called except at compile time, I put a print statement in it
20:39:35
aeth
Bike: If I put (format t "~A~%" "Hello") in the initialize-instance, it will show up in the verbose quickload as each function is compiled, but not when I launch the application, i.e. not when the functions are called at run time. e.g. ; compiling (DEFINE-SHADER (SIMPLE-2D-VERT :VERTEX-SHADER) ...)Hello
20:40:34
aeth
This actually is cool because I do type-checking from the initialize-instance, so it type checks at compile time, but not when calling the function at runtime, at least in SBCL.
20:41:22
aeth
CCL behaves the same way, except provides less information to verbose. I get a bunch of "Hello"s when compiling, and not at runtime.
20:42:17
aeth
This is actually cool, though, because assuming that it's safe, it does compile time type checking
20:43:06
Bike
if make-load-form is being invoked, there's an actual object you're passing to the compiler.
20:43:24
Bike
so, at one point you initialized that, and of course it did your initialize-instance method that does type checks or whatever.
20:43:32
aeth
Right, that object, generated in a macro at compile time, already had its initailize-instance called and its types checked, just at compile time
20:44:46
Bike
this is kind of an odd ontological question. the object has already been initialized in the building image, but not necessarily in the loading image
20:46:04
whoman
i think this having a standards thing, is making things a bit more rough than they have to be
20:46:04
Bike
the way it's described it can definitely not call initialize-instance, and in fact it probably shouldn't.
20:46:48
whoman
a lot of bandwidth spent on dealing with different implementations, may as well write in anything else that isnt portable
20:47:17
Bike
and the implementation i work on is the same, i just didn't notice because argleblargle
20:47:33
whoman
i dont understand, most lisp chat here on irc is about sbcl internals, how this implementation is etc.. only "CL" when it comes to other languages. hmmm, feels like my footing is suddenly in mud
20:48:03
aeth
If I can generate a CLOS object or struct at compile time (or even more elaborate combinations! the CLOS object I'm talking about is filled with simple structs!) using this trick, then maybe I should.
20:48:03
Bike
we're talking about how this behavior is actually universal across implementations, whoman, leave your musery for another day
20:48:46
Bike
aeth: make-load-form-saving-slots is defined more vaguely than i thought, is the deal- "Returns forms that, when evaluated, will construct an object equivalent to object, without executing initialization forms. The slots in the new object that correspond to initialized slots in object are initialized using the values from object. Uninitialized slots in object are not initialized in the new object."
20:49:10
whoman
phoe: thats where i have been for the last few months, until i guess this week when i switched irc clients.
20:49:58
aeth
whoman: I often ask in here to see just how universal some behavior I observed in SBCL, or SBCL and CCL, is.
20:51:42
Bike
it's an obscure bit of the standard, but it makes perfect sense within the fasl model, so i'd expect it to work everywhere fine
20:54:25
aeth
What's the best way to make sure that the object stays valid? I verify it in a function that I call from initialize-instance (it's in a separate function so I can verify it at any time outside of that, too, and it's a function instead of a method because I want check-foo to tell me it's a valid foo, not a valid object)
20:55:05
aeth
Not every implementation respects :type (and not everything can be encoded in a type, anyway) and it can even vary depending on debug level.
20:55:34
Bike
assuming "validity" means some invariant among the slot values, depends on what you wanna let users do
20:55:45
Bike
for normal purposes, your after method and maybe some checks in the accessors seems fine
20:56:04
Bike
disallow slot-value and standard-instance-access and reinitialize-instance (or you could put your method in shared-initialize :after instead)
20:58:12
aeth
(defmethod (setf foo) :before ...) or something? Or are the setters called something different?
20:58:15
Bike
for my "traitlets" thing i ended up writing this whole crappy validator pattern but it basically amounts to :around methods
21:22:19
jack_rabbit
How many projects (if any) use generated documentation? I would imagine it wouldn't be too difficult to write a decent doc generator for CL.
21:22:52
Shinmera
There's at least a brazillion if by "generated" you mean things that gather docstrings and put them in one place.
21:23:55
hjudt_
i solved my issue with dexador using wireshark to inspect packets: the solution is to add another header "Accept-Encoding: gzip" in addition to "Accept: application/json".
21:24:11
sjl
There's also several sites that do it automatically for all projects in quicklisp, which annoys those of us that write more documentation and now have to compete with them in search results.
21:25:07
aeth
Sounds like a nightmare if you're one of the rare people to actually do things the right way with documentation.
21:25:23
jack_rabbit
I imagine a solution to that may be to include a link to the actual documentation it a place those sites will render.
21:26:53
sjl
They render the README, so at least there's a chance the user will see the actual docs if you link it there. Still not ideal.
21:27:25
_death
the other day someone mentioned gigamonkey's manifest.. played with it a little https://github.com/death/manifest
21:28:28
Shinmera
Staple also has a server component. (ql:quickload :staple-server) (staple-server:start)
21:29:30
sjl
I render to plain HTML and host it with bitbucket's pages thingy. But yeah, there are a bunch of people who generate docs based on some prose + docstrings.
22:10:24
phaul
few years back I watched a write yourself a scheme ( I think ) on youtube, which was very entertaining, all I remember that it was very pink, and lots of hello kitty etc and maybe it was done in c-lisp. I tried to google it but couldn;t find it. Does anybody have a link?
22:13:51
whoman
https://stackoverflow.com/questions/5093513/how-to-see-docstrings-and-other-symbol-information-in-common-lisp-repl
22:15:50
aeth
Well, that was strange. I had a type error in a macro. I changed the code. It worked, but wasn't what I wanted. I then changed it back to the original, and it worked. I guess C-c C-c doesn't always work if something in the same file is recompiled because the of compilation unit optimization stuff.
22:17:23
pjb
phaul: Have a look at Lisp in Small Pieces http://pagesperso-systeme.lip6.fr/Christian.Queinnec/WWW/LiSP.html http://pagesperso-systeme.lip6.fr/Christian.Queinnec/Books/LiSP-2ndEdition-2006Dec11.tgz
22:25:52
phaul
nope. but thanks anyways. It was a cool video I would watch it again. also I saw it many years ago probalby it's gone and lost for ever
22:34:12
_death
emaczen: (mapcar #'documentation (list (find-method #'class-name '() (list (find-class 'class))) #'car (find-class 'class)) '(t t t))
22:37:33
Nouv
How does `eval` work at a low level? Where is the parsed function placed in memory? In the stack?
22:42:19
Bike
(defun eval (form) (typecase form (symbol (symbol-value form)) (cons (apply (first form) (mapcar #'eval (rest form)))) (t form))) handles function calls, self evaluating object,s and special variables
22:42:32
|3b|
however it wants... could be anywhere from looking at each form and directly calling a function to do whatever that form says, to compiling it to native code and running the result, to writing out a file, calling a C compiler on it, loading result as a shared object, and calling a function from that
22:43:43
|3b|
sbcl for example usually compiles to native code, but directly evaluates some simple forms