freenode/#lisp - IRC Chatlog
Search
8:03:17
Willi-Smith
Hi, can somebody explain me error "The function SB-EXT:DISABLE-PACKAGE-LOCKS is undefined." when I'm trying "(ql:quickload :ltk)". Run by cl-launch. Thanks.
8:07:42
phoe
sb-ext:disable-package-locks is a SBCL-specific declaration, not a function, so using it as a function is invalid anyway
8:13:44
Willi-Smith
I'm very beginner in lisp and this is my first project with GUI. I need some lightweight environment so I chose cl-launch with sbcl (on arch linux). For run project I use 'cl -Q --source-registry /home/william/.local/share/common-lisp/source: "%f"'. In source folder is unpacked ltk. I guess I'm wrong with my approach.
8:15:08
no-defun-allowed
Huh, the symbol sb-ext:disable-package-locks is present here but not fbound.
8:15:54
no-defun-allowed
I suppose it is; I thought it was once a function, and I think the ltk author must have too.
8:18:23
Willi-Smith
LTK is downloaded from: http://www.peter-herth.de/ltk/, I expect cl-launch uses system sbcl which is sbcl-2.0.3-1
8:22:17
phoe
https://github.com/herth/ltk is where Quicklisp pulls its versions from, so it should work on SBCL 2.0.3
8:30:21
Willi-Smith
Now I can quickload it without error. Last thing is how can I start using ltk package? After I test (ltk::ltk-eyes) this error shows 'READ error during COMPILE-FILE: Package LTK does not exist.'
8:30:51
ym
Hi. I have a simple expression: (mod (apply #'+ angles) (* 2 pi)) ; it returns value > 2pi in some cases. Is it rounding problem?
8:33:50
Willi-Smith
Do I need to create .asd system file for my project or can I only quickload ltk in my .lisp file?
8:34:35
White_Flame
regardless of how it's loaded (and completely regardless of how your other stuff loads), once LTK is in the package should exist
8:37:07
fe[nl]ix
phoe: I statically linked it to libfixposix (git), libcrypto and libssl 1.1.1g, upgraded ASDF to 3.3.4
8:38:39
phoe
does it mean that CFFI is automatically instructed not to look for these libraries externally?
8:39:33
Willi-Smith
This simple .lisp example gives me error "(ql:quickload :ltk) (ltk::ltk-eyes)" > Package LTK does not exist.
8:39:46
fe[nl]ix
phoe: that said, you can simply comment out the loading in the respective sources (cl+ssl or iolib) if you want to play with it
8:42:18
phoe
Willi-Smith: I have no idea what cl-launch does nor I have ever used it in my life; I'm a SLIME user
8:43:53
phoe
nothing I'd like to use if I was beginning to learn, especially if I wanted to use the interactive facilities that Lisp provides
8:44:25
Willi-Smith
I chose it because I can simply run lisp from bash. It works well but Im confused about package importing. It has bad documentation.
8:45:36
no-defun-allowed
I would advise against running Lisp like a "batch" compiler, as using it interactively will make you much more productive and make programming easier.
8:46:26
phoe
so you might find little support for it - there's few people who do it that way and therefore few people who can advise you with that programming style
8:46:52
no-defun-allowed
Willi-Smith: Trust me that you would benefit from interactivity, unless you are able to reason about your entire program without needing to consult a computer.
8:49:19
no-defun-allowed
And even then, you would work faster with interactive tooling; there isn't a reason not to want interactivity.
8:49:51
Willi-Smith
I tried atom with slime but it wasn't so straightforward as this simple bash launcher. I've never worked with emac. Do you recommend me to give it a try?
8:50:33
White_Flame
emacs+slime is the best supported environment for working with Lisp, both the repl .lisp and files, and their interaction
8:51:08
phoe
The idea behind Lisp is that you never really kill or close the Lisp program while you're programming. You instead send commands to the Lisp program that define functions, variables, modify things, or just cause some stuff to happen like (print "hello world")
8:54:12
Willi-Smith
Shall I go with this emac how to https://lispcookbook.github.io/cl-cookbook/emacs-ide.html ?
8:54:16
phoe
ralt: nope - the possibility to transfer running code from one Scheme image to another fully at run-time, stack and continuation and everything.
8:55:51
ralt
Ah, I meant more the concept of having a process that never dies, ala what used to run on mainframes, so that you can take full advantage of instance upgrades and stuff, but abstracted away by the kernel to trust it to run forever
8:59:19
White_Flame
yep, if you've not used emacs before, it's probaly the easiest way to get it up and running with everything
8:59:51
ralt
One thing I really like with this concept is that you no longer need a database, you can store everything in defvar or whatever, and that's effectively persistent
9:01:58
ralt
I would argue most people don't understand how transactions work anyway, so you're making it easier to understand
9:03:55
no-defun-allowed
cl-worlds is an implementation of the "worlds" concept proposed by Warth, Ohshima, Kaehler and Kay for "controlling the scope of side effects".
9:05:22
no-defun-allowed
The basic idea is that one can "sprout" a world from the current world, perform some changes in the world, and then commit those in an atomic manner, after checking that no slots that the computation has read have been changed. Oh, and it lives at https://gitlab.com/Theemacsshibe/cl-worlds or https://github.com/nodefunallowed/cl-worlds
9:05:43
solrize
do most ppl here use slime? do you have it set up so that it launches an inferior lisp as soon as you visit any .lisp file?
9:07:06
solrize
thanks, i got the autolaunch code from someone here and it freaked me out at first, but i see some point to it. other thing i notice is i have to restart slime a lot when the inferior lisp resets... is that an issue for you? i had never used slime before quite recently
9:07:19
phoe
solrize: yes and no, I launch slime manually at the start of my emacs session if I am going to work with lisp stuff
9:07:37
no-defun-allowed
I use a custom metaclass that stores (changed) object slots in a hash table in the current world, so no.
9:09:00
no-defun-allowed
That might make accessing slots somewhat slower, especially if one is accessing a slot bound many parent worlds away for the first time. (After that, however, it'll be cached in the current world.)
9:13:49
no-defun-allowed
ralt: I would suggest skimming http://www.vpri.org/pdf/tr2011001_final_worlds.pdf for the space and time properties of worlds; my implementation is a rough translation of the algorithms in section 5.
9:17:41
ralt
no-defun-allowed: thanks, I actually did something similar for work, except I did a copy of the top-level container and used immutable objects inside
9:19:31
ralt
It effectively means a cheapish clone operation at first and then basically zero overhead
10:08:20
phoe
nope, it establishes a restart allowing user to set the place with a new value and retry the assertion
10:08:51
phoe
the type designator that is passed as the second argument to CHECK-TYPE stays constant
10:09:51
shka_
well, my issue here is that when check-type is used in the top level function, it is obviously very useful and restart helps
10:10:56
shka_
however, when used in a inner function, restart becomes misleading, because value was passed from the above, and therefore error was made before calling the inner function
10:11:36
phoe
yes, if you do (defun foo (x) (check-type x ...) ...) then the restart stores the value in the variable X
10:12:56
phoe
the STORE-VALUE restart in such context effectively becomes a USE-VALUE one since it only allows the function to be called once; the stored value may then discarded when the function exits and the local variable X goes out of scope
10:14:10
phoe
using CHECK-TYPE in such contexts becomes more meaningful if you have places that are more persistent, such as (defun foo (x) (check-type (slot-value x 'my-slot) ...) ...) since then the value is *actually* stored and remembered even when the function quits
10:14:31
phoe
and, honestly, I don't really know how to work around that limitation in the general case
10:16:11
shka_
i tend to use :before methods for validating arguments (it happens that i like OO style for interfaces) but i started to consider using :around instead
10:20:09
phoe
in initialize-instance :before the slots are not yet bound because shared-initialize was not yet run
10:21:12
phoe
I found that validation in :after for initialize-instance does not compose well when you have multiple :after methods
10:21:24
phoe
where the more specific ones depend on the values of slots validated in the less specific ones
10:23:50
shka_
i mean, you are often ending up with (defgeneric make-a-very-specific-type-of-object ...)
10:25:53
phoe
yes, that's the issue - the restart is meaningless and does not actually store the value in the object
10:29:49
phoe
I can imagine that it could be fixed if the variables bound by DEFMETHOD were actually checked at the end of the method and their values were passed to the next called methods; meaning, if a :BEFORE method could alter the values that are passed to next methods
10:30:33
phoe
portable code may depend on these bindings being fresh and therefore mutate them freely
10:30:55
phoe
ACTION adds this issue to the bucket of issues for the Hypothetical Revision of the Standard
10:54:33
ym
Is there some kind of macro extension library implementing typed declarations like for example (let ((foo :type fixnum)) ...)?
10:57:09
Xach
jackdaniel: http://report.quicklisp.org/2020-05-16/failure-report/mcclim.html#mcclim_test fyi
11:03:03
ym
I know that compilers like SBCL do all the magic inside, but I like to control the process, you know.
11:14:44
Xach
ym: I think there are some binding libraries that include type info in the binding. can't think of a specific one offhand though.
11:56:30
ralt
Like if you're using cl-sqlite, it'll automatically figure out that it should add the `libsqlite-3-0` package to the "Depends" field of the package
11:57:34
ralt
phoe: no, it's embracing the packages philosophy of declaring C dependencies rather than trying to bundle them all in a single deployed archive and some environment variables setup at startup to make it work
11:59:27
phoe
ralt: I see, so you'll want to actually make some kind of mapping between foreign libraries and debian packages that provide them
11:59:28
jackdaniel
but I don't know details, it was done so pgloader could be put in debian repositories
12:00:49
ralt
cffi-toolchain is doing half of the job, by providing a binary where grovel libraries are embedded, and the Debian package can provide additional metadata about the system shared libraries that your application is using
12:37:28
ralt
That would make sense. Maybe I can add a subclass to fork/save-lisp-and-die and do the rest afterwards?
12:38:08
phoe
after save-lisp-and-die finishes, the currently running Lisp image is destroyed - at least in case of SBCL
12:38:33
ralt
Yes, that's why I'm saying I can fork, do the slad in the child, and do the rest in the parent
12:42:44
ralt
So my subclass would implement asdf:perform, fork, do (call-next-method) in the child which will slad, and in the parent I wait for the child to die then do the Debian packaging
13:00:45
phoe
pjb: http://www.informatimago.com/develop/lisp/com/informatimago/languages/latex/parser.lisp is missing a closing paren somewhere
13:29:46
phoe
this package has everything written in Lisp... save for the lexer, which is written in flex-generated C
13:49:00
phoe
I am staring at https://github.com/tvraman/aster-math/blob/master/lisp-code/lexer/lispify.l now
14:32:24
phoe
Which regex library provides the symbol named SCAN-MATCH-REGEXP? The only occurrences of this symbol on Google and Github are in informatimago code.
14:42:57
montxero
How does on structure an appplication similarly to how Emacs is structured? That is tgere is a core, and several applications can be written to extend/complement this core in the same way Emacs packages extend the funtionality of Emacs?
14:44:59
phantomics
Then you can write other packages that depend on the direct dependents of the core, creating a hierarchy
14:45:14
montxero
phantomics: Is there a simple application written this way I can study? or are there sources for learning about this style of architecture?
14:46:09
phantomics
It's not that simple, but my April language may help you understand: https://github.com/phantomics/april
14:47:15
phoe
you can also consider various implementation-dependent language extensions to the core, such as sockets, threads, Gray streams, MOP et cetera
14:49:16
phantomics
April is actually designed in such a way that you can extend the language, if you look at spec.lisp you'll see it contains a specification for the entire language, and then at the bottom of spec.lisp there's a small commented section where the spec is extended by creating another function in the language
14:49:50
phantomics
These extensions could be done in software packages that depend on the april package, that's an example of a plugin-supporting system
14:53:44
beach
montxero: I tend to split an application into "modules", where each "module" is located in a particular Unix directory, has its own ASDF system definition file, and has one or more package definitions (in the packages.lisp file) that are specific to that module.
14:54:49
beach
montxero: Then, you can have one "core" module and use the :DEPENDS-ON clause in ASDF:DEFSYSTEM so that your other modules depend on the core module or any other module for that matter.
14:57:53
phantomics
Understanding ASDF is the first thing, looking as .asd files will help you understand
14:59:32
phantomics
Unfortunately, the ASDF manual is rather dry: https://www.common-lisp.net/project/asdf/asdf.html
14:59:59
phantomics
I learned by messing around with ASDF, studying the existing .asd files and referring to the manual to clarify things
15:00:05
montxero
I want write an application to manage references and citations (like Jabref) but also research sources as well
15:01:11
beach
montxero: If you expose your code here (or in #clschool if the stuff is really trivial), then you will likely get remarks on it.
15:01:22
montxero
The idea is to have a core application, then build the reference manager, document reader, document retriver, etc separately