<doulos05>
This is just the simplest part of the program (system?) I want to create. It is an on-exit script for taskwarrior.
<knusbaum>
A package is just a namespace. A system is just a collection of packages.
<doulos05>
So does that little script need to be its own package within my gtd-review system? Or it's own system?
<doulos05>
If I want to be able to asdf:make it into the executable I need to drop into the hooks folder.
<doulos05>
I've read a couple websites about this now and for some reason this concept isn't translating into what I'm trying to create.
<doulos05>
Which tells me I'm not understanding the concept.
<knusbaum>
What errors are you seeing?
<knusbaum>
I've not used asdf:make for a while, but I'll look.
<doulos05>
Not seeing any errors, what I've got works perfectly.
<doulos05>
I'm just not sure how to add the next component of the tool I want to make.
<knusbaum>
You can add it to the existing system, or create a new system.
<knusbaum>
You can add it to the same package even.
<knusbaum>
It is up to your organizational desires.
<doulos05>
I feel like (stop me if I'm mis-understanding CL) I want it to be same system, different package because it's the second in a suite of tools that work together but run separately.
<beach>
doulos05: I usually split a project of mine into one or (usually) more "modules", where each "module" lives in a directory, has an ASDF system definition, and has its own own package definition.
<beach>
doulos05: If the software is large, there will be a top ASDF system that :DEPENDS-ON the others, thereby creating the entire system from its modules.
<knusbaum>
I'm trying to remember how asdf:make works, but if you want separate executables, you might want separate systems.
<doulos05>
beach: So then I'd move this to the gtd-review/taskwarrior-hook directory, rename appropriately, and create a new project in a sibling folder for the next part?
<beach>
It looks like it is already appropriately named.
<beach>
But yes, if you are going to add more stuff that can be considered separate modules, I would create a new directory for each one.
<doulos05>
beach: Yeah, but it has the name for the whole suite when this is only the smallest part.
<beach>
Oh, maybe it is not appropriately named.
<beach>
Got it.
<beach>
Yes, then I would rename it.
<beach>
doulos05: Do you take other remarks on your code?
<beach>
It is often a bad idea to :USE packages other than the CL package. It is better to use explicit package prefixes to refer to symbols in different packages.
<beach>
The Common Lisp HyperSpec has opinions on the number of semicolons you use in comments, and top-level comments should have at least 3.
<beach>
There is usually a single blank line between top-level forms, but you have one occurrence of no blank line and one occurrence of two blank lines.
<beach>
The function GET-CURRENT-PROJECT-LIST does not use its parameter as far as I can see.
<doulos05>
beach: absolutely! This is literally the first time I've written CL code not copy/pasted from tutorials.
<beach>
I see. Congratulations!
<mfiano>
doulos05: Congratulations!
<mfiano>
If you haven't already, check out Practical Common Lisp online. That will open up your eyes to a lot of ideas and get some more familiarity
<doulos05>
beach: Whoops on the missing parameter! How do I ensure that INFERIOR-SHELL is available if I don't :USE it?
<doulos05>
I actually used an explicit package prefix in the code itself I think
<mfiano>
:USE brings in the symbols of the given package into the package being defined, so no qualification is needed. To qualify it, you write it as PACKAGE:SYMBOL
<mfiano>
:USE makes reading/maintaining code difficult because you don't know where symbols came from, and also makes it easy to get conflicts
ec has quit [Ping timeout: 252 seconds]
<beach>
doulos05: What mfiano said. The symbols are available as soon as the external package is defined and the symbols are exported. :USE just makes it possible to use them without a package prefix.
<mfiano>
If the package is long and your fully-qualified symbols are too noisy, you can look into package-local nicknames
<doulos05>
Aha, the :DEPENDS-ON makes sure that it's there. Ok, now this is making sense
zacts has joined #commonlisp
zacts has quit [Client Quit]
<mfiano>
Hmm?
<mfiano>
:DEPENDS-ON has nothing to do with packages/symbols :)
<mfiano>
That is a "system" concept
<doulos05>
right, but :DEPENDS-ON makes sure that inferior shell gets loaded when my system gets loaded so that I can call on it in my packages
<beach>
doulos05: The package is defined when the file that contains the definition is loaded. That may or may not be as a result of the file appearing in an ASDF system definition.
<mfiano>
doulos05: THat sounds right, ok.
<mfiano>
Keep in mind that there is no association between systems and packages and you will be a step ahead of many CL newbies :)
<beach>
Heh.
<beach>
That's true.
<mfiano>
A package is for the most part just a collection of symbols. A system is a collection of modules/files, which may be comprised of any number of packages. N files with 1 package, N files with N packages, etc etc. It's up to you
<mfiano>
It's unfortunate that other languages call the source distribution manifest a package...that's what CL systems are, not packages.
zacts has joined #commonlisp
<doulos05>
Awesome, thank you so much!
<mfiano>
Sure, anytime, and welcome to the party.
zacts has quit [Quit: gtg]
ramenbytes has joined #commonlisp
<doulos05>
Another quick followup, someone mentioned they hadn't used ASDF:MAKE. Do you just use sb-ext:save-lisp-and-die?
<beach>
I don't know about others, but I never bother to make an executable. I consider my Common Lisp REPL to be my shell.
<doulos05>
That makes sense.
<knusbaum>
I prefer to work that way too.
<beach>
I guess I just refuse to accept the crappy application interface that "modern" operating systems give us, and pretend that I have a Lisp OS instead.
<moon-child>
someday we won't have to pretend
* beach
crosses fingers.
hendursa1 has quit [Ping timeout: 252 seconds]
<doulos05>
lol. Emacs is close, but it isn't common lisp
<kakuhen>
Rainer Joswig vehemently disagrees with that
<knusbaum>
I like the unix shell. But if I'm writing common lisp, I prefer to take advantage of the lisp REPL.
<moon-child>
the unix shell is at somewhat of a local optimum in the context of a unix system. But unix as a paradigm has overstayed its welcome
<knusbaum>
I'm happy to be introduced to anything better. Plan 9 is the only paradigm I've seen that seems to beat it (and is widely available)
<White_Flame>
from what I've seen, plan 9 is unix plus some cleanup, tooling, and utf-8, but it still certainly in the unix style
<moon-child>
text composes well, but lacks structure. Shell and c are poor languages. Hardware isolation means IPC is slow, which limits architecture design
<White_Flame>
moon-child: unix isn't about text, it's about C char streams/buffers
<moon-child>
plan9 is an incremental improvement to unix
<knusbaum>
moon-child: more or less, yes.
<moon-child>
White_Flame: char streams, sure. I don't see as that makes a meaningful difference
<White_Flame>
moon-child: it could be binary or whatever
<knusbaum>
Plan 9 serves lots of binary protocols over C char streams
<moon-child>
White_Flame: ok. It still composes well but lacks structure and expressiveness, which was my main point
<knusbaum>
What is available and more structured than unix?
<White_Flame>
anything that has higher level serialization protocols
<moon-child>
available? Nothing
<White_Flame>
but, these tend not to be done at the OS level anymore
<White_Flame>
which means the OS is unaware of anything going on. Everything is black box to it
<knusbaum>
Sure.
<knusbaum>
So something like erlang?
<moon-child>
White_Flame: yes, you can layer higher-level serialization protocols _on top of_ text. But text lacks them inherently, which is problematic. If you want a byte stream, you can do that inside of a structured data paradigm, but you cannot do the other way around
<knusbaum>
Why is it important to have structured data at the OS level?
<White_Flame>
a few other problems with the unix model is the heirarchical filesystem, and the privilege model
<moon-child>
in a general sense. IOW every program invents its own serialization mechanisms, and they are not commensurate. At that point, you lose the composability. Like fullscreen applications. I can't pipe alpine into something, for instance
<White_Flame>
moon-child: right, and it gets difficult to automate things when every single text file has a different format
<knusbaum>
White_Flame: Yes, both of those are problematic if you want to represent non-file resources in the file system.
<moon-child>
knusbaum: erlang is cool. Somebody did an erlang os once, hydros. (There were a few others, but hydros was the most notable one, I think)
<knusbaum>
Oh, that's cool. I'll have to check that out.
<moon-child>
knusbaum: everything is a file, but a file is not a record. That aspect of unix is not terrible
<White_Flame>
knusbaum: even with files, choosing a singular directory for a file to be in becomes more and more troublesome, and links are just a bandaid
<knusbaum>
White_Flame: Yes. Plan 9 fixed a lot of this.
<moon-child>
White_Flame: file descriptors are not terrible. The user/group system isn't great, though. Hierarchy is one of the biggest problems
<knusbaum>
Hierarchy is good if it can be controlled by the process. I.e. namespaces
<moon-child>
White_Flame: notably, you can only hardlink files, not directories, because apparently unix people don't know how to write garbage collectors
<knusbaum>
moon-child: So what's an unavailable but better system?
<beach>
CLOSOS. :)
<White_Flame>
and of course, the unix model exposes a C api, which means by default you're writing applications in a system level language
<ramenbytes>
Originally it was using CL, however the author switched to PicoLisp because of gc performance I believe.
<moon-child>
hey, somebody made a picolisp operating system!
<ramenbytes>
Specifically, SBCL gc performance. They didn't want to have to replace the gc themselves after mucking around a bit with the sources if I recall.
<White_Flame>
yeah, that's something I look forward to in SICL, is the possibility of easier, and even maybe interactive GC exploration
<ramenbytes>
I didn't know that was on the roadmap. I suppose there is a paper in the repo?
<White_Flame>
I'm under the assumption that the GC will be in CL as well
<White_Flame>
I don't recall if that was in a paper, in a discussion with beach, or a fabrication of my imagination ;)
<moon-child>
mezzano gc is also in cl
<White_Flame>
ah true
<ramenbytes>
Fingers crossed we get a SICL gc library...
<ramenbytes>
Something like a MOP for gc maybe...
shka has joined #commonlisp
killsushi has quit [Quit: Leaving]
<phoe>
trivial-garbage already exists but it has a very very basic GC interface
<phoe>
everything else would need to be highly implementation dependent
<phoe>
also the SICL garbage collector makes some assumptions that simply won't be true for other implementations, so AFAIU it won't be possible to easily port it
<moon-child>
I think the goal was to experiment with different GC designs within sicl, not to use multiple CL implementations with sicl's gc
<ramenbytes>
phoe: I was thinking something more like gc-as-a-library, sort of like MPS or the upcoming mmtk but in Lisp. Like how SICL has the reader available as a library.
<phoe>
oh, like that - then you'll also need custom allocators, since AFAIK the SICL one is tied to the GC
<moon-child>
mmtk is upcoming? Isn't it decades old now?
<ramenbytes>
I was thinking about the front page saying something about "not ready for deployment".
cjb has quit [Remote host closed the connection]
sjl has joined #commonlisp
frgo_ has joined #commonlisp
frgo has quit [Read error: Connection reset by peer]
ramenbytes has left #commonlisp [#commonlisp]
chrysanthematic has joined #commonlisp
<beach>
I think it is very hard to design a good GC that is independent of other parts of the system.
<beach>
And the (untested) design of the SICL GC relies on the object representation.
<beach>
I think MPS is probably perfectly good for a library GC. I believe one version of Clasp is using it.
pve has joined #commonlisp
chrysanthematic has quit [Quit: chrysanthematic]
Cymew has joined #commonlisp
rgherdt has joined #commonlisp
ludston has quit [Quit: Connection closed]
hendursa1 has joined #commonlisp
tfb has joined #commonlisp
Josh_2 has quit [Ping timeout: 252 seconds]
trocado has quit [Ping timeout: 268 seconds]
hendursaga has joined #commonlisp
hendursa1 has quit [Ping timeout: 252 seconds]
doulos05 has quit [Remote host closed the connection]
frgo_ has quit [Remote host closed the connection]
frgo has joined #commonlisp
Wilfred has joined #commonlisp
selwyn has joined #commonlisp
prxq_ is now known as prxq
Alfr has joined #commonlisp
lottaquestions_ has joined #commonlisp
lottaquestions has quit [Ping timeout: 268 seconds]
amk has quit [Read error: Connection reset by peer]
amk has joined #commonlisp
Wilfred has quit [Quit: Connection closed for inactivity]
prxq has joined #commonlisp
igemnace has quit [Quit: WeeChat 3.2]
derelict has quit [Quit: WeeChat 3.2]
<luis>
beach: at the last Boston Lisp Meeting, drmeister mentioned he wasn't happy with the performance of MPS, particularly compared to Bohem
tyson2 has joined #commonlisp
zacts_ has joined #commonlisp
<phoe>
luis: is there a recording of that meeting? I missed it and I'd want to see it nonetheless
zacts has quit [Ping timeout: 272 seconds]
zacts_ is now known as zacts
yitzi has joined #commonlisp
CrashTestDummy2 has joined #commonlisp
CrashTestDummy has quit [Ping timeout: 244 seconds]
kakuhen has quit [Quit: Leaving...]
zacts has quit [Quit: gtg]
shka has quit [Quit: Konversation terminated!]
frgo has quit [Read error: Connection reset by peer]
frgo has joined #commonlisp
<beach>
luis: I see. Interesting. It would seem to confirm that it is hard to write a good garbage collector that is independent of the rest of the systme.
shka has joined #commonlisp
aeth has quit [Ping timeout: 268 seconds]
aeth has joined #commonlisp
Inline has joined #commonlisp
gko has quit [Changing host]
gko has joined #commonlisp
Bike has joined #commonlisp
amk has quit [Ping timeout: 264 seconds]
amk has joined #commonlisp
selwyn has quit [Quit: Leaving]
<jmercouris>
hello tomato!
<beach>
I see no such nick around.
igemnace has joined #commonlisp
francogrex has joined #commonlisp
cage has joined #commonlisp
Guest635 has joined #commonlisp
yitzi has quit [Remote host closed the connection]
<jcowan>
libgc is a close approximation
<jackdaniel>
libgc is abovementioned boehm:)
<jackdaniel>
mps aims to be better and (general purpose too)
<jackdaniel>
s/and (/(and /
X-Scale` has joined #commonlisp
<jmercouris>
beach: well, it rhymed, I was just saying hello :-)
X-Scale has quit [Ping timeout: 268 seconds]
<beach>
jcowan: I don't consider a conservative garbage collector to be a "good" one. It is just one that is better than manual memory management when you have to use a language with manual memory management for application programming, while keeping your sanity intact.
<jackdaniel>
beach: libgc may be configured to run in precise mode (you need to provide additional information to it then of course)
findow has joined #commonlisp
<beach>
Now, how on earth would you do that? As in, how do you provide precise stack scanning without knowing what the compiler does with your lexical variables?
aeth_ has joined #commonlisp
aeth has quit [Ping timeout: 244 seconds]
<jackdaniel>
you mark each allocated object yourself
CrashTestDummy3 has joined #commonlisp
<jackdaniel>
I'll link ecl file in a second
aeth_ is now known as aeth
<beach>
So, again, how do you find all the GC roots on the stack if you don't know what the compiler does with your lexical variables?
<beach>
And that's just for starters.
<beach>
You must then also provide information about every data structure you define so that the GC knows which fields contain pointers and which fields do not.
<jackdaniel>
yes, that's the additional information I've mentioned you need to provide
CrashTestDummy2 has quit [Ping timeout: 240 seconds]
<beach>
I don't see the root-finding code in there.
<jackdaniel>
I don't consider myself qualified to dispute, I'm just sharing information that libgc may be configured to run in precise mode (and ecl may be build using that option)
<jackdaniel>
it might be that I have misrepresented what libgc does - after some search it looks that it still scans the memory; the precise mode only gives it necessary information about objects structure (so it knows where to look for pointers in objects)
<beach>
jcowan: Notice that the header of the paragraph talks only about pointer identification.
<jcowan>
sorry, which paragraph?
<beach>
jcowan: And apparently, interoperability is important to this author.
<beach>
The one that talks about the cost of precise GC.
<jcowan>
Yes. This is why Guile uses libgc, because pointers can be passed aboug between libguile and its host
waleee has joined #commonlisp
<beach>
So the entire page is biased.
<beach>
It is not a comparison between conservative and precise GC.
<jcowan>
Of course. What page is not? We write from our own perspective, as we have no access to any other.
<beach>
It is a comparison between the pointer-finding part of the two, given that it operates in an environment together with a hostile language.
<jcowan>
If I wrote a page comparing Scheme to CL, there would undoubtedly be Scheme bias in it.
<jcowan>
(so I do not do such things)
<luis>
phoe: I don't think it was recorded, no.
<beach>
I am merely pointing out to the participants of #commonlisp not to draw the conclusion from this discussion and that page, that conservative GC is always better than precise.
doulos05 has joined #commonlisp
igemnace has quit [Quit: WeeChat 3.2]
igemnace has joined #commonlisp
<beach>
Don't get me wrong though. I think the Boehm GC is a great piece of work, that was thought to be impossible before someone actually did it.
* jcowan
nods
<beach>
And, as I pointed out, it is basically the only option available to applications programs who 1. are forced to use a language with manual memory management, and 2. wish to keep their sanity intact.
<beach>
*programmers
<doulos05>
So I'm still thoroughly confused by packages. I seem to have broken my local-projects for quicklisp.
tfeb has joined #commonlisp
<doulos05>
When I run (ql:quicklisp "gtd-review"), it loads it.
<luis>
Boehm went on to achieve other great things such as adding precise real number arithmetic to the Android calculator. :D
<doulos05>
But when I try to then (in-package "gtd-review"), it says the package doesn't exist.
<sm2n>
doulos05, those are two separate things
<jcowan>
I used it in enhancing the C implementation of Joy, which formerly used malloc/free for strings
tfeb has quit [Client Quit]
<jcowan>
luis: Nice
<Xach>
doulos05: the package defined by loading the system is likely to have an uppercase name.
<luis>
doulos05: your package's name is probably "GTD-REVIEW"
<Xach>
the system name and the packages it defines are not necessarily the same.
<doulos05>
aha, let me try that
<luis>
doulos05: you can also refer to it as :gtd-review if you're not into shouting
igemnace has quit [Quit: WeeChat 3.2]
<beach>
True story: When consulting for a small company here, I recommended they use Boehm, because they had an application written in C++, and they were unable to get the defect count down. They had memory leaks and dangling pointers. The project leaders then told me that they thought the programmers had a moral obligation to clean up after themselves, by freeing the objects they allocated.
igemnace has joined #commonlisp
igemnace has quit [Client Quit]
AnimalClatter has joined #commonlisp
igemnace has joined #commonlisp
<jackdaniel>
that's very noble of that company to embrace morals :)
<beach>
The company later canceled the product, after having spent a few million € on it.
<jackdaniel>
n.b libgc may be used as a leak detector
<beach>
jackdaniel: I didn't know what to say to that. But the CTO agreed with me. They never did follow my advice though.
<doulos05>
Ok, that seems to have helped but I still can't seem to access my exported symbols.
<jackdaniel>
beach: so it seems that the project was cancelled because the developer team was demoralized ,)
<beach>
doulos05: What do you do to access them, and how does the failure manifest itself?
<beach>
jackdaniel: Heh.
igemnace has quit [Client Quit]
igemnace has joined #commonlisp
<beach>
It's a sad story, that unfortunately reflects the sorry state of the software industry. But don't get me started.
CrashTestDummy has joined #commonlisp
<doulos05>
In my Sly buffer, I ran (ql:quickload "gtd-review"). Then (GTD-REVIEW:merge-lists test1 test2).
<doulos05>
I get the error "undefined function" despite it being in the list produced by running the "list all external symbols" recipe in the cookbook
<beach>
doulos05: Then you managed to access the symbol in the package, but the function does not exist. That's different.
<beach>
doulos05: The symbol might exist and be exported, but there may not be a function by that name.
<doulos05>
Let me check for typos, but I'm pretty sure it's correct.
<beach>
doulos05: You may then want to check that your ASDF system actually loads a file that contains the definition of the function.
CrashTestDummy3 has quit [Ping timeout: 244 seconds]
<beach>
Also, you don't have to use upper-case for the package prefix. The reader will automatically up-case it for you (if you are using default settings).
<doulos05>
I told it to. I moved that function and another one (which generates the same error message) out into a utils.lisp file which is in the components list.
<jackdaniel>
doulos05: in the file that defines that function
<beach>
But is that file loaded in the right package?
<jackdaniel>
did you put (in-package gtd-review) at the top?
<jackdaniel>
or to be a purist -- (in-package #:gtd-review)
<doulos05>
Ah... yeah, that'll be it then jackdaniel, thank you!
<jackdaniel>
great, happy hacking and good luck :)
<beach>
doulos05: Normally, every file should start with an IN-PACKAGE form.
<jackdaniel>
(n.b beach question was about the same thing)
<beach>
Yes, but jackdaniel expressed it more directly. :)
<Xach>
Guest635: that is not a concept in common lisp. there are some restrictions on what you can do with the symbols in the CL package, though.
<beach>
Xach: I don't see any message from Guest635.
<MichaelRaskin>
For me they show up in _#commonlisp
<MichaelRaskin>
I am not completely sure _how_
<jmercouris>
I don't see hem either
<jmercouris>
s/hem/them
<Xach>
beach: Hmm. I do, but it looks strange to me.
<beach>
Must be one of those defective bridges.
<Xach>
seems plausible
<MichaelRaskin>
Xach: did you see my message?
<MichaelRaskin>
Whois suggests KiwiIRC, though
<MichaelRaskin>
(my message I tried to send via _#commonlisp)
<Xach>
MichaelRaskin: i see messages from you, but they look normal.
<phoe>
or you are operators
<phoe>
and we are not
<Xach>
oh, that may explain it.
<phoe>
Guest635: say something now?
<Xach>
I haven't seen that feature in action before.
<phoe>
16:33 < Guest635:@#commonlisp> Life is Good
amb007 has joined #commonlisp
<phoe>
I see your message now
<luis>
My IRC client says Guest635's are only visible to channel operators.
<phoe>
OK, that might explain it
<beach>
How bizarre.
<phoe>
I have no ability to check the channel modes at the moment - could someone take a look?
<mfiano>
+ntz
<phoe>
hm
francogrex has quit [Read error: Connection reset by peer]
<phoe>
maybe #help will be of some support
<phoe>
I need to run off now so I can't be of help myself
Guest635 has quit [Quit: Connection closed]
<beach>
It is really disconcerting that people can think that their messages are seen by everyone, but then they aren't. It can make these people think that we are ignoring them.
<phoe>
yes, that's a problem
* phoe
afk
<aeth>
it has to be the z
<aeth>
+nt are standard reverywhere, the defaults when you open a new channel
Guest63 has joined #commonlisp
<jackdaniel>
it is
<jackdaniel>
I've just checked the manual
<jackdaniel>
Guest63: try now
Guest63 has left #commonlisp [#commonlisp]
aeth_ has joined #commonlisp
<jmercouris>
I still don't see anything
<jmercouris>
in the event that there has been any typing
<luis>
+z means "reduced moderation: The effects of +b, +q, and +m are relaxed. For each message, if that message would normally be blocked by one of these modes, it is instead sent to channel operators (+o)."
aeth has quit [Killed (NickServ (GHOST command used by aeth_))]
aeth_ is now known as aeth
<luis>
I think I recognize that IP from our first channel ban, so they may be under some sort of ban.
<luis>
Without +z not even OPs see his messages.
<jackdaniel>
ah! interesting
<aeth>
is there a too-broad +b or +q?
<luis>
The banlist for this channel is empty.
<jackdaniel>
a bug perhaps? oh well
<mfiano>
What about the quiet list?
<mfiano>
If they were +b they wouldn't be able to join. +q and they can join but not speak. +qz and they can speak but only ops see it
<luis>
mfiano: how do I see the quiet list?
<jackdaniel>
is there a quiet list?
<jackdaniel>
I thought it works the other way around: when you set +q mode, then only voiced members can talk
<luis>
That was my impression too.
<luis>
So +z seems to work like shadow banning. That sounds useful for dealing with trolls.
<mfiano>
When +z is set, the effects of +m, +b and +q are relaxed. For each message, if that message would normally be blocked by one of these modes, it is instead sent to all channel operators. This is intended for use in moderated debates.
<jackdaniel>
/deop luis /mode +z /takeover #commonlisp
<jackdaniel>
:)
selwyn has joined #commonlisp
azimut has quit [Remote host closed the connection]
<Xach>
fe[nl]ix: i am getting "Unknown CFFI type SIZE-T" from static-vectors.
azimut has joined #commonlisp
<luis>
#libera tells me "/mode #commonlisp q" is the way to check the quiet list
selwyn has quit [Read error: Connection reset by peer]
<mfiano>
$~a quieted by zirconium.libera.chat on Tue, 08 Jun 2021 21:40:46
<mfiano>
That's an extban
<luis>
Apparently this means anyone not registered with nickserv is on the quiet list. #libera recommends only doing that if there's spam going on.
<luis>
$ = special, ~ = not, a = account
<mfiano>
Yes, well $ = type
dsk has quit [Ping timeout: 240 seconds]
azimut has quit [Ping timeout: 252 seconds]
<pl>
we're back to modes we had on freenode
azimut has joined #commonlisp
<pl>
also, we used to have some quiet extbans due to spam on freenode, and possibly someone copied them?
<fe[nl]ix>
Xach: fixed it, I made a new release
selwyn has joined #commonlisp
Posterdati has joined #commonlisp
<Posterdati>
ok
<Posterdati>
hi
<beach>
Hello Posterdati.
yitzi has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
Inline has quit [Ping timeout: 244 seconds]
amb007 has joined #commonlisp
derelict has joined #commonlisp
<pjb>
Posterdati: so, what's broken in gsll?
<selwyn>
pjb: the nonlinear least squares fitting iirc
selwyn has quit [Read error: Connection reset by peer]
Cymew has quit [Ping timeout: 268 seconds]
selwyn has joined #commonlisp
<Posterdati>
pjb: the groveller
<Posterdati>
pjb: openbsd has supplemental directory for includes
derelict has quit [Quit: WeeChat 3.2]
derelict has joined #commonlisp
IAmRasputin has joined #commonlisp
selwyn has quit [Read error: Connection reset by peer]
aeth has quit [Killed (NickServ (GHOST command used by aeth_))]
aeth_ is now known as aeth
makomo has joined #commonlisp
amb007 has joined #commonlisp
<Posterdati>
pjb: problem where in cffi and gsll sources
<jcowan>
the thing to learn about CTOs is that they have no power
<jcowan>
this is especially important if you are applying for (or being asked about) the role, but important for grunts too. You may get sykmpathy, but not change
<jcowan>
also, destructors are not (and should not be) invoked by the GC, so if they are (Ghu forbid) pervasive, there is indeed nothing to do to clean up.
derelict has quit [Ping timeout: 268 seconds]
amb007 has quit [Ping timeout: 252 seconds]
amb007 has joined #commonlisp
ramenbytes has joined #commonlisp
<tfb>
jcowan: it's perfectly reasonable for *some* hook to be called at the point something becomes garbage. I'd much rather that happen than (say) file descriptor exhaustion
<jcowan>
Sure. But you want to use a finalizer, not a C++ destructor, which may end up being called too early
clintm has quit [Remote host closed the connection]
<tfb>
jcowan: Oh, OK, I don't know the difference. Yes, finalizers is what I meant. Is a destructor the 'this is now out of dynamic scope' thing?
<tfb>
whatever, if it's something C++ does I'll just assume it's wrong (and also made out of jelly and crayon)
<Guest63>
phoe: thanks - just realised I was missing a ' before ,rest
<phoe>
yes, that will be important
<Guest63>
what does that do?
<phoe>
quoting?
<Guest63>
seems like it cancel each other?
<phoe>
oh boy
<phoe>
you *really* need to pick up on CL basics before you go and do macros
<Guest63>
ok :)
<phoe>
like, this is the least painful way
<Guest63>
thanks :)
<phoe>
first understand what quoting does, then understand what backquoting and unquoting do
<phoe>
and then you can use this knowledge to write macros
<Guest63>
I guess ,rest puts the parameters into the macro and then the ' prevents it from being evaluated
<Guest63>
makes sense once I look at the macroexpand-1
<Guest63>
thanks for the solution :)
<Guest63>
Now I will try to figure out how to evaluate (print (+ 2 2)) as you said (on my own)
cage has quit [Quit: rcirc on GNU Emacs 27.1]
cage has joined #commonlisp
<jackdaniel>
`',foo
<jackdaniel>
cl may look like perl too!
<Guest63>
jackdaniel: 'format definitely has a lot of crazy configurations
<shka>
ok, so i will sound like a broken record
<shka>
but macros are overrated
<shka>
people say that it is the killer feature of cl
<shka>
or lisp in general
ramenbytes has joined #commonlisp
<shka>
i would call it "force multiplier"
<shka>
it makes every other feature in the language better
<shka>
but on it's own, macros are nothing
<Guest63>
Macros are good for DSL
<tfb>
loke[m]: it doesn't read like the description of a bad joke language: it *is* the description of a bad joke language
<loke[m]>
tfb: yeah, fair enough. It's the only explanation that makes sense.
tfb has quit []
<shka>
Guest63: yes, but actually you should not start designing DSL starting with macros
pranavats has joined #commonlisp
aeth has quit [Ping timeout: 244 seconds]
aeth has joined #commonlisp
<shka>
macros allow you to simply implement your design while otherwise you could get stcuk
<shka>
*stuck
<shka>
or be forced into compromises
<shka>
but you would be surprised how far you can get without a single defmacro
<shka>
even in DSL
<Guest63>
shka: do you mean by compiling inline
<Guest63>
otherwise I would assume the performance benefits of Defmacro can't be ignored in DSLs?
<Bike>
defmacro isn't generally used for performance reasons
<shka>
Guest63: think about the DSL as a style of API design
<shka>
where you are trying to build some sort of the grammar
<shka>
implementation can be more or less efficient
<Guest63>
sorry - I got confused, I was thinking of reader macros (I think that's it)
<AnimalClatter>
Is there a more obvious way to get the last char of a string than (char mystring (1- (length mystring)))?
<Guest63>
those are very helpful to create DSLs that deviate from the lisp () approach
<phoe>
reader macros aren't used for performance either
<Bike>
AnimalClatter: nope
<Guest63>
not for performance, but for creating DSLs
<AnimalClatter>
@Bike thanks
<Bike>
AnimalClatter: i think alexandria has a lastelt function or suchlike to do that for you
<Bike>
but it's implemented something like that
<phoe>
yes, (alexandria:last-elt "abc") works
<shka>
yes, lastelt in alexandria
<shka>
Guest63: DSLs are not about the syntax, i think that this point elude you
<AnimalClatter>
Thanks all
<shka>
DSL are about structuring interactions
<dieggsy>
is there an easy to way to jump to the sources where the error occured using slime?
<shka>
yes
<shka>
first, you need to navigate to a stack frame
<shka>
then use v key (IIRC)
makomo has quit [Quit: WeeChat 3.0.1]
chrysanthematic has joined #commonlisp
ramenbytes has quit [Remote host closed the connection]
Guest63 has quit [Quit: Ping timeout (120 seconds)]
dsk has quit [Ping timeout: 240 seconds]
aeth_ has joined #commonlisp
aeth has quit [Killed (NickServ (GHOST command used by aeth_))]
aeth_ is now known as aeth
Guest63 has joined #commonlisp
<Guest63>
shka: I was using the term informally
<gigo>
how do I unscramble qiulaty?
IAmRasputin has joined #commonlisp
<jackdaniel>
guality?
<gigo>
can someone help me with this code: https://plaster.tymoon.eu/view/2497 - Trying to make a macro but when I execute I get this error: The variable BLOCK1 is unbound.
<gigo>
jackdaniel: thanks. needed to unscramble it to post to tymoon
<Bike>
gigo: try (macroexpand-1 '(decorate block1 ...)), i think you should be able to see the problem quickly
<Bike>
it will expand into (progn (format t "bla bla bla" block1) ...)
<jackdaniel>
try (decorate 'unblock ...) ; )
<shka>
second format has ~a without argument
<gigo>
is there an easy way to wrap the macro call around (macroexpand-1 ...? It takes a lot of work to wrap calls into macroexpand-1. Type it out and then slurp the next expression. Then after debugging remove it. then barf again. any easier way?
<shka>
i think that you may wanted to put name in there as well
<shka>
if yes, remember about multiple evaluations...
<Bike>
gigo: in slime you can do C-c C-m and it will pop up a frame with the macroexpansion
<gigo>
shka: thanks. yes that one is typo. need to fix that line too.
<Xach>
gigo: I usually use the emacs keystrokes to do it with sly/slime.
IAmRasputin has quit [Ping timeout: 240 seconds]
<Xach>
C-c M-m I believe.
<Xach>
oh, sorry, I am too slow
<gigo>
C-c C-m worked for me
<gigo>
so I learnt the problem in https://plaster.tymoon.eu/view/2497 - ,name is getting replaced with BLOCK1. But I want ,name to get replaced with "BLOCK1". how can I do that?
Josh_2 has joined #commonlisp
<shka>
gigo: during macroexpand, you can get symbol-name
<Josh_2>
Hi
<shka>
then, use the symbol-name (evaluated) and place it into expansion code
<gigo>
now I am confused. why is this working correctly? - https://plaster.tymoon.eu/view/2498 - I was expecting the (format ...) line to expand like this and fail: (format t "~&----- header ~a -----~%" ,(format nil "~a" BLOCK1)) but it expands to (FORMAT T "~&----- header ~a -----~%" "BLOCK1") and works fine.
<gigo>
how does it automatically get the quotes around BLOCK1 in this new example?
<shka>
gigo: well, as jackdaniel mentioned, you perl it :D
<shka>
',name
<shka>
or if you are like me
<gigo>
perl it? what does that mean? I don't think I know enough Lisp to understand the jokes.
<shka>
(quote ,name)
<shka>
sorry
<shka>
anyway, thing is that you are passing a symbol, right?
<gigo>
yes
<shka>
and macroexpand works by producing lisp form
<shka>
gosh, i struggle to explain this
<shka>
gigo: the your code and replace that ,name in format with ',name
<gigo>
',name works and it makes sense too. i understand why it works
<shka>
it works because you are evaluating the inner form during macroexpand
<gigo>
I was expecting the first (format ...) line to expand like this and fail: (format t "~&----- header ~a -----~%" ,(format nil "~a" BLOCK1)) but it expands to (FORMAT T "~&----- header ~a -----~%" "BLOCK1") and works fine.
<shka>
where NAME is bound to 'BLOCK1
<shka>
yes
<shka>
well the problem with macros is that they require thinking in two times at once
<shka>
first, there is macroexpand time, and then there is runtime where the expansion is actually used
<gigo>
okay. I think I got it. So the inner form is executing like ordinary Lisp code: (format nil "~a" name) . This would work even under ordinary circumstance if I was not doing any macro business, so it works inside ,() too.
<shka>
yes, different time
Inline has quit [Remote host closed the connection]
Inline has joined #commonlisp
<gigo>
thanks shka. I think i finally understood this. I will write more examples and practice this more.
ramenbytes has joined #commonlisp
<shka>
gigo: keep in mind that the problem with duality of macros
<shka>
where the code that is supposed to produce code and the produced code is mixed together
<shka>
that's what makes macros difficult to understand
<shka>
once-only is perhaps the best example of this
<shka>
but there are different such macros
<shka>
*other such macros
<gigo>
yes, I need to play with this more to get the hang of it.
chrysanthematic has joined #commonlisp
<Guest63>
If I want to have a variable defined outside of a function, is this the best way of doing it:
<Guest63>
(let ((y 7))
<Guest63>
(defun scope-test (x)
<Guest63>
(list x y)))
<shka>
Guest63: depending on the use case this may be fine
<shka>
more often you will want to use defvar, defparameter and alexandria:define-constant
<Guest63>
I wanted to do (defun my-fn (x) (let* ((y 7) (scope-val (scope-test x
<Guest63>
In this version, scope-test doesnt recognise y from the calling function
tfb has joined #commonlisp
<Guest63>
I'm trying to do some out of order side effects and don't want to make my recursive functions unnecessarily complicated
<Bike>
variables are usually lexical, so that kind of thing won't work
<Bike>
you might want a dynamic variable, in which it will look up the most recent binding _dynamically_ like the y binding here
<Bike>
usually it looks up the innermost binding in the source text instead
chrysanthematic has quit [Changing host]
chrysanthematic has joined #commonlisp
chrysanthematic has quit [Quit: chrysanthematic]
karlosz has joined #commonlisp
jans has quit [Ping timeout: 244 seconds]
<Guest63>
@Bike: thanks, let me have a look at doing that
<pjb>
special symbols let you teletransport variables from one function to another.
<pjb>
Guest63: you can indeed pass closures to let a function access your lexical variables.
<Guest63>
@bike: thanks for that code, I will try it out
<Guest63>
pjb: indeed, I am trying now to balance between recursion, side effects, functional programming to give the "best expression of a function" so that readability is maintained
<jcowan>
"It is an error to use function on a function name that does not denote a function in the lexical environment in which the function form appears. Specifically, it is an error to use function on a symbol that denotes a macro or special form. An implementation may choose not to signal this error for performance reasons, but implementations are forbidden from defining the failure to signal an error as a useful behavior." Why?
<pjb>
Guest63: but if you build C-like pointer in CL, you will have C-like bugs too.
<Bike>
i'm also not sure i understand why you would want it to work
<Guest63>
pjb: thanks for the cool link, I've added it to my bookmark to go through
<Guest63>
indeed, chances of bugs do go up, but if you isolate, hopefully you can limit it considerably
<jcowan>
The case I have in mind is allowing #'foo-macro to return the application of the underlyimng function to 'foo. In this way, you can recognize macro names in operand position.
<jcowan>
'foo or any other atomic value
<jcowan>
er, non-list value
<Bike>
i don't understand. could you give an example of what would happen?
tfb has joined #commonlisp
<Josh_2>
Has anyone here used Rucksack?
<jcowan>
(defmacro foo (a b c) (+ a b c))
<jcowan>
expands to (+ a b c)
<jcowan>
But suppose I want to write (defmacro bar (x) (- x))
<Bike>
Just checking, but you don't mean (defmacro foo (a b c) `(+ a b c))?
<Bike>
er, with commas etc
<jcowan>
Yes, I do.
<jcowan>
sorry, thinking in syntax-rules
<Bike>
sure
<jcowan>
(defmacro bar (x) `(- ,x))
<jcowan>
then (map #'bar '(1 2 3)) expands to ((lambda (x) (- x)) '(1 2 3))
<jcowan>
where of course you'd want to use morc complex macros
<Bike>
uh, you lost me. isn't that an error
<Bike>
do you mean (map (lambda (x) (- x)) '(1 2 3))?
<White_Flame>
the way to map a macro over a list has always been (mapcar (lambda (x) (bar x)) '(1 2 3)) for me
<White_Flame>
gives it a place to expand properly
tfb has quit [Quit: Leaving]
shka has quit [Ping timeout: 240 seconds]
<White_Flame>
(also, MAP needs the return type first, so probably some scheme-isms left over you in your example still :-P)
<White_Flame>
-you
<Bike>
i mean the issue here is that most macros people actually use have more involved syntax than evaluating everything like a function call
<Bike>
if i understand your idea correctly
tyson2 has quit [Ping timeout: 252 seconds]
Inline has quit [Ping timeout: 272 seconds]
Jach has joined #commonlisp
<mfiano>
Bike: Are you still maintaining introspect-environment?
<Bike>
i try to when people need it, but that's not often
varjag has quit [Quit: ERC (IRC client for Emacs 28.0.50)]
waleee has quit [Ping timeout: 240 seconds]
<drmeister>
How would you send a signal to a thread that it should shutdown?
<drmeister>
Or a collection of threads? Would you give them each a cons cell and have the manager thread change the value of the car and have the workers monitor the value of the car? The car is atomic.
<moon-child>
depends entirely on what the thread is doing, who is telling it to shut down, and why
waleee has joined #commonlisp
<Alfr>
How do you communicate with them usually? I usually enqueue such a message, but that'll only do if use messages in the first place.
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
<drmeister>
I'm working in Clasp (Common Lisp with C++ interop) - I've written a program to process 24 GB of DNA sequence data and it generates 1 manager thread that generates 4 worker threads. When I push the "Stop Task" button the user interface thread invokes (bt:kill-thread manager). Currently the workers don't know that the manager was killed.
<drmeister>
Bordeaux threads has condition variables - but they don't look appropriate.
<drmeister>
So I thought - I have atomic CONS cells and I could use those to signal what the workers should do and the workers can poll the CONS cells.
<drmeister>
There's currently no Common Lisp mechanism for a thread to know that it's been killed.
chrysanthematic has joined #commonlisp
<drmeister>
I've done a fair amount of multi-thread programming - I should know how to do this - but I guess I haven't done enough multi-thread programming where I try to coordinate the threads.
<moon-child>
so, are you just breaking up your dataset into 4 and giving one part to each worker? Or are you breaking it up into smaller chunks, and having the workers process a chunk at a time?
<drmeister>
The data is spread over four files so I'm giving one file to each worker.
<drmeister>
So the former.
<moon-child>
If the former, I think it's a good idea to move to the latter, just because one of the threads might get ahead of the others, and then you won't make optimal use of CPU. Having done that, you can tie the 'should I die yet' check into the 'pull/push another work chunk' step
karlosz has quit [Quit: karlosz]
<drmeister>
These files are balanced in size. They come out of a DNA sequencer that generates enormous amounts of data and they spread the data out across files.
<drmeister>
But I hear what you say - I could have a reader thread and some number of worker threads.
<drmeister>
A single writer, multiple reader queue would work for that.
<drmeister>
Yeah - that's actually a good idea. Then I could have the reader pass an end-of-all-data value to each of the workers and they shutdown.
eta has quit [Ping timeout: 272 seconds]
eta has joined #commonlisp
<drmeister>
Still - the user interface would still send a (bt:kill-thread reader) and the reader would have to recognize that it's being killed and send the message to the workers and then die.
<drmeister>
I didn't mention this but I have multiple readers working at the same time as well.
<drmeister>
Here I've switched from manager to reader.
Steeve has joined #commonlisp
<Alfr>
drmeister, the doc of bt:destroy-thread (can't seem to find bt:kill-thread) says it's implementation dependent whether cleanup is run. So I don't think you can reliably use it if you need the killed thread to kill its children too.
<drmeister>
Right - destroy-thread - sorry - not kill-thread
derelict has quit [Ping timeout: 252 seconds]
Steeve has quit [Quit: end]
<drmeister>
The coming bordeaux threads API has more stuff for communication between threads.
Alfr is now known as Guest3889
Guest3889 has quit [Killed (strontium.libera.chat (Nickname regained by services))]
Alfr has joined #commonlisp
<Bike>
mfiano: er, i don't understand. the error call is unreachable, sure, so you shouldn't be seeing that error
torbo has joined #commonlisp
chrysanthematic has quit [Quit: chrysanthematic]
tfb has joined #commonlisp
tfb has quit [Client Quit]
X-Scale has quit [Ping timeout: 265 seconds]
chrysanthematic has joined #commonlisp
<mfiano>
Bike: I don't understand either. But SBCL doesn't know this.
derelict has joined #commonlisp
Alfr has quit [Quit: Leaving]
waleee has quit [Ping timeout: 268 seconds]
X-Scale has joined #commonlisp
Alfr has joined #commonlisp
IAmRasputin has joined #commonlisp
CrashTestDummy2 has joined #commonlisp
random-nick has quit [Ping timeout: 252 seconds]
chrysanthematic has quit [Ping timeout: 268 seconds]
CrashTestDummy has quit [Ping timeout: 252 seconds]
CrashTestDummy3 has joined #commonlisp
IAmRasputin has quit [Ping timeout: 268 seconds]
CrashTestDummy2 has quit [Ping timeout: 240 seconds]
chrysanthematic has joined #commonlisp
Inline has quit [Ping timeout: 268 seconds]
chrysanthematic has quit [Ping timeout: 272 seconds]
derelict has quit [Quit: WeeChat 3.2]
torbo has quit [Remote host closed the connection]