freenode/#lisp - IRC Chatlog
Search
18:16:03
jackdaniel
tumdum: ah, also another thing may be wrong. your symlink doesnt' seem to point to a directory, notice that /home/t/dev/euler vs /home/t/dev/bobbio/ (latter is a directory)
18:16:46
jackdaniel
so you should `ln -s /home/t/dev/euler/` instead of `ln -s /home/t/dev/euler` (I think this may be important wrt symlink following)
18:18:14
jackdaniel
symlinks are nasty (especially if you try to depend on them with code which is meant to run on different implementations)
18:24:45
Xach
It is entirely related to the timestamp of the directory vs the timestamp of the index file.
20:07:17
slaterr
using such a long name for a one-off function written in lambda form is not warranted
20:08:42
confusedwanderer
slaterr: maybe you can steal some code from https://lispcookbook.github.io/cl-cookbook/cl21.html#shorter-lambda
20:09:40
slaterr
I can't think of an example where naming a single element would be necessary. if verbose name is warranted, list of those things already has such a name in plural form
20:21:19
_death
I guess it's hard to unlearn clojure aesthetics because you consider it part of the same family.. but really, it's not idiomatic CL
20:21:29
slaterr
pjb I am implementing clojure's # reader macro in CL. I don't know syntax of CL equivalents well
20:23:45
confusedwanderer
i think the freedom to change these things is part of what makes lisp fun. you shouldn't introduce notation like that in someone else's projects without asking, but for your stuff it's your choice
20:23:48
dlowe
I assume map to stand in for any number of mapping things that takes a function and a sequence
20:23:52
pjb
A lot of lisp code is packaged into libraries distributed thru quicklisp. A lot of problems with those libraries come from bad handling of reader macros in the source code of those libraries.
20:24:28
pjb
(second bad problem, is nickname collision! Fucking don't use short package names or nicknames!)
20:32:35
dlowe
It doesn't bother me when people want to tinker in weird ways with lisp syntax. I love it. Why program in lisp, otherwise? However, I am annoyed when a stylistic opinion is asserted forcefully as an obvious and irrefutable fact with which only a moron could disagree.
20:37:59
drmeister
Hi - does anyone like programming in assembly language and want to contribute to an open source Common Lisp project?
20:39:32
drmeister
LLVM can be used to create function invocations with a fixed number of arguments.
20:39:40
slaterr
dlowe if you scroll up, it wasn't me who started challenging "stylistic opinions" of others. it was you and _death
20:40:46
drmeister
But creating a call with variable number of arguments assembled from a fixed argument call where the last argument is either a Common Lisp list or a va_list (C++ ism).
20:41:02
sjl_
slaterr: #() already means something in Common Lisp. Changing it would be confusing, even if you managed to make it work. If you pick a different character, and use the named-readtables library to make sure not to pollute unsuspecting readtables, it should be possible to implement.
20:42:16
slaterr
dlowe yeah? it seems like you did get butthurt, protecting 15 minutes after discussion ended
20:42:57
slaterr
sjl_ I mean it doesn't matter to me. I am fine using something other than #. redefining # would be bad, assuming it is even possible
20:43:03
dlowe
slaterr: I wanted to make sure you were pushed back on a bit. Anyway, it might not have been about you.
20:45:20
_death
I guess every Lisper has this phase of experimentation and fascination with microsyntactic "optimizations" at some point.. then you grow up
20:45:25
slaterr
dlowe, you should have pushed back when I shot down your silly widget-count example. but, because you didn't (and couldn't), we are still discussing this 45 minutes later
20:47:28
slaterr
so you think simple, one-off few characters anonymous functions should have very verbose names for their arguments? no wonder you like loop, you have no sense of style or aesthetics
20:49:41
rk[ghost]
hmm, i am currently using CLL. my typical strategy for reloading my program is to (quit) and then (load "file") again. i am working on ways to modularize and load bits and have it do things from within modules.. however, is there a REPL command to "unload everything" (to prevent clobbering) so to avoid quitting and returning back to shell?
20:50:51
dlowe
rk[ghost]: many times you can reload source code without even stopping execution of the program
20:51:12
rk[ghost]
dlowe: i just don't want to remove extra variables in the debugging process. would be really annoying to be doing things and then find out it is because something old was still loaded in.
20:51:55
dlowe
rk[ghost]: yeah, that does happen. The usual method of development is to use "system" files like asdf that can track what files have changed
20:52:17
rk[ghost]
i see.. i will probably get there in time, but sometimes it is useful to know the hacky solutions XD
20:52:19
dlowe
but you can also compile and load individual functions and variable declarations into your running image
20:52:30
_death
rk[ghost]: then you have a good idea what you just redefined and what is the current state of the system should be
20:52:30
slaterr
dlowe this was forcefully asserting my stylistic opinion, just so you can tell the difference. as opposed to just explaining why I'd prefer clojure-like macro, when being told that I shouldn't
20:52:57
rk[ghost]
right but for instance what if the second run of a file doesn't have a defparameter *var*..
20:53:12
rk[ghost]
in such case i wouldn't expect *var* to be visible anymore, but yet it should be, eh?
20:54:55
rk[ghost]
slowly i am attempting to have my modules have "upgrade" functions like in OTP.. i'll probably eventually try to migrate things to lisp-flavoured-erlang XD
20:55:36
rk[ghost]
plus, then i would have to migrate things like Hunchentoot, which i don't fully understand.
20:56:00
dlowe
slaterr: it can really suck to feel piled upon, but there's a lot of different opinions in the channel, and I was just saying how much I liked the (shorter) plambda
21:00:01
slaterr
dlowe yeah, one second you liked shorter plambda, then next second you recommended an even longer than necessary lambda variant. it seems you just like to argue for the sake of it
21:01:46
rk[ghost]
... not having luck with the favicon.. just aesthetics, so i guess i will just abandon it..
21:05:45
dlowe
slaterr: I figured there was an understanding that these example bits of code were stand-ins for something potentially more complex, where a longer name would have value, contrary to your assertion that the specification of the argument was completely lacking in worth.
21:06:28
dlowe
and I have seen a lot of complex code that used single letter a-z variable names and it was terrible
21:07:02
slaterr
then your understanding was poor. and if function arguments warrants a verbose name then it shouldn't even be a lambda
21:08:09
slaterr
a-z variable names are excellent in very short functions. your proposed variable name was several times longer than the useful characters in the body of a function
21:09:13
slaterr
and you have to repeat variable name twice.. completely drowning the actual useful code in that snippet with unnecessarily long variable names.
21:09:56
_death
right, there are many times where a lambda expression is stylistically suboptimal.. and using something like #(... % ...) only makes it more difficult to recognize
21:11:53
slaterr
_death only if you are unfamiliar with the syntax. and the same argument can be used against any user-defined macro with non-standard naming convention and semantics
21:14:51
_death
every abstraction has a cost, and such crutches (and clojure has more of them, unfortunately) add up.. they help keep the code short at the price of hiding more useful abstractions
21:17:43
_death
so locally they seem nice (if you don't mind cryptic names like "%" or "->") and short, but overall they get you boilerplatish low-level code..
21:17:44
slaterr
what more useful abstraction would you use here? we are just passing a 3 character function to map
21:19:20
_death
slaterr: your example is a toy example, so your toy solution looks clever.. instead of trying to come up with something better for the toy example, I am just sharing my experience with such things
21:20:44
slaterr
a toy example? so you never had to do some simple operation to a list of things? you never use map?
21:21:22
_death
slaterr: so my experience tells me that a plain lambda there is OK.. and then when there's more code and it things get more complex, it's easier to see the patterns
21:23:13
slaterr
so we agree that # is better at lambda's job, than lambda. creating simple, short functions on the fly
21:23:22
_death
so instead of trying to optimize lambda syntax, keep it plain and optimize when it counts
21:24:32
pfdietz
Don't know if this was mentioned: https://github.com/eschulte/curry-compose-reader-macros
21:25:38
_death
slaterr: for reading, I do use pretty-lambda which substitutes the greek letter for the word
21:26:01
slaterr
pfdietz that is nice. I'd argue even nicer if you are just using lambda or # to emulate partial application
21:32:25
slaterr
{+ 1} syntax for partial application comes very close to haskell's (+ 1). it also supports positional arguments, and function composition. a lot nicer and more powerful than #'s
21:35:50
pjb
slaterr: if you publish your sources (eg. to quicklisp), then yes, if you do it naively.
21:36:28
pjb
slaterr: the point here is that LOAD specifies that the file is loaded in the context of a (let ((*readtable* *readtable*)) …)
21:37:11
pjb
Instead, you must SET the *readtable*. (eval-when (:compile-toplevel) (setf *readtable* *my-file-readtable*))
21:44:56
pfdietz
Both LOAD and COMPILE-FILE bind both *PACKAGE* and *READTABLE* (to themselves) before processing the file, so changes to either during the load/compile do not escape.
21:46:02
pfdietz
Changes as in changes to the variable, not changes to the package or to the readtable objects.
21:51:07
fiddlerwoaroof
An alternative to messing with the lambda syntax is to define higher order functions that combine other functions to produce the lambda you want
21:57:21
_death
fiddlerwoaroof: this reminded me of this snippet https://gist.github.com/death/34d4bd499b323016fa65be5ba72fabc1
22:00:53
rk[ghost]
ha.. gee.. changed the .ico to a .png.. maybe ff doesn't support the x-icon type.. it just worked.. yaay:D
23:10:48
fiddlerwoaroof
_death: yeah, I have a library that implements this pattern: https://github.com/fiddlerwoaroof/data-lens
23:10:59
jmercouris
let's say I've done (ql:quickload :some-library), how can I get the system-version loaded
23:11:16
fortitude
ASDF defines systems as a tree of components; each component might be something more specific like a module or a file definition
23:16:19
fiddlerwoaroof
(defining methods for generic functions you don't own for classes you don't own)
23:17:14
fiddlerwoaroof
On the other hand, "someone" could define a library for querying ASDF for various bits of information
23:18:57
fiddlerwoaroof
(to be clear I'm not referring to anyone in particular, just making a joke about every annoying problem being someone else's problem)
23:19:29
fiddlerwoaroof
It's the kind of thing I'm interested in, but I never seem to have the time for
23:20:14
fiddlerwoaroof
At a very simple level, just define some functions (asdf-query:system-version :alexandria)
23:21:13
jmercouris
thanks, have you seen the branch? it is quite different than the current incarnation
23:21:21
fiddlerwoaroof
I don't know if you've run into the little bug where the start-swank command seems to kill the app on mac
23:32:38
mrpat
What is the best package for downloading https sites? It seems cl+ssl is messing with my Drakma and Dexador.
23:36:31
jcowan
No, Smalltalk and Ruby are the kings of monkey-patching. You can do it in pretty much any dynamic language, but in a lot of langs the culture won't let you.
23:40:12
fortitude
mrpat: drakma and dexador should both work without having to set up cl+ssl first, but cl+ssl can have issues on some systems (windows)
23:40:31
fortitude
I think dexador bundles its own certificate store, which should avoid most of the problems if its recent enough
0:02:27
fiddlerwoaroof
A former coworker wrote a nice blogpost about the problem: https://lexi-lambda.github.io/blog/2016/02/18/simple-safe-multimethods-in-racket/
1:21:28
pillton
That is quite a restriction. It also completely ignores the point of generic functions i.e. separating operations from state.
1:24:21
fiddlerwoaroof
pillton: not really, I believe beach, for example, has mentioned similar things.
1:24:50
fiddlerwoaroof
In most cases you're either defining a new protocol or you're defining a new implementation of the protocol
1:25:18
fiddlerwoaroof
In the former case, since you defined the generic function, you can define methods that specialize it however you want, since you own the protocol
1:26:01
fiddlerwoaroof
In the latter case, you should only specify how your new class interacts with the pre-existing protocol, otherwise you might change the contract of the protocol for other classes.
1:37:55
makomo
_death: interesting writeup regarding On Lisp, thanks. i'll give it a proper read when i get the time
1:39:05
makomo
hm, where's does one draw the line between using designators vs. using actual objects (that the designators designate)?
1:40:41
makomo
for example, in the case of ASDF, most of the time you can pass designators such as :hello or "hello" instead of the actual system object representing the system hello
1:41:02
makomo
but then comes asdf:component-version which takes a system object instead of a designator
1:41:37
makomo
when designing a library, where draw the line between accepting designators and not doing so?
1:46:43
makomo
pillton: hm, i don't understand. by "representations" do you mean designators? if so, why?
1:48:07
pillton
Bah. http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_p.htm#pathname_designator
1:51:15
pillton
The string "/tmp/hello-world.txt" is an equivalent representation of (make-pathname :name "hello-world" :type "txt" :directory '(:absolute "tmp")).
1:54:49
makomo
oh, i think i see the point of your guideline now, which was in favor of designators in that case
1:55:16
makomo
what if you have 2+ representations and they do share a common class, but that class is not a common class for the object they designate?
1:55:52
makomo
you still have a designator but it is essentially only the common class of the 2+ designators
1:56:21
makomo
however, that wasn't really my question. i'm more wondering about API design, i.e. *when* to actually accept such designators and when not to
1:56:46
makomo
i.e. whether to constantly worry within your API that a designator might be passed in, or to cut it off at one point and say "i want an object of type X now, no more designators"
1:57:17
makomo
Bike: i see, so basically a "layered" approach? the highest-levels parts accept them and then lower (library) levels don't?
2:33:04
fiddlerwoaroof
It's like input validation in a web app: you want to validate and sanitize the user-submitted data asap so you don't have to worry about all the nonsense a user will throw at you.
2:40:43
skidd0
when creating an asdf system, how can I set up some special variables on system load?
2:44:05
fiddlerwoaroof
It depends on what exactly you want to do, but I think the write thing is an :around method on perform that is specialized one your current system and some operation such as load-op
2:44:51
fiddlerwoaroof
skidd0: this is probably better: https://common-lisp.net/project/asdf/asdf.html#Controlling-file-compilation
2:48:32
fiddlerwoaroof
I think that should work out fine, something like (defun main () (initialize-hash-lib) (do-stuff))
2:49:26
skidd0
tho checking if *special* is set is probably just as time consuming as resetting the *special* anyway
4:11:49
elderK
Have been working on my structure-thing. God damn I have a lot of helper functions for it :P
4:17:15
fortitude
elderK: technically, no; a structure can have several representations including a plist or other non-class value
4:17:41
fortitude
if you're willing to require that the struct be class-based, then I think then slot-value is safe to use (not 100% sure though)
4:21:58
beach
The existence or not of a particular slot is an implementation detail. A protocol is defined by functions and initargs.
4:55:01
elderK
From what I understand, it allows us to provide a form that can reconstruct some literal at load-time.
4:55:03
beach
It's rare that you need it. Only when you need to save application objects in a FASL so that you can create a similar object when the FASL is loaded.
4:56:00
elderK
beach: I've seen it used in a way that suggests it can be used to somehow store data that the compiler is using when generating a macro expansion, into the expansion.
4:56:13
elderK
Like, binary-types creates a bunch of record objects - then patches them into the expansion as literals.
4:57:32
beach
Yes, I can see that. Any time you compile something that contains literal objects that the system does not know how to represent in a FASL, you need this kind of mechanism.
5:45:27
beach
Actually, that's an interesting topic. Talk to me about the usefulness of FASLs now that computers are so fast that you can compile the code when it is LOADed without any significant performance impact!
5:46:29
no-defun-allowed
here's one: macros can do anything normal functions can so what if a macro does a lot of processing on its arguments?
5:47:43
p_l
beach: FWIW, on my pretty recent hw I see considerable real time difference between loading code from FASL and compiling
5:48:59
no-defun-allowed
otoh, asdf or quicklisp loads fasls when your system definition is absolutely broken or something like that and it's annoying
5:49:23
no-defun-allowed
eg: you move your toplevel stuff to src/ and the files are no longer there cause you neglected foo.asd and it loads from the fasls
5:50:20
shka_
beach: modern systems have constantly increasing number of dependencies and compilation time adds
5:51:29
beach
shka_: Again, you are talking one execution at the beginning of a session that should typically last months, unless your computer crashes the way mine does.
5:54:40
no-defun-allowed
wait no i don't but i probably should cause at least it's easier to install alternate drivers which might not crash on it
5:54:56
beach
p_l: I don't understand. If you work on some system, you would typically edit a single file at a time, then C-c C-c or run ASDF which would then only compile and load one single file. No?
5:55:16
no-defun-allowed
i'd consider leaving a lisp "running" if s-l-a-d somehow kept the slime connection
5:57:12
no-defun-allowed
cause i don't leave emacs running all the time cause i'm still stuck in a "workspaces don't exist" mindset sometimes
5:57:54
no-defun-allowed
cause i was brought up on winxp where the closest thing was a hack which "grouped" programs and windows and would let you minimize and reshow groups
5:58:40
beach
Let me summarize: p_l is quitting the Common Lisp system for no reason. shka_ upgrades several times a day, and no-defun-allowed has not considered leaving the Common Lisp system running. :)
5:59:36
no-defun-allowed
also sometimes i need to purge out old code since i'm pretty bad at leaving a system half broken and the saved code's fine
5:59:39
shka_
actually the most frequent reason for restarting lisp for me is lost invariant of GC :P
6:00:02
no-defun-allowed
on that note, is there a way to replace a :BEFORE or :AFTER method with slime like you would with a defun?
6:00:28
no-defun-allowed
from experience it just tacks another one on, but i do understand figuring out which to replace may not be trivial
6:01:08
pjb
in the meantime: cl-user> (uptime) / uptime: 11 days, 15 hours, 6 minutes, 24 seconds. / 1004784
6:01:56
beach
Anyway, I would like to thank everyone for this VERY INTERESTING discussion. I now have a very good picture of why people need FASLs.
6:02:24
no-defun-allowed
i've heard ccl on arm has had problems with threads and gc, but i don't know much about that other than my research on cl on pi
6:02:29
beach
shka_: Are you saying your Common Lisp system does not have first-class global environments?
6:03:11
no-defun-allowed
same thing here with tests, i often spin up a second lisp in a terminal to load tests.lisp and see if it loses or not
6:03:52
no-defun-allowed
after hacking around with aeth to get gitlab ci working on cl, i get a bit too pissed off when ci fails
6:04:57
no-defun-allowed
also testing the tests is important since i did a lot of prototyping of my admittedly very simple fuzzer
6:04:57
beach
Again, thanks to everyone for this very enlightening discussion. I am a bit wiser than I was 15 minutes ago.
6:06:55
no-defun-allowed
come to think of it after a recent slowdown in my programming ci has very destructive psychological effects
6:07:18
no-defun-allowed
you end up just doing the bare minimum required to pass the tests sometimes
6:07:18
fiddlerwoaroof
beach: I generally have one lisp session that I use for most of my projects and then one or more that I use for things I don't want to accidentally kill
6:07:54
fiddlerwoaroof
However, I have a tendency to hit the heap size limit at the worst possible times
6:11:04
fiddlerwoaroof
As far as stale-code goes, I've found that (delete-package :foo) or (rename-package *package* (format nil "~a.OLD" (package-name *package*))) solves most of those issues
6:12:41
fiddlerwoaroof
As far as quicklisp is concerned, I think ironclad takes about a minute to compile, as does mcclim if I'm compiling it fresh