freenode/#lisp - IRC Chatlog
Search
12:26:29
knobo3
I experience a big delay when restarting one of my caveman projects on my development server that runs sbcl 1.4.2
12:31:44
Xach
dim: I tried using asdf 3.3.1 to test things, but these problems did not immediately present themselves.
12:39:16
jmercouris
This isn't a strictly lisp question, but within my browser, I have a global-map (as in emacs), I've named it global-map for consistency with emacs, but I'm thinkig about making it *global-map* to be consistent with lisp
12:40:39
jmercouris
Yeah, my other code has earmuffs, but I was thinking of making exceptions for emacs specific variables to avoid confusing people
12:41:00
jmercouris
I think earmuffs for all global vars for more consistency is more important than confusing a few emacs users
12:41:21
jmercouris
ecraven: Yeah, it MIGHT be a little less confusing in the beginning for some familiar variables, but more confusing in the long run
12:41:26
ecraven
also, it's not emacs, is it? so unless you want to emulate more, I wouldn't care about just a few variables
12:41:56
knobo3
Does it load the same project multiple times? https://gist.github.com/knobo/de67a3ab9a55b9b8ab423c75f33936f7
12:42:16
mercourisj
It's not emacs exactly, and emacs is in elisp, this is in lisp, so I should follow lisp convention
12:44:19
mercourisj
ecraven: No, I absolutely agree, it makes a lot of sense, and I hadn't thought of that before, so thank you
12:45:22
TMA
mercourisj: jmercouris: you can point emacs users to a file with a (define-symbol-macro global-map *global-map*) they can load if they wish
12:48:17
jmercouris
I will only personally support webkit on Linux though as I fundamentally do not trust google
12:55:14
TMA
mercourisj: jmercouris: you can point emacs users to a file with a (define-symbol-macro global-map *global-map*) they can load if they wish [this perhaps did not come through]
12:55:38
jmercouris
TMA: Ah, yes I did not see your message earlier, I guess I was disconnected at the time
12:56:28
jmercouris
TMA: so maybe some package they can install that loads a whole bunch of these expansions written out for common vars?
12:57:22
jmercouris
TMA: Maybe I didn't say that correctly, but something akin to package-install, where they can install something that makes "alias" from some special set of vars (emacs specific global ones) to the ear muff version?
12:59:16
jmercouris
I'm starting to feel like Linus now that I have actual users, I can't just break userspace whenever I feel like it
13:01:00
TMA
jmercouris: something like an emacs-compatibility-layer, yes. I think that it might be a package that will be separate, contain the aliases and the users could just (use-package ...) it themselves
13:02:24
TMA
jmercouris: the support burden needs to be considered. Personally I am not convinced that a non-emacs application shall cater to such emacs-specific taste preferences.
13:03:25
pjb
jmercouris: I would (defvar *global-map*) and (define-symbol-macro global-map *global-map*)
13:04:01
TMA
jmercouris: it will just invite "where is the rest of elisp?" and "why haven't you done it as an emacs package?" questions.
13:04:13
pjb
jmercouris: However, this would have the property of letting local bindings to global-map be lexical bindings. Perhaps not what you'd want.
13:04:18
jmercouris
TMA: Lol, that would be funny to see wouldn't it :D I'm already getting questions about Evil
13:05:51
jmercouris
pjb: I've looked at the source extensively already actually :D when I was trying to figure out how to get to stop eating my commands when in the REPL, as well as how to support copy/paste integration
13:06:38
pjb
I would advise to stick to the *convention*. It will let you avoid losing hours debugging strange bugs.
13:08:22
jmercouris
pjb: I'll just pretend I'm not aware of the discrepancy and leave it as earmuffs for now then :P if some emacs user comes across this log at a later time, they can proceed at their own risk :D
13:54:08
minion
schweers, memo from phoe: I know, I was kidding about the manuals. I keep on finding new gems and pearls inside ALEXANDRIA whose manual I've read tens of times and even inside CL.
13:59:23
tfb
schweers: CCL's editor is hemlock, so, yes (I don't know how far it has diverged from other hemlocks)
14:39:05
Xach
Shinmera: halftone has some trouble too -- http://report.quicklisp.org/2017-12-06/failure-report/halftone.html#halftone
14:46:50
Shinmera
Xach: That's the same error as for lionchat. It's from the qt-libs asd, and I still don't understand what it's doing.
14:48:23
Shinmera
:shrug: I can't tell you what's going on. I can't reproduce it, nor explain it in any way.
15:04:36
Shinmera
But that shouldn't have anything to do with the error that's in your failure report. That one is just complete nonsense to me still.
15:07:19
Xach
Now, I could see an argument that halftone is not to blame and it's a breaking UI change in uiop or asdf or something.
15:18:43
eudoxia
the stamp< thing is something Fare reported: https://twitter.com/Ngnghm/status/937885821272756226
15:47:28
jmercouris
Seems to be using some RB somehow, maybe there is an RB to SED transpiler they are using
15:51:30
jmercouris
Zhivago: What do you mean? I have no idea if he wrote it in ruby and just committed the sed, or literally wrote it in sed, there's no way for me to know actually
15:52:03
Zhivago
What I mean is how can you tell if a program is a transpiler or if it is a compiler?
15:53:36
Bike
the documentation suggests that the ruby file is a different implementation of the same thing (lisp via convoluted text editing)
15:56:28
mercourisj
Zhivago: My best guess (not being a compiler expert or anything) is that a transpiler goes from language a -> language b, whereas a compiler will go from language a -> machine code
16:00:10
waynecolvin
all compilers transform source code to object code, just sometimes the output is text files for further processing
16:00:50
mercourisj
I'll just leave this here: https://en.wikipedia.org/wiki/Source-to-source_compiler
16:01:58
Zhivago
wayne: So, a compiler which outputs assembly is a transpiler? But a compiler which includes an assembler and outputs the result of assembly is a compiler?
16:02:43
Zhivago
mercourisj: We have compilers from one machine code to another. Therefore machine code is source code. Therefore all compilers are transpilers?
16:05:26
jmercouris
Zhivago: See: "A source-to-source compiler translates between programming languages that operate at approximately the same level of abstraction, while a traditional compiler translates from a higher level programming language to a lower level programming language."
16:06:59
Bike
well, you brought it up, so if you want to argue about it go ahead i guess. except not since it's definitely off topic.
16:08:10
Zhivago
jmercouris: Ok, so would a lisp to C compiler be a compiler, but a lisp to C compiler be a transpiler?
16:09:28
Bike
the ecl internals manual also helpfully explains some things, e.g. how closures are implemented.
16:09:28
_death
"transpiler" is just javascript newspeak, they need to come up with new terms for everything because they lack historical education..
16:09:54
jackdaniel
and many optimizations are performed on ecl size, so it's not naive transpilation
16:11:53
ercourisjm
Can someone explain what (documentation) wants for "doc-type"? It says "symbol" in the CLHS, but I don't understand what they want
16:11:57
Zhivago
Apparantly a transpiler targets a language of the same level of abstraction and doesn't do many optimizations.
16:12:26
_death
ercourisjm: it depends what you want documentation for.. for example it could be the symbol FUNCTION or the symbol VARIABLE..
16:12:34
Zhivago
Although how we measure the level of abstraction or determing the critical level of optimization is unclear.
16:13:07
jackdaniel
many terms are fuzzy (especially in natural language). but right, not well defined term
16:13:55
_death
ercourisjm: well, actually VARIABLE is not there.. but it's also a generic function, so can be extended with new doc-types
16:17:13
alandipert
i am using lisp for some adventofcode problems, i'd much appreciate any thoughts or feedback on my solution for today's puzzle http://adventofcode.com/2017/day/6 https://github.com/alandipert/advent-of-code-2017/blob/master/day06.lisp
16:17:41
ercourisjm
Bike: Can you explain exactly what is going on then? I'm not doubting your opinion, just trying to understand
16:18:21
Bike
The CL package doesn't even have a symbol CONSTANT (try (find-symbol "CONSTANT" "CL"))
16:18:57
Bike
defconstant makes constant bindings. there is no way to alter a constant binding portably. you can't shadow them. that's what a constant is.
16:19:05
_death
alandipert: looks similar to mine.. https://gist.github.com/death/02e716211827683c48a9c580348fd5a5
16:26:47
mercourisj
I've asked this quesiton awhile ago and looked through the IRC logs to try to find it but could not, what's the way to list all of the variables defied by defvar?
16:27:55
Shinmera
Here's how to do it on some implementations. https://github.com/Shinmera/staple/blob/master/symbols.lisp#L198
16:30:59
Younder
Look Lisp allows you to enter a string for documantaion. It is however optional and should be. But if the interface is documented it should be possible to figure out what function you want.
16:32:23
whoman
.... asinine would be typing like a sloppy pig and expecting everyone to mentally compensate
16:32:49
jmercouris
I'm going to stay offline until my connection stops breaking, sorry for the lurker spam
16:32:54
whoman
and of course usually those times being the times under emotion or stress or anger, which never leads to clarity or understanding.
16:35:14
whoman
it is understood that listing symbols is how we inter-face with lisp. which is interesting because 'graphical' user inter-faces are probably less meaningfull due to not being as linguistic as text/repl/tui
16:37:29
flip214
I tried to subscribe to the elsconf ML; the confirmation link arrived within a minute, but there's no password or welcome message after ~15 minutes....
16:46:49
flip214
ah, sorry for the noise. there's no automatic welcome mail, but "Awaiting moderator approval"
18:04:56
Xach
borodust: but for quicklisp, all new stuff is added, and the old stuff stays in place, and new dists point to a mix of old and new archives
18:05:27
Xach
so one distinfo.txt is updated to point to the new system / release indexes, but the old ones stay in place pointing at older stuff
18:05:41
Xach
but there is a second distinfo.txt that never changes that matches up to that particular set of stuff
18:07:01
Xach
borodust: http://blog.quicklisp.org/2011/08/going-back-in-dist-time.html has the guide
18:49:21
phoe
I want to use a hash table for storing vectors of 16 (unsigned-byte 8)s. How should I do that? EQUALP?
18:55:06
pjb
phoe: yes, you have to use equalp. Notice that if they were vectors containing strings, strings would be compared case insensively.
19:22:03
gendl
Hi, if I have an error object in a variable, how can I actually "throw" that error and land in the debugger?
19:24:35
gendl
I have an existing handler-case, I want to keep it mostly the same, but just have it signal the error right now for debugging purposes.
19:24:45
jasom
gendl: handler-bind will automatically resignal if you don't have a non-local exit; this is one of several differences between bind and case
19:25:22
Bike
jasom: this is slightly inaccurate- rather than resignalling, it just doesn't stop the existing signaling from continuing
19:25:25
jackdaniel
handler-bind doesn't unwind the stack (important note if you are interested in a backtrace)
19:26:53
jackdaniel
nb, if you want to have backtrace and actually handle the error, you want handler-bind inside handler-case ;)
19:27:00
jasom
gendl: for logging backtraces http://shinmera.github.io/dissect/ has a pretty good out-of-the-box experience; you can literally just bind #'dissect:present and be done.
19:27:52
jasom
gendl: handler-case will give you the backtrace for the scope in which the handler-case appears (the stack has already unwound to there by this point) handler-bind will have available the stacktrace at the point of the signal (the stack has yet to be unwound)
19:29:03
Shinmera
As jasom mentioned, with dissect you can capture the stack information and pass it around as you want.
19:29:30
jasom
this is also why handler-bind doesn't silence the error; you need to manually unwind the stack (e.g. throw) , wherase handler-case has already unwound the stack for you.
19:42:49
k-stz
In 64bit sbcl, fixnum are of size 2^63, this can be verified by adding `most-positive-fixnum' and `most-negative-fixnum'. That leaves a single bit (63+1) to be the lowtag identifying the type in memory.
19:42:52
k-stz
I try to understand how a single bit suffices for this, also reading the sbcl internals talks about lowtags. Where memory is dword (2x64bit) alligned and the least significant, low, 4bits of that alligned memory is used for type information.
19:45:55
k-stz
in sbcl all lips objects have type information in memory, so should't there be more bits to distinguish them all
19:49:33
jsnell
k-stz: xxx0 are all fixnums; xxx1 are types of other values, with 3 bits to identify further
19:58:08
jsnell
I guess looking at https://github.com/sbcl/sbcl/blob/master/src/compiler/generic/early-objdef.lisp would be a useful thing to look at
20:00:19
k-stz
So if i understand correctly: every pointer that starts with a 0, is identified to point to a fixnum, else the next 3 bits are read to identify other types. Now these 4bit-tag are already part of the pointer to the object in the lisp-heap, because they are dword aligned, the pointer doesn't need the lower 4 bits to distinguish the 16bytes within.
20:02:17
sjl
k-stz: ending with a 0 doesn't mean it points to a fixnum -- it means the fixnum is immediately encoded in the other bits
20:02:50
k-stz
sjl: ah that makes sense! because fixnums are supposed to guard against heap allocation
20:14:06
k-stz
that seems clever to me, is that common implementation practice? I guess the C malloc()/free() couple implementation might use those tricks too
20:15:12
pjb
In one or two old implementation, the type tag was relatively to a memory page, so all the object allocated in a given page were of the same type. But AFAIK, all implementations had immediate values, for optimization.
20:15:29
sjl
k-stz: it's been common/around since 1966 https://www.snellman.net/blog/archive/2017-09-04-lisp-numbers/
20:15:51
pjb
Since the start, the first LISP implementation used this trick, which was natural on the 7090.
20:16:19
pjb
Actually, one could say the 709/7090 was a lisp machine; it even had a EVAL I mean, XEC instruction!
20:16:52
sjl
pjb: do you have a source for that? the post I linked says disagrees that lisp 1/1.5 did it, and cites their manuals
20:18:22
sjl
sure. but according to the manuals, lisp 1/1.5 didn't do it, even if it was around beforehand
20:22:12
osune
I'm looking at database bindings for storing a little bit of data (3 - 4 relational tables ; ~ 300 rows each ). I would go for cl-sqlite but I've seen rucksack(http://quickdocs.org/rucksack/ ), too. Has somebody experience with this?
20:24:38
jsnell
pjb: yes, those are the exact sources that show that those Lisp implementations did not encode immediate values in pointer values via tagging
20:27:45
jsnell
pjb: you have a very curious definition of immediate, I guess. a number in Lisp I is four conses + a heap-allocated raw value
20:35:43
phoe
osune: that's not a lot of data, rucksack might be able to help you here if you're looking for a portable solution.
21:03:11
felideon
phoe: on a cursory look, planks seems to abstract the rucksack transactions and serialization stuff.
21:04:07
felideon
osune: so if your 4 tables map nicely to CLOS objects, planks might be worth a shot.
21:05:18
osune
planks didn't provide a tutorial / manual / docstrings or i missed them all ; so I was unsure what it provides
21:06:13
felideon
osune: seems like https://github.com/drewc/planks/blob/master/src/persistent-objects.lisp is where the magic happens.
21:06:50
felideon
I'm assuming you want to inherit PERSISTENT-STANDARD-OBJECT when you create your classes.
21:08:25
osune
you are assuming wrong cause I have no idea what you are talking about ! This is my first dip into persistance in common lisp beside from "write it to a file", so this symbol is unkown to me.
21:10:16
felideon
osune: no worries, I mispoke. I should have said 'I would imagine having to inherit'
21:13:04
osune
ahh I see. I think I start to understand the rucksack way first, from there I hope to understand what problem planks tries to solve. Thanks for your help
21:16:03
osune
I think this is to heavy weight for my current usecase. But I keep it in mind. thanks
21:21:48
felideon
osune: I see the tutorial now. I was wondering why class definitions had to be wrapped in transactions and the answer is in there.
21:22:37
felideon
osune: If you want another simple example, I also played with rucksack a few years ago, based on the tutorial. https://github.com/felideon/cluckin-sack/blob/master/cluckin-sack.lisp
21:41:17
jmercouris
I need to basically make autocomplete for my describe-symbol function in my browser and I was going to limit it to *earmuff* symbols, so I wanted to just have a filter
21:43:06
jmercouris
Another thing I've been thinking about lately is the elisp convention of (interactive) within a defun body making the command callable by the command system, is there a way I can achieve something similar in common lisp?
21:43:18
pjb
jmercouris: of course, you can filter the result of (package-symbols), but it would be faster to filter while do-symbols, or even, to use apropos-list.
21:43:40
pjb
(apropos-list "\\*" "CL-USER") #| --> (*read-eval* … *oldest-forward-compatible-asdf-version*) |#
21:43:54
pjb
but it's not conforming, the syntax in the first argument of apropos-list is implementation dependant.
21:45:00
jmercouris
pjb: I'd like to stick with things that are standard across implementations mostly
21:45:35
jmercouris
The thing about the (interactive) within the body of the defun is, I don't understand how I'd get a reference to the current function to register it, somehow I feel like this involves a part of lisp I am unfamiliar with so far
21:46:28
pjb
jmercouris: first, in CL it's written (declare (interactive)). emacs lisp has this special case declaration (interactive).
21:46:46
pjb
jmercouris: then, indeed, non-standard declarations must be processed by your own tools.
21:47:02
pjb
So if you want it to be processed when you evaluate the defun form, it must be your own defun macro.
21:47:30
Bike
you could also have a table of interactivity information, like a hash table where the keys are functions, and have a like (register-interactive function specification-goes-here)
21:49:49
pjb
jmercouris: be careful in macros, try to avoid compilation-time stuff, since it makes it harder to compile-file.
21:50:58
jmercouris
Yeah, I will have to be careful, I've already really messed up my keybinding definition macro I think, I will probably have to redo it and simplify the definition of commands I think
21:51:19
jmercouris
It is way too obtuse, even when I am implementing new keybindings I am having to look up my own syntax
21:53:26
emaczen
I'm getting different results between SBCL and CCL -- what are some common things to check?
21:53:55
pjb
For example, hemlock-interface:defcommand doesn't defun at compilation-time so the compiler cannot know that the command is a function, so if you try to call it in other code compiled, you will get a undefined function warning… This is bad.
21:54:22
pjb
But if you call the make-command function that follows at compilation-time it's bad too…
21:55:10
Xach
emaczen: there are many differences, like in how random state works, the internal time units, etc. What kind of stuff does your code do?
21:58:58
emaczen
At the moment I'm mainly interested in looking at deleting caches or other compiler stuff that would be differnet between SBCL and CCL
21:59:48
Bike
(load (compile-file "whatever.lisp")) will force recompilation and reload of whatever's on your disk.
21:59:53
Xach
whoman: I use it, but I think the built-in stuff in asdf does a lot of stuff and more portably too.
22:01:59
Bike
something to notice here is that the caching is done by asdf rather than by your implementation.
22:02:34
Bike
so what else are you doing? calling any libraries that use implementation details? getting into the package system? what?
22:18:07
Xach
emaczen: it is cruel to string me along like this :( i am dying to know what is going on!
22:19:49
emaczen
Xach: I'm inspecting, trying to find reasonable discrepancies, taking educated shots in the dark!
22:22:47
jasom
emaczen: what happens when you modify literals (if you use backtick you may have literals and not realize it)
22:24:17
jasom
emaczen: if sbcl has no style-warnings then you are less likely to be doing it though.
22:25:02
jasom
and on other implementations it may cause all appearances of '(1 2 3) to behave like '(1) afterwards
22:37:06
emaczen
well, I may have narrowed it down to a specific function of mine, SBCL always returns the same thing, whereas CCL does not and CCLs return value is very different each time...
22:37:26
emaczen
I still have no idea why or which implementation defined feature is causing it, but I'm getting there
22:45:23
emaczen
I will if I really can't figure it out -- if I pasted it, you would need a lot of other code still
23:14:03
jmercouris
I have something like do-symbols in a list of symbols, I want to turn that list of symbols to a list of strings
23:32:13
Xach
it is interesting that you can make a web browser without knowing how to get a symbol name as a string.
23:40:38
jasom
jmercouris: symbols are also string designators so you can just do e.g. (string 'foo)