hackware has quit [Remote host closed the connection]
rumbler31 has quit [Remote host closed the connection]
dddddd has quit [Remote host closed the connection]
pillton has joined #lisp
pest-ctrl has quit [Remote host closed the connection]
vlatkoB has joined #lisp
<beach>
Good morning everyone!
CloseToZero has joined #lisp
Arcaelyx has quit [Ping timeout: 246 seconds]
nanoz has joined #lisp
<faheem>
pfdietz: I'm not sure what curation means in this context.
<LdBeth>
Morning, beach
Necktwi has joined #lisp
FreeBirdLjj has joined #lisp
<faheem>
I remember when I previously tried using SBCL, most of my issues were with GC. And I bit to do with not being able to figure out how to implement/silence
<faheem>
optimization suggestions. Which seems like a bit of a black art.
<dialectic>
Issues like what? memory usage, pause times?
<faheem>
Any significant changes in the GC or numerical calculations? I know this is vague, so feel free to ignore.
<dialectic>
Tuning GC is a black art in every runtime
<faheem>
dialectic: I think it wouldn't return the memory when it should have.
<faheem>
I filed a bug report. Possibly more than one. Let me do a quick search.
<faheem>
dialectic: I meant, the optimization stuff was a black art.
<aeth>
faheem: I know how to write numerical SBCL. Yes it takes years to master, although it always does.
<aeth>
Especially on a GCed platform
<aeth>
Maybe I should start a consulting company...
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
lawfullazy has quit [Ping timeout: 248 seconds]
Bike has quit [Quit: Lost terminal]
<aeth>
This is probably why Lisp lost to C in the era when performance mattered a lot more. That and SBCL didn't exist yet. Then again, lots of people write stuff in Java or even JavaScript now where performance matters...
<White_Flame>
I think python is the most popular language in the "numerical performance scenario with slowest language" category
<aeth>
Python cheats. It uses Fortran/C/C++ libraries
<White_Flame>
there's a LOT of native python in a lot of performance-heavy scenarios
<dialectic>
Languages didn't lose to one another, operating systems did.
<dialectic>
Although I think the meta speculation is somewhat off-topic here.
<White_Flame>
aeth: especially in distributed computing
FreeBirdLjj has quit [Ping timeout: 268 seconds]
<aeth>
White_Flame: I just enjoy when I'm bottlenecked by one core running at 100% of some (probably pure) Python script. /s
<aeth>
The source code of that script I'm not reading is probably very readable, though
keep_learning_M has quit [Quit: This computer has gone to sleep]
<aeth>
White_Flame: This came way after Lisp lost, though, which suggests it might just have been too early
<faheem>
aeth: You wrote "it always does". I'm not sure what you mean by that.
<aeth>
faheem: Learning all of the edge cases where you need to pay attention and where you don't
<faheem>
Slowless isn't a real issue with SBCL. It's fast enough. But GC weirdness can be an issue.
<faheem>
aeth: Ah. I see. So you understand all those compiler notes?
<aeth>
"All" is a strong word, you can probably stump me on one.
<faheem>
Has much changed with the GC situation since 2012/2013? I know there has been a lot of work done.
<faheem>
And many releases.
FreeBirdLjj has joined #lisp
<aeth>
I'm not sure. #sbcl probably knows. I have a fairly non-idiomatic style for performance-critical numerical code.
<faheem>
aeth: Would it be fair to say that SBCL is the way to go for performance-critical numerical work?
<faheem>
Well, still the way...
<aeth>
I've gotten fairly good at controlling when allocations happen, which requires discipline that's more than normal (but less than C++). And I can't get that same level of insight on other implementations.
<faheem>
aeth: Interesting. So this is quite manual? Do you write C++ too?
<faheem>
What is your use case?
<aeth>
SBCL gives you structs of arrays (defstructs of specialized arrays). I don't think that the struct slot type is as optimized in other implementations
<faheem>
aeth: I see. You might be aware that Tomaz Papp wrote a blog post about how he was switching from CL to Julia, citing mostly performance reasons.
<faheem>
Like I said, I don't think performance is/was an issue. GC possibly, yes.
<aeth>
It's not quite manual (unless you involve the FFI, which I sometimes do), but it does take a lot of thinking
<faheem>
aeth: Do you have some example code you could share?
<aeth>
My primary use case is a game engine
<faheem>
aeth: Ah. So very interactive.
kajo has quit [Ping timeout: 252 seconds]
<aeth>
Numerical is basically the same thing but more double-float and less single-float (so harder to avoid boxing)
rozenglass has joined #lisp
<faheem>
aeth: Yes, trying to keep things unboxed is a big thing, I recall.
<aeth>
I would never use a JIT like Julia because I prefer what you get from an AOT. You do basically have to effectively write statically typed in SBCL, though.
kajo has joined #lisp
<faheem>
AOT?
<aeth>
I guess this means there is necessarily going to be a bit of overhead because now you're pairing dynamically typed (types with the values) with static type declarations (types with the variables) in one thing
<aeth>
AOT = ahead of time
<aeth>
I heavily rely on disassemble
<faheem>
Ah. I thought the SBCL compiler *was* JIT.
<aeth>
I think method dispatch might be JITed in CL implementations
<faheem>
aeth: Sounds like you've had a lot of experience. You should write a tutorial.
<aeth>
CL is kind of this weird AOT where you frequently recompile a function
<faheem>
I'm sure many people would be interested.
<aeth>
well I have bits and pieces in places and in IRC logs
<aeth>
also quite a few failed experiments in style
lavaflow_ is now known as lavaflow
<faheem>
aeth: That does look quite elaborate. Could that be put in a library?
<aeth>
eventually, yes
CloseToZero has joined #lisp
<faheem>
aeth: Ok. But not currently?
<aeth>
define-function is almost feature complete. The complementary LET-style macro needs to be finished at some point. That's a lot more elaborate, actually. It also needs its own indentation since FLET-style macros can't really be auto-indented by SLIME properly because it doesn't know enough about their structure
<aeth>
define-function isn't really special. There are probably 5+ other macros that do something similar, the most popular being the defstar library. What it is, though, is the fanciest.
<faheem>
aeth: Sounds like it would helpful to have in its own library. Provided the documentation was there too.
<aeth>
(And defstar is GPLv3, which sort of made me make define-function as elaborate as it is, out of frustration of being forced to reinvent the wheel for my MIT-licensed game engine. If you force me to reinvent the wheel, I will, but it's going to be a better wheel.)
<aeth>
With 32-bit single-floats would be a chore to work with and I wouldn't be able to do things like use (unsigned-byte 64)s which I can use in SBCL without boxing them if I'm really careful
<faheem>
aeth: I haven't been on a 32 bit computer in years, but in 2012 I was.
<aeth>
Those issues were probably fixed a long time ago but there might be others.
<aeth>
I mostly try to run the GC when I don't care, and when using a long running loop I try to avoid creating garbage, though.
<faheem>
aeth: It is possible to avoid the GC, then? I didn't think that was an option.
<aeth>
faheem: If you avoid potentially creating garbage at certain parts of your program I don't *think* the GC will run at surprise moments, although it might. Debugging/logging/threading could break this assumption even if it's true.
<aeth>
(If I'm wrong someone will correct me, but it might take hours.)
<faheem>
aeth: I suppose just turning off the GC isn't an option?
<aeth>
I mean, it might be.
<aeth>
You can sort of turn it off by preallocating everything you can and declaring the rest dynamic extent.
<dialectic>
Running the garbage collector at well known intervals is practically equivalent to turning it off for bouts of execution.
Necktwi has quit [Ping timeout: 248 seconds]
<aeth>
I think someone here might have said once that the GC will only potentially run at moments of heap allocation? If that's true, then that's easy, you can easily detect allocations in SBCL through lots of ways.
<aeth>
Avoid allocation in a key area, and then if you're really paranoid (gc :full t) afterward
<faheem>
So basically it boils down to manually managing memory oneself.
frgo has quit [Ping timeout: 245 seconds]
<aeth>
no, having manually managed memory myself for CFFI stuff (often through the static-vectors library) that has its own pitfalls and style.
<aeth>
I mean, I guess you could even just use static-vectors for non CFFI stuff if you really wanted to manually manage those arrays
<faheem>
Ok, so not manual management then.
<aeth>
I don't think arrays of single-float/double-float/unsigned-byte/signed-byte/bit/etc. are a bit deal for the GC because afaik the GC would just be looking at the metadata at the front and then skipping the whole thing, unlike a T array, where anything could contain a pointer
<aeth>
If that's the case, then that would suggest having fewer big arrays of double-floats are a good thing to be easy on the GC. Maybe a range of a 1D array, or a row of a 2D array.
<aeth>
s/a bit deal/a big deal/
gravicappa has quit [Ping timeout: 245 seconds]
frgo has joined #lisp
<aeth>
I have a lot of ideas and hunches that would probably need confirmation from #sbcl
<aeth>
I'd use the fewer, bigger arrays anyway, though, because that would make it easier to preserve type information. e.g. (aref (aref foo 42) 2) is going to lose the information that that's a double-float and (aref foo 42 2) isn't.
<aeth>
there's not dozens of them and the data isn't the same sort of thing, structs with :type in slots work, at least in SBCL
<aeth>
s/there's/if there's/
<aeth>
(for the type information, not for the GC)
<aeth>
faheem: Anyway, I'd say it's not memory management, it's kind of half of memory management. The other half is freeing, or using a with-foo to free, or using finalizers to free, or using a cleanup method that calls other cleanup methods etc to free. And that's a ton more work.
<aeth>
Although depending on how you implement your preallocation-in-big-arrays (e.g. object pooling) it could basically be a lot more like manual memory management than that.
frgo_ has joined #lisp
frgo has quit [Ping timeout: 244 seconds]
<aeth>
All of the terrifying bugs that waste your entire day involve freeing. The allocation stuff will just slow down your code if you mess it up.
nanoz has quit [Ping timeout: 248 seconds]
v88m has quit [Ping timeout: 272 seconds]
d4ryus has quit [Quit: WeeChat 2.4]
d4ryus has joined #lisp
karswell has quit [Read error: Connection reset by peer]
keep_learning_M has joined #lisp
<faheem>
aeth: It certainly sounds like you've thought about it a lot, and know a lot.
<faheem>
You should definitely try and write up some of it. Even a rough draft would be helpful. On Github or whereever.
<faheem>
You could ask for comments/feedback. AFAIK there isn't such a thing as a performance guide for CL>
<faheem>
Though people do work in that space.
<aeth>
Oh, there are probably a dozen of us!
iovec has joined #lisp
ggole has joined #lisp
<aeth>
I think you'd get a lot of people complaining about a performance guide, though, because it's fairly necessarily SBCL-specific, although a lot of it would/could also apply to implementations like CCL and probably will never apply to implementations like CLISP and basically are impossible to apply to JSCL (a JavaScript CL attempt)
shka_ has joined #lisp
<aeth>
People love portability, although a "performance guide" really just a bunch of workarounds that might just slightly slow things down on other implementations rather than e.g. a guide to SBCL's define-vop like this https://pvk.ca/Blog/2014/08/16/how-to-define-new-intrinsics-in-sbcl/
dacoda has joined #lisp
Jeanne-Kamikaze has quit [Quit: Leaving]
_whitelogger has joined #lisp
_whitelogger has joined #lisp
seok has joined #lisp
<seok>
Does anyone have experience using caveman2?
<seok>
How is session managed in caveman2 when stored in memory, i.e, do I need to manage destruction to avoid overloading
oni-on-ion has quit [Remote host closed the connection]
<faheem>
aeth: I think if you want performance, portability would have to take a back seat. Though of course portability is desirable.
<faheem>
And if people complain about documentation they're just being silly.
<faheem>
Documentation is a big problem, across the board. For much of the free software ecosystem.
<faheem>
It can be quite frustrating, having these powerful tools and not knowing how to use them.
<faheem>
A helping hand would be much appreciated.
random-nick has joined #lisp
kajo has quit [Ping timeout: 252 seconds]
zhlyg has joined #lisp
krwq has quit [Remote host closed the connection]
hhdave has joined #lisp
manualcrank has quit [Quit: WeeChat 1.9.1]
hhdave has quit [Client Quit]
zotan has quit [Ping timeout: 252 seconds]
zotan has joined #lisp
cosimone has joined #lisp
dale has quit [Quit: My computer has gone to sleep]
iovec has quit [Quit: Connection closed for inactivity]
kenanb has joined #lisp
<kenanb>
ls
<kenanb>
sorry, wrong window :)
<drdo>
kenanb: It would be (ls) here!
dialectic has quit [Ping timeout: 258 seconds]
<LdBeth>
Traditionally we do (dir)
<no-defun-allowed>
(directory (merge-pathnames #p"*.*" pathname)) ; on SBCL at leas
<no-defun-allowed>
; s/leas/least
Inline has quit [Ping timeout: 252 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
Inline has joined #lisp
_whitelogger has joined #lisp
dddddd has joined #lisp
maxxcan has joined #lisp
elderK has quit [Quit: Connection closed for inactivity]
maxxcan has quit [Client Quit]
vaporatorius has quit [Remote host closed the connection]
hhdave has joined #lisp
hhdave has quit [Quit: hhdave]
orivej has joined #lisp
mrcom has quit [Ping timeout: 245 seconds]
papachan has joined #lisp
oni-on-ion has joined #lisp
nanoz has joined #lisp
cosimone has quit [Quit: WeeChat 2.4]
Josh_2 has joined #lisp
jmercouris has joined #lisp
<jmercouris>
hi guys, I am having a bit of a mental block here, let's say I have list like this (list 0 1 2 (my-fun 10)), how can I get the evaluated list where (my-fun 10) --> 10
<jmercouris>
in other words I would like '(0 1 2 10)
<jmercouris>
I did do (eval '(list 0 1 2 (my-fun 10)))
<Josh_2>
You don't want my-fun to evaluate?
<jmercouris>
yes, I do
<jmercouris>
I am wondering though if eval is really the way
<pjb>
jmercouris: obviously, eval is not the way. But you asked for it.
<pjb>
jmercouris: on the other hand, if you want to save both the unevaluated form and the evaluated form, perhaps eval is what you want. Unless you need access to the lexical environment, in which case a macro might be preferable.
<bzp>
hello everyone they can help me please, I need to translate this code of java to lisp
<beach>
bzp: That's a strange request.
<beach>
I guess you are not trying to learn Common Lisp.
<bzp>
try to do it in lisp but I do not manage to make to work
<beach>
In that case, show us what you have so far.
<beach>
Also, you can't be sure that people here know Java, so you need to explain what it is you want to do.
<beach>
bzp: If you want to learn Common Lisp, people here are more than willing to help, but it doesn't look like you do, so I am guessing it is unlikely that you will find someone to do this for you here.
<ck_>
bzp: I tried! Unfortunately, I failed at the first line :-( I don't know how to import java.util.* in Common Lisp
Inline has quit [Ping timeout: 252 seconds]
<_death>
here you go: (let ((a (make-array (list (read) (read))))) (map-into (make-array (reduce #'* (array-dimensions a)) :displaced-to a) #'read) (print a)) ;; HTH
scymtym has quit [Ping timeout: 258 seconds]
<LdBeth>
It seems to read input into a 2D array and print that array out
<beach>
bzp: Why do you want a Common Lisp version of this?
<beach>
bzp: Besides, _death already gave you what you want.
<bzp>
I want to learn only and see if you can do some exercises of other languages.
<beach>
You want to learn Common Lisp?
<beach>
Then I recommend a good book.
<beach>
minion: Please tell bzp about PCL.
<minion>
bzp: please look at PCL: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
jmercouris has joined #lisp
<jmercouris>
pjb: ok will do, thanks
martylake has quit [Ping timeout: 244 seconds]
lnostdal has quit [Quit: "Fascism, Nazism, Communism and Socialism are only superficial variations of the same monstrous theme—collectivism." -- Ayn Rand]
Bike has joined #lisp
kajo has quit [Ping timeout: 252 seconds]
kajo has joined #lisp
chip2n has joined #lisp
bzp has quit [Quit: Lost terminal]
grewal has joined #lisp
Josh_2 has quit [Remote host closed the connection]
Josh_2 has joined #lisp
jmercouris has quit [Ping timeout: 244 seconds]
martylake has joined #lisp
hortiel has joined #lisp
nirved has joined #lisp
igemnace has joined #lisp
igemnace has quit [Remote host closed the connection]
nirved_ has quit [Ping timeout: 252 seconds]
Arcaelyx has quit [Read error: Connection reset by peer]
Arcaelyx has joined #lisp
Arcaelyx has quit [Read error: Connection reset by peer]
martylake has quit [Ping timeout: 245 seconds]
martylake has joined #lisp
martylake_ has joined #lisp
igemnace has joined #lisp
martylake has quit [Ping timeout: 268 seconds]
Arcaelyx has joined #lisp
igemnace has quit [Remote host closed the connection]
Arcaelyx has quit [Read error: Connection reset by peer]
hortiel has quit [Ping timeout: 244 seconds]
v88m has joined #lisp
Arcaelyx has joined #lisp
Arcaelyx has quit [Read error: Connection reset by peer]
frgo_ has quit [Remote host closed the connection]
lnostdal has joined #lisp
pest-ctrl has joined #lisp
igemnace has joined #lisp
Arcaelyx has joined #lisp
Josh_2 has quit [Read error: Connection reset by peer]
jmercouris has joined #lisp
donotturnoff has joined #lisp
frgo has joined #lisp
jmercouris has quit [Ping timeout: 248 seconds]
CloseToZero has quit [Ping timeout: 245 seconds]
linli has joined #lisp
linli has quit [Remote host closed the connection]
CloseToZero has joined #lisp
igemnace has quit [Remote host closed the connection]
frgo has quit [Ping timeout: 245 seconds]
cosimone has quit [Quit: WeeChat 2.4]
manualcrank has joined #lisp
igemnace has joined #lisp
akoana has joined #lisp
Inline has joined #lisp
papachan has quit [Quit: Leaving]
scymtym has quit [Ping timeout: 252 seconds]
martylake_ has quit [Ping timeout: 272 seconds]
dacoda has quit [Ping timeout: 252 seconds]
frgo has joined #lisp
frgo has quit [Ping timeout: 258 seconds]
martylake has joined #lisp
igemnace has quit [Remote host closed the connection]
nanozz has joined #lisp
lnostdal has quit [Quit: "Fascism, Nazism, Communism and Socialism are only superficial variations of the same monstrous theme—collectivism." -- Ayn Rand]
nanoz has quit [Ping timeout: 258 seconds]
varjag has joined #lisp
fckit has joined #lisp
nanozz has quit [Ping timeout: 245 seconds]
frgo has joined #lisp
frgo has quit [Ping timeout: 272 seconds]
ggole has quit [Quit: Leaving]
Bike has quit [Quit: Lost terminal]
igemnace has joined #lisp
CloseToZero has quit [Quit: WeeChat 2.5]
frgo has joined #lisp
krwq has joined #lisp
frgo has quit [Ping timeout: 268 seconds]
mrcom has joined #lisp
lnostdal has joined #lisp
frgo has joined #lisp
frgo has quit [Ping timeout: 245 seconds]
moei has quit [Ping timeout: 244 seconds]
cosimone has joined #lisp
moei has joined #lisp
<fiddlerwoaroof>
Hi, everyone
<fiddlerwoaroof>
j
<seok>
hello
cosimone has quit [Quit: WeeChat 2.4]
nicdev has quit [Ping timeout: 245 seconds]
frgo has joined #lisp
nicdev has joined #lisp
frgo has quit [Ping timeout: 258 seconds]
hdasch has joined #lisp
<shka_>
good evening
<shka_>
is it possible in asdf to ask to compile every file in the project as one compilation unit?
vlatkoB has quit [Remote host closed the connection]
<p_l>
don't recall such function, but it could be possible to write something that makes it happen? a new kind of file which is interpreted to be concatenated from several others...
dale has joined #lisp
<p_l>
there's a problem that the only way to force single compilation unit iirc is to make it a single CL:COMPILE input
josemanuel has joined #lisp
<shka_>
p_l: i don't think that this is true, standard explicitly states that compile-file works by wrapping input in with-compilation-unit (:override nil)
<shka_>
therefore, it should be possible to compile-file in loop while in with-compilation-unit
donotturnoff has quit [Ping timeout: 244 seconds]
<shka_>
since :override is nil, it should use the outer compilation unit
<shka_>
unless i don't understand this correctly
<shka_>
which is possible
<p_l>
ah, mixed another issue that also involves it
<p_l>
shka_: still, you will probably need to either modify existing ASDF compile-op, or implement your own as different file-type and inside of it call compile including with-compilation-unit
<p_l>
unless someone already did the former when I wasn't looking
notzmv has quit [Ping timeout: 258 seconds]
<shka_>
p_l: it turns out that asdf has feature that allows to solve this
slyrus_ has joined #lisp
<shka_>
:around-compile namely
<shka_>
this can be also used to bind *readtable* and stuff
<shka_>
fascinating
slyrus__ has quit [Ping timeout: 245 seconds]
<p_l>
very interesting. I thought of various extensions one can use to implement their own compile-op, but I see there's some arguments already...
frgo has joined #lisp
<shka_>
Well, this *feels* like the right solution.
frgo has quit [Ping timeout: 245 seconds]
dialectic has joined #lisp
v88m has quit [Ping timeout: 244 seconds]
t58 has joined #lisp
v88m has joined #lisp
<shka_>
p_l: well, scratch that, this does not seem to have any effect
fckit has quit [Ping timeout: 272 seconds]
<p_l>
shka_: make an :around method to check?
<shka_>
p_l: not sure what do you mean
<p_l>
I was thinking if it would be possible to make an :around method around compile-op or something to verify what's getting passed, but now I realize it won't guarantee anything since I don't see a way to check for compilation unit
<shka_>
well, i see what happens in the assembly result
cosimone has joined #lisp
Arcaelyx has quit [Ping timeout: 268 seconds]
<shka_>
on the other hand, it may actually work
frgo has joined #lisp
cosimone has quit [Quit: WeeChat 2.4]
chip2n has quit [Remote host closed the connection]
<shka_>
yeah, it is sbcl thing
frgo has quit [Ping timeout: 246 seconds]
<shka_>
it will use local call convention only in the block
<shka_>
and compiliation unit is not important in that regard
nydel has quit [Ping timeout: 258 seconds]
ramus has quit [Ping timeout: 258 seconds]
ramus has joined #lisp
cosimone has joined #lisp
fortitude has quit [Remote host closed the connection]
random-nick has quit [Read error: Connection reset by peer]
t58 has quit [Quit: Leaving]
garbochock has joined #lisp
<garbochock>
new lisper (and programmer altogether) here. Currently reading 'a gentle introduction to symbolic computation' - which is a great resource for learning the basics of lisp. Looking at 'the little schemer' for further reading. My question is - where do one continue studying in order to learn how to write useful programs in lisp?
<dialectic>
Practical Common Lisp
<garbochock>
thanks. Might I ask, how did you get introduced to the language?
<garbochock>
But yes, seems a healthy read
<dialectic>
I think it was the Paul Graham articles.
<garbochock>
right hear a lot of people speaking of those
<dialectic>
His books were pretty good.
cosimone has quit [Quit: WeeChat 2.4]
<dialectic>
I wouldn't read the little schemer. It's basically a book for teaching you how to think recursively.
<dialectic>
It is somewhat idiosyncratic to Scheme.
<dialectic>
It does not teach you any of the interesting parts of Lisp, either: symbols, heterogeneous lists and property lists, macros, the object system, any of the sophisticated control structures in Lisp or the conveniences (like keyword arguments, rest arguments, #'APPLY . . .)
cosimone has joined #lisp
<garbochock>
really? My impression was that it was fairly generic - and as such could be easily applied to common lisp
<garbochock>
I could benifit from having a greater grasp on recursion
<moldybits>
it's good for recursion, iirc
<garbochock>
alright!
<dialectic>
Then you'll probably benefit from that book. I don't often reach for recursion but of course it is indispensible when I ned it.
<garbochock>
what do you use lisp for?
<dialectic>
I'm writing a compiler. I needed the dynamic type system and garbage collection so I wouldn't give myself a headache. I needed the macros so I could properly abstract over repeated patterns.
<dialectic>
I also needed the symbols so I wouldn't have to write string interning myself.
<dialectic>
...although I am starting to wonder if I needed the string interning.
<p_l>
at least getting your own non-interning READ is somewhat easy
frgo has joined #lisp
<dialectic>
garbochock: Let me show you a little macro I wrote the other day for lexing operator string sequences in source code. It isn't particularly good style and I take some liberties because it's only used in one place (I assume a free variable, I'm rather ad-hoc about the data structure, etc...) but it should be instructive anyway. And it's recursive.
<dialectic>
grrr hastebin.com is down again
<garbochock>
Please do. It might fly over my head honestly but im curiousn about individual user cases of lisp so it's greatly appreciated
<garbochock>
a dang
frgo has quit [Ping timeout: 245 seconds]
<garbochock>
fyi I'm a 27yo 2nd semester compsci student with little background in the field prior - i'm very much fumbling in the dark
<dialectic>
ok check this out and hold on to your butt
<dialectic>
ctrl-f "lex-operators". What I'm saying in that call is "every (string sym) pair should parse string and return sym". So if "..." appears in a source code file, that returns the token ELLIPSIS
<dialectic>
What that macro does, pay attention, is it takes that list of pairs (anyone else in here, please don't correct me that those aren't really "pairs"), and it sorts them lexicographically. Then it builds a finite state machine out of those strings.
moei has quit [Quit: Leaving...]
<dialectic>
It takes the state machine - this is all happening at compile time! - and it recurses over it, building up the case-switch code that I've pasted at the end, peeking at the next char and advancing when necessary.
<dialectic>
You could use a regular expression... but this should show you how libraries like cl-ppcre do this very task
orivej has quit [Ping timeout: 268 seconds]
<dialectic>
You can't do this with a scheme "syntax-rules" btw. But you can do it with the various nonportable macro facilities in each scheme implementation.
krid has quit [Remote host closed the connection]
<garbochock>
held on to my butt - can't find it anymore
<dialectic>
if you can't read that code, don't worry, after seeing that again for the first time in two weeks I can't read it either. Only slightly kidding.
<dialectic>
If I had intended to share it then I would have documented what I am doing.
<garbochock>
haha. No it's just over my level of understanding of the language. Seriously appreciated though - I need study material, and I need to look at code written by people knowing the language better than me
v0|d has joined #lisp
<dialectic>
Reading and writing are both important. On Lisp is a very inspiring book. Same with Let Over Lambda
makomo has joined #lisp
<dialectic>
Basically if you keep using Lisp, you should read Practical Common Lisp -> Let Over Lambda or On Lisp or both.
<garbochock>
writing down. Let over lambda I've heard good things about
<garbochock>
anyway thanks. turn in time for me - maybe see you around in the channel another point. night!
Lycurgus has joined #lisp
garbochock has quit [Ping timeout: 248 seconds]
frgo has joined #lisp
ym555 has joined #lisp
ym555 has quit [Client Quit]
dialectic has quit [Ping timeout: 246 seconds]
frgo has quit [Ping timeout: 268 seconds]
<makomo>
how come clsql's insert-records doesn't support inserting multiple records at once :(
dialectic has joined #lisp
<dialectic>
Ok, I haven't tested this yet, but I need some opinions: is string interning worth it for a well organized symbol table? I thought I'd get cheap string tests out of it but I'm wondering if the overhead for interning strings makes it come out the same.
makomo has quit [Read error: Connection reset by peer]
makomo has joined #lisp
<aeth>
Hmm, Ryzen 3000 is coming out tomorrow. It sure would be nice if a 12 core computer (the most in tomorrow's launch, but not overall) would actually be a substantial improvement in CL compilation times over a 4 core computer.
<aeth>
One of those rare moments where I'm jealous of C++ programmers.
cosimone has quit [Quit: WeeChat 2.4]
<dialectic>
On the other hand, C++ creates a lot of unnecessary compilation work for itself.
<aeth>
Absolutely, especially header files.
<dialectic>
Plus the whole bestiary of new features every few years. I would hate to be a maintainer for GCC or Clang.
<aeth>
Still, we should start a gofundme to send out as many Ryzen 9 3950X (coming out in September) to as many people involved in CL build processes and CL compilers. Only $749. https://en.wikipedia.org/wiki/Ryzen#Zen_2_microarchitecture
<aeth>
Just a subtle hint to multithread things :-p
<aeth>
"Here's 16 cores that don't speed up your compilation times!"
<dialectic>
Compilers are hard to parallelize, aren't they?
<dialectic>
You can't run the passes concurrently
<Petit_Dejeuner>
If you're compiling several files that don't rely on each other.
<aeth>
Petit_Dejeuner: right
<aeth>
Not every compiler is thread safe afaik, which is why the last attempt to parallelize ASDF does heavyweight forking insetad of lightweight threads. Although they might have improved since then.
<Petit_Dejeuner>
Wasn't someone on here talking earlier about how SBCL uses fork or something?
<aeth>
no, that was POIU
<Petit_Dejeuner>
ah
<aeth>
or whatever that was
<aeth>
I think that was because of how SBCL used to work, though
<Petit_Dejeuner>
Side not, I feel like I'm losing my mind. I used to be apple to SBCL and SLIME working perfectly on any machine with little to no effort, but not it feels like the REPL is always broken for some reason.
<Petit_Dejeuner>
able*
<dialectic>
As one of the poor people using the SLIME package for Atom, I have never had a bug free environment
<dialectic>
I should submit a patch someday
frgo has joined #lisp
frgo has quit [Ping timeout: 268 seconds]
xkapastel has joined #lisp
dddddd has quit [Remote host closed the connection]
dacoda has quit [Remote host closed the connection]