phoe changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <http://cliki.net/> <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.16, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
khisanth_ has joined #lisp
akoana has joined #lisp
didi has quit [Ping timeout: 248 seconds]
torbo has joined #lisp
edgar-rft has joined #lisp
igemnace has joined #lisp
slac-in-the-box has quit [Ping timeout: 248 seconds]
v88m has joined #lisp
nowhereman has joined #lisp
nowhere_man has quit [Ping timeout: 258 seconds]
didi has joined #lisp
dieggsy has quit [Quit: ZNC 1.7.3 - https://znc.in]
powerbit has quit [Read error: Connection reset by peer]
cromyr has joined #lisp
chipolux has quit [Ping timeout: 244 seconds]
Fare has joined #lisp
chipolux has joined #lisp
moldybits has joined #lisp
semz has quit [Ping timeout: 248 seconds]
karlosz_ has joined #lisp
anewuser has joined #lisp
akoana has left #lisp ["Leaving"]
froggey has quit [Ping timeout: 258 seconds]
froggey has joined #lisp
Lord_of_Life has quit [Ping timeout: 246 seconds]
semz has joined #lisp
ym555 has quit [Quit: leaving...]
Lord_of_Life has joined #lisp
karlosz_ has quit [Quit: karlosz_]
Inline has quit [Ping timeout: 250 seconds]
beach has joined #lisp
abarbosa has quit [Remote host closed the connection]
esrse has joined #lisp
pillton has joined #lisp
<beach> Good morning everyone!
aautcsh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
beach has quit [Disconnected by services]
beach has joined #lisp
torbo has quit [Remote host closed the connection]
karlosz_ has joined #lisp
karlosz_ has quit [Quit: karlosz_]
orivej has quit [Ping timeout: 245 seconds]
lispyone has quit [Ping timeout: 248 seconds]
asedeno has quit [Ping timeout: 248 seconds]
zmt00 has quit [Ping timeout: 248 seconds]
mathrick has quit [Ping timeout: 248 seconds]
rumpelszn has quit [Ping timeout: 248 seconds]
voidlily has quit [Ping timeout: 248 seconds]
gravicappa has joined #lisp
asedeno has joined #lisp
lispyone has joined #lisp
rumpelszn has joined #lisp
dddddd has quit [Remote host closed the connection]
orivej has joined #lisp
techquila has quit [Ping timeout: 248 seconds]
mathrick has joined #lisp
voidlily has joined #lisp
ricekrispie has quit [Read error: Connection reset by peer]
Bike has quit [Quit: Lost terminal]
orivej has quit [Ping timeout: 245 seconds]
karlosz_ has joined #lisp
marusich has joined #lisp
pillton has quit [Read error: Connection reset by peer]
cracauer has quit [Ping timeout: 248 seconds]
Lord_Nightmare has quit [Ping timeout: 244 seconds]
GoldRin has quit [Remote host closed the connection]
xkapastel has quit [Quit: Connection closed for inactivity]
dacoda has quit [Read error: Connection reset by peer]
asarch has joined #lisp
techquila has joined #lisp
vlatkoB has joined #lisp
Lord_Nightmare has joined #lisp
anewuser has quit [Quit: anewuser]
Lord_Nightmare has quit [Excess Flood]
asarch has quit [Quit: Leaving]
Lord_Nightmare has joined #lisp
hatchback17645 has joined #lisp
dylon has joined #lisp
karlosz_ has quit [Quit: karlosz_]
orivej has joined #lisp
<hatchback17645> (find-all-symbols store-here)
karayan has quit [Ping timeout: 256 seconds]
<beach> hatchback17645: Are you new here?
orivej has quit [Ping timeout: 264 seconds]
sauvin has joined #lisp
dale has quit [Quit: dale]
jprajzne has joined #lisp
orivej has joined #lisp
pankajgodbole has joined #lisp
orivej has quit [Ping timeout: 248 seconds]
hatchback17645 has quit [Quit: Ping timeout (120 seconds)]
Fare has quit [Quit: Leaving]
cosimone has joined #lisp
mathrick has quit [Ping timeout: 252 seconds]
ltriant has quit [Quit: leaving]
JohnMS_WORK has joined #lisp
zhlyg has joined #lisp
krwq has joined #lisp
mathrick has joined #lisp
hiroaki has quit [Ping timeout: 272 seconds]
mathrick has quit [Ping timeout: 252 seconds]
mathrick has joined #lisp
kajo has joined #lisp
ecilam has quit [Ping timeout: 258 seconds]
makomo has joined #lisp
Kaisyu7 has quit [Quit: ERC (IRC client for Emacs 26.2)]
scymtym has quit [Ping timeout: 248 seconds]
Kaisyu7 has joined #lisp
mathrick has quit [Ping timeout: 250 seconds]
v0|d has joined #lisp
actuallybatman has quit [Ping timeout: 258 seconds]
beach has quit [Remote host closed the connection]
sindan has joined #lisp
scymtym has joined #lisp
nowhereman has quit [Ping timeout: 245 seconds]
<sindan> Is there a way for a function to access the call stack without calling up the debugger?
<jackdaniel> sindan: try trivial-backtrace library
<jackdaniel> there are also some bits for that in swank, but you'd need to look into it yourself
<jackdaniel> I think that someone made yet another library for that but I can't recall the name nor the author
ggole has joined #lisp
<sindan> cool, thanks!
schweers has joined #lisp
<sindan> trivial-backtrace is all I need
dylon has quit [Remote host closed the connection]
blandest has joined #lisp
pfdietz has quit [Ping timeout: 256 seconds]
marusich has quit [Remote host closed the connection]
Oladon has quit [Read error: Connection reset by peer]
cosimone has quit [Ping timeout: 248 seconds]
cosimone has joined #lisp
krwq has quit [Remote host closed the connection]
aautcsh has joined #lisp
mathrick has joined #lisp
catalinbostan has joined #lisp
catalinbostan has quit [Client Quit]
aautcsh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Bronsa has quit [Remote host closed the connection]
shifty has joined #lisp
mathrick has quit [Ping timeout: 252 seconds]
mathrick has joined #lisp
powerbit has joined #lisp
igemnace has quit [Quit: WeeChat 2.5]
<adlai> didi: there are peek-char and peek-byte that unread by default, if your usecase is likely to need this unfeature more often than not
<adlai> e.g., if you're reading a code which is mostly multibytes, and occasionally a single byte.
cosimone has quit [Quit: WeeChat 2.4]
m00natic has joined #lisp
iovec has joined #lisp
edgar-rft is now known as birthdays
birthdays is now known as people
aautcsh has joined #lisp
people is now known as edgar-rft
moldybits has quit [Quit: WeeChat 2.4]
xkapastel has joined #lisp
pankajgodbole has quit [Ping timeout: 245 seconds]
crystalball has joined #lisp
crystalball has quit [Client Quit]
dddddd has joined #lisp
SaganMan has joined #lisp
moldybits has joined #lisp
aautcsh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
v0|d has quit [Ping timeout: 248 seconds]
maxxcan has joined #lisp
aautcsh has joined #lisp
donotturnoff has joined #lisp
orivej has joined #lisp
esrse has quit [Ping timeout: 258 seconds]
aautcsh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SaganMan has quit [Read error: Connection reset by peer]
SaganMan has joined #lisp
polezaivsani has joined #lisp
polezaivsani has quit [Ping timeout: 245 seconds]
iovec has quit [Quit: Connection closed for inactivity]
ludston has quit [Ping timeout: 245 seconds]
polezaivsani has joined #lisp
orivej has quit [Ping timeout: 272 seconds]
maxxcan has quit [Read error: Connection timed out]
maxxcan has joined #lisp
Bike has joined #lisp
zulu-inuoe has joined #lisp
SaganMan has quit [Ping timeout: 245 seconds]
v88m has quit [Ping timeout: 258 seconds]
xkapastel has quit [Quit: Connection closed for inactivity]
gareppa has joined #lisp
makomo has quit [Quit: WeeChat 2.4]
cosimone has joined #lisp
gareppa has quit [Quit: Leaving]
blandest has quit [Quit: rcirc on GNU Emacs 27.0.50]
ricekrispie has joined #lisp
pfdietz has joined #lisp
orivej has joined #lisp
igemnace has joined #lisp
dale_ has joined #lisp
dale_ is now known as dale
aautcsh has joined #lisp
amerlyq has joined #lisp
aautcsh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
LiamH has joined #lisp
catalinbostan has joined #lisp
catalinbostan has quit [Ping timeout: 268 seconds]
wilfredh has joined #lisp
hatchback176 has joined #lisp
sjl_ has joined #lisp
JohnMS_WORK has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
byronkatz has joined #lisp
Necktwi has joined #lisp
<byronkatz> Hi everyone! I'm Byron, in the midst of learning lisp.
amerlyq has quit [Quit: amerlyq]
FreeBirdLjj has joined #lisp
Necktwi has quit [Client Quit]
Necktwi has joined #lisp
<Bike> hello byron. ask questions if you have them. there's also #clnoobs.
<sjl_> #clschool is the new version of #clnoobs
<Bike> oh. clschool then
<sjl_> no one had ops in #clnoobs to combat the spam a while back, so folks moved to a new channel
<surrounder> ah nice re: #clschool
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 245 seconds]
Lord_of_Life_ is now known as Lord_of_Life
Necktwi has quit [Quit: leaving]
<maxxcan> hi byronkatz
maxxcan has quit [Quit: maxxcan]
Inline has joined #lisp
Inline has quit [Read error: Connection reset by peer]
Inline has joined #lisp
jprajzne has quit [Quit: Leaving.]
orivej has quit [Ping timeout: 248 seconds]
moei has joined #lisp
xkapastel has joined #lisp
saravia has joined #lisp
q9929t has joined #lisp
moei has quit [Ping timeout: 245 seconds]
amerlyq has joined #lisp
shka_ has joined #lisp
q9929t has quit [Quit: q9929t]
wigust- has quit [Quit: ZNC 1.7.3 - https://znc.in]
schweers has quit [Ping timeout: 248 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
scymtym has quit [Ping timeout: 248 seconds]
FreeBirdLjj has quit [Ping timeout: 246 seconds]
cosimone has quit [Quit: WeeChat 2.4]
linack has joined #lisp
mindCrime has joined #lisp
mindCrime has quit [Client Quit]
mindCrime has joined #lisp
mindCrime has quit [Read error: Connection reset by peer]
mindCrime has joined #lisp
FreeBirdLjj has joined #lisp
cosimone has joined #lisp
scymtym has joined #lisp
themsay has joined #lisp
mindCrime has quit [Remote host closed the connection]
mindCrime has joined #lisp
zotan has quit [Quit: ZNC 1.6.5+deb1+deb9u1 - http://znc.in]
zotan has joined #lisp
rpg has joined #lisp
PuercoPop has quit [Quit: ZNC 1.6.3 - http://znc.in]
ggole has quit [Quit: Leaving]
actuallybatman has joined #lisp
cosimone has quit [Ping timeout: 257 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
cosimone has joined #lisp
aindilis has joined #lisp
FreeBirdLjj has quit [Ping timeout: 245 seconds]
pankajgodbole has joined #lisp
Boubert has joined #lisp
flazh has quit [Ping timeout: 245 seconds]
Boubert has quit [Client Quit]
linack has quit [Ping timeout: 268 seconds]
moldybits has quit [Read error: Connection reset by peer]
shifty has quit [Ping timeout: 245 seconds]
moldybits has joined #lisp
saravia has quit [Remote host closed the connection]
<didi> adlai: Thank you.
clothespin has joined #lisp
pfdietz has quit [Ping timeout: 256 seconds]
ebrasca has joined #lisp
mindCrime_ has joined #lisp
mindCrime has quit [Ping timeout: 246 seconds]
Jesin has quit [Quit: Leaving]
Jesin has joined #lisp
clothespin has quit [Remote host closed the connection]
cosimone has quit [Quit: WeeChat 2.4]
refpga has joined #lisp
v88m has joined #lisp
m00natic has quit [Remote host closed the connection]
pankajgodbole has quit [Ping timeout: 245 seconds]
<flip214> sjl_: that problem got solved in the new channel? or should we start keeping a note somewhere?
linack has joined #lisp
<flip214> about the current channel name ... #clschool-2018-06-12-evening-in-EU
kajo has quit [Ping timeout: 248 seconds]
kajo has joined #lisp
<sjl_> someone active has ops in #clschool, so spam can be combated successfully now
clothespin has joined #lisp
clothespin has quit [Remote host closed the connection]
rozenglass has joined #lisp
aautcsh has joined #lisp
Lycurgus has joined #lisp
bexx has joined #lisp
donotturnoff has quit [Remote host closed the connection]
aautcsh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
donotturnoff has joined #lisp
josh5tone has quit [Ping timeout: 272 seconds]
themsay has quit [Read error: Connection reset by peer]
sauvin has quit [Ping timeout: 245 seconds]
themsay has joined #lisp
fortitude has joined #lisp
Grauwolf has quit [Remote host closed the connection]
Grauwolf has joined #lisp
varjag has joined #lisp
nanoz has joined #lisp
themsay has quit [Ping timeout: 268 seconds]
aautcsh has joined #lisp
pfdietz has joined #lisp
hatchback176 has quit [Remote host closed the connection]
simendsjo has joined #lisp
seann has joined #lisp
orivej has joined #lisp
_whitelogger has joined #lisp
themsay has joined #lisp
gravicappa has quit [Ping timeout: 245 seconds]
nanoz has quit [Ping timeout: 248 seconds]
themsay has quit [Read error: Connection reset by peer]
themsay has joined #lisp
ym has quit [Quit: Leaving]
v88m has quit [Read error: Connection reset by peer]
byronkatz is now known as awesomedood2015
simendsjo has quit [Remote host closed the connection]
simendsjo has joined #lisp
awesomedood2015 is now known as b6nvv0Rx
cosimone has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
semz has quit [Quit: Leaving]
v88m has joined #lisp
cosimone has quit [Quit: WeeChat 2.4]
xkapastel has quit [Quit: Connection closed for inactivity]
itruslove has quit [Remote host closed the connection]
<Godel[m]> Hi, in https://fare.livejournal.com/188429.html, the author claims that `… Racket keeps evolving, and not just "above" the base language, but importantly below. This alone makes it vastly superior to CL …`. What could it mean to evolve below the language? Is he referring to the subsets of racket that exist (functional, lazy)? (I haven't programmed in racket.)
manualcrank has quit [Quit: WeeChat 1.9.1]
manualcrank has joined #lisp
kajo has quit [Ping timeout: 248 seconds]
manualcrank has quit [Client Quit]
amerlyq has quit [Quit: amerlyq]
<Bike> given the example of ffi, i would guess runtime type stuff
manualcrank has joined #lisp
<mfiano> Also, he eventually moved to Gerbil Scheme, though I believe he is doing mostly ML these days.
simendsjo has quit [Ping timeout: 272 seconds]
<oni-on-ion> Godel[m], perhaps something about racket swapping their guts to chez scheme recently
<Godel[m]> Sorry, I don't understand what is runtime type stuff. I haven't dealt with racket at all.
<oni-on-ion> its just a branding
<Bike> stuff about the runtime. "runtime" is not a racket-specific term.
<Bike> garbage collection, calling conventions, assembly routines
scymtym has quit [Ping timeout: 248 seconds]
manualcrank has quit [Quit: WeeChat 1.9.1]
manualcrank has joined #lisp
<Godel[m]> And common lisp lacks those runtime stuff?
shka_ has quit [Ping timeout: 248 seconds]
<Bike> no. "keeps evolving", he said.
themsay has quit [Read error: Connection reset by peer]
<Bike> if you're that concerned you should just ask fare. there's probably an email address on there somewhere.
themsay has joined #lisp
<mfiano> oni-on-ion: No, that article pre-dates Racket's Chez efforts.
<Godel[m]> Thanks.
themsay has quit [Read error: Connection reset by peer]
<oni-on-ion> i do not know which article one refers
<oni-on-ion> oh.
<oni-on-ion> why i say branding is because most/all the other schemes can do the racket things
jmercouris has joined #lisp
<oni-on-ion> or does do them
<jmercouris> how hard do you think it would be write a javascript interpreter in CL?
<oni-on-ion> reverse parenscript ?
<jmercouris> no, not reverse parenscript
<jmercouris> a javascript interpreter and environment
<jmercouris> with its own stack, memory etc
themsay has joined #lisp
<oni-on-ion> well. parenscript is CL that produces JS. do you want CL to *consume* JS , or something else ?
<jmercouris> I want JS to run within a CL image
<jmercouris> I'm not looing for a compiler
<oni-on-ion> so the inverse of parenscript. yeah. just translate javascript to CL...
<jmercouris> s/looing/looking, sorry the "k" key is stuck on my computer
<jmercouris> you can't just translate javascript to CL, there are many semantics to the way javascript does addition, for example
<oni-on-ion> hehe well i wouldnt want to <insert source code> everytime i want to describe it.
donotturnoff has quit [Ping timeout: 245 seconds]
<fortitude> jmercouris: it's not really an interpreter, but there is http://marijnhaverbeke.nl/cl-javascript/ which might be a starting point
<Xach> jmercouris: i use cl-js for that. works nicely.
<Xach> yeah, that thing from marijn
<jmercouris> that is quite a spec...
chipolux has quit [Ping timeout: 244 seconds]
<jmercouris> making a javascript engine must be quite the task...
<Xach> My impression is that it's not too bad but making it "fast" is a pretty big challenge
<jmercouris> Yeah, I bet, especially since speed is so crucial for JS
<Xach> it helps if you have many multibillion-dollar companies working on it
<fortitude> I'd think that trying to preserve all the strange type-conversion stuff would be quite the trick (c.f. all the "what the heck javascript" talks)
<Bike> this spec looks like it's defining a virtual machine
<jmercouris> I have been thinking a lot about web engines, and I have concluded that the web standard has increased so massively and javascript become so large partly as a way to increase the barrier to entry for new engines
<Bike> hanlons's razor
vlatkoB has quit [Remote host closed the connection]
<jmercouris> I think it is deliberate on the part of organizations such as Google...
<Bike> and irrelevant, anyway
<jmercouris> Well, not exactly, I have been considering implementing an engine in CL
<jmercouris> I'm just thinking about all of the components, and what it would take to reasonably fund such a task
kajo has joined #lisp
<jmercouris> maybe it is a fools errand...
<Bike> the good thing about it being a virtual machine is that, in theory, you don't need to think like a person to implement it, just follow all the steps stupidly
<Bike> the bad thing is god it just keeps going
<fortitude> if you're doing a greenfield project, it might be easier to implement webassembly support and take somebody else's javascript-on-WA, assuming that exists
<oni-on-ion> if parenscript was written in prolog, one could just swap the args, and get the inverse.
<oni-on-ion> mAgIc
<jmercouris> fortitude: a very salient observation
<Bike> https://duktape.org/ or you could ffi to something like this
<Bike> it's in one file. how big is that file...
<jmercouris> apparently not *too* big
<jmercouris> considering; "Embeddable, portable, compact: can run on platforms with 160kB flash and 64kB system RAM"
<Bike> 96801 lines
<jmercouris> That is truly something...
<Bike> so there's some scale for you
<Bike> i mean, that's not how they develop it, obviously
<jmercouris> well, not necessarily obviously
<Bike> it's not how they develop it. if you look at the repo they use separate source files like regular human beings.
<Bike> and the duktape.c begins "autogenerated".
<jmercouris> oh I see
<Bike> anyway there you go. should give you an idea of how hard a js engine is.
<jmercouris> at any rate, I bet it could be far fewer lines of CL
<Bike> the site also links several other "small" projects.
<jmercouris> so probably 1/10 the size or so
<Bike> and microsoft's "chakra core" and v8 are both open source, i just don't thinkt hey have ffiable apis
<jmercouris> so its a 10k line project, so maybe about 6 months to a year of man-hours
<jmercouris> just for the JS runtime
<jmercouris> so I guess the minimum budget to develop a new web rendering engine must be at least 500,00.00 USD
<jmercouris> s/500,00.00/500,000.00
<Bike> also, that's one designed for low memory usage rather than speed. it probably doesn't jit and stuff.
alexanderbarbosa has joined #lisp
<jmercouris> Bike: can you explain JIT?
<jmercouris> or rather as an open question, can anyone in the channel explain to me JIT? I don't know much about compilers
<White_Flame> of course, that example is in C, and thus has to implement their own GC, while in Lisp you can simply use the native one
<White_Flame> I don't think javascript is all _that_ difficult to implement in a naive approach
<White_Flame> parsing the source text is probably going to be one of the more finnicky things to do
libertyprime has quit [Ping timeout: 245 seconds]
<Bike> i'm sure it's not difficult. it's just that there's a lot of it.
<Bike> jmercouris: it means compiling things at runtime, generally.
<Bike> sometimes patching existing functions is also implied
<fortitude> jmercouris: at a very high level, JITing is essentially using an interpreted chunk of code until you've collected som stats about how it is actually being used, then replace it with a compiled version that takes advantage of those stats
<White_Flame> (and then recompile if those expected stats are violated later)
<jmercouris> I wonder why you would do that?
<White_Flame> performance
<jmercouris> obviously, but in which ways?
<Bike> because interpreting code is generally slower than letting your machine do it
<White_Flame> you can do things like inline virtual functions, if you can at runtime resolve & assume its type will be consistent
<jmercouris> okay so by compilation you mean "turning into byte code"
<jmercouris> rather than being processed by the VM
<Bike> or machine code.
didi has left #lisp ["O bella ciao bella ciao bella ciao, ciao, ciao."]
<White_Flame> modern JS engines have multiple stages of bytecode and asm code
<White_Flame> they tradeoff quick-to-start execution in more naive bytecode environments, with slow-to-start optimized machine language outputs
<fortitude> jmercouris: the stats you collect allow you to optimize the compiled code for how it's actually being used, instead of how you assume it might be used in some hypothetical future
<fortitude> the tradeoff is having to wait a bit before you can actually do that (warmup times turn out to be pretty variable in some systems)
<jmercouris> fortitude: Ok, I see
<White_Flame> in fact, the entire raison d'état for webasm was to decrease the startup latency of loading & parsing
<jmercouris> could this be classified as a very primitive form of "machine" learning?
<jmercouris> as the VM runs it makes better and more informed decisions about how to compile snippets?
<White_Flame> it's certainly heuristic feedback, yes
<Bike> do we have to classify it as machine learning
<jmercouris> its trendy
<White_Flame> although it doesn't make its own new auto-classifications; it simply routes the optimization paths the authors have provided
<fortitude> thing is the optimizations are local and ephemeral (you don't save them in a "smarter" vm that you use the next time you start your browser up)
<White_Flame> and many of the JIT heuristics are incredibly simple, merely figuring out what the actual concrete type of a variable usually is
<White_Flame> from which a lot of general constant propagation style optimization can happen
<White_Flame> and that's just basically a histogram
<jmercouris> I don't see how the above is related to histograms
<White_Flame> a histogram is a count of occurrences. X axis is which type a variable happened to be during a pass, Y axis is the count
<White_Flame> so it was a null twice, and a Number 3 million times, it optimizes for Number
seann has left #lisp [#lisp]
<White_Flame> *if it was
<White_Flame> there's usually a count of times a section of code has been run, and when that hits a threshold, it attempts to optimize it further (and coined the name "hotspot")
<White_Flame> using the histogram metrics of what the variable types were
ebrasca has quit [Remote host closed the connection]
<White_Flame> the JVM and various JS engines are really fascinating to look into. There's a ton of money & talent thrown at making those faster (regardless of the language quality that runs on them)
<jmercouris> what a shame, that money could be spent to heat dumpsters in the NY winters and it would be put to better use
chipolux has joined #lisp
mindCrime_ has quit [Ping timeout: 248 seconds]
Arcaelyx has joined #lisp
xkapastel has joined #lisp
dacoda has joined #lisp
<aeth> jmercouris: The real issue is why are those programmers being paid to work on JS engines and not CL.
linack has quit [Quit: Leaving]
<jmercouris> aeth: because the world is a cruel and unfair place
<jmercouris> maybe we should be asking ourselves: "ask not what your programming language of choice can do for you, but what can you do for your programming language of choice"
Bike has quit []
kini has quit [Remote host closed the connection]
dacoda has quit [Remote host closed the connection]
dacoda has joined #lisp
<bexx> i'm doing an assignment in which I need to download the atoms in the max depth of a list to the succesive upper level
<bexx> but i can't
<no-defun-allowed> download?
<bexx> sorry I don't know the english word
<bexx> downgrade?
LiamH has quit [Quit: Leaving.]
<bexx> let me show you what I build
<no-defun-allowed> could you provide an example? i'm guessing something like ((a b c)) -> (a b c)?
<bexx> yeah that is
<bexx> if (a (b c)) -> (a b c)
<bexx> (a (b c (d e))) -> (a (b c de ))
<bexx> the max depth is joining the anterior level
<jmercouris> ok
<jmercouris> so only the deepest elements need to go up one level?
<no-defun-allowed> hm, do just the innermost lists get splatted?
<bexx> jmercouris: that's correct
<bexx> I want to understand the idea
<jmercouris> bexx: what you can do is represent the structure as a tree
<bexx> ok
<jmercouris> then you can find the leaf with the greatest distance to the root node
<bexx> and then?
<jmercouris> this is the leaf that needs to be merged into the parent node
<bexx> I need to go one by one?
<bexx> I was thinking of something like ,@
<jmercouris> well I would make a tree structure ffrom the list, and then use a depth first search
<bexx> but I can't find a function to do that
<no-defun-allowed> append?
<jmercouris> oh, you are allowed to do it in Lisp?
<no-defun-allowed> (append '(a b c) '(d e)) -> '(a b c d e)
<jmercouris> no-defun-allowed: I think the program needs to be able to accept a generalized input
<bexx> jmercouris: yeah is a lisp assignment
<bexx> '(a (b (c) d) e ((f g) h i) j) -> (a (b c d) e (f g h i) j)
<bexx> that's an example
<jmercouris> yes, I understand the example
<bexx> with the pastebin code I can get '(a (b nil d) e (nil h i) j)
<jmercouris> the easiest way you'll solve this problem is by breaking it down in the way I suggested
<pjb> So you need to flatten the before-deepest lists.
<bexx> pjb: that's it!
<bexx> thanks!!
<jmercouris> performance is not really critical in this type of assignments, more so clarity in understanding what you are doing
<jmercouris> bexx: how does that help you?
<jmercouris> bexx: at any rate you will have to traverse the whole structure to find the deepest list
<bexx> jmercouris: I know, but know I can get the flatten of the before-deepest list
<bexx> jmercouris: and that's it
<jmercouris> bexx: I'm not really following you, but if you know how to do it now, best of luck!
zhlyg has quit [Ping timeout: 248 seconds]
<bexx> jmercouris: i'm going to try!
<grewal> jmercouris: My guess is that bexx has already written a flatten-one-level funtion and a get-deepest-leaves funtion. Most *good* teachers tend to walk you through difficult problems
<pjb> bexx: deepth of an atom is 0, deepth of a list of atom is 1. deepth of a list of lists of atoms is 2. This is the before deeepest lists you want to process.
<White_Flame> bexx: btw, #clschool is good for asking beginner questions
<White_Flame> but you can certainly finish here
<pjb> (I take flatten from a library such as com.informatimago.common-lisp.cesarum.list:flatten but you would have to write it for the exercice probably).
<jmercouris> grewal: I didn't think of that
<pjb> bexx: note that once you have a working solution, you may notice that it is very inefficient, and you might want to optimize it. This will make it more obscure…
<jmercouris> that makes sense though, it would seem a complex problem for a new student
b6nvv0Rx has quit [Remote host closed the connection]
varjag has quit [Ping timeout: 248 seconds]
sjl_ has quit [Quit: WeeChat 2.3-dev]
<bexx> pjb: your solution is really simple!
<bexx> pjb: I think that i'm overcomplicating things
<jmercouris> the solution is very syntactically simple, but conceptually difficult, in my opinion
<pjb> bexx: the thing is that you must write first a working solution. and only once you have a working solution, you should think about optimizing it.
<bexx> yeah i'm just trying to get a solution
<jmercouris> I still vote for making a tree...
<bexx> later i can think of the optimization
dacoda has quit [Ping timeout: 248 seconds]
<jmercouris> a tree is the most natural representation of this data structure
<bexx> jmercouris: why are you going to make a tree?
<jmercouris> because you will have to traverse the structure a few times, and conceptually it is simpler to traverse a tree
<jmercouris> well not a few times, but in the best case 1 time, in the worst case 2 times
<jmercouris> you have to know where within the structure the deepest nodes lie
<bexx> jmercouris: and how do i get the list again?
<grewal> Also it's not so much *making* a tree as it is interpreting the structure as a tree,
<jmercouris> bexx: turning a tree into a list and a list into a tree is a function you'd write
<pjb> bexx: the problem is indeed not a problem on lists, but of tree. The notion of deepth is a tree notion.
<bexx> ooh i see
<jmercouris> bexx: you could use structs or something to represent nodes, or you could do what pjb says and just treat the list of of lists as a tree
<pjb> bexx: but the trick is that there are an infinite numbers of ways to represent trees with lists.
<jmercouris> bexx: here is a very short chapter in PCL about treating lists as trees: http://www.gigamonkeys.com/book/beyond-lists-other-uses-for-cons-cells.html
<pjb> bexx: so it's a good idea to introduce functional abstration over your representation to clearly manipulate the tree. The function deepth does that. My function flatten-before-deepest doesn't abstract the notion of tree, it's a little magical for this.
<bexx> pjb: i'm trying to understand the magic of the case
<bexx> pjb: why if (deepth list) is 2 i need to flatten the list?
<grewal> pjb: Why do you keep using the word 'deepth'? Is it a technical term I'm unaware of?
<bexx> grewal: no, pjb just called that way a function
<jmercouris> grewal: see: https://pastebin.com/MP37jCzT
<grewal> bexx: You should think about that question a little longer before asking that it.
<pjb> (deepth 'a) #| --> 0 |# no flatten.
<pjb> (deepth '(a b c)) #| --> 1 |# no need to flatten it anymore.
<pjb> (deepth '(a (b) c)) #| --> 2 |# hit.
<bexx> pjb: but if the input is more deep?
<pjb> grewal: if a is a leaf, (a b c) is a tree of deepth 1, with 3 childrens, a, b and c.
<pjb> grewal: (a (b) c) is a tree of deepth 2, with 3 childrens, two leaves a and c, and the subtree of deepth 1 (b).
<pjb> bexx: then we process the children recursively, in the following mapcar.
<pjb> bexx: so the magic, is that we don't explicitely say that the list is a representation of a label-less tree node, giving the list of children of the node.
<pjb> bexx: we could rewrite it with functional abstraction that would make this clear.
<pjb> See the usenet article linked above.
<jmercouris> and probably should, because it is unlikely a new user will understand fully/deeply a solution of that nature
<grewal> pjb: My question really was 'why use "deepth" instead of "depth"'? And your answer basically is deepth is (1+ depth)?
<pjb> grewal: bexx: without the explicit functional abstraction, the magic trick is that I don't show that I've recognized that it was a problem on trees, and given a solution that manipulates implicitely a tree.
<pjb> We see lists, but it's actually tree nodes.
<pjb> grewal: oh, I'm not native so I may make spelling mistakes.
<pjb> Don't make anything of it.
<bexx> pjb: is really great
<bexx> pjb: i'm trying hard to understand it
<jmercouris> bexx: perhaps you'd better spend your time implementing a tree abstraction instead
<jmercouris> I don't think that it is a solution that the professor imagined or intended
<jmercouris> and part of the exercise is probably for you to understand that nested lists are trees
<bexx> jmercouris: yeah i'm reading the gigamonkeys chapter that you posted
<jmercouris> probably I imagine the nexts lessons will be on homiconicity or something and manipulation of ASTs
v0|d has joined #lisp
<grewal> pjb: You usually don't make such mistakes. It's sometimes hard to tell what's an accident and what's intentional
rpg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Bike has joined #lisp
kini has joined #lisp
<bexx> pjb: I think that your solution is not correct
<bexx> pjb: (flatten-before-deepest '(a (b (c) d) e ((f (e a d) g) h i) j))
<bexx> pjb: gets -> (A (B C D) E ((F E A D G) H I) J)
<bexx> so in this example I can't flatten (b (c) d)
<bexx> because the maximum deepest level is (e a d)
<pjb> so in terms of the tree-methods indicated in that usenet post, your trees would be abstracted as: https://pastebin.com/uESF4B2s
<pjb> bexx: good point. Then when the depth is 1, you should call flatten directly.
<pjb> (flatten-before-deepest '(b (c) d)) #| --> (b c d) |#
<pjb> But I'm not sure what you're saying.
<pjb> Do you mean that you don't want to flatten (b (c) d)?
<bexx> i'm thinking that the maximum level of depth is for (e a d)
<sukaeto> Godel[m]: if I were in a snarky mood, my response would be "Has Racket ever been used for anything outside of teaching undergrads how to program?"
<bexx> (c) in this case is in the 3 level
jmercouris has quit [Remote host closed the connection]
<bexx> (e a d) is in level 4
<pjb> bexx: yes. My function considers the subtrees independently.
<bexx> so i only need to downgrade (e a d)
<pjb> bexx: if you wanted to consider the whole tree, you would have to write it differently.
<bexx> yeah i'm trying
polezaivsani has quit [Quit: ERC (IRC client for Emacs 26.2)]
zaquest has quit [Remote host closed the connection]
<pjb> bexx: so with tree abstraction you could write it as: https://pastebin.com/H7Qr9F33
ltriant has joined #lisp
<pjb> bexx: and for flatten-deepest-children: https://pastebin.com/0MCUpRtE
<pjb> bexx: notice that you can easily change the representation of the trees, without changing any of your code. You just need to substitute the set of tree methods in *default-tree-interpretation*
<pjb> For example, you could add labels to your tree nodes, or use a representation with CLOS objects for the nodes, etc.
<pjb> If you restrict yourself to binary trees, you could use cons cells instead of lists.
<pjb> or hash-tables for the nodes, when the label is multi-valued.
<pjb> All your tree processing code would still be unchanged.
<pjb> bexx: notice also that you could just use CLOS and generic methods, but since we are dealing here with interpretations of the same class, namely the CONS class, we would have to wrap our lists in CLOS abstractions. Ie. define different CLOS classes for the different interpretations of our lists. tree-make-tree would return then CLOS instances instead of our lists.
notzmv has joined #lisp
ricekrispie has quit [Quit: YEET]
Lycurgus has quit [Ping timeout: 258 seconds]
libertyprime has joined #lisp
PuercoPop has joined #lisp
torbo has joined #lisp
ecilam has joined #lisp
<bexx> pjb: seems like it's working great!
<bexx> pjb: what do you think?
<pjb> bexx: yes, it seems good. Only it doesn't abstract away. So it works only specifically on this list representation of your tree.
ltriant has quit [Quit: leaving]
notzmv has quit [Remote host closed the connection]