freenode/#lisp - IRC Chatlog
Search
10:58:57
beach
The entire idea was fantastic. The first year there were less than 200 participants, as I recall, but it grew to more than 1000 pretty fast.
11:01:25
beach
It was just amazing to walk into the main entry hall of ENSERB and see all these people hacking away.
14:17:52
beach
But Scheme is a good idea to learn as well if you want to try something different from C.
14:18:25
beach
People here use Common Lisp for all kinds of things. It is a general-purpose programming language.
14:19:11
murtagh
Could you give me a reason why ppl would use C and why would they use Scheme or Common Lisp
14:19:54
beach
Globally speaking, C is closer to the machine, and Common Lisp is much better for writing applications.
14:22:36
beach
C is a very unsafe language, whereas most Common Lisp implementations are safe by default.
14:24:10
beach
murtagh: There is no widely agreed-upon definition of "Lisp", which is part of the reason why this channel is about Common Lisp, which is quite well defined.
14:24:12
phoe
Lisp is a whole family of languages, including dialects like Scheme, Racket, Common Lisp, Clojure, Shen, Hy, Lisp Flavored Erlang, and what else
14:24:54
beach
murtagh: I believe there is a channel #lispgames that is dedicated to games in Common Lisp.
14:25:21
Xach
Furthermore, #lisp is the place where people who *like* common lisp congregate - not simply people who use it. It's not a support group for people who are forced to use it and hate it.
14:27:43
Xach
common lisp has a well-written standard, multiple mature implementations, the possibility of commercial support, examples of successful companies and applications with CL at their core (though not a zillion, they do exist), potential for fast code
14:28:59
Xach
i sometimes wish there were multiple multibillion-dollar companies racing to improve it, but then i think the result would not really be recognizable as the thing i like for very long.
14:58:53
VincentVega
Happy 2021, folks! A bit late to the party, but now that quickdocs is closed. what do you use? I just want to explore the existing projects. For emacs, there's MELPA which makes it easy as every project there has a very short description and you can search it.
15:02:36
contrapunctus
VincentVega: awesome-cl/cl-cookbook, but I'm just a newcomer. Would the querying functions of Quicklisp work?
17:22:28
pve
at some point I'd like to give one to my son, but I fear he's still a bit too young for CL :)
17:33:15
aeth
pve: Probably too low-level but you could probably hack together some 80s-style 2D game that he can just modify
17:53:32
phoe
We have CL:CONSTANTP that accepts a Lisp form and a lexical environment, and answers true or false. Is it generally possible to have a hypothetical CONSTANT-VALUE operator that produces a value off a form that has been declared constant by CONSTANTP?
17:57:50
jackdaniel
i.e ecl's compiler has a function constant-value-p which returns two values: whether it is a constant, and if it is, the second value the value
18:02:02
aeth
phoe: Portably, I guess could do something like this, which doesn't have an environment, but I think the only portable DEFCONSTANT is global, anyway: (and (constantp '+foo+) (symbol-value '+foo+))
18:03:03
phoe
aeth: portably, yes, but if an implementation answers that e.g. '(+ 1 2) is CONSTANTP, then it should be able to fetch that value
18:03:33
phoe
I'm asking because I'm verifying my comment at https://www.reddit.com/r/lisp/comments/kob7hd/compiler_macros_when_why_how_and_real_life/
18:03:37
jackdaniel
constant may be defined in the compilation unit (but not really evaluated), that's another gotcha (then symbol-value won't work)
18:06:06
phoe
that's where the hypothetical CONSTANT-VALUE function comes into play, but I have no idea if there even exists a portalib for it
18:08:31
aeth
phoe: maybe something like this? (if (and (symbolp foo) (constantp foo)) #| the fast path using (symbol-value foo) |# #| the slow path |#)
18:09:02
phoe
basically https://github.com/Clozure/ccl/blob/553c0f25f38b2b0d5922ca7b4f62f09eb85ace1c/level-1/l1-utils.lisp#L680-L684
18:09:58
aeth
Well, I guess not because CL:+ is package-locked in SBCL and perhaps other implementations.
18:11:50
aeth
phoe: That doesn't help the general case, only with CL:+, which was poorly chosen on my part. Unless the package you're using is package locked. It looks like Alexandria has this... #+sb-package-locks (:lock t)
18:12:09
phoe
aeth: the general case is that I have a form, and an implementation tells me that this form is CONSTANTP
18:12:11
aeth
Idk which implementations other than SBCL implement the feature sb-package-locks, though
18:12:43
phoe
possibly using implementation-dependent functionality, because it's required in the general case
18:13:06
aeth
But a tree-walk only works if it's package locked, otherwise it could stand for anything.
18:19:19
aeth
phoe: I guess SYMBOLP is the only thing you can do portably for the portable path, then? Since that's just global. i.e. (and (symbolp '+foo+) (constantp '+foo+)) then (symbol-value '+foo+)
19:10:38
MetaYan
The sb-cga issue that's been causing many failures in the Quicklisp reports now has a fix: https://github.com/nikodemus/sb-cga/pull/8 . Does anyone here have the possibility to merge it?
21:10:54
makomo
does anyone have a recommendation for a library that implements a mutable ordered set?
21:11:52
makomo
it's a bit annoying how fragmented the ecosystem is when it comes to data structures :/
21:13:50
makomo
shka_: i've taken a look at cl-data-structures :-), and was just about to ask you a bit about it. does the set interface have just those 3 functions? what about unions, intersections, differences?
21:15:24
Alfr
phoe, ah okay. It's insertion order, not inventing some H respecting < for every problem. Didn't know about it, thanks.
21:16:16
shka_
makomo: i certainly want to add unions, intersection and difference, i just didn't manage to get to it yet
21:21:24
shka_
if you want to contribute to the development of cl-ds, you are encouraged to implement the set intersection for skip-lists ;-)
21:27:39
makomo
shka_: is there some sort of reference that you used while implementing the skip-list-based set or?
21:32:38
shka_
it is not particularly complex data structures, erase proved to be the most difficult part
21:43:30
shka_
but honestly, after you get the basic property of the one into your head, you can figure out the rest
21:48:36
mfiano
balancing red-black trees is quite easy compared to other rebalancing such as AVL/WAVL
21:49:16
mfiano
Also, all self-balancing trees can be written in terms of 2 functions split and join, with the rest of the code shared among all implementations.
21:51:29
mfiano
Maybe people should write tests to ensure the invariants. The algorithm is quite simple
21:52:19
mfiano
Also, for the split/join awesomeness, have a read this paper which is what I did for RB/AVL: https://arxiv.org/pdf/1602.02120.pdf
21:56:35
mfiano
I guess I recalled incorrectly: "all code except JOINisgeneric across the balancing schemes
21:58:45
contrapunctus
I'm trying to write a Gemini CGI script. (I'm new to Gemini, web programming, _and_ CL. 😅) This is not a long-running application - does the "connect to remote Lisp image" workflow still make sense for it? 🤔
21:59:33
shka_
contrapunctus: i honestly don't understand your question, but connecting to the remote lisp is normally very useful
22:01:26
contrapunctus
shka_: most of the examples I've seen for remote interaction have been of programs with a constant event loop of sorts running.
22:02:21
shka_
contrapunctus: well, for what is worth i used to connect to the remote server with a decent hardware resources to crunch some data
22:04:44
contrapunctus
shka_: what did your workflow look like? Start remote SBCL (running swank), create SSH tunnel, and M-x slime-connect, each time you want to work on it? 🤔
22:11:28
benjamindc
When I try to load my asd file I get an error: Execution of a form compiled with errors. Form: ("alexandria"). But when I prefix defsystem with asdf (e.g. asdf:defsystem), I don't get that error. But I see that it's standard not to use the prefix on code that I see on github. What am I doing wrong?
22:12:43
Xach
Also, I wouldn't say it's standard not to use the prefix - that is a way around the very problem you have.
22:15:50
benjamindc
Now I'm having the problem that when i run (asdf:test-system "systemname"), rove runs successfully, but doesn't run any tests.
22:21:54
Xach
a table would be faster but longer to make - i can't think of a well-known short idiom
22:24:41
frodef
In terms of efficiency I could easily whip up a simple loop, but I don't think it would be more readable/idiomatic.
22:25:16
phoe
if it's eq or eql or equal or equalp I just add them into a hash table and return NIL if there's a FOUNDP
22:26:06
semz
If a function converts something to a string, is it ever a disadvantage if the resulting string has a fill pointer? I find the function much easier to write using FPs and feel it'd be silly to copy the entire thing just to end up with a simple-string.
22:26:49
phoe
semz: mostly speed I think, some code is more performant if it knows that it works on simple strings
22:27:34
frodef
semz: I can do a helper function, just that if there's already such a function or idiom, that'd be better.
22:28:32
Xach
semz: yeah, working on arrays with fill pointers is slower in general. if a consumer cares, it would have to convert.
22:31:29
Xach
It can still be the right choice for you! It just helps to be aware that it's not without drawbacks.
22:36:15
phoe
CONSTANTP question: could someone provide me an example where the &environment argument passed to CONSTANTP matters? Like, where it changes the actual outcome of the function?
22:37:46
frodef
I guess an env could hold e.g. a symbol-macro that transforms a symbol to e.g an integer?
22:48:08
semz
(cons x y) has duplicates iff y contains x or y contains duplicates, so it's enough to check cdrs
22:51:35
semz
once you've checked for 1 in '(1 2 3), there's no need to check 2 against all of '(1 2 3) again because (test 2 1) = (test 1 2) was already done earlier
22:56:01
semz
i'm going to shamelessly use this as an argument that my solution trips less people up :-)