Xach changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/>
Kundry_Wag has joined #lisp
harovali` has quit [Ping timeout: 240 seconds]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orivej has joined #lisp
Kundry_Wag has quit [Ping timeout: 258 seconds]
turona has quit [Ping timeout: 246 seconds]
turona has joined #lisp
Bike has joined #lisp
smokeink has joined #lisp
sauvin has quit [Quit: Leaving]
sauvin has joined #lisp
oni_on_ion has joined #lisp
oni-on-ion has quit [Ping timeout: 248 seconds]
karswell has quit [Ping timeout: 260 seconds]
smazga has quit [Ping timeout: 258 seconds]
oni_on_ion has quit [Ping timeout: 260 seconds]
oxum has joined #lisp
lucasb has quit [Quit: Connection closed for inactivity]
oni-on-ion has joined #lisp
Josh_2 has quit [Ping timeout: 258 seconds]
jeosol has joined #lisp
orivej has quit [Ping timeout: 240 seconds]
TMA has quit [Ping timeout: 240 seconds]
TMA has joined #lisp
Kundry_Wag has joined #lisp
sjl has quit [Quit: WeeChat 2.3-dev]
eschulte has joined #lisp
zclark has quit [Quit: ERC (IRC client for Emacs 26.3)]
smokeink has quit [Ping timeout: 240 seconds]
patlv_ has joined #lisp
harovali` has joined #lisp
karlosz has quit [Quit: karlosz]
karlosz has joined #lisp
bitmapper has quit [Ping timeout: 268 seconds]
Kundry_W_ has joined #lisp
EvW has quit [Ping timeout: 248 seconds]
Kundry_W_ has quit [Ping timeout: 240 seconds]
patlv__ has joined #lisp
patlv_ has quit [Ping timeout: 265 seconds]
patlv__ has quit [Ping timeout: 258 seconds]
smazga has joined #lisp
smazga has quit [Ping timeout: 240 seconds]
efm has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
kscarlet has joined #lisp
Kundry_Wag has joined #lisp
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 265 seconds]
Lord_of_Life_ is now known as Lord_of_Life
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 265 seconds]
ahungry has joined #lisp
X-Scale has quit [Ping timeout: 265 seconds]
X-Scale` has joined #lisp
eschulte has quit [Remote host closed the connection]
X-Scale` is now known as X-Scale
william1_ has joined #lisp
william1_ has quit [Ping timeout: 268 seconds]
MightyJoe has joined #lisp
kscarlet` has joined #lisp
davepdotorg has joined #lisp
cyraxjoe has quit [Ping timeout: 268 seconds]
kscarlet has quit [Ping timeout: 265 seconds]
slyrus has joined #lisp
davepdotorg has quit [Ping timeout: 265 seconds]
slyrus__ has quit [Ping timeout: 260 seconds]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 268 seconds]
keep_learning has joined #lisp
cyraxjoe has joined #lisp
MightyJoe has quit [Ping timeout: 268 seconds]
kscarlet` has quit [Ping timeout: 260 seconds]
X-Scale has quit [Ping timeout: 268 seconds]
<beach> Good morning everyone!
X-Scale` has joined #lisp
X-Scale` is now known as X-Scale
<ahungry> mornin
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
Bike has quit [Quit: Lost terminal]
Kundry_W_ has joined #lisp
oni_on_ion has joined #lisp
oni-on-ion has quit [Ping timeout: 248 seconds]
Kundry_W_ has quit [Ping timeout: 268 seconds]
oni_on_ion is now known as oni-on-ion
smazga has joined #lisp
dale has quit [Quit: My computer has gone to sleep]
smazga has quit [Ping timeout: 240 seconds]
froggey has quit [Ping timeout: 268 seconds]
froggey has joined #lisp
Necktwi has quit [Ping timeout: 240 seconds]
doublex_ has quit [Ping timeout: 260 seconds]
gravicappa has joined #lisp
narimiran has joined #lisp
oxum has quit [Remote host closed the connection]
dvdmuckle has quit [Quit: Bouncer Surgery]
patlv has quit [Quit: Leaving]
dddddd has quit [Ping timeout: 268 seconds]
dvdmuckle has joined #lisp
Codaraxis has joined #lisp
davepdotorg has joined #lisp
frgo has quit [Ping timeout: 265 seconds]
oxum has joined #lisp
harovali` has quit [Ping timeout: 240 seconds]
davepdotorg has quit [Ping timeout: 268 seconds]
Kundry_Wag has quit [Remote host closed the connection]
orivej has joined #lisp
<stylewarning> global side effects at macroexpansion time is evidently evil
<no-defun-allowed> Except INTERN.
<stylewarning> Yeah that one seems like a winner
ozzloy has joined #lisp
ozzloy has joined #lisp
<no-defun-allowed> INTERN can run at macroexpansion time.
<stylewarning> Getting Coalton to work means completely reworking how I'm doing stupid global side effects.
anonymous-coward has joined #lisp
<stylewarning> I said it at SBCL20 and I'll say it again: I think opt-in strong, static types in a Common Lisp DSL would be a killer feature.
<no-defun-allowed> Sounds good.
vlatkoB has joined #lisp
<no-defun-allowed> The Standard ML type variable syntax accidentally works too: (function ((list 'a) (list 'b)) (list (cons 'a 'b)))
<stylewarning> cute (:
Kundry_Wag has joined #lisp
<stylewarning> no-defun-allowed: actually maybe that's a rly good idea, i've been having "issues" in coalton where mistyping (har har) a type can lead to unexpected results
<stylewarning> no-defun-allowed: so maybe i should enforce that type variables be quoted
<no-defun-allowed> :^)
<no-defun-allowed> Sadly ''a works less well for eqtypes.
oxum has quit [Remote host closed the connection]
<stylewarning> no-defun-allowed: eqtypes are a hack and i'm not going to implement them
<no-defun-allowed> Good.
oxum has joined #lisp
<stylewarning> implement type classes or something else; eqtypes are (imho opinion, hindsight 2020, bla bla) a hack
makomo has joined #lisp
<no-defun-allowed> It could notate a type which EQL or EQUAL or YOUR-VERY-OWN-EQUALITY-PREDICATE can check, but in Lisp it'd be silly.
<no-defun-allowed> Wait, it's only silly in dynamically-typed Lisp. Never mind the last six words there.
Kundry_Wag has quit [Ping timeout: 268 seconds]
<no-defun-allowed> Typeclasses are cool; but please don't come here next week saying that monads are no big deal as they're just monoids in the category of endofunctors.
<stylewarning> (:
karlosz has quit [Quit: karlosz]
<p_l> :D
<p_l> it's funnier when you find out part of *why* Monads in Haskell != mathematical monads
karlosz has joined #lisp
grabarz has joined #lisp
anonymous-coward has left #lisp [#lisp]
Kundry_Wag has joined #lisp
grabarz has quit [Client Quit]
Oladon has joined #lisp
oxum has quit [Read error: Connection reset by peer]
cantstanya has quit [Ping timeout: 240 seconds]
oxum has joined #lisp
cartwright has joined #lisp
igemnace has joined #lisp
oxum has quit [Read error: Connection reset by peer]
oxum has joined #lisp
<LdBeth> "monads are no big deal as they're just monoids in the category of endofunctors."
ahungry has quit [Remote host closed the connection]
karlosz has quit [Quit: karlosz]
<p_l> LdBeth: or, if you go with old enough material, "a nice hack/extension from Glasgow University to make IO less sucky, maybe it will become part of the language"
mingus has joined #lisp
narimiran has quit [Quit: leaving]
narimiran has joined #lisp
rwcom4 has joined #lisp
rwcom has quit [Ping timeout: 265 seconds]
rwcom4 is now known as rwcom
vlatkoB has quit [Remote host closed the connection]
paul0 has joined #lisp
<aeth> LdBeth: old joke, for a new joke you need to make it as mathematically dense as possible
<aeth> unfortunately, that's like writing a short story even though it would still fit in a line
vlatkoB has joined #lisp
Kaisyu7 has quit [Quit: ERC (IRC client for Emacs 26.3)]
<drmeister> Hey lispers - if I want to write out a binary file from Common Lisp - how would I go about doing that? Here's a bit more detail.
<drmeister> In Clasp I'm exploring the idea of writing a sequence of compiled object files out to a single file.
<drmeister> The file is going to be broken up by chunks the size of unix memory pages.
<beach> You open the file(s) with :element-type '(unsigned-byte 8)
<drmeister> The first pages are going to be laid out like this...
<drmeister> And after that I want to write out object files that start at page boundaries (4K).
<drmeister> So I have a combination of 8-byte words and bytes.
<drmeister> So for the words I guess I have to do the shift and masking to break them up into (unsigned-byte 8).
<beach> You may be helped by a library such as binary-types.
<drmeister> binary-types - eh? I'll check it out.
<beach> But breaking things up like that is not hard. A dozen lines of code at most.
<drmeister> Ok.
<drmeister> Got it - thanks.
JohnMS_WORK has joined #lisp
flamebeard has joined #lisp
<drmeister> I'm planning to mmap these files into memory and load and link the object files directly into Clasp's runtime.
Harag has joined #lisp
<Harag> morning, anybody running sbcl on a mac book? I have a little string matching program that run under a minute on linux but on the mac book (64 16gb ram) it runs for 5 minutes to do the a tenth of the records to be processed
<Harag> any advice?
Kundry_Wag has quit [Remote host closed the connection]
scymtym has quit [Ping timeout: 268 seconds]
<drmeister> I haven't done any profiling with sbcl - but profile it is what I would say.
<aeth> Harag: are the versions identical?
<aeth> that's the first thing I would look for
<aeth> It could be a bugfix or a new bug
<Harag> of sbcl yes
orivej has quit [Ping timeout: 240 seconds]
<Harag> and the program 100 lines of code are to
Oladon has quit [Quit: Leaving.]
<aeth> The next thing I'd personally do is see if the output of DISASSEMBLE is roughly the same. If it's very off there could still be differences, like different global optimization levels
<aeth> After that, I'd profile.
anewuser has joined #lisp
<aeth> sb-prof and sb-sprof are the ways you profile iirc
<Harag> on the linux machine sbcl uses 1gb ram (I alocate 12 to it on startup)
<aeth> Profiling should be particularly good at seeing something that radically overallocates
<Harag> on mac it is not going past 126mb and I allocate 5gb on startup
<aeth> hmm, or underallocating I guess
shifty has quit [Ping timeout: 268 seconds]
<aeth> One of the cached FASLs might have issues, too. On Linux it would be in ~/.cache/common-lisp/ but I'm not sure about macOS.
<aeth> Caching is never perfect, although bad caching will normally be crashing not weird performance.
<aeth> (That's basically all I can think of without profiling data.)
<Harag> thanx
<aeth> you're welcome
<Harag> the only other thing I think it might be is reading and writing from disk....
<aeth> yes, if that relies on syscalls it might just be different
<Harag> mmm that might be it ssd vs normal drive
adam4567 has joined #lisp
<aeth> that too
gioyik has quit [Quit: WeeChat 2.6]
Kundry_Wag has joined #lisp
<pjb> Harag: check your LC_* environment variables. Perhaps, on Linux it's set so sbcl uses a 8-bit characters, while on macOS, it's set to use unicode, ie. 32-bit characters.
<pjb> Harag: also, is your Linux a 32-bit host? macOS is pure 64-bit.
<aeth> afaik 64-bit is normally faster in CL because it boxes fewer things
<aeth> wouldn't the one that's slower and less RAM usage imply it could be 32-bit? Is SBCL on macOS only 64-bit? Only the latest macOS is pure 64-bit.
varjag has joined #lisp
Kundry_Wag has quit [Ping timeout: 258 seconds]
<eeeeeta> Xach: I got your close-paren email; issue should be fixed :)
<eeeeeta> (thanks very much for letting me know!)
jprajzne has joined #lisp
<p_l> Harag: is the linux machine the same computer?
<p_l> because to be blunt... macbook under macos in general runs slower than anything else on the same hw
<p_l> (by design)
<p_l> might be better on the new Mac Pro
<p_l> (or the old ones, before trashcan design)
scymtym has joined #lisp
<no-defun-allowed> I thought the trash can design was pretty okay with respects to throttling.
<p_l> no-defun-allowed: heard both that and the opposite
<no-defun-allowed> And it is probably "old" now.
<aeth> p_l: by design? designed for battery longevity?
<p_l> personally I can only offer anecdotal evidence of running Win10ProWks on 2018 mbp15" w/ i98
<aeth> for latency instead of throughput?
<p_l> *i9
<p_l> aeth: for being quiet (and battery)
<no-defun-allowed> i9?
<aeth> no-defun-allowed: no, nearly 11 times better than that
<p_l> no-defun-allowed: I've got i9-8850HK in my mbp
<no-defun-allowed> p_l: how much did a MacBook with an i98 cost?
<p_l> no-defun-allowed: 3099 dollars too many
<no-defun-allowed> Mother of Barton - does that throttle hard too?
<p_l> under macos? heavily
<p_l> yesterday, I installed Win10ProWks
<p_l> on one hand, it's loud
<aeth> laptop "i9"s are a joke in general
<p_l> on the other... hoooolyyyy fucking shit speed difference
<no-defun-allowed> I guess they're mostly battery by mass, but surely that'd ruin the battery life too.
<p_l> no-defun-allowed: for few generations macs scrape by to keep their official claims about battery life by software tricks
<aeth> just watch, AMD will have a 12-core laptop by 2021
<aeth> (I wonder what the battery life would be on that thing)
<p_l> and anecdotal battery life is based around being nearly as sleep-happy as mobile phone
brettgilio has quit [Ping timeout: 246 seconds]
<p_l> aeth: considering that a 15" laptop (twice the weight of 2016 MBP) with Xeon E3 had >10 hour battery life
<p_l> (and might have been less "battery by weight" than the MBP)
<aeth> AMD already has Zen 2 12-core lower power than the 3900X so we might see one this year since Ryzen 4000 mobile is one gen behind, i.e. Zen 2.
<p_l> aeth: hopefully in a proper premium design
<aeth> AMD just needs to lower 65 W TDP (currently the lowest for its 12-core) to... 35 W? That's as high as it goes atm afaik. Maybe it'd make a new category?
<aeth> If not 2020 and Zen 2, probably 2021 and Zen 3.
<jackdaniel> "..ah, and the lisp thing. Lisp may run on these machines!"
<jackdaniel> voila, on-topic again ;-)
<oni-on-ion> zazen
<aeth> jackdaniel: no, you'd want to use something that threads well ;-)
Duuqnd has joined #lisp
<aeth> I'm mostly kidding. The lack of a parallel ASDF is annoying.
<aeth> I want things to compile twice as fast when I triple the cores
grabarz has joined #lisp
<oni-on-ion> yeah =( although i have never come across any lisp compiling that takes much time at all. just built sbcl 2.0.0 and its one of the fastest compiler-compilings compared with the countless others in this machine
<pjb> aeth: poiu
orivej has joined #lisp
adam4567 has quit [Quit: ERC (IRC client for Emacs 26.3)]
anewuser has quit [Quit: anewuser]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 240 seconds]
hhdave has joined #lisp
orivej has quit [Ping timeout: 260 seconds]
dilated_dinosaur has quit [Ping timeout: 268 seconds]
amerlyq has joined #lisp
dilated_dinosaur has joined #lisp
davepdotorg has joined #lisp
Kaisyu has quit [Quit: Connection closed for inactivity]
Necktwi has joined #lisp
mn3m has joined #lisp
ebrasca has joined #lisp
shifty has joined #lisp
ebzzry has quit [Ping timeout: 265 seconds]
orivej has joined #lisp
Cymew has joined #lisp
vidak` has joined #lisp
william1_ has joined #lisp
oxum_ has joined #lisp
Guest69106 is now known as neuro_sys
oxum has quit [Ping timeout: 258 seconds]
rixard has quit [Read error: Connection reset by peer]
Harag has quit [Remote host closed the connection]
oni-on-ion has quit [Remote host closed the connection]
jayspeer has joined #lisp
jayspeer has quit [Remote host closed the connection]
jayspeer has joined #lisp
heisig has joined #lisp
Harag has joined #lisp
rixard has joined #lisp
<Harag> aeth: fyi I took both linux and mac to sbcl 2 and the performance gap is mostly gone now
<aeth> that's why they bumped the version number to 2.0, clearly
<Shinmera> Speaking of that, new Portacle with SBCL2 https://github.com/portacle/portacle/releases/tag/1.4
<Shinmera> testing would be very appreciated.
jonatack has quit [Ping timeout: 260 seconds]
davepdotorg has quit [Remote host closed the connection]
EvW1 has joined #lisp
davepdotorg has joined #lisp
igemnace has quit [Quit: WeeChat 2.7]
davepdotorg has quit [Ping timeout: 268 seconds]
m00natic has joined #lisp
Kundry_Wag has joined #lisp
gxt has quit [Quit: WeeChat 2.7]
Kundry_Wag has quit [Ping timeout: 268 seconds]
oxum has joined #lisp
dddddd has joined #lisp
oxum_ has quit [Ping timeout: 260 seconds]
rwcom1 has joined #lisp
rwcom has quit [Ping timeout: 240 seconds]
rwcom1 is now known as rwcom
<Xach> eeeeeta: do you use rss?
<eeeeeta> Xach: yeah, I'm subscribed to planet lisp
<eeeeeta> why?
ljavorsk has joined #lisp
<Xach> eeeeeta: you can subscribe to your project build failures too
<eeeeeta> Xach: aha, where/how
mingus has quit [Remote host closed the connection]
oxum has quit [Remote host closed the connection]
oxum has joined #lisp
<eeeeeta> Xach: oh sweet! thanks, I'll subscribe to those then :)
<Xach> hmm, i should do some badges or something.
vidak` has quit [Read error: Connection reset by peer]
oxum_ has joined #lisp
EvW1 has quit [Ping timeout: 245 seconds]
oxum_ has quit [Remote host closed the connection]
ljavorsk has quit [Ping timeout: 260 seconds]
oxum_ has joined #lisp
stepnem_ has joined #lisp
oxum has quit [Ping timeout: 260 seconds]
oxum has joined #lisp
davepdotorg has joined #lisp
stepnem has quit [Ping timeout: 260 seconds]
oxum_ has quit [Ping timeout: 268 seconds]
ym has joined #lisp
ggole has joined #lisp
EvW has joined #lisp
jebes has quit [Quit: ZNC 1.7.4+deb7 - https://znc.in]
jeosol has quit [Remote host closed the connection]
makomo has quit [Ping timeout: 240 seconds]
oxum_ has joined #lisp
oxum__ has joined #lisp
oxum___ has joined #lisp
EvW has quit [Ping timeout: 248 seconds]
oxum___ has quit [Remote host closed the connection]
jonatack has joined #lisp
frgo has joined #lisp
oxum___ has joined #lisp
oxum has quit [Ping timeout: 265 seconds]
oxum_ has quit [Ping timeout: 268 seconds]
oxum__ has quit [Ping timeout: 265 seconds]
redeemed has joined #lisp
redeemed has quit [Remote host closed the connection]
rwcom3 has joined #lisp
oxum has joined #lisp
oxum_ has joined #lisp
rwcom has quit [Ping timeout: 260 seconds]
rwcom3 is now known as rwcom
oxum___ has quit [Ping timeout: 265 seconds]
oxum has quit [Ping timeout: 260 seconds]
smazga has joined #lisp
orivej has quit [Ping timeout: 268 seconds]
smazga has quit [Ping timeout: 260 seconds]
papachan has joined #lisp
EvW1 has joined #lisp
william1_ has quit [Ping timeout: 268 seconds]
jebes has joined #lisp
lucasb has joined #lisp
ebzzry has joined #lisp
Kundry_Wag has joined #lisp
oxum_ has quit [Read error: Connection reset by peer]
oxum has joined #lisp
theBlackDragon has quit [Remote host closed the connection]
__jrjsmrtn__ has quit [Ping timeout: 260 seconds]
makomo has joined #lisp
__jrjsmrtn__ has joined #lisp
patlv has joined #lisp
william1_ has joined #lisp
Duuqnd has quit [Quit: Leaving]
william1_ has quit [Ping timeout: 260 seconds]
grewal has quit [Ping timeout: 265 seconds]
grewal has joined #lisp
Bike has joined #lisp
jmercouris has joined #lisp
<jmercouris> anyone know how to get the ... syntax in parenscript?
<jmercouris> I'm trying to do: array1.push(...array2)
<jmercouris> the dots are literals
<Odin-> Has it been updated for that?
<jmercouris> I don't know, I'm not sure what the dots are called, so I can't search for it
<jmercouris> the '...' does not appear anywhere in the parenscript reference
<Odin-> It was added at the same time as arrow functions.
<jmercouris> surely there must be a way to get the parenscript compiler to emit '...'
<jmercouris> I get a very helpful sldb "too many dots" :-D
<jmercouris> what an absolute mess of a language javascript is
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
<jmercouris> is there perhaps another way to get the functionality of 'array1.push(...array2)' without using the dot operator?
<Odin-> There's a "paren6" in quicklisp.
<Odin-> This is ES6 syntax, so...
<Bike> three dots in a row is called an ellipsis. googling "javascript ellipsis" suggests that this is called "spread syntax".
<Colleen> Bike: drmeister said 8 hours, 45 minutes ago: He said he's pushing some updates in the next week to support static constructors but only for MacOS at first. Linux will have to be taken care of by someone with experience with linux.
<Colleen> Bike: drmeister said 8 hours, 46 minutes ago: Lang Hames showed up in the llvm Discord channels and said what I came up with looks fine.
<jmercouris> it does support :... https://github.com/BnMcGn/paren6/
<Bike> oh, this is apply.
<Odin-> jmercouris: In that case, I think 'array1.push.apply(array2)' does the same.
<Bike> python has the same kind of thing. i wonder why these languages do this instead of using a higher order apply function.
g0d_shatter has joined #lisp
<jmercouris> Odin-: I'll give that a try, thank you, worst case I'll do concat and assignment together
<Odin-> Because this isn't quite the same. This is the "spreadable list" part of apply.
<Odin-> JS has apply, but IIRC that only takes a single array. You can argue that's not a proper apply, but it is what it is...
papachan has quit [Ping timeout: 265 seconds]
<jmercouris> Odin-: array1.push.apply(array2) does not work, I just tested in the console
<Bike> apply takes two arguments, the first is "this"
<Bike> i think.
<Bike> i learned this like thirty seconds ago, so maybe check documentation yourself too
<jmercouris> OK :-D
<Bike> so maybe array1.push.apply(array1, array2).
<Odin-> Oooh, right.
<Odin-> 'Function.prototype.apply(array1, array2)'.
<Bike> wacky.
<Odin-> I haven't actually been messing with this stuff recently.
<jmercouris> Indeed, you are correct
<Odin-> JS is nothing if not bizarre.
<Odin-> Err.
<Odin-> Array.prototype.push.apply.
<jmercouris> I was just thinking this is a most obtuse syntax
<Odin-> About half of JavaScript's oddities can be explained by the prototype paradigm.
<jmercouris> What is the prototype paradigm? I've never understood that
<Odin-> The other half is just down to it being designed in half an hour or so.
<jmercouris> also, what are polyfills?
<Odin-> Polyfills are code that checks if the implementation has some functionality, and if it doesn't, implement it.
<jmercouris> they are a way to backport functionality, strange that they invented a term for it
<Odin-> That whole ecosystem is completely bonkers.
<jebes> prototypes are cool. JS does it badly
Bike has quit [Remote host closed the connection]
EvW1 has quit [Ping timeout: 260 seconds]
<jebes> its pretty simple to understand, every object is its own class and then things get messy
Bike has joined #lisp
<jmercouris> EVERY INSTANCE is its own class?
william1_ has joined #lisp
<jebes> well
<jebes> no, more like every group of instances
<jebes> but if you do a thingamajig to an instance and make it divert it then becomes its own class
<jebes> its really just better to forget classe
william1_ has quit [Ping timeout: 260 seconds]
<jebes> or alternatively don't listen to me ever about anything because i don't like teh script either
oxum_ has joined #lisp
<Odin-> 'Class' isn't a meaningful term.
<Bike> i thought it was just every object is a copy of a prototype instance, and there are no classes.
<jebes> Bike: exactly
<Odin-> Every object instance has a prototype. If a method doesn't exist on an object, then its prototype gets searched.
<jebes> except now we do have class based js
<jebes> which is syntactic sugar on top of the prototype system
<Odin-> That's just a set of conventions on top of the prototypes.
<jebes> where's my cl -> web assembly system dang it
LiamH has joined #lisp
<Odin-> JS tends to cause a similar feeling of weirdness as CLOS does.
<Odin-> Most JS code just papers over it even more.
oxum has quit [Ping timeout: 260 seconds]
random-nick has joined #lisp
<Odin-> It's a fundamentally different way of thinking about OO than the class-based stuff, but because class-like stuff is easy to fake, the weirdness seems to surprise people more when it bites them.
gravicappa has quit [Ping timeout: 265 seconds]
Lycurgus has joined #lisp
FreeBirdLjj has joined #lisp
gxt has joined #lisp
<Xach> "Pretend it's like something I already know" is the source of many problems everywhere
davepdot_ has joined #lisp
theBlackDragon has joined #lisp
<Odin-> I'd argue that syntax similarity tends to be a bad thing, because of that.
atgreen has joined #lisp
<jebes> burn yourself like a brilliant bonfire everytime you do something new and all that
davepdotorg has quit [Ping timeout: 268 seconds]
JohnMS_WORK has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
fivo has joined #lisp
adolby has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
adolby has joined #lisp
<eeeeeta> situation: javascript doesn't have OO
<eeeeeta> ES6 designers: oh well just have this class keyword anyway, sssh
jonatack has quit [Ping timeout: 268 seconds]
jonatack has joined #lisp
<jebes> it has OO
<jebes> if JS isn't OO then neither is Lisp. CLOS is not a traditional OO system
<beach> It is pointless to discuss what is or what is not X when there is no widely agreed-upon definition of X.
<dlowe> OO is more of an architectural style, and some languages support that style in different ways
<dlowe> or not
<jebes> I agree with dlowe here
<jebes> honestly if it has parametric polymorphism i call it OO
<dlowe> I feel the same about "scripting"
<jebes> so fuck it, Haskell is OO now
<jebes> s/parametric/ad-hoc
SaganMan has joined #lisp
SaganMan is now known as nekosagan
oxum_ has quit [Remote host closed the connection]
boeg has quit []
Odin- has quit [Quit: That's the wrong…]
Kundry_Wag has quit [Remote host closed the connection]
fivo has quit [Quit: WeeChat 1.9.1]
patlv_ has joined #lisp
patlv has quit [Ping timeout: 265 seconds]
ebrasca has quit [Remote host closed the connection]
gravicappa has joined #lisp
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 260 seconds]
Lord_of_Life_ is now known as Lord_of_Life
oxum has joined #lisp
milanj has joined #lisp
<jmercouris> I a really bothered by the fact that there are no constructors for objects to do data sanitation
vms14 has joined #lisp
<jmercouris> if I have class potato, I frequently make a function make-potato
<jmercouris> I wish it were part of the spec, gratuitous as it may be
boeg_ has joined #lisp
<vms14> guys I've found a codewars-like website that allows common lisp :D
<Xach> jmercouris: that is usually done in initialize-instance.
<Xach> jmercouris: or shared-initialize.
<vms14> hackerrank.com
<jmercouris> Xach: I've used those too, it doesn't feel the same
<jmercouris> it is quite close though, i will give you that
<vms14> I guess not all exercises can be done with lisp, but at least the fp ones will let you use sbcl
<Xach> jmercouris: what's the difference in your view?
<Xach> the critical difference
<jmercouris> there is no critical difference, I just wish it were a language constructor like in java
<jmercouris> the specificity would make it nicer
<jmercouris> kind of like choosing to use when vs if with only one clause
<Xach> jmercouris: what do you mean by specificity?
<jmercouris> I'm trying to describe it above by the WHEN vs IF comparison
<jmercouris> I remember reading in a style book that beach reccommended
<Xach> I know that Keene's book recommends it
<jmercouris> that is it, yes
<jmercouris> I would just like it to be very obvious that THIS is a constructor
patlv_ has quit [Ping timeout: 260 seconds]
<jmercouris> and there would be tooling in place to find constructors ina project etc
<jmercouris> initialize-instance :after get's close, but not quite there
<Xach> It's not a constructor, though. It's for initialization.
<Xach> M-. initialize-instance finds them all.
<jmercouris> in java they are called constructors
<jmercouris> maybe I'm just trying to shoehorn my old views into the world of lisp
<jmercouris> perhaps the feeling will wear down with more time
<eeeeeta> I swear initialise-instance actually gets the initargs
<eeeeeta> or one of them does
<Xach> eeeeeta: it does.
<eeeeeta> that feels pretty much like a constructor to me
<Bike> initialize-instance feels pretty distinguished to me. if anything it's more obvious to me than just having a function that has the same name as the class
jonatack has quit [Ping timeout: 260 seconds]
pfdietz has joined #lisp
<eeeeeta> yeah exactly
jprajzne has quit [Quit: Leaving.]
FreeBirdLjj has quit [Remote host closed the connection]
<phoe> jmercouris: if you write DEFMETHOD INITIALIZE-INSTANCE {:AROUND,:BEFORE,:AFTER}, then it MEANS that this is a Lisp constructor.
FreeBirdLjj has joined #lisp
<phoe> THIS is literally the idiom, just like Class(...) { ... } in java
<jmercouris> phoe: allet klaerchen
<phoe> if MAKE-INSTANCE is the analogue of java's new ..., then INITIALIZE-INSTANCE is the way to declare constructors
<jmercouris> they are a reasonable parallel, agreed
<phoe> in :BEFORE I usually place keyword argument type validation, in :AFTER some logical validation that needs to have the slots already bound and then some additional stuff that needs to be computed
<phoe> this way, when the slots become bound, they are always of proper type/contain proper values/etc.. and the stuff in :AFTER can assume that it operates on sane data
atgreen has quit [Remote host closed the connection]
<vms14> how to send EOF in slime?
<phoe> vms14: ,sayoonara
<vms14> no
<vms14> xD
<phoe> vms14: depends on where you want to send it then
FreeBirdLjj has quit [Ping timeout: 260 seconds]
<vms14> hmm I've tried C-u RET
klltkr has joined #lisp
<phoe> EOF is not a character
<vms14> but it signals end of file
<vms14> I want to put eof while using read
<phoe> what are you reading?
<vms14> stdin
wnj has quit [Remote host closed the connection]
<phoe> the terminal process's stdin?
<phoe> I mean, inferior lisp's?
<vms14> no, I'm in slime-repl I'm using (read) with no parameters so it reads from stdin
<vms14> I can put stuff and it reads it, but idk how to send it eof
patlv_ has joined #lisp
<phoe> OK, so you want to send EOF to slime-repl
<vms14> yes
<vms14> well, to whatever is reading (read)
<phoe> in my case it is reading *standard-input*, so #<SWANK/GRAY::SLIME-INPUT-STREAM {100F9CC8F3}>
X-Scale has quit [Quit: HydraIRC -> http://www.hydrairc.com <- Wibbly Wobbly IRC]
<vms14> meh, I'll make that test in raw sbcl
<vms14> xD
<phoe> you need to send it an empty string, it seems
atgreen has joined #lisp
<phoe> it reads from a string
<phoe> so you need to pass it an empty string to have it read an EOF
<vms14> it was my fault
<vms14> (read *standard-input* nil)
<vms14> and it seems to accept C-u RET
<vms14> yes, it works
<vms14> (loop while (setf meh (read *standard-input* nil))
<vms14> do (print meh))
patlv_ has quit [Ping timeout: 260 seconds]
pfdietz has quit [Remote host closed the connection]
Lycurgus has quit [Remote host closed the connection]
<vms14> I needed stuff like hackerrank, it makes you write a lot of code
<vms14> but I wasn't able to find a website alike with common lisp
<Xach> vms14: what does hackerrank do that helps you?
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
orivej has joined #lisp
<vms14> Xach is just a website with exercises, the fact that helps me is that supports common lisp as a language of choice
<vms14> a lot of friends recommended me to use codewars and alike, but there was no common lisp so I didn't want to
<Xach> vms14: the exercises help you get better at common lisp?
<vms14> you learn programming by coding
<vms14> my worst problem is that I tend to read a lot of theory but I practice very little
<Xach> I agree - I don't have experience getting exercises from a website so I am trying to understand the appeal better
<Xach> I am very eager to make certain things and that drives my practice. I got a 3d printer for christmas and now I want to make STL files from some of my SVG files. I will have to figure out some math and tesselation I think.
<vms14> Xach it's just a website which gives you some kind of text editor and a problem, then you solve that problem using the language of choice
gareppa has joined #lisp
<vms14> they test the code and if it works you go to the next exercise
<vms14> svg is very interesting stuff
<vms14> and it's xml after all, but yes, it involves maths and claims to be automated
<Xach> I might skip the SVG part - the drawings are done in Lisp and SVG is the output. But I could possibly output STL directly.
<jmercouris> I don't think those websites improve coding, they are contrived problems
<jmercouris> just how solving all the project euler problems wouldn't make you good on a team
<vms14> jmercouris: they incite you to write code, and this one seems to have fp problems
<jmercouris> you want to write code? have someone hire you to write code
<vms14> yes, but no one is hiring me to write common lisp code
<vms14> I'd really like that
<vms14> but the world is not as I'd like
<vms14> they'll hire me to write php or java
* vms14 cries
<galdor> vms14: do the Advent of Code
<galdor> it will force you to solve fun problems with any language
<vms14> galdor: a guy recommended me that too
<vms14> a wise one
<galdor> and it's much more interesting than hackerrank
smazga has joined #lisp
<vms14> I'm not a very good programmer, I have troubles designing programs
<galdor> and problems are more algorithmics than mathematics, which is good to practice a language
<jmercouris> trouble designing programs is not going to be solved by these trivial problems
<galdor> designing programs correctly comes with experience
<jmercouris> architecting programs is a different class of knowledge
<jmercouris> you must inspect and work on large projects to develop this knowledge
<galdor> therefore write a lots of stuff of various kinds, see what works and what does not, and learn
jayspeer has quit [Quit: ERC (IRC client for Emacs 26.3)]
Kundry_Wag has joined #lisp
<pjb> phoe: are you sure? (with-input-from-string (stream "") (read stream nil #\)) #| --> #\Sub |#
vivit has joined #lisp
<vivit> SBCL gives me style-warning "The return value of DELETE should not be discarded". Why is that?
<_death> vms14: AoC is good, and there are other language-agnostic sites that go deeper within a field, such as cryptopals and rosalind..
CrazyEddy has quit [Remote host closed the connection]
<White_Flame> vivit: because calling a destructive function on a list might need the variable holding the list to be updated
orivej has quit [Quit: No Ping reply in 180 seconds.]
<White_Flame> eg, what if you delete the first item?
<Bike> vivit: you can't rely on the argument being mutated in the way you expect, or at all.
orivej has joined #lisp
karlosz has joined #lisp
Kundry_Wag has quit [Ping timeout: 260 seconds]
cosimone has joined #lisp
<Bike> delete is "REMOVE but it's _allowed to_ mess with its argument", not "REMOVE but you call it for the side effect instead of using the value".
<vms14> xD the exercise: Output the list with the integers at odd positions removed i.e. the first element, the third element and so on.
<vms14> my solution: read twice and print once
<vivit> Bike, White_Flame: Does that mean it depends on the implementation whether the destruction happens, or simply that it's unpredictable and highly context-dependent whether the destruction happens?
<Bike> it's undefined, so both.
<Bike> another example: even if you pass in a vector, if any elements are deleted, the length of the vector must be reduced. This isn't something that you the programmer can do to a simple vector, and the implementation might not either.
slyrus has quit [Ping timeout: 268 seconds]
heisig has quit [Quit: Leaving]
<pjb> vivit: how do you destroy the last element of a list? (last) is represented with a cons: (last . nil)
<Bike> so it might make a new vector instead, even with delete.
<pjb> vivit: (delete 'last (list 'last)) -> ()
<pjb> vivit: the paradox is that there are no lists in lisp! Only chains of cons cells. And the empty list is NOT represented with a cons cell, but with the symbol NIL.
bitmapper has joined #lisp
<pjb> (eq '() 'nil) #| --> t |#
<vivit> So the main reason to use DELETE instead of REMOVE is optimization?
<Bike> yes.
<pjb> vivit: more or less.
<pjb> vivit: you definitely do not want to use delete on immutable lists, or on lists that must not be mutated!
<clothespin> anyone here got experience implementing bi-directional streams?
<pjb> In these cases, it's not a question of optimization.
<pjb> In doubt, use remove.
<pjb> clothespin: what do you mean?
<pjb> clhs make-two-way-stream
<pjb> clothespin: ^ ?
<Bike> gray streams, presumably?
<clothespin> implementing the innards efficiently/logically
Kundry_Wag has joined #lisp
<pjb> clothespin: the innads of WHAT?
<clothespin> the innards of a bidirection stream which I'm going to connect to a repl and a display
<pjb> You still are not defining what you mean by "bidirectional stream".
<clothespin> I wrote a simple streams version for ACL in 2009, I lost that code, now I'm reimplementing with sb-gray
<pjb> In any case, if make-two-way-stream is not good enough for you, you can do exactly what you want with gray streams.
pfdietz has joined #lisp
<clothespin> I'm currently thinking one buffer with indices for star and stop input...one buffer to make rendering efficient
X-Scale has joined #lisp
<vivit> The context I'm working in is that I have two classes, PLACE and THING. PLACE has a slot called CONTENTS, and THING has a slot called LOCATION. I want all the objects of these classes to, at all times, satisfy the condition that thing TH has a location of place PL iff (MEMBER TH (CONTENTS PL)) is not nil.
CrazyEddy has joined #lisp
Kundry_Wag has quit [Ping timeout: 268 seconds]
<vivit> The way I'm donig this is defining a function (PUT TH PL) that removes TH from its current location and puts it in PL, correcting all references.
m00natic has quit [Remote host closed the connection]
jonatack has joined #lisp
<Bike> so you'll have to actually setf the CONTENTS slot(s) rather than just using delete.
jmercouris has quit [Remote host closed the connection]
<pjb> You may choose to use remove instead of delete, if you give clients the list itself.
<pjb> ie. if you have something like: (defclass place () ((contents :initform '() :accessor place-contents))
<vivit> I currently have it so that place-contents is only a reader, not an accessor
<pjb> On the other hand if you have (defclass place () ((contents :initform '()))) (defmethod place-contents ((self place)) (copy-list (slot-value self 'contents))) then you can use delete, because the list belongs to the place and no other object can have it.
<pjb> vivit: then use remove.
<pjb> The problem is not writing, but reading, and having several places referencing the same list. It may break things if you modify the list.
<beach> vivit: Change it to be an accessor.
<vivit> right
<pjb> Of course not.
<pjb> You want to control those lists, so you definitely do not want to let clients access it willy-nilly!
<beach> vivit: If you really want the contents to be modifiable, you will have to turn it into an abstract data type, not a Common Lisp list, which is a concrete data type.
<beach> Then you can use a slot reader only. No accessor needed.
Kundry_Wag has joined #lisp
milanj_ has joined #lisp
gareppa has quit [Quit: Leaving]
<pjb> This is not really the point. The point is that it is wanted that the class PLACE manages and controls this list, to ensure the invariant cited above.
<pjb> Therefore no other object can have access to this list. It doesn't matter if it's directly the cons, the slot, or thru an abstract data type.
<beach> OK, then that's easy. Just do what Bike suggested.
<beach> And use REMOVE rather than DELETE.
milanj has quit [Read error: Connection reset by peer]
<clothespin> hi beach
<pfdietz> And lament that SORT isn't called NSORT.
<pjb> Once the class PLACE controls the list, it can use DELETE, because it is the only object that has access to the cons cells of this list.
<pjb> SO use DELETE.
<vms14> guys how can I remove an element of a character array?
<beach> pjb: Fair enough.
<phoe> vms14: you can;t
<phoe> you need to reallocate.
<phoe> that's the issue with arrays.
<vms14> I'm trying with delete but it removes all those characters
<phoe> oh! a single element you mean
<vms14> phoe: precisely the last element
<jackdaniel> vms14: if it has a fill pointer, then decrement the fill-pointer
<phoe> (remove ... :count 1) but that will reallocate as well
<vms14> jackdaniel: oh, nice :D
<phoe> otherwise--- yes, what jackdaniel said
<vms14> ty
<pjb> vms14: (let* ((s "Hello World") (ms (make-array (length s) :initial-contents s :element-type 'character))) (replace ms ms :start1 6 :start2 7) ms) #| --> "Hello orldd" |#
<phoe> yes, the end of the vector is a special case if your vector has a fill pointer
<vms14> that's nice, because they'll have
<pjb> vms14: if you don't want the final #\d: (let* ((s "Hello World") (ms (make-array (length s) :fill-pointer (length s) :initial-contents s :element-type 'character))) (replace ms ms :start1 6 :start2 7) (decf (fill-pointer ms)) ms) #| --> "Hello orld" |#
<pfdietz> Also might consider dsplacement.
<vms14> I love adjustable fill pointer arrays because I can use them with format
<vms14> (defun make-text-buffer () (make-array 0 :adjustable t :fill-pointer t :element-type 'character))
<vms14> thanks for the different ways to remove an element of array
<vms14> see you :D
vms14 has quit [Remote host closed the connection]
<pfdietz> In practice, I use REMOVE instead of DELETE unless profiling shows I should use the latter. I almost never do.
dale_ has joined #lisp
dale_ is now known as dale
<pjb> For the lurkers who stayed, there's also a faster way to "remove" an element from an array. Eg for a string: (let ((ms (copy-seq "Hello World"))) (setf (aref ms 6) #\Null) ms) #| --> "Hello
<galdor> I like to use DELETE as final return value of a function
<galdor> this way it's clear we are not reusing the parameter
<galdor> (function or construction such as DO)
<vivit> pjb: the thing that goes in the LOCATION slot of a thing is the place object, not the list itself
<pjb> That's ok.
<pjb> PUT is a multi-method…
milanj has joined #lisp
milanj_ has quit [Read error: Connection reset by peer]
karlosz has quit [Quit: karlosz]
jebes has quit [Quit: ZNC 1.7.4+deb7 - https://znc.in]
<pfdietz> I've been thinking what CL would look like as a more functional language. One could make setf expanders more functional, by having them perform copies as needed (nested copies for nested places), bottoming out in assignment to a var.
<pfdietz> The fset project has something like that for its functional accessors.
wnj has joined #lisp
vivit has quit [Ping timeout: 268 seconds]
neuro_sys has quit [Ping timeout: 268 seconds]
stux|RC-only has quit [Read error: Connection reset by peer]
<clothespin> are these proposed features designed to make CL more thread safe?
stux|RC-only has joined #lisp
<Bike> pfdietz: copies?
<Bike> oh, like, instead of actually mutating
<pjb> Like in C++?
ggole has quit [Quit: Leaving]
gko has left #lisp ["ERC (IRC client for Emacs 26.3)"]
papachan has joined #lisp
vivit has joined #lisp
Josh_2 has joined #lisp
Harag has quit [Read error: Connection reset by peer]
Harag1 has joined #lisp
brown121408 has joined #lisp
brown121407 has quit [Ping timeout: 268 seconds]
<Xach> clothespin: no
Kundry_Wag has quit [Read error: Connection reset by peer]
Harag1 is now known as Harag
Kundry_Wag has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
frgo has quit [Ping timeout: 240 seconds]
Codaraxis has quit [Ping timeout: 268 seconds]
<vivit> If 'A is shorthand for (QUOTE A), is `A shorthand for anything?
frgo has joined #lisp
jeosol has joined #lisp
<Xach> vivit: not in a standard way like QUOTE. but the results are standardized.
brown121408 has quit [Read error: Connection reset by peer]
CrazyEddy has quit [Remote host closed the connection]
<vivit> What about #.
<Xach> vivit: that has standard meaning
<Bike> sharp dot couldn't be implemented as a macro or special operator or anything.
brown121407 has joined #lisp
<vivit> Hrm
<vivit> So if, for example, I want to benefit from format syntax in a docstring, I absolutely must sharpdot it?
<Xach> vivit: there are other ways but that is the easiest built-in way.
<beach> vivit: That's what I do.
<Xach> you could write your own read-macro, for example, but that is more work.
frgo has quit [Ping timeout: 240 seconds]
grabarz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orivej has quit [Ping timeout: 268 seconds]
<beach> vivit: Also, ' is not "shorthand" for anything. It is a reader macro that reads the expression that follows and returns it wrapped in (QUOTE ...).
<Xach> if it was not short and convenient, we would all write (QUOTE ...) instead.
<vivit> what, does the word "shorthand" have a standard meaning in this context? :P
<vivit> I wasn't sure of the specification details, so I picked an ambiguous word
<beach> And I fill you in with the right terminology.
<Xach> beach is incorrect in this case. ' is shorthand for (QUOTE ...) and reader macros are the mechanism that makes it work.
<vivit> thank you Xach
<beach> If it's "shorthand", I ought to be able to write "'hello" and get a string that contains "(QOUTE HELLO)".
<beach> But I am done with this discussion.
davepdot_ has quit [Remote host closed the connection]
hhdave has quit [Quit: hhdave]
sjl has joined #lisp
<Xach> That is a very silly example and I'm glad you will not try to defend it.
<vivit> #| 'hello |# -> #| (QOUTE HELLO) |#
zclark has joined #lisp
orivej has joined #lisp
<Xach> #| is a reader macro also
<Xach> and ( too
<vivit> Interesting
<vivit> The language's self-similarity runs even deeper than I thought
frgo has joined #lisp
<pfdietz> Bike: right, instead of mutating. So (setf (functional-car x) y) ==> (progn (setf x (cons y (cdr x))) y) ;; but with temp vars as needed
brown121408 has joined #lisp
brown121407 has quit [Ping timeout: 265 seconds]
<Bike> i used to know people who worked on the haskell lens library, but i didn't particularly understand anything, as is common with me and haskell
papachan has quit [Ping timeout: 268 seconds]
<vivit> is ; a reader macro?
<Xach> vivit: yes.
<vivit> what about |# and )?
<Xach> vivit: http://l1sp.org/cl/2 will give you lots of detail
<Xach> vivit: no - they are recognized in the reader functions introduced by #| and (
<Bike> parts of tokens, like characters in symbols and numbers, aren't reader macros. neither is whitespace. other than that most syntax is reader macros or adjacent.
<Bike> maybe all of it, i don't recall
<sjl> speaking of reader macros, is there a better way to make a single CL file that's both (load)able and ./runnable without having something like (set-dispatch-macro-character #\# #\! (lambda (stream s n) (read-line stream) (values))) in your sbclrc?
<pjb> vivit: everything is a reader macro, but integers, floating-point numbers, and symbols.
<Xach> sjl: yes
<Bike> i think with --script, shebangs are ignored, in sbcl?
<sjl> Bike: Yes, but then you can't (load) it in a normal REPL
<sjl> Xach: can you elaborate?
<Bike> oh duh.
<pjb> vivit: this means that you can easily change the syntax of the whole lisp, with reader macros, (and also the syntax of integers floating-point numbers and symbols, but this is a little more work.
<Xach> sjl: https://twitter.com/xach/status/1210647756026630144 is something I use sometimes.
<Xach> i think i learned it from rob warnock.
<sjl> Xach: that relies on ./foo on a non-executable, non-shebang file just passing itself to the current shell, right?
<sjl> Will that work if someone's using a non-POSIX shell (e.g. fish)?
<sjl> Or is there something else going on here that I don't understand
<Xach> sjl: I don't know, if you find out please tell me.
<Xach> the "$0" is also obviously useful only in certain cases, but the full form is so gross I leave it out for clarity.
<sjl> Yeah that breaks in fish
<sjl> works in bash
<Bike> oh i see, it uses the : operator, then ; chains... and in lisp it's just a string to discard and then a comment
<Bike> spooky
<sjl> Yeah
<sjl> and explicitly quotes the : so it's a lisp string
<sjl> which you mentioned, lol
<sjl> it's clever
<sjl> unfortunately doesn't work in non-posix shells
<Bike> it seems like it would be hard to do anything like this and have it work in every shell
boeg_ is now known as boeg
cosimone has quit [Quit: Terminated!]
<sjl> Yeah. I think the shebang reader macro is probably the only way, though that's obviously annoying to require people to use
<Xach> #! is a kernel thing
<sjl> Yeah
vivit has quit [Ping timeout: 260 seconds]
<sjl> #! are literally just two magic numbers that happen to be the ascii chars # and !
<Xach> sjl: what does fish do with that file? could it be tricked in a way that makes it still work in bash? of course, that would be hard to do for every shell.
<sjl> https://paste.stevelosh.com/a2b4bb27fdfd87732c42d3e3999384861dfa6ef8 but yeah, adding support for more and more shells is gonna be tricky
mn3m has quit [Ping timeout: 268 seconds]
* sjl has a meeting, back in a bit
vivit has joined #lisp
vivit has quit [Changing host]
vivit has joined #lisp
<Josh_2> whats the best guide for writing reader macros?
<Josh_2> It's something I've never done but I have a good usecase (I think) so I reckon I should take a stab at it
<Xach> Josh_2: i like the idea of reader macros but i think it's one of those things that works best as something specific to an application and not for general use in a library, most of the time.
orivej has quit [Ping timeout: 268 seconds]
william1_ has joined #lisp
<Josh_2> Well in this case, I would just use the read macro as short hand for something like (build-data-packet ..)
<Xach> Josh_2: i don't know of a guide offhand. i suspect it's in practical common lisp but haven't double-checked.
<Xach> Josh_2: what's the .. in that case?
<travv0> i don't think pcl covers reader macros but i could be wrong
<Josh_2> the variables to the data packet, recipient and data
<Bike> i don't know how much of a guide there could be. you take the stream, probably read some stuff, probably return an object.
<Bike> If you just want a shorthand sort of reader macro like ' or #', looking at your implementation's definition of them could be helpful
<Bike> they're likely only a few lines
varjag has joined #lisp
<Xach> Josh_2: what would the reader macro look like?
<Bike> e.g. SB-IMPL::READ-QUOTE
makomo has quit [Quit: WeeChat 2.4]
<Xach> I liked the idea of a timestamp reader as [2020-01-08 ...] but I don't want that leaking into a general library (like when you load chronicity)
<Josh_2> Is it a problem to provide these read macros for use at the repl?
<Bike> doesn't named readtables help with that kind of thing?
<Xach> I would like it in a specific application that deals a lot with timestamps, and I would want emacs or any editor to know how to deal with it.
<Bike> (i kind of don't use reader macros much, so i suppose i don't know)
<Xach> Bike: yes, but i don't think chronicity uses it properly, or maybe something upstream is to blame.
<Bike> oh, i see.
<Bike> Josh_2: just make sure it can be turned on and off.
<Bike> like if nothing else you can have enable-my-syntax disable-my-syntax functions.
<Xach> What I know is that after loading chronicity it prints and reads timestamps in brackets even though I don't want that by default.
<Josh_2> Bike: alrighty
<Xach> I really like having terse syntax in the repl for various things but would rarely put it in application or library code.
<Bike> off the top of my head, cl-interpol does this. the whole library is about providing some syntax, but it's not enabled until you call enable-interpol-syntax.
william1_ has quit [Ping timeout: 268 seconds]
<Bike> so that avoid what xach is talking about, i think.
<Xach> I use (defun :go (&optional (thing *)) (run-program "/usr/bin/open" thing)) to open pathnames in the repl with (:go) but would never have that in source code.
shifty has quit [Ping timeout: 268 seconds]
gxt has quit [Ping timeout: 240 seconds]
oni-on-ion has joined #lisp
moon-child has quit [Quit: ZNC 1.7.4 - https://znc.in]
amerlyq has quit [Quit: amerlyq]
slyrus has joined #lisp
v88m has quit [Remote host closed the connection]
brown121408 has quit [Read error: Connection reset by peer]
brown121408 has joined #lisp
ebrasca has joined #lisp
flamebeard has quit []
cosimone has joined #lisp
moon-child has joined #lisp
<pjb> and add: (define-symbol-macro .go (:go))
g0d_shatter has quit [Quit: Leaving]
nowhere_man has joined #lisp
cosimone has quit [Quit: Terminated!]
frgo has quit [Remote host closed the connection]
defaultxr has quit [Quit: WeeChat 2.7]
milanj has quit [Quit: This computer has gone to sleep]
hiroaki has joined #lisp
<phoe> functions named by keywords were AFAIK meant to be utilized by end-users
<phoe> like, that's the area where you can define your handy shortcuts
<phoe> so it is unwise for programmers to write their programs in a way that clobbers that space
cosimone has joined #lisp
<phoe> so the standard doesn't prohibit (defun :foo ...) but coding conventions generally do
<oni-on-ion> whoa. (defun :some-stuff () ..) ?
<phoe> yes
<phoe> (:foo) is very handy because it's available *everywhere*
<oni-on-ion> interesting =)
<phoe> since the keyword package is available everywhere, thanks to the property of the Lisp reader
<phoe> Xach: chronicity should be updated to use a named readtable
<phoe> in my code that I am currently writing, I use [2p] to refer to a mahjong tile, 2 of pinzu (circles)
<phoe> and a named readtable is very handy for the purpose of not leaking #\[ #\] macros outside
<phoe> in my library [2p] actually constructs a standard instance that also prints as [2p], so print-read consistency is there as long as the readtable is the same
<phoe> but that's a standard and maybe obvious way of working with objects that have their own reader macros - to have their printed representations use the same reader macros that are used to read them
<phoe> not unlike local-time timestamps that use #\@ for @2020-...
<LdBeth> phoe: doing you play Richii Mahjong
<oni-on-ion> ohh nice, phoe =)
<phoe> LdBeth: yes, a riichi mahjong player here
<oni-on-ion> i am used to it from long ago. called "serialization" i think
<phoe> that's "kinda-like" serialization
<phoe> except the object is printed readably
<oni-on-ion> when print form and read form are ... back and forthy. brain
<phoe> being printed readably is the proper term I think
<phoe> LdBeth: I'm working on a hand evaluator in Lisp, you can track the progress at https://github.com/phoe/riichi-evaluator/ if you wanna
<oni-on-ion> it was called serialization in my head. there is much better term
<phoe> the readme doesn't exist but the code should be good enough to read
<phoe> but the tests exist - so if you are fluent with mahjong terms, you can read and see what's going on in there.
<oni-on-ion> just curious, how come mahjong?
<phoe> if this was #lispcafe I'd tell you it's a complex but amazing four-player game
<phoe> but sadly, it's #lisp
jebes has joined #lisp
<oni-on-ion> its a satisfying answer. ty =) i had thought of doing some trading card games in lisp.
<LdBeth> phoe: I see you write two Tenhou there https://github.com/phoe/riichi-evaluator/blob/576ec7d69c164a38f68082d67022f8590cd9390f/src/yaku.lisp#L169 I suppose one of them should meant to be Renhou
<LdBeth> But I’m a little surprised that Open Richii is included ;)
<Xach> phoe: lispworks prohibits functions named by keywords
<sjl> Josh_2: Let Over Lambda has a section or two on reader macros, if I remember correctly. Just take that book with a hearty grain of salt.
orivej has joined #lisp
grabarz has joined #lisp
<Josh_2> sjl: what do you mean?
<sjl> that book has a lot of very strong opinions that not all lisp folks share. So if the author says something that seems crazy, don't just take it as gospel.
vivit has quit [Ping timeout: 260 seconds]
<jebes> LoL is great way showing why the use of lisp can be super risky too
<Josh_2> oh right
<jebes> Get a jr dev writing reader macros and you're going to have some fun
<Josh_2> I have a physical copy of it, but I've never read it
<jebes> i have a physical copy that i read 80% of
<jebes> will revist... e v e n t u a l l y
vlatkoB has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<Josh_2> That's most of it :D
<phoe> LdBeth: thanks, I'll correct it
karlosz has joined #lisp
<phoe> Xach: woah. well, okay.
<Xach> phoe: i think there's a restart that defines it anyway
jeosol has quit [Ping timeout: 260 seconds]
<phoe> ooh, well, a cerror is not *exactly* prohibiting it
<Xach> phoe: those kinds of errors make me wonder what bug they hit that prompted them to make it an error, or if they just thought about it from first principles, or what
<Xach> like some important customer, or themselves, had a stray :foo when they meant foo and it screwed up something for days.
<phoe> more like a massive warning
<phoe> yep, sounds like it
<Xach> (define-condition massive-warning (warning) ...)
<phoe> ...
<phoe> well
<phoe> (cerror "yolo" 'massive-warning ...)
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
brass has quit [Ping timeout: 268 seconds]
william1_ has joined #lisp
efm has quit [Quit: Konversation terminated!]
ebrasca has quit [Remote host closed the connection]
brass has joined #lisp
brettgilio has joined #lisp
rwcom9 has joined #lisp
varjag has quit [Remote host closed the connection]
william1_ has quit [Ping timeout: 268 seconds]
rwcom has quit [Ping timeout: 265 seconds]
rwcom9 is now known as rwcom
cosimone has quit [Quit: Quit.]
jebes has quit [Ping timeout: 260 seconds]
vivit has joined #lisp
milanj has joined #lisp
nowhere_man has quit [Ping timeout: 260 seconds]
vivit has quit [Ping timeout: 258 seconds]
cosimone has joined #lisp
cosimone has quit [Quit: Quit.]
Harag has quit [Remote host closed the connection]
Harag has joined #lisp
ft has quit [Ping timeout: 268 seconds]
varjag has joined #lisp
<copec> beach or Bike Why is McCLIM based on 2 rather then 3?
<Bike> i'm not the person to ask about mcclim, sorry.
brettgilio has quit [Ping timeout: 268 seconds]
<copec> sorry to bother you Bike
<scymtym> copec: best ask in #clim
ft has joined #lisp
hjudt has quit [Ping timeout: 245 seconds]
<pfdietz> I found use of reader macros interferes with SBCL's coverage reporter.
<tazjin> question about save-lisp-and-die in SBCL, the docs say: "Foreign objects loaded with sb-alien:load-shared-object are automatically reloaded on startup"
<tazjin> how is this implemented? Does it keep the exact path from which the object was loaded?
<dlowe> yeah, that's kind of the problem with reader macros - they work great with CL but almost nothing that operates on code
<tazjin> (I'm writing a CL build system in Nix and need the dumped image to contain references to the Nix store paths for linked objects)
hjudt has joined #lisp
scymtym has quit [Ping timeout: 248 seconds]
<Xach> tazjin: yes. but you can clobber them before saving - i don't think is supported explicitly, but it works.
<tazjin> Xach: having the exact paths is actually exactly what I want :) thanks!
<Xach> tazjin: ok. see sb-sys:*shared-objects* to peek at what it's saving
<tazjin> excellent, thank you!
femi has quit [Ping timeout: 268 seconds]
Lycurgus has joined #lisp
<Bike> there's also a :dont-save parameter to load-shared-object, it looks like, so you could do that and then in your initialization function load them explicitly from wherever you please, I think?
<tazjin> what's happening here is that Nix, after completing a build, scans the build output for references to the store paths (which are basically directories under /nix/store/<hash>-name) to track the runtime dependencies of the output
<Bike> huh.
<tazjin> for example, in my current system the path to the openssl I use is `/nix/store/pph1k412q5h8q20r10vmmnffwnh57bs1-openssl-1.1.1d/lib/libssl.so`
<tazjin> if any of these paths are found by Nix in the build output, it knows that I have a runtime dependency on the "package" that produced that path
<Bike> i dunno if they'll show up under ldd or anything...
<tazjin> they don't need to, it basically string searches through all outputs (including binaries)
<Bike> ah.
femi has joined #lisp
<Xach> sbcl strings aren't c strings
<Bike> really? i thought they were
<Bike> i mean, in that they have a null terminator, anyway
<jackdaniel> unicode yada yada. maybe base-strings are more like c arrays of characters
frgo has joined #lisp
<Xach> Bike: I don't think that's the case. I'll confirm.
ft has quit [Ping timeout: 268 seconds]
ft has joined #lisp
gravicappa has quit [Ping timeout: 240 seconds]
<Xach> thank goodness
<White_Flame> as strings are arrays, why would they bother with zero-termination?
<tazjin> wondering if I can drop the runtime dependency on SBCL that's in there 🤔
<Bike> White_Flame: so that you can pass strings to alien routines without having to cons up a new one
frgo has quit [Ping timeout: 260 seconds]
dmiles has quit [Ping timeout: 260 seconds]
<jackdaniel> when gc is a moving one such string should be pinned in a memory in that case, no?
<White_Flame> but SBCL strings by default aren't base-strings
<White_Flame> so there's still hoops to be jumped through
dmiles has joined #lisp
<jackdaniel> I like the initial element of (array nil) :)
<White_Flame> ok so yeah, not all strings are zero-terminated, it just allows that for simple-base-string which makes sense
narimiran has quit [Ping timeout: 240 seconds]
<Bike> well, character has an n-pad-elements 1 as well, with unicode
<Bike> not sure what's going on with that honestly, obviously it's not going to work as a c string directly
ft has quit [Ping timeout: 268 seconds]
cartwright has quit [Ping timeout: 240 seconds]
ft has joined #lisp
<sjl> > Lisp strings of type base-string are stored with a trailing NUL termination, so no copying (either by the user or the implementation) is necessary when passing them to foreign code, assuming that the external-format and element-type of the c-string type are compatible with the internal representation of the string.
<White_Flame> sjl: yeah, just wondering why full character strings also get it
<jackdaniel> if it is a memory which may be casted i.e to uint32_t array, then some unique element at the end could be useful in foreign word
Kundry_Wag has quit [Remote host closed the connection]
<sjl> Yeah not sure. Extra insurance in case it ever gets passed to some C thing accidentally?
<jackdaniel> not that such canaries are more useful then passing deliberely array size
<Bike> i feel like practically any utf-32 strings is gonna be full of null bytes, though
Kundry_Wag has joined #lisp
<Bike> the high byte of each character is null, right?
grabarz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Xach> so full
Lycurgus has quit [Remote host closed the connection]
<Xach> that was my thinking
cartwright has joined #lisp
<pfdietz> SBCL (simple-array character (*)) strings store the characters without the extra stuff needed for immediate character values, so when accessing a character there's are two additional instructions (shift, or). Storing the characters in a simple-vector doesn't need that.
<nirved> it would have been interesting to have package-local-readtable
cosimone has joined #lisp
<Xach> nirved: *readtable* is bound around LOAD
<Xach> nirved: so the pieces are more there than for other things you might wish to be local
<Bike> pfdietz: same as for any specialized array, no? but for fixnums you can skip the OR, and if you know what you're doing you can avoid needing the box
scymtym has joined #lisp
rwcom has quit [Ping timeout: 258 seconds]
rwcom has joined #lisp
<drmeister> Xach: When I use (load "~/quicklisp/setup.lisp") does quicklisp build itself using ASDF right away? Or does it have its own compilation code before it starts ASDF?
<drmeister> I'm asking because I created a new fasl format in clasp that consists of concatenated .o files in one binary file.
<drmeister> I feed the object file data within this new fasl file into our JIT one after the other and they get linked/relocated and made executable.
<drmeister> I'm trying to get this new fasl file working with ASDF and quicklisp.
<jackdaniel> drmeister: quicklisp is loaded from quicklisp/quicklisp/quicklisp.asd via asdf:load-op
<Xach> drmeister: setup.lisp does a little bit of work, like trying to load asdf, but then loads itself via asdf
<drmeister> Ah - so it does load itself via asdf - thank you.
<drmeister> So I need to make asdf work with this new fasl format. The rabbit hole goes deeper.
<drmeister> Now - how do I modify ASDF to generate fasl files.
<drmeister> Are there Common Lisp implementations that only generate fasl files?
bitmapper has quit [Remote host closed the connection]
slyrus_ has joined #lisp
nekosagan has quit [Ping timeout: 265 seconds]
mister_m has quit [Remote host closed the connection]
slyrus has quit [Ping timeout: 268 seconds]
<Xach> drmeister: what else would they generate?
<White_Flame> images, but aren't those basically fasls as well?
<Xach> White_Flame: no
bitmapper has joined #lisp
<Xach> White_Flame: at least on sbcl, fasls include a small bytecode system that controls how its data is loaded.
<drmeister> jackdaniel Was just explaining to me how ECL works with ASDF to generate .o files that are bundled into .fas/.fasb files I inherited that behavior in Clasp but never really paid attention to it.
<drmeister> In implementations that don't generate .o files - jackdaniel says the only way to create a bundle is to concatenate source code.
<Xach> White_Flame: images are mapped wholesale into the address space
rpg_ has joined #lisp
<White_Flame> ok
<phoe> I know that CCL has a way of concatenating its FASL files
<phoe> like, without concatenating mincomped source code
<drmeister> I can combine our new faso (FASt Object list files) into larger ones. Maybe I'll just use that.
<drmeister> I'll have compile-file generate .faso files and have the bundle function concatentate .faso files together into larger ones.
<phoe> a CCL FASL file is just a series of "commands" and serialized data that are executed in some order - they may be DEFUNs, they may be lists/conses/strings/vectors et cetera
doublex_ has joined #lisp
<phoe> so it isn't hard to recompose these - one just opens two files, concatenates their command streams, recomputes offsets and size and other metadata based on that and dumps to file again
<phoe> > Are there Common Lisp implementations that only generate fasl files?
<phoe> drmeister: I don't understand, CCL seems to do exactly this
<White_Flame> maybe ones that compile but don't execute them? ;)
<phoe> other than dumping cores and such, but that's probably not what you are describing
<phoe> White_Flame: CCL is able to compile-file and dump a FASL just fine though
<drmeister> phoe: That is helpful. What is it exactly that CCL does?
<drmeister> Oh wait - sorry - I read from the bottom up.
<phoe> drmeister: uhh. What kind of detail----
<phoe> Oh, well, one second
<drmeister> I can replicate what CCL does with these new faso files.
<phoe> a CCL FASL file is composed of the following operations/datums.
<phoe> That's some code I refactored and cleaned up - the upstream CCL has this much more messy and with redundant and no longer used faslcodes.
xuxuru has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
<phoe> GVECTOR and IVECTOR are internal vector types that are backing storage for things like structs and standard instances.
<phoe> VETAB-ALLOC and VEREF is, to the best of my knowledge, the equivalent of #1= and #1# references that work across a FASL file.
<phoe> ;; hey, look, my digging into depths of CCL seems to have paid off somehow
Kundry_Wag has quit [Read error: Connection reset by peer]
<phoe> ;; I'm sorta surprised it did
Kundry_W_ has joined #lisp
<phoe> doesn't SBCL do a similar thing though? it seems to only dump FASL files and no other objects
<Bike> i think so.
<Bike> there are also CFASLs but those aren't really the same kind of thing anyway, as far as I understand
anewuser has joined #lisp
<White_Flame> I haven't seen "cfasl" outside of cyc.
<White_Flame> what's the distinction?
<phoe> it seems that fasl contains load-time side effects where cfasl contains compile-time side effects
<phoe> and I'm likely incorrect, but that's what I found by skimming google results
<Bike> well, that's what i remember. i haven't used them or anything though.
<phoe> like, if there is a compile-time side effect, then this should be emitted out into a fasl
<phoe> since :compile-toplevel stuff doesn't make it into a fasl since it isn't meant to make it there
<phoe> I mean, (eval-when (:compile-toplevel) ...)
<Bike> also in the docstring.
<White_Flame> and it doesn't seem like compile-time side effects, but compile time things to run, even in sexpr format
<White_Flame> "The FASL contains the runtime expressions of the Lisp file, and the CFASL contains the compile-time expressions of the Lisp file", where the former is binary stuff
<Bike> what is the distinction between "compile-time side effects" and "compile time things to run"? those sound the same to me.
* White_Flame hasn't gotten into actual cyc cfasl encoding/decoding yet
<White_Flame> the expressions themselves, vs the output of running those expressions
xuxuru has quit [Quit: xuxuru]
<Bike> most of them don't even have outputs. i think you might be overthinking this.
<White_Flame> eg, the page claims that a (defmacro ...) form will exist unevaluated in the cfasl, such that when loaded, the macro will then expand
<phoe> yes, because defmacro has compile-time side effects
<Bike> the compile-file docstring in sbcl also briefly describes it
rumpelszn has quit [Quit: ZNC 1.6.6+deb1ubuntu0.2 - http://znc.in]
<Bike> "outputs the toplevel compile-time effects of this file"
<phoe> when you define a macro in a file, it affects the compiler environment because it is made available to be recognized in the next forms in the file
<Bike> but anyway, that's nothing much to do with the original question
<phoe> for (defmacro foo () ...) (foo) to work properly, DEFMACRO FOO *must* have compile-time effects
<White_Flame> yeah, but "what's a cfasl?" is certainly another question of merit ;)
<White_Flame> phoe: right, but the effects aren't recorded in the cfasl
<phoe> White_Flame: the side effects aren't - the forms that cause these side effects are.
nowhere_man has joined #lisp
<phoe> so you were correct that DEFMACRO gets its unevaluated form in there.
<phoe> or, rather
<Bike> i mean, you could still compile it.
<phoe> when you load a CFASL, effects are as if you compiled a file into a FASL
<phoe> because all compile-time effects become, uh, effective
<phoe> that's how I understand it
<White_Flame> I don't think I posted it here yet, but I will run into cfasl support with this: https://github.com/white-flame/clyc
vivit has joined #lisp
<White_Flame> porting Cyc to common lisp
rumpelszn has joined #lisp
Khisanth has quit [Ping timeout: 268 seconds]
johnjay has quit [Remote host closed the connection]
turona_ has joined #lisp
turona has quit [Ping timeout: 252 seconds]
atgreen has quit [Remote host closed the connection]
Lord_Nightmare has quit [Quit: ZNC - http://znc.in]
johnjay has joined #lisp
Khisanth has joined #lisp
turona_ has quit [Ping timeout: 240 seconds]
Lord_Nightmare has joined #lisp
cosimone has quit [Quit: Quit.]
Bike has quit [Quit: Bike]
cosimone has joined #lisp
cyraxjoe has quit [Ping timeout: 268 seconds]
MightyJoe has joined #lisp
random-nick has quit [Ping timeout: 258 seconds]
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
drewc has quit [Ping timeout: 252 seconds]
papachan has joined #lisp
nowhere_man has quit [Ping timeout: 246 seconds]
nowhereman has joined #lisp
wxie has joined #lisp
drewc has joined #lisp
LiamH has quit [Quit: Leaving.]
vivit has quit [Ping timeout: 268 seconds]
Kundry_W_ has quit [Remote host closed the connection]
Bike has joined #lisp
Kundry_Wag has joined #lisp
vivit has joined #lisp
Kundry_Wag has quit [Ping timeout: 258 seconds]
pfdietz has quit [Remote host closed the connection]
noobineer1 has quit [Read error: Connection reset by peer]
wxie has quit [Ping timeout: 240 seconds]