freenode/#lisp - IRC Chatlog
Search
6:28:08
aeth
fouric: Describe the hardware itself in Lisp, now that RISC-V exists as an open instruction set.
6:29:44
aeth
There are multiple efforts to generate JavaScript and multiple efforts to generate GLSL. So generating VHDL and/or Verilog probably wouldn't be too hard.
6:30:45
whoman
=/ curious why no other llvm efforts? theres several for a lot of langs, i notice today
6:38:34
beach
fouric: Sure. I feel like I had a very productive morning explaining important Cleavir concepts to at least one interested listener.
6:41:13
beach
whoman: Another reason is that LLVM is mainly a C++ library, so it is non-trivial to interface to, and that LLVM is mainly designed for compiling C++-like languages, so the fit is not perfect for compiling Common Lisp. Case in point, Clasp uses C++ exceptions to implement non-local exists in Common Lisp, and C++ exceptions were not meant to be used that often, so they are very slow.
6:42:00
whoman
beach: oh geez, that is terrible =( i did not know that. i thought JVM and CLR were specific enough already
6:42:03
beach
whoman: Yet another reason is that LLVM is a moving target, so that if one were to use some essential feature to implement Common Lisp, then that feature may disappear or get modified in future versions of LLVM.
6:42:04
Bike
i think that might be due to a choice to use C++ abi functions, rather than llvm itself strictly
6:42:38
beach
But then, LLVM does not suggest an alternative that can be used with Common Lisp or other similar languages.
6:43:02
Bike
well it has its own low level mechanism. i actually think it could be a good fit for CL, but i haven't gone into it much
6:43:33
Bike
it's built for C++ which sometimes, but not all the time, needs to execute arbitrary code upon exiting a scope, which is true for C++ with desctructors, and for CL with unwind-protect
6:44:57
beach
whoman: More reasons: Apparently, LLVM has problems with code that moves, probably because that doesn't happen in C++ since it doesn't have GC. So Clasp (as I recall) can currently not move code or recover space when a function is redefined.
6:47:13
beach
The right thing to do here would be to write a system similar to LLVM, but written in Common Lisp and designed for dynamic languages. It is a big project, but not huge. It would be much simpler than LLVM because of the superior abstraction mechanism we have at our disposal.
6:47:31
whoman
today i heard that c++ gets nasty-slow when it gets into a thing called 'chain of destructors' or somesuch. sounds scary -- been close to it in my day
6:48:09
beach
Bike: It probably seems bigger than it really is because 1. It is written in C++ and 2. It is designed to handle all the obscure stuff of C++.
6:48:15
Bike
whoman: yeah when you exit a scope you have to run destructors for any automatic-allocation objects, and those destructors can run other destructors, and so on
6:49:21
Bike
and there's lots of complicated stuff in there for, like, reordering conditions based on... path... I'm tired
6:52:01
jack_rabbit
Bike, Yes, I would be very surprised to find out there isn't. But beach has done far more work with it than I.
6:52:05
Bike
clasp has to do more conceptual work before it can even worry about that though. making sure we don't gc a function we're in the middle of, and so on
6:54:56
Zhivago
There's nothing particularly special about chains of destructors -- it's pretty much the same as unwind-protect.
6:55:49
Zhivago
The fundamental problem with destructors is that they don't make sense in systems with GC.
6:56:32
Bike
since you know when objects are released, you can use them for, basically, unwind protect
6:56:43
Zhivago
A destructor is code that runs sometime after the reference count to an object reaches zero.
6:57:12
Zhivago
Which is problematic for a destructor, since a destructor needs access to the object.
6:57:33
aeth
whoman: If CL was like SH, then "destruct" would be a thing with the api (destruct &rest ignored) that destroys your drive. Then you'd never be able to typo "defstruct"
6:57:47
Zhivago
Which means that the reference count is really above zero, and then you have the issue if what happens if the destructor generates new references to the object which would bring it above the destruction level?
6:58:12
Zhivago
Which is why objects in Java can be resurrected from the dead, and have to remember if they've been destructed or not.
6:58:17
beach
jack_rabbit: I have not worked with LLVM. I wouldn't. I am just following the discussions in #clasp.
6:58:42
Zhivago
Which is why GC systems that aren't designed by insane people used finalizer semantics instead, which do not involve the object that has been GC'd.
6:58:53
aeth
Bike: What changes would have to be made to bring RAII to CL, if that even makes any sense at all?
6:59:44
Bike
in CL we can just unwind protect to say "execute this when you leave this block" and we don't need to bother with tying it to objects
7:00:28
beach
whoman: Code that must be run sometime after an object is no longer accessible is problematic in all GC systems that explicitly do not touch dead objects, like copying collectors.
7:01:17
Zhivago
It just requires sharing those resources with a suitable finalizer, rather than mediating access to them through the object.
7:01:56
Zhivago
A more serious problem is the lack of generalized resource management integration with garbage collection.
7:02:32
Zhivago
If your GC is responsible for freeing up file handles, what happens if running out of file handles doesn't invoke GC?
7:03:34
Zhivago
If you have optional resources -- like file handles that could be closed or kept open for performance, who tells you that there's a shortage and would you kindly close the handles you don't really need right now?
7:04:32
Zhivago
GC allows all of these things to be deferred whereas RAII forces them to be eager -- and that requires a more thorougher design.
7:07:53
Zhivago
On the other hand GC is kind of a symptom of the problems of undisciplined shared memory, so perhaps it's just enabling the problems that it solves, and we might be better off by replacing it with restricted memory arenas.
7:10:32
Zhivago
If they're contained in an ephemeral process, maybe you just don't care, because you'll send the final non-garbage somewhere else, and then disappear.
7:11:15
Zhivago
(Which is a kind of GC, but with radically different requirements, since you can't just scribble on the one true graph of objects, since there isn't one.
7:16:13
Zhivago
Or you could say that GC is a problem of implicit persistent storage, and solve it by not having any.
7:18:19
Zhivago
But imagine if every function call happened in its own temporary process, receiving arguments via a message and sending a result via a message (effectively).
7:21:32
Zhivago
If the function is implemented as a procedure which happens to produce garbage, then you might need something if it runs out of resources to recycle that garbage.
7:22:02
Zhivago
But if it doesn't, then no recycling is required, and that recycling is what GC algorithms are about.
7:23:08
whoman
there is no argument. because listen, there is a law of relative space in effect here. objects cut from fabric cannot be larger than the original fabric. and so on, recursively as we cut out of the main fabric
7:23:34
whoman
at some point everything is recycled back to the fabric, all being 'temporary' -- there is always garbage being collected no ?
7:23:37
Zhivago
whoman: You appear to be gibbering. I will stop talking to you until you become coherent.
7:25:38
aeth
oh, hey, it might be a speed advantage to use make-load-form on things that are constant
8:58:55
hjudt_
i have a problem with dexador: if i use (dex:head "https://my-host/url" :verbose t :headers '(("Accept" . "application/json"))) then i can see in the server response it would send me json. but when i use (dex:get "https://my-host/url" :verbose t :headers '(("Accept" . "application/json"))), the server sends me back "application/xml". however, when i use wget -O - --header "Accept: application/json", the
9:00:24
hjudt_
(perhaps i should add that the server can respond with json or xml depending on the accept header i send it)
9:03:30
hjudt_
strange thing is that dexador verbose output tells me it does set "Accept: application/json". so what's the difference between dexador and wget here?
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