freenode/#lisp - IRC Chatlog
Search
5:26:02
pillton
If you specify the append method combinator in the generic function, why do you need to do it again in the method definition?
5:26:53
Bike
the method qualifiers aren't really relevant until a method combination is actually done, and that might be as late as when youc all the generic function
5:48:08
pillton
Read the paragraph starting with "Pathname merging treats a relative directory specially."
5:49:24
pillton
You also have to remember that common lisp pathnames discriminate between files and directories regardless of what the OS thinks.
5:50:31
pillton
So #p"salmon" is equivalent to (make-pathname :name "salmon") which is not (make-pathname :directory '(:relative "salmon")).
5:56:05
jmercouris
alright, so my function works: https://gist.github.com/bea205432895183d84e6a42f46215b28
5:56:40
jmercouris
it's supposed to make a file relative to ~/.config/next/, so if you pass (xdg-data-home "fish") it will point to ~/.config/next/fish
6:02:04
pillton
I usually do (defvar *foo-data-directory* (merge-pathnames ...)) and then (defun foo-data-path (in) (merge-pathnames in *foo-data-directory*)).
6:06:19
pillton
Well, if you are nice, the variables would go in a foo-config.asd system which would allow the user to configure the pathnames before loading foo.asd.
6:08:10
pillton
The variables don't go in the asd. I meant that you create a foo-config system which loads a lisp file containing the variables.
6:10:17
pillton
e.g. https://github.com/markcox80/specialization-store/blob/master/specialization-store.asd#L4
6:12:22
pillton
Yes. (Though the example I linked is a system for figuring out what an implementation supports.)
6:15:21
jmercouris
I didn't want to implement it as I'd rather have a nice ~/.next.d dir, but I think it is what users want
6:15:40
jmercouris
pillton: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
7:02:12
borei
i have several classes generic-vector (just vector) --> r-vector (vector with double-float components) and 3d-vector (vector in our 3D space)
7:03:36
phoe
(defclass generic-vector () ()) (defclass r-vector (generic-vector) ()) (defclass 3d-vector (r-vector) ()) - this is what I understand so far
7:03:48
borei
my question is will initialize-instance :before method be proper place to provide space dimension for 3d-vector
7:06:11
phoe
I would rather define an INITIALIZE-INSTANCE :AFTER method on GENERIC-VECTOR with a key argument of :SPACE asking either for the vector size, or :VECTOR asking for the array itself.
7:06:33
phoe
This way, you can either setf the vector to the slot, or construct a new vector based on :SPACE.
7:07:18
phoe
But that depends on how you want to initialize the generic-vector class, and may depend the most of the array element type of your vectors.
7:07:49
phoe
because if you only pass :SPACE, then you have no chance to modify the type of the vector.
7:08:12
phoe
so you may actually want to add :SIZE and :TYPE, or just :MAKE-ARRAY-ARGUMENTS for most generality.
7:08:52
phoe
and (check-type size unsigned-byte) (apply #'make-array size make-array-arguments) in your constructor.
7:11:37
borei
when i do call make-instance 'vector-3d i don't want to supply space dimension, it's clear from the class type
7:15:34
phoe
You could try to define an INITIALIZE-INSTANCE method on VECTOR-3D that calls (call-next-method :size 3).
7:17:35
phoe
This should work since you are allowed to define custom methods on INITIALIZE-INSTANCE.
7:19:37
phoe
this also appears that it should work, with the additional side effect of making it impossible for the user to supply their own :SIZE.
9:07:56
schweers
It seems my intuition is misguided here, maybe someone can clarify: how come SORT is marginally faster on a list than on a simple-array? Both without any type declarations and initially filled with the same random fixnums.
9:08:12
schweers
I filled the list with (random most-positive-fixnum) and copied it over to the array
9:09:13
beach
Just guessing, but mergesort is faster than quicksort, and mergesort is easy to implement on a list, but hard on a vector, so typically quicksort is used on vectors instead.
9:11:34
schweers
okay, I get that different algorithms may be the reason, but, admitting to have quite the gap in my knowledge … is mergesort really faster than quicksort? I guess not always, right?
9:13:16
beach
mergesort needs O(n) additional memory (except for recent research that decreases that significantly, at the cost of more operations).
9:13:41
Shinmera
Can't mergesort also be parallelised easily? Though I doubt any implementations do that currently
9:13:45
beach
But since the list already contains O(n) additional memory, no more memory is required to use mergesort on a list.
9:15:23
beach
The can both be parallelized, because they are both divide-and-conquer, so they both generate two separate problems of around half the size.
9:17:02
beach
The interesting thing I plan to do is to implement mergesort on vectors by checking how much stack space is available and choosing an implementation that is good for that available space. In the worst case, choose a slower version that uses only O(1) additional memory as recent research shows is possible.
9:18:51
schweers
beach: you mentioned that this comes at the cost of more operations. do you know off the top of your head how much more?
9:21:08
beach
Fast Stable Merging and Sorting in Constant Extra Space, by Bing-Chao Huang and Michael A. Langston.
9:22:53
beach
Also: Practical In-place mergesort, by Jyrki Katajainen, Tomi Pasanen, and Jukka Teuhola.
9:26:12
beach
It is well worth getting one. It is not expensive and you get a discount on conferences, sometimes even on ELS.
9:26:13
schweers
I have to admit that I’m not quite sure what you meant by “forward search”. I just used the search bar.
9:26:40
beach
For each article entry, there is a "cited by" list. You find the entry for the article you know about, then you click on that list. That way you go forward in time.
9:37:05
beach
That's what I mean by the membership being worth it. You win after just a few articles.
9:41:17
jackdaniel
I'm not very impressed by paywalls for articles (given they don't pay scientists for whose papers they charge and which are usually written for money collected in form of taxes)
9:42:07
beach
It could be worse. Now, many journals make the authors pay to have the article published, and it is not cheap either.
9:42:47
schweers
As I’m not an academic I surely lack insight, but I do wonder how this model could ever arise, let alone stay alive in the digital age
9:42:49
beach
I consider the ACM membership fee as paying for the entire digital library service (in addition to getting CACM on paper).
9:43:40
beach
schweers: Inertial. On-line journals need to acquire the same prestige as the established journals owned by the publishing houses.
9:44:50
schweers
beach: that’s not what I meant (the ACM). But what I’ve heard from other publishers is that they ask for money left and right (and quite substantial amounts at that) without /seeming/ (am I wrong here, I’d love to know) to provide any real benefit.
9:45:59
beach
It is only a matter of time. This is probably why they try to extract as much money as possible before they disappear.
9:46:00
TMA
schweers: well, originally it was a journal subscription -- a printed, bound object containing the articles. then there was a service that mailed you a single article. boom, the world went digital -- but the inertia and inflation means you pay for it even though the costs have bottomed.
9:47:07
jackdaniel
schweers: you may be interested in Aaron Swartz story (especially his Guerilla Access Manifesto)
9:47:09
schweers
Yes, but aparantly universities pay obscene amounts of money to access their own research. Anyways, I should be doing other stuff than complaining online ;)
9:49:05
jackdaniel
ftr: https://archive.org/stream/GuerillaOpenAccessManifesto/Goamjuly2008_djvu.txt (sorry for the offtopic)
10:32:09
chenbin
can somebody help this sbcl on windows issue? https://pastebin.com/raw/3gAPvJQr thanks
10:44:58
knobo
Which documentation generation system do you use, and which do you think I (or other) should use?
10:45:36
Shinmera
Documentation isn't generated, you write it. But you can assemble the documentation into a single file with systems like Staple.
10:47:02
beach
knobo: Perhaps you are thinking of generating documentation from documentation strings? That technique has the unfortunate consequence that there is no place to put a section about goals, concepts, philosophy, etc. As a result, the documentation often becomes incomprehensible.
10:48:54
Shinmera
knobo: It's not about being stupid or not, some people genuinely believe that dumping out function signatures counts as documentation.
10:49:30
beach
knobo: I think both me and Shinmera object a bit to the term "documentation generation system" and I also think we both encourage more effort into writing good documentation as opposed to collecting it from documentation strings that are often inadequate, partly because they represent noise in the source code.
10:50:27
TMA
beach: the chenbin's question was ended with some five spaces and a "thanks" --- an inadequate expression of gratitude, granted, but not absent altogether
10:51:14
beach
Take this one for instance (SBCL): (documentation 'car 'function) => "Return the 1st object in a list."
10:51:24
knobo
Would be good if I could write documentation in a seperate file, and include documentation from docstrings.
10:51:36
Colleen
knobo: About documentation-utils https://shinmera.github.io/documentation-utils#about_documentation-utils
10:52:43
beach
knobo: Slots should not be part of client-visible documentation. They are implementation details that may change over time.
10:52:48
knobo
beach: right.. I forgot about that. But simple inline docstrings can be useful. So I'll not use setf.
10:55:04
beach
Documentation strings that are physically near code represent noise to the maintainer of the code, because, presumably he or she already knows the external interface before attempting to modify the code. I think that is the reason (the noise factor) why many documentation strings are so skimpy; you don't want to mess up the code too much.
10:57:51
knobo
Though it is often easy to read it from the code. If the argument is an alist or a plist or something else.
10:59:33
knobo
Any project that is so good that it could be used as a reference case for writing documentation?
11:02:04
Shinmera
knobo: ... yeah so? Are you asking about the act of writing documentation, or the literal way in which the strings are put into source code?
11:02:27
Shinmera
Because for the former I fail to see how the place where you put your documentation matters at all
11:07:02
makomo
thought i might see a nickname like "rstrandh" or something on irc. i always wondered who that guy was :-)
11:07:10
knobo
In javascript I use jsdoc. I just thought maybe people used a similar strategy in lisp.
11:07:58
Shinmera
knobo: I write the documentation overview, concepts, etc into the README.md . This then gets combined with the docstrings into an about.html file that contains the entire documentation for a project.
11:08:26
beach
makomo: Thanks, you too. For the record, my nick is just a literal translation into English of my last name.
11:13:40
makomo
beach: ah, now i remember your page also (it has a unique look). i've read your essay on lisp a few months back i think, when i was just starting out.
12:02:13
osune_
I have two questions: Is it possible (without CFFI) to pass (c-)structs between embedded ecl and c? And: how valid is ECL as replacement for LuaJit as plugin language on ARM (Cortex A9 / Cortex A53) ?
12:05:22
pjb
I wonder why would anybody want to do the same as cool kids. They're the adult losers in general.
12:05:37
pjb
http://www.dailymail.co.uk/sciencetech/article-3181611/The-curse-cool-Kids-popular-school-losers-adults-claims-study.html
12:06:39
pjb
osune_: CFFI is only a portability layer over each implementation specific FFI API. So the answer to your question is yes, but you would be silly to do that.
12:16:27
jackdaniel
osune_: you may inline C in ECL programs and call CL functions from C, passing structs verbaitm is possible too of course
12:16:54
jackdaniel
ECL doesn't do JIT though (unless you call that way built-in compiler, but its not the same in my eyes)
12:35:50
osune_
jackdaniel: thanks for this information. I've understood by reading the examples in the ecl directory and the manual how to convert from and to cl_object primitive types. But I miss an example of how to pass arrays and structs. I tried to look at EQL but I don't know QT and it's quite big. Can you point me to an example?
12:37:54
osune_
I figured I would compile a lisp plugin file on startup to fasl once and would load the fasl?
12:56:03
osune_
jackdaniel: I could do that but, this would mean I need an compiler on the device. Which I don't have. I'll try to find more examples thanks so far.
12:58:14
jackdaniel
fasl files are (in reality) disguised shared objects (don't confuse that with fasc, which are bytecode)
13:02:18
schweers
do people here actually use template systems in an editor for lisp? like yasnippet in emacs?
13:03:51
osune_
jackdaniel: maybe I'm missing something or we missunderstood: I want to embedd ECL in a embedded C application on ARM. I create my Linux Image with buildroot. Currently I'm assuming ECL will just build fine. Now users can write a plugin for my application by: a) write lisp code which gets just loaded (do I get here an fasl or fasc?) b) write lisp code, compile it on their machine to C with the ECL compiler , which gets compiled to an
13:03:51
osune_
*.so via gcc crosscompiler, the result can be loaded via dlopen on runtime. The goal here is that users of the device don't need access to the crosscompilation toolchain to write and load Plugins. Which eliminates option b)
13:05:14
jackdaniel
if you don't have gcc compiler and you can't compile sources beforehand you end up with fasc files indeed
13:05:56
osune_
which can be compiled from *.lisp files on the embedded device via the embedded ecl code right?
13:07:23
jackdaniel
keep in mind though that bytecode is much slower than native binary (put that on top of the fact that ECL isn't a speed champion anyway *and* that you run on a slow arm box) – so I wouldn't put serious computations in these plugins if I were you
13:15:58
pjb
serious computation = deep loops. Anything a user can write can be interpreted or byte-compiled without ill-effects. Just provide the fast primitives the user wants.
13:16:12
osune_
Thanks for the heads up. The plugin code will process some binary data mostly. I currently don't expect heavy load computations. But I have the option to embedd ECL alongside to luaJit. Even if ECL will prove as an ill fit for the plugins it might come handy for configuration tasks.
14:35:33
Shinmera
shka: If you're confused about anything, or find anything lacking, don't hesitate to let me know
14:39:07
shka
Shinmera: thanks, i will, I will read reader application, it seems to be elaborate example
14:39:27
Shinmera
shka: The tutorial linked in the docs goes through writing an entire application (plaster)
14:40:17
Colleen
shka: A lengthy and in-depth example https://shirakumo.github.io/radiance#a_lengthy_and_in-depth_example
14:53:45
zukunf
what accounts for lisp high latency in this chart?? --> https://danluu.com/input-lag/
14:57:40
lieven
not enough data to tell. If his terminal on the symbolics is a CLIM listener, it is doing far more work than just putting a character on the screen.
15:55:50
shka
is there a way to ensure that lisp file is always loaded from scratch and never cached in FAS?
15:58:41
Shinmera
There's nothing built into ASDF to do this, unless you want to just LOAD everything, in which case there's load-source-op, if I remember correctly.