Josh_2 has quit [Remote host closed the connection]
aartaka has joined #commonlisp
Josh_2 has joined #commonlisp
<beach>
Hello mxben.
<beach>
mxben: Are you new here? I don't recognize your nick.
<mxben>
hello beach. I am new here. new to IRC too. logged in with Matrix.
<beach>
I see. Welcome!
<beach>
What brings you here?
<mxben>
a colleague recently introduced me to emacs and I have been liking it. then I learnt about elisp. then commonlisp. one thing led to another. learnt about IRC communities and here I am. i will probably just lurk and learn.
<beach>
Sounds good. I also recommend #clschool which discusses basic questions in case that happens to be your current level.
<mxben>
thanks. that is exactly my current level. will join it.
igemnace has joined #commonlisp
mon_aaraj has quit [Ping timeout: 268 seconds]
random-nick has joined #commonlisp
aartaka has quit [Ping timeout: 268 seconds]
aartaka has joined #commonlisp
mon_aaraj has joined #commonlisp
gateway2000 has quit [Ping timeout: 244 seconds]
OlCe`` has quit []
OlCe has joined #commonlisp
thuna` has joined #commonlisp
taiju has quit [Ping timeout: 255 seconds]
gateway2000 has joined #commonlisp
matt has joined #commonlisp
matt is now known as Guest4845
Guest4845 is now known as matt`
mon_aaraj has quit [Ping timeout: 268 seconds]
mon_aaraj has joined #commonlisp
lisp123 has joined #commonlisp
mon_aaraj has quit [Ping timeout: 268 seconds]
mon_aaraj has joined #commonlisp
dre has left #commonlisp [Leaving]
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
aartaka has quit [Ping timeout: 268 seconds]
aartaka has joined #commonlisp
Inline has joined #commonlisp
Josh_2 has quit [Ping timeout: 240 seconds]
lisp123 has quit [Quit: Leaving...]
glaucon has joined #commonlisp
Josh_2 has joined #commonlisp
mayuresh has joined #commonlisp
<mayuresh>
hello everyone. :)
<mayuresh>
is "lisp in small pieces" generic enough to understand compilers?
<mayuresh>
or is it more specific to scheme?
triffid has quit [Read error: Connection reset by peer]
lisp123 has joined #commonlisp
triffid has joined #commonlisp
<jackdaniel>
it is general enough
<mayuresh>
jackdaniel: thanks. :)
<jackdaniel>
it discusses various aspects of "lisps", not only scheme
<jackdaniel>
that said, "understanding compilers" is a vague concept ,)
<mayuresh>
jackdaniel: i would like to know how "real" compilers work on the inside.
<jackdaniel>
cyber-psycho-analysis - emerging field of ai
Josh_2 has quit [Remote host closed the connection]
Josh_2 has joined #commonlisp
<mayuresh>
jackdaniel: before diving into reading the code of a real compiler.
<jackdaniel>
an important insight is that compilers are like any other program that takes input and produces /results/
mon_aaraj has quit [Ping timeout: 268 seconds]
mon_aaraj has joined #commonlisp
mayuresh has quit [Quit: Leaving]
mon_aaraj has quit [Ping timeout: 276 seconds]
mon_aaraj has joined #commonlisp
cage has joined #commonlisp
lisp123 is now known as Topre35g
matt` has quit [Remote host closed the connection]
taiju has joined #commonlisp
mon_aaraj has quit [Ping timeout: 272 seconds]
mon_aaraj has joined #commonlisp
MajorBiscuit has quit [Quit: WeeChat 3.5]
MajorBiscuit has joined #commonlisp
Topre35g has left #commonlisp [Leaving...]
Josh_2 has quit [Remote host closed the connection]
Josh_2 has joined #commonlisp
mon_aaraj has quit [Ping timeout: 240 seconds]
serbest has joined #commonlisp
mon_aaraj has joined #commonlisp
rogersm has quit [Read error: Connection reset by peer]
azimut has joined #commonlisp
serbest has quit [Quit: Leaving]
mon_aaraj has quit [Ping timeout: 276 seconds]
mon_aaraj has joined #commonlisp
jmdaemon has quit [Ping timeout: 264 seconds]
leeb has joined #commonlisp
rogersm has joined #commonlisp
Posterdati has joined #commonlisp
Th30n has quit [Quit: WeeChat 3.5]
dBc has joined #commonlisp
jeosol has quit [Quit: Client closed]
glaucon has quit [Quit: Leaving.]
jeosol has joined #commonlisp
tyson2 has joined #commonlisp
glaucon has joined #commonlisp
mon_aaraj has quit [Ping timeout: 268 seconds]
mon_aaraj has joined #commonlisp
contrapunctus has left #commonlisp [#commonlisp]
contrapunctus has joined #commonlisp
dBc has quit [Quit: leaving]
rogersm has quit [Read error: Connection reset by peer]
<nij->
Here, if I change the `out` under launch-program to *standard-output*, it prints a lot of files into the repl. However, with `:output out` it returns an empty string. Why so?
taiju has quit [Ping timeout: 240 seconds]
triffid has quit [Ping timeout: 268 seconds]
jeosol has quit [Quit: Client closed]
<pjb>
nij-: launch-program seems to be asynchronous.
<nij->
Yes it is.
<pjb>
I get this error: #<STRING-OUTPUT-STREAM :CLOSED #x30200268B0BD> is closed
<pjb>
(in ccl)
<nij->
(Btw, I've also try to rebind *standard-output* to out, and the result is the same: https://bpa.st/P6DQ)
<pjb>
nij-: shall I explain it in detail?
triffid has joined #commonlisp
<nij->
pjb I got similar error when I used run-program (synch.) instead of launch-program.
<pjb>
Being asynchronous, launch-program launches the subprocess, and return, so with-output-to-string closes the stream and return its content "". Then the subprocess runs, and tries to write on that closed stream, which fails. (or is silently ignored perhaps in some implementation).
<pjb>
run-program is not asynchronous.
<nij->
I see. Lemme try to use run-program and make it work.
<Josh_2>
Are you trying to search by regex? You could use UIOP with ppcre directly
<Josh_2>
I guess your method handles subdirectories first, but I'm sure there is a lisp tool around to do that for you :)
<nij->
Weird. After I relaunch my repl, the issue goes away..
<pjb>
you can also write lisp code: (directory #P"/tmp/**/*.out") #| --> (#P"/private/tmp/assign-82401.out" #P"/private/tmp/assign-88143.out") |#
<pjb>
instead of shell code…
<nij->
I guess maybe when I was playing with launch-program I've done some irreversible damage to the run time.
<nij->
Thanks, folks.
<Josh_2>
nij-: try this (directory "/<your dir>/**/*.csv")
<Josh_2>
Seems to have worked nicely for me and produces a nice list!
<Josh_2>
I did not know you could do what pjb showed
<Josh_2>
thank you pjb :)
mon_aaraj has quit [Ping timeout: 268 seconds]
mon_aaraj has joined #commonlisp
ebrasca has joined #commonlisp
<nij->
Another question.. I'm reading a bunch of csv files, some of them contain "bad characters" (I guess) and that's why I get "Error: the octet sequence #(151) cannot be decoded. [Condition of type SB-INT:STREAM-DECODING-ERROR]"
<nij->
I don't care about those bad characters. Is there a way for me to advise lisp to simply ignore those characters?
<beach>
Does your file contain multi-byte UTF-8 characters?
<nij->
I'm not sure @@ there are so many characters
<pjb>
Perhaps they're not utf-8?
<pjb>
perhaps they're windows-1250 files? or something?
<beach>
nij-: OK, so let me ask you this: what language is the text in?
<nij->
Mostly english, but sometimes there could be some asian characters too.
<pjb>
you definitely need to know what encoding is used!
<beach>
Ah, OK, never mind. You can always read it as binary and convert yourself.
<nij->
pjb How do I find out?
<pjb>
or use a 1-1 encoding such as iso-8859-1, but it's an ugly hack.
<Josh_2>
Are you writing your own parser? There are libraries for parsing csv's
<pjb>
nij-: you ask the author of the file.
<pjb>
nij-: alternatively, you may try all the encoding and see which don't give an error. Then see which decode the text seemingly correctly.
<hexology>
e.g. `(map-csv-file "mydata.csv" #'process-line :external-format :cp1252)
tyson2 has quit [Remote host closed the connection]
<nij->
hexology Thanks :) I'm trying :iso-8859-1 and so far so good. It does take a while..
<hexology>
as far as i know, 0x97 isn't valid in iso-8859-1 either. i'd sooner use cp1252. but if it's good enough for your needs, then it's good enough
causal has quit [Quit: WeeChat 3.5]
rogersm has quit [Quit: Leaving...]
karlosz has joined #commonlisp
shka has quit [Ping timeout: 240 seconds]
<nij->
Oh boy.. now I get a #<SB-KERNEL::CONTROL-STACK-EXHAUSTED> ..
<nij->
is there anyway that I can provide with more spaces for sbcl?
shka has joined #commonlisp
<Bike>
--dynamic-space-size whatever on startup
<Bike>
but if your control stack is exhausted you might just have an infinite recursion bug
mon_aaraj has quit [Ping timeout: 268 seconds]
mon_aaraj has joined #commonlisp
<White_Flame>
also, dynamic space isn't stack size
<Bike>
...oh doy yeah. my bad
triffid has quit [Remote host closed the connection]
triffid has joined #commonlisp
<White_Flame>
but I'm pretty sure there's a stack size cmdline setting as well. it just usually doesn't matter if it's runaway recursion,as you say
triffid has quit [Remote host closed the connection]
triffid has joined #commonlisp
jeosol has joined #commonlisp
tyson2 has joined #commonlisp
karlosz99 has joined #commonlisp
karlosz13 has joined #commonlisp
karlosz has quit [Ping timeout: 252 seconds]
karlosz99 has quit [Ping timeout: 252 seconds]
aartaka has quit [Ping timeout: 260 seconds]
aartaka has joined #commonlisp
mon_aaraj has quit [Ping timeout: 264 seconds]
mon_aaraj has joined #commonlisp
gxt has quit [Remote host closed the connection]
mon_aaraj has quit [Ping timeout: 260 seconds]
gxt has joined #commonlisp
mon_aaraj has joined #commonlisp
<nij->
hmm i see.. I just changed my algorithm which is simpler.. thanks
glaucon has quit [Quit: Leaving.]
triffid has quit [Ping timeout: 268 seconds]
shka has quit [Quit: Konversation terminated!]
shka has joined #commonlisp
triffid has joined #commonlisp
karlosz13 has quit [Ping timeout: 252 seconds]
karlosz has joined #commonlisp
triffid has quit [Client Quit]
aartaka has quit [Ping timeout: 272 seconds]
notzmv has quit [Ping timeout: 272 seconds]
aartaka has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
karlosz36 has joined #commonlisp
karlosz has quit [Ping timeout: 252 seconds]
varjag has joined #commonlisp
karlosz36 has quit [Quit: Client closed]
karlosz has joined #commonlisp
aartaka has quit [Ping timeout: 272 seconds]
aartaka has joined #commonlisp
orestarod has joined #commonlisp
<defaultxr>
nij-: if you end up having to deal with files of other encodings which you don't know and you don't care about the characters that can't be parsed, i do something like this: http://ix.io/454g . it's SBCL-specific but if you're using a different implementation it might have similar restarts
<defaultxr>
i have a lisp irc bot and with all the weird text that ends up on irc channels, wrapping read in a handler-case like that is pretty much essential
aartaka has quit [Ping timeout: 272 seconds]
aartaka has joined #commonlisp
<defaultxr>
er not `read`, `read-line`.. `read` would probably not be a good idea
anticomputer has quit [Ping timeout: 268 seconds]
anticomputer has joined #commonlisp
anticomputer has quit [Remote host closed the connection]
gxt has quit [Remote host closed the connection]
tyson2 has joined #commonlisp
gxt has joined #commonlisp
theBlackDragon has quit [Ping timeout: 255 seconds]
theBlackDragon has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 27.1]
<pjb>
defaultxr: nij-: or use unicode #\u65533 aka #\Replacement_Character if your implementation uses unicode.
aartaka has quit [Ping timeout: 268 seconds]
pve has quit [Quit: leaving]
attila_lendvai has quit [Ping timeout: 268 seconds]
aartaka has joined #commonlisp
ahlk` has quit [Quit: ERC 5.4.1 (IRC client for GNU Emacs 28.1)]
<hexology>
defaultxr: what's the difference between sb-int:stream-decoding-error and sb-impl:stream-decoding-error?
<hexology>
and is there any docs for the conditions and restarts supported in sbcl? i didn't see the terms "stream-decoding-error" or "input-replacement" in the sbcl manual
gxt has quit [Remote host closed the connection]
<seok->
how is GC in CL typically implemented? keeping track of two-way references?
<hexology>
defaultxr: also, what irc client library do you use? or did you write your own?
gxt has joined #commonlisp
<nij->
Why don't langs like rust have just-in-time compilation like lisp? What's the advantage of that? I mean, while developing in Lisp, we can interact with and change the program while its running. This makes the workflow much easier.
notzmv has joined #commonlisp
<drakonis>
because of how rust does compilation
<drakonis>
the unit of compilation for rust is not the same as CL's
<Gnuxie>
It's deep ideological reasons really
<drakonis>
is it?
waleee has joined #commonlisp
<nij->
Why do they stay in such old model? What's good about it?
<White_Flame>
small binary size, that's it
<drakonis>
ehhh
<drakonis>
no
<White_Flame>
and of course manual human control over everything; can't let a computer decide things for you, that's socialism!
<nij->
Also.. by the way, I'm running a function over a list of length 50000.. it will take a while. I wonder if there's a way to have it telling me how much it's done (without cluttering the repl.
<nij->
White_Flame if small binary size is of concern, we can stay with JIT and then always go back to AIT in the end, right?
<White_Flame>
you could, but then your turnaround cycle is much slower
<White_Flame>
ok, then it should at least inherit the capability to JIT and feed into AOT I think
Josh_2 has quit [Remote host closed the connection]
shka has quit [Ping timeout: 268 seconds]
<defaultxr>
hexology, i'm not sure the difference, other than the obvious: that one is exported/external, and one is not. it might not actually be necessary to have both, but that snippet of code has been working well for me for a few years now so i have no reason to change it :)
<Shinmera>
Rust is meant to be a "systems language", meaning a runtime (beyond C lol) is probably not something they like.
<Shinmera>
Anyhow, Rust is OT here :)
<defaultxr>
as for your question about the irc library i use: i rolled my own. it's unfortunately not publicly available as it's pretty integrated into the bot itself and i haven't really put any effort into polishing it for public release
<hayley>
seok: "how is GC in CL typically implemented? keeping track of two-way references?" Tracing.
<aeth>
not really hard to roll your own IRC library... TCP/IP is doing most of the work
<aeth>
you can IRC via telnet if you remember to PONG any PING
<Shinmera>
rolling your own IRC library is hard.
<Shinmera>
IRC is a shit protocol with way too many gotchas.
<aeth>
rolling your own IRC library that someone could use in prod in some more popular language is probably hard
<hayley>
nij-: Because they think if they have a very nice type checker, they won't have any bugs to poke at interactively. I'm not sure if I'm exaggerating or not.
<aeth>
rolling your own IRC library better than the public CL IRC libraries is probably doable in a month
<aeth>
I was dissatisfied with them last I checked, but it has been years
<aeth>
the issues I had were mainly with usocket itself, which any similar IRC library would also have
<aeth>
(unless they used another TCP library)
<aeth>
ofc I didn't take the extra two weeks to actually make it usable by others
<aeth>
iirc, though, there are some things that you need to add on top of the basics, like tracking which users are in which channels if you want per channel messages/logs because QUIT doesn't tell you what channel(s) they're in
<aeth>
I think NICK is the same
mon_aaraj has quit [Ping timeout: 268 seconds]
<aeth>
it's also realyl hard to detect if you've been disconnected and are in the process of pinging out, but I think that's on usocket
<defaultxr>
IRC definitely has some gotchas, but i feel like it's a lot easier to get started with than more modern protocols, since it's just text, and quite simple to parse yourself
<aeth>
defaultxr: right, another way to put it is that all you need is a TCP library (and encryption if you're doing modern IRC over an encrypted connection)
<aeth>
defaultxr: another protocol is probably going to need XML or JSON and a bunch of other things
<defaultxr>
yup, exactly
<aeth>
and some of IRC's landmines are avoided by parsing text in a safe language, i.e. everything but C
mon_aaraj has joined #commonlisp
<hayley>
Ripping off Dan Ingalls: and a systems language is a pile of junk that doesn't fit into a modular language. There shouldn't be one.
<defaultxr>
writing an IRC bot has traditionally been the way i teach myself a new language, so i may be biased, but i think it's a pretty good exercise if you want to learn how to write something more "from scratch" rather than just by gluing together a bunch of existing libraries
<defaultxr>
unless you want to write your own json library or the like in the process
<defaultxr>
actually, the frustration of having to restart my python irc bot every time i made a change was one of the things that made lisp appealing to me; even keeping most of the code in another module and then calling reload() is still way more effort and more error-prone than what the baseline is for CL
nij- has quit [Ping timeout: 268 seconds]
<Shinmera>
defaultxr: I'm definitely biased, but Lichat is a lot easier.
<Shinmera>
(and a lot better [smug.png])
<aeth>
defaultxr: tbf, you have to be careful to make sure that reloading still works in any Common Lisp application that might have a main loop or something similar
<aeth>
because you can't recompile the main loop itself, as well as any higher order functions that you pass into it
<aeth>
(or you can, but that will require a restart or a very careful migration process)
<aeth>
so once it's an application, it's no longer free and you have to design it with functions being redefined at runtime in mind. But, hey, I guess at least it's possible.
<hexology>
i do wonder about the compilation unit thing. why _don't_ other languages have small compilation units like lisp?
<hexology>
it's a big improvement in the end-user experience compared to recompiling an entire module
fitzsim has quit [Remote host closed the connection]
<Shinmera>
a historical reason is that they're oriented around batch processing of files.
<aeth>
also means that optimizations are limited to function scope or at least file scope
<Shinmera>
a performance reason is that it allows more efficient function calls.
<aeth>
try doing a Common Lisp workflow in a language like Java that encourages you to have a million tiny files
<aeth>
(and a million tiny methods)
<hexology>
hm, isn't sbcl pretty competitive performance-wise with other compiled languages?
<aeth>
benchmark SBCL isn't idiomatic SBCL :-p
<hexology>
i also thought most programming languages didn't do whole-program analysis anyway
<aeth>
once you're aware of it, you can work around things
<aeth>
SBCL might even have a multifile compilation mode that's completely incompatible with the SLIME workflow but could produce marginally faster final applications
<hexology>
per-function (?) compilation generally seems a lot easier to deal with and implement than a true JIT
<aeth>
failing that, you could put it in one big file with the right EVAL-WHENs if a macro uses a function (so you need the function definition at macro time)
<hexology>
(i am not educated on this topic)
<Shinmera>
hexology: not whole, but certainly not having to look stuff up through a symbol is faster.
<defaultxr>
aeth, true, it's certainly not completely effortless in CL either. but definitely way, way nicer than python and the like. the condition system also helps a lot with that. but i think i'm probably preaching to the choir in here O:)
<Shinmera>
not by much, but it is.
<aeth>
defaultxr: the condition system has a huge flaw that massively limits its usefulness
<aeth>
defaultxr: they're not standardized
<aeth>
what happens when a DESTRUCTURING-BIND fails to parse? Well, it's different in every implementation.
<aeth>
iirc, someone here wrote their own just to get consistent conditions
<hexology>
good reason to use metabang-bind?
<defaultxr>
also true. i haven't had much reason to use implementations other than SBCL yet but even so, it never feels good to have to use a symbol from one of the sbcl packages for something that should be in common-lisp
mon_aaraj has quit [Ping timeout: 272 seconds]
thuna` has quit [Remote host closed the connection]
mon_aaraj has joined #commonlisp
contrapunctus has left #commonlisp [#commonlisp]
mon_aaraj has quit [Ping timeout: 268 seconds]
mon_aaraj has joined #commonlisp
thuna` has joined #commonlisp
fitzsim has joined #commonlisp
Inline has quit [Remote host closed the connection]
orestarod has quit [Ping timeout: 276 seconds]
gxt has quit [Ping timeout: 268 seconds]
gxt has joined #commonlisp
mon_aaraj has quit [Ping timeout: 272 seconds]
mon_aaraj has joined #commonlisp
random-nick has quit [Ping timeout: 240 seconds]
gxt has quit [Remote host closed the connection]
ahlk has joined #commonlisp
gxt has joined #commonlisp
varjag has quit [Quit: ERC 5.4.1 (IRC client for GNU Emacs 29.0.50)]
gxt has quit [Ping timeout: 268 seconds]
gxt has joined #commonlisp
gxt has quit [Remote host closed the connection]
gxt has joined #commonlisp
akoana has joined #commonlisp
karlosz has quit [Ping timeout: 252 seconds]
Lord_of_Life has quit [Ping timeout: 268 seconds]
Lord_of_Life has joined #commonlisp
karlosz has joined #commonlisp
anticomputer has joined #commonlisp
morganw has quit [Remote host closed the connection]