freenode/#lisp - IRC Chatlog
Search
6:48:35
beach
It is interesting to see that jmercouris seems to assume a particular way of bootstrapping Common Lisp, i.e., that it has to be built from a small subset of itself. As it turns out, that is a very painful way of bootstrapping a Common Lisp system.
7:02:13
no-defun-allowed
Dibejzer: I think that is a shell problem, not a SBCL problem. Did you `chmod +x hello-world.lisp` first and run it using `./hello-world.lisp`?
7:04:00
no-defun-allowed
And most certainly, do NOT run it with sudo unless superuser permissions are necessary.
7:05:20
no-defun-allowed
If you run a program with sudo, it can pretty much do whatever with your computer, as it is run as the `root` user.
7:06:52
no-defun-allowed
It would be like rightclicking the program and selecting "Run as Administrator".
7:07:56
no-defun-allowed
These are Unix problems and not Lisp problems though, so I should probably leave them though.
7:08:04
Dibejzer
But, even "simple" actions, like entering folders quite often are impossible without sudo
7:08:49
phoe
Dibejzer: if you can't enter a folder without sudo there's usually a very good reason for that
7:09:49
no-defun-allowed
Then you should change the permissions on those directories so that your regular user can read them instead of using a hammer^W^Wsudo on them.
7:10:22
aeth
Dibejzer: you can always discuss it in #lispcafe (the off-topic channel) but that doesn't sound typical
7:10:38
Dibejzer
So, is it a normal workflow that you have to manually change permissions for so many folders?
7:11:30
aeth
pretty much everything in modern Linux/Unix is done in /home/your_name and permissions don't really come into play unless you e.g. want to make install SBCL globally (but you can install SBCL locally, I do... in fact, usually /home is much larger than / so you literally can't install everything globally)
7:12:44
aeth
Literally all of my programming is done locally, including installed language implementations. The only thing related to #lisp that I have installed in the root partition under /usr is stumpwm, the window manager, afaik
7:13:25
no-defun-allowed
ACTION still grabs SBCL from the Arch repository since that's usually close to the newest version
7:13:55
Dibejzer
I understand the concept, but will take some time to understand how to implement it
7:14:46
Dibejzer
but, for example, the script we chmoded back there was in the ~/.clisp/hello-world.lisp
7:14:52
no-defun-allowed
Installing is one of the legitimate uses for sudo, running hello world programs probably is not.
7:15:17
aeth
Installing things globally under root is dangerous because you can really mess things up if you're outside of your distro's package manager unless it's installed under /usr/local/ and even then it might mess up some things.
7:15:50
aeth
If it's under your home directory ~/ then the worst case is that it can mess up everything in home, which is only 85% of everything that's important :-p
7:16:42
aeth
no, you should not need sudo to access anything under /home unless it's under another user's home, but you only really need one "real" user who has a home
7:17:07
Bike
i don't think this is the ideal channel for untangling why your system is apparently so untrusting of you
7:19:15
aeth
Dibejzer: Anyway, the tldr is to write simple scripts under ~/bin (and chmod +x them) that set the correct environment variables (because often that's the only way to do it) and install stuff like SBCL locally. e.g. for SBCL I installed it to ~/.local I have a "export SBCL_HOME=/home/myname/.local/lib/sbcl" followed by the path to the ~/.local/bin/sbcl
8:42:22
Demosthenex
5 second opinion, total noob looking for a simple testing framework while working in repl, what to use?
8:44:39
Shinmera
if you move on from the repl you might want to look into bigger things like parachute or whatever else. there's a thousand of them out there, so pyp.
8:46:06
Demosthenex
i'm seeing quite a few, that's why i asked. looks like alot of duplication, not alot of differences.
8:46:35
Demosthenex
just tinkering with a restful api, and wanted to start capturing things i'm doing in the repl as tests
8:52:09
phoe
if you want to run a bunch of automated tests, choose one of the already existing ones - 1am, fiveam, parachute, fiasco, anything.
8:53:19
Demosthenex
and yes there is reason to use a testing framework with teh repl. i nail down a piece of code and test it on the repl, i need to record that in a test so it repeates later
8:54:31
phoe
I default to 1am in the beginning since it is so dumb that I can fully understand it after reading its source
9:18:36
Shinmera
Also, almost any discussion in here about what a best practise might be will inevitably result in hours long discussions, so I don't even know if such practises exist :)
9:46:57
smokeink
can slime step-debug through macro-expanded code ? https://stackoverflow.com/a/3216672
10:58:47
vydd
phoe: hm. does any of the frameworks you listed support parametrization? (I tried looking at all of their docs, but couldn't find any hints on that)
11:15:43
Xach
Hmm, is there a good way to get in touch with Leo Zovic other than filing bug reports?
11:20:51
phoe
vydd: parametrization as in running the same test body with different input each time?
11:25:57
phoe
vydd: typically you do not need that in Lisp due to its functional nature; you can write a single test that has (dolist (test-datum *test-data*) (is (goodp test-data)))
11:29:52
vydd
either I'm confused about how ..parachute in your case? works, or we're talking about different things... let me test that code and get back to you
11:32:31
phoe
I'm in a bus, can't really use a proper emacs now - maybe Shinmera will be able to assist
11:53:15
vydd
phoe: it does work with dolist! that's cool https://plaster.tymoon.eu/view/1567#1567 ... Shinmera, maybe you could consider adding that to a FAQ?
11:55:05
vydd
curious thing, btw. with no docs, I just tinker with the code and try to make stuff work through autocomplete. when docs are available, and especially as comprehensive as Shinmera's, I try searching in docs first, and when I fail, I kind of assume the feature is simply not supported
12:08:42
Shinmera
vydd: In those cases I typically construct my own test result instances instead of relying on IS etc, so that the overview shows the proper values.
12:09:01
Shinmera
It's a bit cumbersome though, so I might have to look into a way to improve that and add it to the docs.
12:09:42
Shinmera
IS, etc. are just thin macros. If you expand one (or look in testers.lisp), you should be able to figure out how to get it done.
12:10:44
Shinmera
Also, doing parametric tests like that can quickly explode the number of test cases. I should add a way to bundle tests or suppress them from being displayed in the overview.
12:12:05
Shinmera
trying to run uax-9's tests with the default report will kill your emacs, for instance.
12:34:23
vydd
Shinmera: here's a reason why first class support for parametrization might be needed: https://plaster.tymoon.eu/view/1568#1568
12:34:48
vydd
(I've read with-shuffling, and I'm aware it won't work, I just wanted to get the point across)
12:36:40
vydd
oh, it is? :) that's how this whole thing started - I couldn't find it in docs, and then phoe offered dolist as a solution... so, how do I do it?
12:38:31
Shinmera
(loop for test in (alexandria:shuffle (loop for x from 0 to 10 collect (make-instance 'parachute:comparison-result ..))) do (parachute:eval-in-context *context* test))
12:39:49
Shinmera
you could also write a result that first gathers all tests, then shuffles them, and then evaluates them, then bind *context* before doing IS.
12:40:28
Shinmera
Maybe with-shuffling ought to do that, but it might also be surprising. I don't know.
12:42:12
vydd
understood. I thought there was a way other than the cumbersome one (your words! :)) when you said "supported", that got me confused
12:44:25
vydd
do you accept PRs? I guess the real problem would be agreeing on the right API. maybe a new thing like DEFINE-PARAM-TEST could be introduced.. not sure
12:45:33
Shinmera
Designing the right API is indeed the problem. I don't consider it urgent enough of a problem right now, though, since you can just construct the instances.
12:46:48
vydd
true...well. you know what, when I get to the stage I want to have regression tests in the app I'm working on, I'll try with parachute, and if make-instance starts getting annoying, we can chat again
12:55:16
Xach
Hmm! I need to provide an alternate name for http://beta.quicklisp.org/client/quicklisp.sexp because the "sex" substring is blocked for many people behind (very stupid) content filters.
12:57:21
pfdietz
When using the RT test framework, I would use the idiom of having the form under test return NIL for success, otherwise it would return information about which specific input caused the failure.
12:57:25
vydd
Xach: sounds good... just not sure if it would be interpreted in a special way on macOS
12:58:10
Shinmera
pfdietz: In Parachute the test-result instance typically returns the result of the form under test when evaluated.
12:59:51
pfdietz
I'm guessing the IS macro is so one can put several tests together that share some expensive set up and teardown code.
13:00:55
Shinmera
so FINISH returns the result of make-instance after completing the test, which is then the value for the thing function, that serves the IS comparison.
13:01:02
pfdietz
RT just has test definitions that look like (deftest <test-name> <test-form> <expected-results>)
13:04:14
pfdietz
One thing I added to rt in ansi-test was the ability to execute the tests repeatedly, in random order. This found a bug in SBCL (some persistent state in the handling of certain method combinations). Not quite the same as with-shuffling.
13:04:51
Shinmera
There's a lot of stuff that could be added to Parachute that's found in other frameworks, I'm sure :)
13:06:38
pfdietz
I just want to understand what all the various frameworks are bringing to the table, so one can be extended to cover all bases.
13:07:26
Shinmera
The latter is what Parachute tries to do. It has a very flexible evaluation model, which I tried to put to the test by writing compatibility layers that emulate the syntax and semantics of other frameworks.
14:10:33
pfdietz
I need to find that usage summary for the various test frameworks in quicklisp systems. A few had most of the "market".
14:28:03
puchacz
hi, I can't find in ccl manual - are hash tables thread safe? is there a special keyword to make them safe?
14:28:37
pfdietz
In SBCL there is a keyword, but I don't know about CCL. It's not from the CL standard in any case.
14:29:48
puchacz
I did not even install ccl, just want to try something, because there might be a bug in sbcl /hunchentoot when running on multiple cores.
14:44:20
puchacz
so maybe there is a library that would let me define around defuns, like in CLOS, so I can wrap calls to gethash and similar?
14:52:58
puchacz
death: I am not sure what crashes, would you expect for example a bug in my code to crash sbcl image like this? (hold on, need pastebin)
14:54:28
puchacz
when running the same delivered image locally on my PC, which is 4 cores virtual box, it is not crashing
14:55:41
pfdietz
I wonder if SBCL could use a threading mode that does things more randomly, so bugs could be exposed with fewer cores.
14:55:42
puchacz
it is running a numerical model fitting, hunchentoot is for giving arguments to the cost function, it does the calculations in multiple threads, joins into a single result and returns it via hunchentoot to the "driver" routine
14:58:14
_death
puchacz: this log indicates (i) corruption (ii) use of a bad file descriptor (maybe after being closed) .. do you know the reason for ii?
14:58:28
pfdietz
beach: it is of course conforming for an implementation to make GETHASH be generic, but no conforming program can exploit that.
15:00:40
_death
puchacz: I would guess that the socket got closed but still its fd being passed around
15:03:35
_death
puchacz: as for the memory corrutpion, I don't know that it has to do with the fd trouble.. for that I would either pepper my source code with log forms to try to localize the problem, or try to use sbcl's debugger (ldb) to figure out more, or maybe use other tools.. maybe good to consult #sbcl to get tips on how to debug that
15:04:26
mister_m
Can someone help me find documentation on the `:read-file-form` function I see used when defining some asdf systems? For instance, when loading a version -- :version (:read-file-form "version.txt"). Google is really failing me.
15:06:17
_death
at least it's good to log the thread ids and their roles (e.g., "hunchentoot handler thread", "acceptor thread", etc.).. the thread id where the corruption is detected is in the error message
15:06:56
_death
that of course does not mean that that's where the corruption happens.. but may provide clues
15:08:11
puchacz
I understand I can corrupt data structures in my program in a sense of having something unexpected in a variable or cons cell, but can I break lisp itself?
15:10:02
_death
puchacz: #sbcl is better informed than me on that.. but note that your program uses ffi (cl+ssl)
15:15:35
_death
yeah, you landed there because of the second issue, I'm guessing. but I'm talking about the low-level sbcl debugger
15:21:33
_death
well, if there's memory corruption some low-level knowledge may be needed to find out the problem
16:01:26
jmercouris
Anyone know of a CL LSP or efforts to create one to allow for easier editing of CL outside of the Emacs ecosystem?
16:02:35
beach
jmercouris: Yes, I am working on SICL, and I am planning (with a lot of help) and IDE that is not Emacs based.
16:03:51
beach
Maybe. I know there are attempts to create an editor using the LSP, but I don't know whether it will be Second Climacs.
16:07:06
beach
I have not thought about it for some time. When I realized I was unable to write code using only a subset of the language, it became impossible for me to imagine starting with a small subset and building the rest from there.
16:07:43
oni-on-ion
or did he mean something like https://sep.yimg.com/ty/cdn/paulgraham/jmc.lisp?t=1564708198&
16:07:53
jmercouris
I am just thinking about it from a porting perspective, that's really why I am curious
16:09:06
jmercouris
and kind of minimizing that work by making it so you only have to make a very small amount of Potato lang functions to get everything started
16:09:12
samsepi01
When using SBCL timers, I get messages like "WARNING: Starting a poll (2) without a timeout while interrupts are disabled." I can’t understand what am I doing wrong?
16:09:27
jmercouris
that's why I am so hung up on figuring out how to reduce the amount of work you would have to do in Potato lang to get started
16:09:32
beach
jmercouris: I have no idea why you would want that. Why not generate native code directly?
16:10:21
jmercouris
beach: whether you are generating the code or writing it by hand, there is an amount of work in making your CL code compile via the Potato lang compiler
16:10:41
jmercouris
_death: that sounds correct based on my knowledge of words, but I don't know exactly what that is
16:11:17
jmercouris
beach: let's say you wanted to make your own version of ABCL, but instead of that it is PCL, potato common lisp
16:12:28
beach
jmercouris: So you want to take an existing Common Lisp system written in some language L1 (which i not Common Lisp), and you want to have it written in a language L2 instead (which is also not Common Lisp). Is that it?
16:14:01
jmercouris
I want to know how I can write code in Y language to compile X language with the smallest amount of work
16:14:23
jmercouris
after the initial compilation/bootstrapping, of course I could use X language to recompile X language
16:16:12
beach
I don't care how we arrived at the current situation, but it is there, and I can take advantage of it.
16:16:48
jmercouris
could we potentially build some sort of interop with Potato lang by using its compiler?
16:17:25
jmercouris
I've been thinking and thinking about it, and I was wondering why there is so much C++ code
16:17:32
pjb
jmercouris: the only reason you may have to do bootstrapping, is if you're lost on Mars, can't communicate with Earth, and have built a new computer from scratch.
16:19:21
pjb
Already in the 60s, people DID NOT bootstrap anymore. At IBM, they implemented emulators of new computers to be able to develop the software with old computers for the new computer before the hardware was ready. Bootstrapping is so '40s!
16:21:01
beach
jmercouris: I call it "bootstrapping" in SICL, but it is not that kind of bootstrapping.
16:22:03
beach
jmercouris: I use an existing Common Lisp system to execute SICL code that generates (or will generate) native code.
16:24:19
pjb
jmercouris: already, people implementing new compilers by bootstrapping nowadays cheat, since they use top-notch macOS systems to edit and debug their code. They should bootstrap it using a KIN-1 !!! http://oldcomputers.net/kim1.html
16:25:51
beach
jmercouris: My guess with respect to Common Lisp is that there is this idea that Common Lisp has to be created using some lower-level language, but that is not the case, of course.
16:26:16
beach
jmercouris: Now, building a Common Lisp system is considerably harder than (say) writing a C compiler in C.
16:27:07
beach
jmercouris: The reason is that a C compiler is a simple file translator, whereas a Common Lisp system contains a complex graph of objects right from the start.
16:27:37
Xach
jmercouris: i found it helpful to understand that code to run on a machine is just a sequence of bits, and it's not hard to make a program in any language create a sequence of bits, either in memory on on disk. sometimes it's tricky to know what bits to put in what order, but they are all bits at the bottom.
16:28:07
beach
jmercouris: And, the best way of creating that graph is to execute code. And it is best if that code is Common Lisp code.
16:28:46
Xach
so if the bits on x86 to test for zero and jump are 42, and on arm it's 31, it's not a big deal to make a compiler on x86 generate arm, as long as you configure it to produce the right bits.
16:29:21
Xach
the higher-level management of program meaning is one thing and generating the right bits is another.
16:29:24
jmercouris
Right, I was just thinking about stuff like RISC or something which is quite different than x86
16:30:10
jmercouris
I bet it would be insanely difficult to formally prove that they are computionally equivalent
16:30:42
jmercouris
I did study some formal verification in graduate school, I ended up leaving the class feeling like it was a toy that could never really be used
16:31:40
jmercouris
thanks for the explanations and links, more to think about, I'm off to cook some dinner now
16:38:41
puchacz
so I started ccl locally, I can see its make-hash-table non-standard keyword arguments, but where is it documented?
18:29:55
_death
have you tried reducing the amount of code that runs? if it's only a trivial handler, does it still happen?