freenode/#lisp - IRC Chatlog
Search
7:45:01
LdBeth
is it good idea to store the instruction database :allocation :class into a mixin class so the database can be isolated for different machine
8:28:13
g0d_shatter
LdBeth: I'm sorry I can't help you, but I'm super curious what the application is if you can talk about it!
8:30:23
LdBeth
g0d_shatter: it an assembler modeled after the one used for Symbolics Virtual Lisp Machine https://github.com/hanshuebner/vlm
9:00:12
lieven
yeah the ANSI committee is going to reconvene and bring out a new version of the standard with the deprecated functions removed any day now
9:03:07
heisig
There is none. I think at some point in time, people were too hyped about cl:complement and made some funny choices.
9:05:40
jackdaniel
orthogonal features like complement make a lot of sense from a learning perspective, but deprecated in case of CL means: it will be around for another three standard revisions
9:22:06
aeth
You all covered pretty much every point in one of the strangest CL flamewar topics except also... remove-if-not is faster unless the compiler optimizes remove-if complement, which the compiler authors are less incentivized to do because remove-if-not exists, even though remove-if-not is deprecated
9:31:50
aeth
lieven: Last time it was brought up (although for all I know it was implemented 15 SBCLs ago) it wasn't quite as trivial as it sounds, but imo the key thing it shows is that it wasn't seen as particularly idiomatic or else it would have been optimized already.
9:32:32
heisig
lieven: Heh, 'easily'. Have you ever tried parsing keyword arguments in a compiler macro :)
9:34:01
heisig
And there is the problem that you couldn't optimize (let ((g (complement f))) (remove-if g x)), because the compiler macro only sees 'g'.
9:34:48
aeth
heisig: re keywords, is there a way to get to the point where you can use destructuring-bind? I've never written a compiler macro
9:36:03
lieven
heisig: sure. the whole point of optimizing is to get the low hanging fruit. if people are deliberately obfuscating their code, they can live with the default speed
9:37:44
heisig
aeth: Hmm, one could check that every second argument is a valid keyword, and then use destructuring-bind. Then one would still have to make sure that the order of evaluation is preserved.
11:25:32
heisig
phoe: Issue TEST-NOT-IF-NOT Writeup: "Several alternative names for REMOVE-IF-NOT were suggested: KEEP-IF, ABSTRACT, FILTER. We did not pursue these suggestions."
11:29:46
galdor
did someone already this issue where emacs open all flexi-streams files when loading the system in slime ?
11:33:04
phoe
heisig: IMO twenty+ years of Common Lisp practice have shown that the future ANSI CL committee should likely pursue them at some point in time
11:42:35
heisig
Even if there ever was a new standard, there cannot be any changes to the CL package. Otherwise, this new standard would break existing code.
11:44:57
heisig
I think it would be hilarious if there was a new CL standard, and it would essentially be 'We fixed a few typos and clarified a few descriptions'.
11:48:12
scymtym
"typo fixes and clarifications? why didn't you add lambdas and compile-time metaprogramming? everybody has those nowadays"
14:24:17
pfdietz
slyrus: I have let the power of being able to merge pull requests in fset go to my head, and have merged one of yours from 2018.
14:30:21
chimneys
do i need to run loading after installation as well,.. https://www.quicklisp.org/beta/#loading
14:31:26
chimneys
I open I see sbcl inside it, but it says kernel connecting and cells don't execute
14:33:49
chimneys
A connection to the notebook server could not be established. The notebook will continue trying to reconnect. Check your network connection or notebook server configuration.
14:46:53
dnaeon
hey all! i have two packages that export the same symbols, e.g. package `A:foo` and then I have package `B:foo`. How could I import these symbols into my own package and use both `A:foo` and `B:foo`? Any way I could import-alias them or similar?
14:47:54
jackdaniel
basically you can't import two different symbols with the same name into the same package
14:48:25
chimneys
how do i install the new kernel cl-jupyter , is it not installing because of virtual envs
14:48:49
pjb
dnaeon: (defpackage "YOUR-PACKAGE" (:use "CL" "A" "B") (:shadow "FOO")) (in-package "YOUR-PACKAGE") (+ a:foo b:foo)
14:50:10
pjb
dnaeon: you can also consider whether those two foos are actually the same. For example, it may be the name of a generic function and a:foo is a method on As, while b:foo is a method on Bs. Then both packages A and B should use a package I that exports FOO and (defgeneric foo (…)).
14:50:30
pjb
dnaeon: of course, it may be two entirely different foos, such as cl:car and tesla:car…
14:50:54
phoe
so if you have symbols QWERTYUIOP:FOO and ASDFGHJKL:FOO, you can local-nickname the packages to Q and A
14:52:51
jackdaniel
chimneys: I know that venv is some clever mechanism to bypass problems with the packaging, toher than that I try to not think about things like this
14:52:59
dnaeon
Ok, I was under the impression that if I use `(defpackage my-package (:use :A :B))` then within my package all symbols from `A` and `B` would inherited and cannot fully qualify things such as `A:foo` and `B:foo`.
14:56:49
chimneys
if you don't like to think about it , think what a beginner might be going through who is pasting lisp cmds without understanding them
14:59:44
phoe
USEing a package means that you can refer to all of its symbols without qualifying them with the package name
15:02:06
phoe
because then conflicts occur, and you need to explicitly choose one or the other or not use both packages at the same time.
15:03:13
phoe
There's also the issue if an USEd package decides to change its export list later on, e.g. because it decides to export new functionalities. It means that sudden use conflicts can arise even when you do absolutely *nothing* - only because a dependency has changed.
15:03:31
pjb
If two packages export symbols with the same name, you can use them, shadowing this name!
15:03:43
phoe
pjb: yes, I meant that by explicitly using one or the other - by means of SHADOW or SHADOWING-IMPORT-FROM
15:04:11
phoe
and I don't think that you have a support contract with Shinmera to be able to tell him that it's his job to help you out
15:04:50
phoe
perhaps if no users of cl-jupyter are in here, you could try raising a GitHub issue with the details
15:05:21
phoe
I think it'll capture the maintainers' attention more surely than expressing slightly immature behaviour on IRC
15:07:39
beach
chimneys: Maybe you have misunderstood the purpose of #lisp. It is not a support channel for newbies. It is a forum for discussing the language, its implementations, libraries, and applications between users of Common Lisp.
15:13:07
galdor
are there other general CL communities ? I mean there used to be the pro-lisp mailing list but it's dead
15:14:21
jackdaniel
and there are repositoreis on gitlab.common-lisp.net (so you could say that cl.net users form some kind of a community)
15:16:17
jackdaniel
I've never managed to configure usenet client properly, probably I'm too young :) but I've been told I've avoided plenty of bad experience, so :)
15:24:12
phoe
with an occasional worthwhile post from Jim Newton who seems to be magically immune to all of the shitposts that happen there
15:44:34
beach
The people behind it are regulars at ELS and there have been presentations about its purpose, its organization, etc.
15:47:48
galdor
I wasn't aware of them, I do not hear anything about who they are, what they do, etc.
15:48:15
jackdaniel
galdor: they among other things host common-lisp.net and services associated with it
15:52:52
jackdaniel
if you chip in with your expertise there will be four. that said they do a tremendous job. you may want to say hi on #common-lisp.net
15:55:02
pjb
galdor: YOU are responsible to update the wiki! cliki.net is a wiki, if YOU find someting wrong, YOU must correct it!
15:55:47
galdor
I guess it is the same things with sending patches, it's all fun and all, then you realize you are mostly alone in it and abandon
15:59:06
easye
chimneys: that volunteer list needs to be updated. flip214 has been putting in a lot of effort as well.
16:00:02
chimneys
but the site has only one top admin who control everything? because i see the mainatainer changing
16:22:04
beach
The description of TRACE in the SBCL manual mentions that "breakpoints" are used when :ENCAPSULATE is NIL. TRACE is can perform actions upon function entry and before function exit, and one possible action is to stop execution (break).
16:22:06
beach
But does anyone happen to know how these breakpoints work, and whether these breakpoints are available at other places in the code, and if so, how to set/clear them?
16:24:25
Nilby
I used things like sb-di:make-breakpoint sb-di:activate-breakpoint in my debugger. I don't really know how they work though.
16:34:21
beach
Sure. The stepper documentation mentions that it is "instrumentation based", and for stepping to be available, the DEBUG quality must be greater than all of speed, space, and compilation-speed.
16:35:54
beach
But there does not seem to be any documentation for sb-di:make-breakpoint etc., other than the docstrings.
16:40:29
Nilby
I probably should have documented what I discoverd about it, but I didn't feel qualified.
16:49:58
Nilby
Thankfully the code in debug-int.lisp has a lot of nice comments. I sometimes wish they were in the docstrings though.
16:50:07
beach
AHA, the comment in the stepper says it works differently. It says that the compiler inserts "STEP-CONDITION signalling [sic] forms into code compiled at high debug settings, and having a handler for them at the toplevel."
16:54:17
beach
Nilby: Not quite sure what you mean by that, but I think I have enough information for the "Previous work" section of my paper.
16:57:35
Nilby
karlosz: Right, but when you have a huge comment in the code, and no docstring in an external interface function, I wish they would have just copied a few lines into the docstring. I feel like old code didn't want to bloat memeory with docstrings.
17:00:05
karlosz
there's a feature called sb-doc that will even remove docstrings from standard library functions (and extensions etc.) because it will save memory in the core image
17:01:20
Nilby
I want the opposite function. Put all the docstrings back, even the ones that aren't there.
17:02:16
karlosz
i mean you need the source to understand the implementation anyway, i don't see why its advantageous ot have it in a docstring
17:04:45
karlosz
actually a lot of the implementation details are in a manual, rather than a docstring ;)
17:06:13
beach
There is an "internals" documentation, but it doesn't mention breakpoints as far as I can tell.
17:06:58
Nilby
Not understanding doesn't seem to stop me. Not knowing what of types arguemnts should be does though. Although I guess I could ask the compiler's type inference. :-)
17:07:57
pjb
Perhaps I could redo cl-stepper with this technique, it seems a lighter instrumentation.
17:08:14
karlosz
the real one is here: https://cmucl.org/docs/internals/design.html#Tracing-and-Breakpoints
17:10:38
karlosz
yep. for the next SBCL release i added a new section called "Advanced Compiler Use and Efficiency Hints" which says to read the CMUCL user manual because they describe how to optimize code for the compiler (which hasn't changed) in 100x more detail
17:11:18
karlosz
with a whopping 50 pages of optimization tricks and descriptions of how the compiler works
17:20:12
beach
Given that SBCL has these breakpoints, it is very surprising that no real source-level interactive debugger exists for SBCL. Unless of course, I am missing something obvious.
17:21:01
beach
I mean, SLIME could provide a key sequence to set a breakpoint in the code indicated by the editor point.
17:25:19
karlosz
i mean the functionality is all there. i don't think its the compilers job to deal with things like have source level interaction
17:25:34
karlosz
i think the reason there wasn't any in the compiler is because in CMUCL hemlock provided it
17:27:46
karlosz
unclear how to do source level interaction without an editor interface to the compiler
17:30:39
karlosz
speaking of CMUCL, the next release of SBCL will have whole program optimization a la CMUCL block-compilation
17:31:18
karlosz
so you can finally have your unboxed floating point calls and returns where you please
17:32:36
beach
Anyway, thanks for all the information. Time for me to go have dinner with my (admittedly small) family and then spend time with her.
17:44:42
asarch
With Postmodern, why don't: (query session :select "foo,bar" :from "baz" :where "id = 32424")?
17:45:47
asarch
We could even do: (query nasa-session ...) ... (query ibm-session ...) ... (query 4chan-session ...)
18:16:16
pfdietz
I don't think people realize the state of the compiler at the fork. It was not very mature.
18:17:20
karlosz
pfdietz: i will admit that i tend to have rose-colored lenses looking to the past. but the point on documentation and ease of reading the source still stands
18:18:51
SmallBrain
I've never written any code in my life before and figured "why not start with Lisp?" so I downloaded Portacle and read through the tutorial and at some point it said: "execute-extended-command has be rebound to the <execute> button" where is that?
18:20:12
pjb
SmallBrain: basically, it's an event loop that reads the next character, and looks up a table (key map) to find a function (command) to be executed.
18:20:21
pfdietz
My schtick is torturing lisp compilers until they confess. SBCL's compiler is quite resistant now. CMUCLs? It breaks almost immediately, even now.
18:20:39
pjb
SmallBrain: the nice thing is that you can configure this key map table at any time, during the execution of the program.
18:21:06
karlosz
pfdietz: yeah, from reading the source it seems that your bugs provoked a lot of backporting of sbcl fixes into cmucl by gerd
18:21:40
pjb
SmallBrain: if you have a key labelled <execute> on your keyboard, you can map the keycode of this key to the X11 key sym, and then you can map in emacs this keysym <execute> to some command, such as execute-extended-command.
18:22:06
karlosz
makes you wonder if it wasn't forked, given that people kept porting patches to and from CMUCL constantly until about 2004 when it became a ghost town there
18:22:10
pjb
SmallBrain: without such a key, it is customary, and the default, to use the key combination Meta-x (noted as M-x).
18:22:39
SmallBrain
pjb: ah, the problem is, I don't have that key and portacle has Meta-x rebound to something else
18:22:51
pjb
SmallBrain: the Meta keysym is usually mapped from a key labelled Meta, or if not present, a key labelled Command, Windows, or evne Alternate or Option.
18:23:05
karlosz
and, sometimes the patches when ported to cmucl would accrue improvements and those improvements wouldn't make it back
18:23:19
pjb
SmallBrain: the mesasge may be misleading, because the basic operation is adding a new key binding, not removing the old one.
18:24:01
pjb
SmallBrain: so M-x might still work. If not, the meta key is also mapped by emacs from ESC escape. But since ESC is not a modifier, you have to type it separately, first ESC, then x.
18:24:38
pjb
SmallBrain: you can also see where the execute-extended-command is bound, by typing C-h w execute-extended-command RET
18:24:58
SmallBrain
phoe: yes, I just downloaded it because it seemed less of a hassle than configuring everything myself
18:25:08
pjb
it will say you something in the minibuffer such as: execute-extended-command is on <execute>, <menu>, M-x
18:25:40
pjb
and inversely, you can know what command is bound to a key by typing C-h k followed by the key.
18:25:49
SmallBrain
pjb: i tried that and it literally said: "execute-extended-command is bound to the <execute> key"
18:26:33
SmallBrain
pjb: and google only gave me stockphotos of a return key where "execute" was written on it
18:26:50
Nilby
If you want you can probably type something like: <Esc> X global-set-key execute-extended-command <F1>
18:26:53
pjb
SmallBrain: go to the scratch buffer, and type: (global-set-key (kbd "M-x") 'execute-extended-command) C-x C-e
18:27:43
pjb
SmallBrain: you could also do that in the minibuffer with M-: (global-set-key (kbd "M-x") 'execute-extended-command) RET
18:28:21
pjb
Nilby: if the command execute-extended-command is only bound to <execute>, then ESC x is not bound to it, and won't do anything.
18:29:08
pjb
SmallBrain: yes, you can add a key binding with global-set-key, or with local-set-key when you want it only in the current buffer.
18:29:50
pjb
SmallBrain: you can have a bunch of global-set-key forms in your ~/.emacs to customize emacs as you wish.
18:30:54
Shinmera
Anyway, you don't need to read the Emacs tutorial. All the necessary terminology and keybindings are explained in the Portacle help buffer.
18:31:14
Shinmera
Due to portacle's customisation the emacs tutorial is more likely to be confusing than not
18:31:25
pjb
Shinmera: so perhaps portable should issue a message saying that "execute-extended-command has been rebound to the <execute> button" is not alarming because there's still a M-x working the same or better?
18:31:59
SmallBrain
Shinmera: I figured i couldn't hurt because i had never used any program like that
18:32:35
pjb
If you tell me that M-x doesn't work, it's very alarming to me, and I guess to any emacs user.
18:33:06
SmallBrain
pjb: the tutorial said too that M-x was rebound, I just couldn't find any "execute" key
18:33:09
phoe
or rather just mention that "if you want to use the vanilla emacs tutorial - be aware that it will not be useful, since Portacle was customized compared to the vanilla emacs and the tutorial won't cover that"
18:33:57
phoe
I can imagine a situation where someone downloads portacle, fires up the default tutorial, and gets stuck there because the tutorial doesn't apply to emacs
18:34:24
pjb
SmallBrain: so, the thing is that <execute> is the name of a virtual key (a keysym), not a physical key identified by a keycode.
18:35:00
pjb
SmallBrain: if you are on X, you can map some physical key you are not currently using, to the <execute> keysym, my editing a xmodmap file.
18:35:15
SmallBrain
I think the tutorial is fine as it is, it was probably just not written with the thought that someone as clueless as I could try it...
18:37:16
pjb
SmallBrain: for example, if the <Pause> keysym is mapped from the keycode 111, and you don't use it, you could map it to <execute> By replacing the line: keycode 111 = Pause Break by keycode 111 = Execute in ~/.xmodmap and reloading it with xmodmap ~/.xmodmap
18:37:59
pjb
SmallBrain: you could then scratch the Pause label and paint a new Execute label, or just erase all labels and remember them from key position (use a Das Keyboard blank keyboard or similar).
18:38:26
pjb
SmallBrain: Alternatively get yourself a SpaceCadet keyboard with all those funny key labels :-)
18:39:45
pjb
SmallBrain: but the thing is that with portable, execute-extended-command is not useful, since it's replaced by another command. Try: C-h k M-x to see which one. So you can just forget about the <execute> key.
18:40:04
phoe
I suggest that, if you want to go with the tutorial, you download the vanilla emacs and do the tutorial there
18:40:32
phoe
this way, you'll avoid the inspecting and rebinding mess that pjb is suggesting now, and you'll go straight to learning emacs instead.
18:40:49
phoe
since I don't think you want to learn how to turn portacle into vanilla emacs - you want to learn emacs instead
18:41:40
phoe
and I'll disagree, portacle is good enough when you don't want to invest your time and set up your own emacs installation for whatever reason and want to just hack some lisp.
18:41:49
SmallBrain
was it perhaps masochistic to try to learn programming with LISP as first language over all?
18:42:28
pjb
SmallBrain: no, it's really simple. But some people want to load a ton of pre-configured tools on newbies. This is not a good idea.
18:42:37
SmallBrain
I mean I want to learn Lisp, but most people suggested I start with Python or Javascript
18:42:49
pjb
SmallBrain: it's better to let you use your own editor, take a CL implementation, and run it in a terminal.
18:43:11
phoe
take into account language popularity though, python and JS are hundreds+ of times more popular than CL
18:43:34
phoe
it's possible to learn programming by doing Lisp, and there's one book that was written exactly for that reason
18:43:40
minion
SmallBrain: please look at gentle: "Common Lisp: A Gentle Introduction to Symbolic Computation" is a smoother introduction to lisp programming. http://www.cs.cmu.edu/~dst/LispBook/
18:43:46
pjb
SmallBrain: after a week or so, you'll be fed up typing (load "my-source.lisp") in the REPL, so you'll be ready (ie. you will understand what and why) to use emacs and tools to integrate the editor with the CL implementation.
18:44:27
chimneys
SmallBrain: no just learn lisp in one hour that "gentle" tutorial is too big and rough, didn't waste time. In fact I am learning lisp from derek banas youtube tutoiral
18:45:31
pjb
SmallBrain: and similarly, emacs is very big so as a newbie, you could easily be overwhelmed. The thing with emacs is to start with the "bare" emacs, and to install and use emacs packages when you start feeling the need for them. Not pre-installing them, because then you won't understand what you did and why. And be prepared: you will never finish learning emacs, a lifetime wouldn't be enough!
18:47:00
phoe
SmallBrain: the way pjb is suggesting is actually the long one and AFAIK portacle attempts to be a shortcut for it. common lisp and emacs are pretty closely tied to each other by means of an IDE package called Slime.
18:47:37
phoe
and Slime is basically a requirement to utilize what's actually good about Lisp - the fact that it's an interactive and image-based language
18:48:11
phoe
image-based, meaning that you run Lisp once and then program by means of mutating that image
18:48:49
SmallBrain
phoe: I'l need more experience before I can accurately understand what that means
18:49:30
phoe
many other languages work by the means of writing your program in a text file, running it through a compiler, and executing the resulting program
18:51:04
phoe
and you program by changing these contents - for example, if you define some new functions, you add some new stuff to the Lisp image
18:51:23
phoe
if you tell Lisp that this previously defined function should instead do another thing, you modify stuff in the Lisp image
18:52:05
phoe
and you do all of this without ever turning it off - unless you screw something up so badly that a restart is required (;
18:52:29
phoe
that's why it's interactive - you converse with the Lisp image by telling it to add X or change Y or remove Z or run a piece of code
18:53:02
SmallBrain
without having to close the compiler, and rewriting everything in the text file and running it through the compiler again, only to find out that something is wrong
18:53:34
phoe
if you screwed up while writing a function, you only need to fix and recompile that function
18:54:36
SmallBrain
so does that mean the overall coding process is faster than with other languages?
18:55:44
dnaeon
hey folks, can someone please explain the following behaviour of `defpackage` when used along with Quicklisp and ASDF? https://gist.github.com/dnaeon/5018d1e5ebbc22a59f67a8e1b6a6ef35
18:56:25
phoe
the fact that Lisp can look into its own self pretty deeply is very fun - the debugger plus the inspector are a powerful combo
18:56:45
Xach
dnaeon: :USE and :IMPORT-FROM are about how you type symbol names and if they require prefixes or not
18:57:12
phoe
slime makes it possible to interactively inspect the stack and see the values of the local variables and the contents of these values and the contents of the contents of these values and so on.
18:57:47
pjb
SmallBrain: the emacs description I gave you above, where you can modify the keymap bindings in the program that is currently runing, actually it's based on an emacs lisp image-based development scheme. The idea is that you have a program, (a bunch of functions), and you can add, remove or replace functions while the program is running, as well as inspecting the data and of course modifying the data while the program is running.
18:58:11
pjb
SmallBrain: so when you program in an image-based system, you are actually modifying the running program.
18:58:56
SmallBrain
And that book that was linked further up, does it contain something like a list of possible formulas for Lisp-commands? or would that be a sisypho-task?
18:59:05
pjb
SmallBrain: of course, such a system doesn't only contain a compiler. At least, it will contain either an emacs (event loop -> key -> function), or a REPL = read eval print loop: (loop (print (eval (read)))).
18:59:59
pjb
SmallBrain: but you can have all kind of features implemented in an image based system, including an editor such as an emacs (which is the case for GNU emacs using emacs lisp, or for example Hemlock implemented in Common Lisp), and other applications.
19:00:03
phoe
SmallBrain: you usually don't need to get from the written text to a separate executable
19:00:25
Xach
executables are one thing that you can make but it isn't always the main thing like it is in other environments
19:00:36
dnaeon
Xach: phoe: in general that would mean that any dependency defined in my ASDF system will be available to my packages using the fully-qualified package path, and using `:USE` or `:IMPORT-FROM` within `defpackage` is more like a convenience, isn't it? e.g. whether you need just some symbols imported or inherit all of them from a given package?
19:00:39
SmallBrain
phoe: I was hoping for something like explanations for formulas like "if-then-else"
19:01:14
phoe
SmallBrain: that book contains explanations for such basics, and many other things in the language
19:01:15
pjb
SmallBrain: this is a question of delivering executable. Nowadays, we mix file-based development with image-based development, by editing files saved on the file system, outside of the image, and constantly being compiling and loading those files. We can do that because our computers have become very fast, so we can recompile and load interactively.
19:01:39
phoe
in many other languages, making executables is the only way to interact with the programs written in these languages
19:01:42
pjb
SmallBrain: so since the program is saved in files, once it's completed and debugged, we can use those files to generate an executable.
19:01:57
phoe
and your program can be invoked fully from the Lisp REPL, without ever needing to leave it
19:02:16
pjb
SmallBrain: it can be either by loading them in an image, and saving it as an executable image (most cl implementations do that), or compiling them and linking them (eg. with ecl).
19:02:49
pjb
SmallBrain: but you can also deliver lisp programs in other ways, eg. as sources, or as fasl file (ie. compiled files that can be loaded and run later).
19:05:11
SmallBrain
alright, I can't thank you all enough, I was about to give up since I had been sitting at this problem since yesterday
19:06:09
Xach
SmallBrain: i find it's a real help to ask people for help and get answers in real time.
19:07:13
[df]
one day we will all have our brains plugged in to one global lisp image running on a planet-sized supercomputer
19:08:52
phoe
SmallBrain: filed an issue at https://github.com/portacle/portacle/issues/130. Thanks for finding a bug in Portacle. (;