space_otter has quit [Remote host closed the connection]
prince1 has joined #lisp
bitmapper has joined #lisp
prince1 has quit [Ping timeout: 265 seconds]
buffergn0me has joined #lisp
buffergn0me has quit [Ping timeout: 256 seconds]
geirt has joined #lisp
peterhil` has quit [Quit: Must not waste too much time here...]
margeas has joined #lisp
geirt has left #lisp [#lisp]
markong has quit [Ping timeout: 260 seconds]
KDr21 has quit [Ping timeout: 255 seconds]
hiroaki has quit [Ping timeout: 272 seconds]
frgo_ has quit [Remote host closed the connection]
X-Scale has quit [Ping timeout: 240 seconds]
frgo has joined #lisp
X-Scale` has joined #lisp
X-Scale` is now known as X-Scale
peterhil has joined #lisp
markoong has joined #lisp
margeas has quit [Ping timeout: 240 seconds]
markoong has quit [Ping timeout: 255 seconds]
oxum has joined #lisp
ljavorsk_ has quit [Ping timeout: 260 seconds]
ebzzry has joined #lisp
KDr21 has joined #lisp
elderK has joined #lisp
<elderK>
Happy Sunday, everyone.
<minion>
elderK, memo from phoe: there also exist package-local nicknames that aid one with defining functionalities in multiple packages. You can use names like A:OFFSET, F:OFFSET, S:OFFSET, even if the packages are named e.g. FROB.ACCESSIBILITY, FROB.FUNCTIONALITY, FROB.SECURITY - PLNs do the translation.
<elderK>
phoe: Are package local nicknames widespread yet? I remember them being an implementation extension.
iAmDecim has quit [Ping timeout: 260 seconds]
gko_ has joined #lisp
notzmv has quit [Remote host closed the connection]
<aeth>
They're sufficiently widespread now
notzmv has joined #lisp
notzmv is now known as Guest68602
KDr21 has quit [Ping timeout: 265 seconds]
oxum has quit [Ping timeout: 260 seconds]
ebzzry has quit [Ping timeout: 256 seconds]
Guest68602 is now known as notzmv
buffergn0me has joined #lisp
cmatei has quit [Ping timeout: 240 seconds]
iAmDecim has joined #lisp
iAmDecim has quit [Ping timeout: 265 seconds]
bitmapper has quit [Ping timeout: 240 seconds]
prince1 has joined #lisp
caltelt has joined #lisp
prince1 has quit [Ping timeout: 255 seconds]
KDr21 has joined #lisp
EvW1 has quit [Ping timeout: 240 seconds]
zulu_inuoe has joined #lisp
KDr21 has quit [Ping timeout: 265 seconds]
KDr21 has joined #lisp
cods has quit [Ping timeout: 260 seconds]
iAmDecim has joined #lisp
iAmDecim has quit [Ping timeout: 240 seconds]
semz has quit [Ping timeout: 240 seconds]
ebzzry has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
semz has joined #lisp
semz has quit [Changing host]
semz has joined #lisp
cmatei has joined #lisp
KDr21 has quit [Ping timeout: 265 seconds]
nitrix has left #lisp ["Leaving"]
zulu_inuoe has quit [Ping timeout: 255 seconds]
caltelt has quit [Ping timeout: 255 seconds]
caltelt has joined #lisp
space_otter has joined #lisp
Oladon1 has joined #lisp
Oladon1 has quit [Read error: Connection reset by peer]
PuercoPope has joined #lisp
elderK has quit [Ping timeout: 255 seconds]
ebzzry has joined #lisp
Necktwi_ has quit [Quit: leaving]
Necktwi has joined #lisp
prince1 has joined #lisp
prince1 has quit [Ping timeout: 255 seconds]
shadowswalker has joined #lisp
peterhil has quit [Quit: Must not waste too much time here...]
peterhil has joined #lisp
Josh_2 has quit [Ping timeout: 268 seconds]
shadowswalker has quit [Ping timeout: 255 seconds]
shadowswalker has joined #lisp
<beach>
Good morning everyone!
wxie has joined #lisp
theruran has quit [Quit: Connection closed for inactivity]
lottaquestions has joined #lisp
lottaquestions_ has quit [Read error: Connection reset by peer]
harshrc has quit [Ping timeout: 260 seconds]
wxie has quit [Ping timeout: 255 seconds]
buffergn0me has quit [Ping timeout: 240 seconds]
iamFIREcracker has quit [Ping timeout: 256 seconds]
wxie has joined #lisp
akoana has joined #lisp
akoana has left #lisp [#lisp]
akoana has joined #lisp
iAmDecim has joined #lisp
zulu_inuoe has joined #lisp
caltelt has quit [Ping timeout: 258 seconds]
iAmDecim has quit [Ping timeout: 256 seconds]
gravicappa has joined #lisp
zulu_inuoe has quit [Ping timeout: 240 seconds]
torbo has joined #lisp
rwcom has quit [Ping timeout: 265 seconds]
vlatkoB has joined #lisp
EvW has joined #lisp
_whitelogger has joined #lisp
rwcom has joined #lisp
ebzzry has joined #lisp
prince1 has joined #lisp
rwcom has quit [Ping timeout: 258 seconds]
prince1 has quit [Ping timeout: 255 seconds]
gravicappa has quit [Ping timeout: 256 seconds]
_whitelogger has joined #lisp
Lycurgus has joined #lisp
ebzzry has quit [Ping timeout: 240 seconds]
wxie has quit [Remote host closed the connection]
wxie has joined #lisp
ebzzry has joined #lisp
shadowswalker has quit [Ping timeout: 256 seconds]
Nikotiini has quit [Ping timeout: 258 seconds]
luckless has quit [Quit: Leaving]
luckless has joined #lisp
Nikotiini has joined #lisp
lavaflow has quit [Quit: WeeChat 2.7]
davsebamse has joined #lisp
davsebam1e has quit [Ping timeout: 256 seconds]
space_otter has quit [Remote host closed the connection]
space_otter has joined #lisp
torbo has quit [Remote host closed the connection]
Bike has quit [Quit: Lost terminal]
Bourne has joined #lisp
v88m has quit [Ping timeout: 240 seconds]
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 258 seconds]
Lord_of_Life_ is now known as Lord_of_Life
_whitelogger has joined #lisp
v88m has joined #lisp
dale has quit [Quit: My computer has gone to sleep]
prince1 has joined #lisp
ravenx has joined #lisp
TanKian has joined #lisp
rippa has joined #lisp
oxum has joined #lisp
prince1 has quit [Ping timeout: 258 seconds]
TanKian has quit [Read error: Connection reset by peer]
TanKian has joined #lisp
oxum has quit [Ping timeout: 265 seconds]
_whitelogger has joined #lisp
TanKian has quit [Read error: Connection reset by peer]
narimiran has joined #lisp
vlatkoB_ has joined #lisp
Bourne has quit [Remote host closed the connection]
vlatkoB has quit [Ping timeout: 240 seconds]
Bourne has joined #lisp
iamFIREcracker has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
TanKian has joined #lisp
KDr21 has joined #lisp
iAmDecim has joined #lisp
iAmDecim has quit [Ping timeout: 268 seconds]
_whitelogger has joined #lisp
srji has quit [Ping timeout: 265 seconds]
srji has joined #lisp
Lycurgus has quit [Quit: Exeunt]
drl has quit [Quit: Ex-Chat]
prince1 has joined #lisp
TanKian has quit [Quit: TanKian]
TanKian has joined #lisp
prince1 has quit [Ping timeout: 256 seconds]
TanKian_ has joined #lisp
TanKian has quit [Ping timeout: 255 seconds]
TanKian_ is now known as TanKian
jeosol has quit [*.net *.split]
shka_ has joined #lisp
TanKian has quit [Ping timeout: 255 seconds]
ebzzry has joined #lisp
<lukego>
Is there a stable imgui binding for Lisp?
TanKian has joined #lisp
<lukego>
(Or something similar i.e. low-tech way to splash interactive graphics on the screen)
rj0d has joined #lisp
rj0d has quit [Read error: Connection reset by peer]
* Shinmera
is once again depressed he can't recommend Alloy yet
rj0d has joined #lisp
rj0d has quit [Remote host closed the connection]
shifty has joined #lisp
rj0d has joined #lisp
rj0d has quit [Remote host closed the connection]
jmercouris has quit [Remote host closed the connection]
<pjb>
lukego: imgui and stable? imgui.hUnicode: Changelog, comments, minimum CI integration. (#2541, #2538, #…5 days ago
<no-defun-allowed>
Some implementations like SBCL and Clozure have synchronised hash tables, but some don't and need you to bring your own lock. Is there a wrapper library that has a clone of the CL hash table protocol, but ensures everything is synchronised?
rj0d has joined #lisp
vap1 has joined #lisp
Inline has joined #lisp
vaporatorius has quit [Ping timeout: 265 seconds]
TanKian has joined #lisp
cods has joined #lisp
cods has quit [Changing host]
cods has joined #lisp
TanKian_ has joined #lisp
TanKian has quit [Ping timeout: 260 seconds]
TanKian_ is now known as TanKian
<_death>
lukego: I've been working on imgui+ecl thing, but it's not public (yet?) .. https://adeht.org/dump/vids.html has some videos
iAmDecim has joined #lisp
<lukego>
borodust: Hey I'm trying to run bodge-nuklear examples but first thing that happens is "Unhandled memory fault at #x0" on the %glfw:create-window call in nuklear.example:run. any troubleshooting tip?
TanKian has quit [Quit: TanKian]
* lukego
checks his opengl install
iAmDecim has quit [Ping timeout: 240 seconds]
_jrjsmrtn has joined #lisp
__jrjsmrtn__ has quit [Ping timeout: 255 seconds]
scymtym has quit [Remote host closed the connection]
space_otter has quit [Remote host closed the connection]
ggole has joined #lisp
KDr21 has quit [Ping timeout: 256 seconds]
Bourne has quit [Ping timeout: 265 seconds]
prince1 has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
prince1 has quit [Ping timeout: 240 seconds]
<phoe>
lukego: you might want to ask on #lispgames
<lukego>
phoe: Thanks. Looks like I'll run out of time for the moment. I'm fighting with nix to get all my stuff onto the latest and greatest in case it's some opengl issue that's been fixed.
<lukego>
oh hey it works! Just as I have to leave the keys. Cool. Just some opengl gremlins hopefully now pinned down by nix.
iAmDecim has joined #lisp
_paul0 has joined #lisp
iAmDecim has quit [Ping timeout: 258 seconds]
paul0 has quit [Ping timeout: 272 seconds]
ebzzry has joined #lisp
scymtym has joined #lisp
iAmDecim has joined #lisp
_paul0 has left #lisp [#lisp]
markoong has quit [Ping timeout: 258 seconds]
oxum has joined #lisp
markong has joined #lisp
orivej has quit [Ping timeout: 265 seconds]
bitmapper has joined #lisp
iamFIREcracker has quit [Ping timeout: 258 seconds]
seok has joined #lisp
<seok>
how would I download m3u8 videos?
<seok>
anyone got an idea
<borodust>
hello lukego: do you use bodge-nuklear from main quicklisp dist or from bodge dist?
<borodust>
lukego: ah, nvm, looks like you figured it out; feel free to ping me anytime you have problems with bodge stuff
notzmv has quit [Ping timeout: 260 seconds]
akoana has left #lisp ["Leaving"]
oxum has quit [Remote host closed the connection]
<phoe>
seok: that doesn't really sound Lisp-specific
<seok>
yeah, it is a method of streaming videos on the web
<seok>
I'm not sure of its architecture tho
<MichaelRaskin>
It does not look like there is a suitable Common Lisp library, and details of wrapping youtube-dl are probably offtopic here
gabba has joined #lisp
<seok>
does youtube use m3u8?
v88m has quit [Ping timeout: 260 seconds]
<phoe>
it isn't YouTube
<phoe>
YT uses much more complex formats for that; see youtube-dl for source code for that
<seok>
I'm trying to save lecture videos off my uni, VLC player seems to work somewhat but was wondering how I would do it programatically
<phoe>
if you wanted to do that in Lisp, you could possibly translate some other code that works with m3u8 playlists - I found https://github.com/denex/hls-downloader
<phoe>
that is, after a while of googling
gabba has left #lisp [#lisp]
oxum has joined #lisp
<seok>
Oh nice
<seok>
I wasn't able to find that
caltelt has joined #lisp
trittweiler_ has joined #lisp
<seok>
did you search for HLS?
<seok>
I'll try that one
oxum has quit [Remote host closed the connection]
<phoe>
I tried for "m3u8 download"
<seok>
what
oxum has joined #lisp
<seok>
That's what i've been searching
varjag has joined #lisp
caltelt has quit [Ping timeout: 260 seconds]
oxum has quit [Remote host closed the connection]
rj0d has quit [Remote host closed the connection]
hiroaki has joined #lisp
oxum has joined #lisp
nowhere_man has joined #lisp
Bike has joined #lisp
nowhere_man has quit [Ping timeout: 272 seconds]
caltelt has joined #lisp
bitmapper has quit []
ljavorsk has joined #lisp
prince1 has joined #lisp
prince1 has quit [Ping timeout: 240 seconds]
jmercouris has joined #lisp
random-nick has joined #lisp
thodg has joined #lisp
_whitelogger has joined #lisp
EvW1 has joined #lisp
v88m has joined #lisp
trittweiler_ has left #lisp [#lisp]
rm34D has joined #lisp
rm34D has quit [Remote host closed the connection]
caltelt has quit [Ping timeout: 265 seconds]
<jmercouris>
would you say the length of files in a lisp program should be limited?
<jmercouris>
are smaller files preferred?
gravicappa has joined #lisp
<Shinmera>
I prefer smaller files.
<Shinmera>
But other people clearly don't.
<_death>
my recent projects are one or a few big files each
varjag has quit [Ping timeout: 256 seconds]
<jmercouris>
I used to be a small file person, but I've been moving slowly to big files
<jmercouris>
when I can just jump to any defun I need, I think it is a bit easier to reason about than jumping between files
<edgar-rft>
jmercouris: yes, a file shold not be longer than a few million lines
dddddd has joined #lisp
<jmercouris>
11
lucasb has joined #lisp
<edgar-rft>
I think it's also no good idea to have files that are bigger than your harddisk
<jmercouris>
no, that's fine
<jmercouris>
you just stream them
<edgar-rft>
what's with files where the Lisp read-time is longer than a human lifespan?
<jmercouris>
Shinmera: how does deploy actually under the hood manage shared libraries
<Shinmera>
the source is there to read?
<jmercouris>
Shinmera: let's say I make an app bundle, and it figures out, OK, I need these dylibs, what does it do to the cffi load path or whatever?
<jmercouris>
Shinmera: The source is there to read
<Shinmera>
it just loads the libs with an explicit path
<jmercouris>
and when you move this program around your filesystem?
<Shinmera>
since it knows where they'll be relative to the directory.
<Shinmera>
*relative to the executable
<jmercouris>
that's what I'm saying, what about moving the executable around
<jmercouris>
suddenly the path is different
<Shinmera>
the paths are constructed relative to the executable, so
<jmercouris>
so, it breaks then
<Shinmera>
no?
<jmercouris>
the executable could be moved anywhere on disk
<jmercouris>
Oh, ok I see
<Shinmera>
well yeah if you move it away from the rest of the directory things break
<jmercouris>
you meant to say that the paths are in the app bundle still
<Shinmera>
I don't know what that means so I don't know if I meant to say that.
<jmercouris>
fair enough, but if what you said above is true, that is what you meant to say
<jmercouris>
in any case, I get it
Lycurgus has joined #lisp
nowhere_man has joined #lisp
lottaquestions has quit [Ping timeout: 256 seconds]
Lycurgus has quit [Quit: Exeunt]
lottaquestions has joined #lisp
slyrus has joined #lisp
nowhereman has joined #lisp
nowhere_man has quit [Ping timeout: 272 seconds]
markong has quit [Ping timeout: 260 seconds]
markong has joined #lisp
zaquest has quit [Quit: Leaving]
zaquest has joined #lisp
devrtz has quit [Ping timeout: 256 seconds]
devrtz has joined #lisp
terpri has quit [Remote host closed the connection]
terpri has joined #lisp
ggole has quit [Remote host closed the connection]
ggole has joined #lisp
notzmv has joined #lisp
jmercouris has quit [Remote host closed the connection]
prince1 has joined #lisp
shifty has quit [Ping timeout: 240 seconds]
prince1 has quit [Ping timeout: 260 seconds]
JohnnyL has joined #lisp
margeas has joined #lisp
EvW1 has quit [Ping timeout: 240 seconds]
markoong has joined #lisp
markong has quit [Ping timeout: 258 seconds]
loli has quit [Quit: WeeChat 2.7.1]
refpga has joined #lisp
loli has joined #lisp
margeas has quit [Ping timeout: 265 seconds]
efm has quit [Ping timeout: 265 seconds]
orivej has joined #lisp
efm has joined #lisp
nowhereman has quit [Ping timeout: 256 seconds]
ebrasca has joined #lisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #lisp
ebrasca has quit [Remote host closed the connection]
markong has joined #lisp
JohnnyL has quit [Quit: leaving]
markoong has quit [Ping timeout: 240 seconds]
<markasoftware>
Does common lisp have a mechanism for dynamically binding the function slot? Like `cl-letf` or `flet` in Emacs.
<MichaelRaskin>
flet or labels
<beach>
MichaelRaskin: That would be lexical.
orivej has quit [Ping timeout: 260 seconds]
<beach>
Not dynamic.
<markasoftware>
I know let can be both dynamic or lexical depending on "special", but I think flet is always lexical
<MichaelRaskin>
Oh, Emacs flet is dynamic? Oops, my bad
<markasoftware>
There's a function I use that I want people to be able to override if they don't like my default definition of it, and I don't want to add it as an optional argument to every other function that uses it.
<MichaelRaskin>
Well, you can funcall a special variable
<markasoftware>
yeah, that's my current plan
<beach>
Or, you can create yourself a macro that saves the old definition, installs a new one, executes some code, and then re-installs the old one.
<beach>
Don't forget the unwind-protect, though.
zulu_inuoe has joined #lisp
ebrasca has joined #lisp
Lord_of_Life has quit [Read error: Connection reset by peer]
<pjb>
minion: memo for jmercouris: the size of source files and their arrangement doesn't matter: just write an emacs command to fetch and save toplevel forms automatically in any organization you like and forget it! Don't visit lisp file, visit lisp toplevel forms!
<minion>
Remembered. I'll tell jmercouris when he/she/it next speaks.
seok has quit [Remote host closed the connection]
vms14 has joined #lisp
jeosol has joined #lisp
<vms14>
there is a way to use remove-if with a function that accepts two elements and pass one element that would be the same in all calls instead of wrapping it with a lambda?
<semz>
I don't think there is. Why is a lambda not acceptable?
<vms14>
yeah, I've realized It's too lazy stuff for abstracting that
<vms14>
but wondered if there was a way, like a similar function that would do
bitmappe_ has joined #lisp
zulu_inuoe_ has joined #lisp
<_death>
lambda is fine.. there's also alexandria:curry/rcurry
ljavorsk has joined #lisp
seok has joined #lisp
zulu_inuoe has quit [Ping timeout: 260 seconds]
<seok>
I'm reading an article on early lisp, and there is a line about it being easier to write a new language than a library
<seok>
I don't really understand this, and I feel like I'm missing out on a huge feature of lisp, what can I read to really understand this concept?
<seok>
From my understanding it probably has something to do with what makes macros so great
<seok>
But I still don't get it
<markasoftware>
seok: i think early lispers vastly overestimated the utility of macros
<markasoftware>
that's why today's most popular dynamic languages don't have good ones
<markasoftware>
buuuut there are lots of situations where a mini-language is very useful
<seok>
So are macros not as good as lisp advocates say they are?
<markasoftware>
yo umight want to read some of SICP, structure and interpretation of computer programs. I believe they implement lots of mini-languages in there
<seok>
For me I really didn't get how macros were so significant other than saving a few lines of code trying to write a function
<seok>
Wow, 883 pages
<seok>
That's a read
<markasoftware>
lol yeah i haven't read much of it
<seok>
Thanks I'll check that out
<markasoftware>
it's considered one of the best books abotu programming in general
<markasoftware>
let's take an example: yo uwant to write a program that can simulate electric circuits
<markasoftware>
how do you want to specify the electric circuit to the program? Realistically, you'd probably import a schematic file from a CAD program or something, but let's try to make it more elegant than that
<markasoftware>
In Java or C or another static language, you'd do somethin glike this:
<markasoftware>
Diode d2 = new Diode();
<markasoftware>
d2.connectAnodeTo(r1);
<markasoftware>
Resistor r1 = new Resistor();
<seok>
Yup
<markasoftware>
etc etc, it's quite verbose
<aeth>
seok: Macro-driven APIs allow you to do a lot of things at compile time that otherwise would be done at runtime with the equivalent API, so it changes a lot of things. The macro call (foo ((a b c) (d e f))) is roughly equivalent to the function call (foo '((a b c) (d e f))) but with the latter, all of the fanciness you're doing in that macro has to be done at runtime.
<aeth>
So, essentially, you never have to let efficiency decisions due to language limitations drive your API design.
nowhereman has joined #lisp
<seok>
Hm
<markasoftware>
With lisp you could design your own language to input the circuit schematic
<seok>
but even in static languages
<seok>
it's going to be more verbose
<aeth>
In practice, what that means is probably string generation for some target language, like HTML. But really there are a dozen or more such languages you might want to target (e.g. SQL). Instead of having string templates, you can have s-expression versions of that language, since it's going to (mostly) be done at compile time if properly designed.
<seok>
but if you don't want to evaluate the variables at runtime
<seok>
you can let those variables a b c d e f hold pseudo-pointers only, not the object
<markasoftware>
like
<markasoftware>
(resistor r2 250-ohms)
<markasoftware>
(resistor r1 5k-ohms)
<markasoftware>
(diode d1 :anode r1 :cathode r2)
<seok>
for instance you could have a hash/dictionary with the keys and objects
<seok>
and pass the keys only
<aeth>
e.g. (:html (:head ...) (:body (:p ...))) with no variable input can be transformed directly into a literal string of HTML, and with some variable input could be turned into a literal FORMAT string with one input without much of a performance loss. Etc.
<aeth>
Even if your Java program expresses HTML as objects or whatever, you're going to have a performance loss at the ToString() runtime call
<markasoftware>
You might want to take a look at parenscript for an example of what aeth is saying; it can transpile lisp code to javascript at compile-time
<seok>
Yes, I do use a lot of those web related libraries
ljavorsk has quit [Ping timeout: 255 seconds]
<seok>
so are advantages of macros in the syntax and performance?
Ven`` has joined #lisp
<seok>
From my understanding macros provide freedom in the syntax over other languages, but not functionality
<aeth>
In Common Lisp, you control exactly at which stage something executes, and exactly how it looks like.
<aeth>
In C++, you can control which stage something executes at, but not very easily, and not with essentially the same language as the runtime language with no modifications at all.
<aeth>
(And not controlling its appearance.)
<aeth>
And in most languages, you don't even have that freedom.
<seok>
Yeah
<vms14>
seok: the thing is symbols and lists are a very common and easy to use stuff in lisp
<seok>
Now I know that,
<aeth>
Now, it's not all DEFMACRO. There are a few other things at play like EVAL-WHEN, reader macros (sort of like C preprocessor macros), read-eval (i.e. #.(foo)) etc. that let you do that in combination
<vms14>
and languages have usually atoms, tokens and alike
<seok>
Is it wrong to not use such freedom when coding in lisp?
<seok>
IE, are you more productive in coding when you create the syntax for your goal?
<vms14>
I'm just doing some pseudocode language stuff to practice and found is very tied to lisp if you use simbols and the sentence is a list
<vms14>
lispers would kill me for having globals without earmuffs :D
<seok>
:D
<Odin->
That's something that makes it easy for you to shoot yourself in your foot, but feel free to do so if you particularly want.
bitmappe_ has quit []
<Odin->
Lisp is absolutely full of good ways to shoot yourself in the foot.
bitmapper has joined #lisp
<vms14>
Odin-: yes I know, I tend to use earmuffs, but wanted "name" be a list of names
cosimone has joined #lisp
<vms14>
so (is word name) would work
<vms14>
(is word verb) and same for adjectives or alike
<seok>
interesting
<vms14>
and I don't have to change the function "is" for new types
<aeth>
seok: As far as functionality in macros, you can just call a third party interpreter/compiler or write ASM if your implementation exposes it (or, I guess, portably if you care to)... so any line of code can do literally anything at any time, assuming that you only have the context of that one line of code. It's a bit natural that other languages would give this up, since it makes things easier for tools.
<vms14>
(defun is (word what-is) (car (member word what-is)))
Lord_of_Life_ has joined #lisp
<aeth>
As long as you write a CL-reader-compatible parser algorithm, you can basically run any language within CL (that's more of a reader macro thing than a macro thing, though)
<Odin->
seok: In theory, any programming language can provide any desired functionality. At least if the Church-Turing thesis is indeed true.
<seok>
Yes
<Odin->
I wouldn't want to build a large system in Brainfuck, though.
<aeth>
The worst case scenario for regular macros is probably LOOP, which has a bunch of meaningful non-parenthesized clauses, which means that the editor won't indent it properly without special casing LOOP keywords (and even the Emacs+SLIME workaround for this doesn't do it perfectly for complicated if/thens IME)
<vms14>
Odin-: yes, but not most languages have a reader macro that let's you read the code as text input
Lord_of_Life has quit [Ping timeout: 265 seconds]
Lord_of_Life_ has quit [Excess Flood]
<seok>
So fundamentally, if Lisp is superior to other languages, it can only be superior in its syntax
<vms14>
also in my case I just need to wrap the sentence in parenthesis and it's a list
<Odin->
vms14: My point is that eventually _all_ of the features of a programming languages can be termed "a syntactic convenience".
<Odin->
-s
<seok>
Which means, when someone asks, "What's so good about Lisp?", The answers is - Syntax?
<Odin->
seok: I'd say it's no single thing. It's a bunch of things, most of which aren't combined by other programming languages.
<vms14>
seok: the answer is macros
<aeth>
seok: Well, the regular syntax just makes things look less out of place once you start inserting your own arbitrary macros (at least, as long as your macros don't look like LOOP)
<vms14>
it's code generation "on the fly"
<Odin->
Macros are the only one that hardly anyone else implements _at all_.
<seok>
@aeth I actually liked lisp syntax when I first heard about it
<Odin->
But it might be worth remembering that Lisp was the first programming language to feature 'if'.
<seok>
Haha
<vms14>
you can skip evaluating stuff, and reorder the syntax before getting it evaluated
Lord_of_Life has joined #lisp
<vms14>
so you could transform the syntax as you want
<aeth>
Odin-: IF is more of a precursor to the ternary. COND is more of a precursor to the actual if/else if/else block
<seok>
@Odin- what do you mean
<vms14>
and the parenthesis are what let you do that since they're delimiters of a list and the code it's just that. A list
<seok>
You can implement if in assembly tho
<Odin->
aeth: Hm, true.
<vms14>
so to generate code you only have to generate a list
<aeth>
Odin-: to the point where if the order was reversed and COND came after languages with if blocks, then COND would probably be called IF because 'if' is the first thing you see in if/else if/else blocks
<Odin->
aeth: Then again, I also noticed that my comfort with the ternary operator went through the roof after using CL for a while. :)
<aeth>
Odin-: yes, but you have to be careful because you can't expect everyone else to be able to read a nested ternary :-)
Lord_of_Life has quit [Excess Flood]
zulu_inuoe_ has quit [Ping timeout: 265 seconds]
<Odin->
aeth: Which sucks! :p
<Odin->
seok: Obviously it can be implemented in assembly. Otherwise it couldn't be implemented on an actual computer.
Lord_of_Life has joined #lisp
<seok>
Yeah, so lisp is not the first language to use "if"?
<Odin->
Errr.
<aeth>
seok: Assembly's conditional jumps isn't using structured programming.
<Odin->
Assembly languages don't have 'if'. You can build if on top of conditional execution and branching.
<seok>
Ok
<aeth>
CL does have an equivalent to ASM, if you combine WHEN or UNLESS with GO in TAGBODY, but even that is contained to within the scope of TAGBODY.
vms14 has quit [Remote host closed the connection]
<aeth>
(WHEN and UNLESS are just single-branch versions of IF)
scymtym has joined #lisp
<aeth>
seok: CL was the first language iirc to have something like COND, that is (cond ((> x y) :gt) ((< x y) :lt) (t :eq)) which is like (in pseudocode): if (x > y) return GT; else if (x < y) return LT; else return eq;
<aeth>
s/return eq/return EQ/
<seok>
Right
<aeth>
(It's slightly different than the if/else if/else block in most programming languages because it implicitly has return values because it is an expression, not a statement.)
<seok>
I forget how old lisp is
<seok>
Unrelated question: is it discouraged to use CLOS to store simple hash-like data
<aeth>
Oh, right, not it wasn't CL, it was a precursor Lisp, probably LISP 1.5?
<aeth>
s/not it/it/
<Odin->
Indeed.
<seok>
wondering if it would cause performance hits
<Odin->
seok: It may, but there's at least some effort to minimise it in some implementations.
<seok>
Because I don't know how much I will suffer in performance
<seok>
I can't make a decision whether to benefit in abstraction by using CLOS
<seok>
or to stick to hashes
<Odin->
This is why you should use accessor functions either way, and profile diligently.
hiroaki has quit [Ping timeout: 265 seconds]
<seok>
What is an accessor function?
<seok>
I don't profile :(
<aeth>
An accessor function has a reader (getter) and a writer (setter). It doesn't have to be a method, e.g. CAR is an accessor
<seok>
ah
<aeth>
(setf (car list) 42) and (car list)
<seok>
okok
ljavorsk has joined #lisp
<aeth>
So you basically define a trivial function and a trivial matching SETF, and then the implementation details don't matter.
<seok>
Yeah
<Odin->
Or start with a CLOS object with an accessor, and if that's not fast enough, you can change out the implementation if you need to.
<aeth>
Right, but there's essentially no difference from the API's point of view (as long as the user doesn't do :before/:after/:around) how it's implemented because of the unified function/method syntax. It could even be a macro, but then there are more places where that illusion fails, like higher order functions.
<Odin->
Yup.
prince1 has joined #lisp
<Odin->
And designing things so that you can change implementation details if needed is particularly useful for efficiency purposes.
<aeth>
I guess you could say that the concept of accessor is a bit... ducktyped? If there's a foo and an equivalent (setf foo) with the same API, then it's an accessor.
lavaflow has joined #lisp
<seok>
well i tried it
<seok>
accessor for clos takes 184054 cpu cycles
<seok>
for hash it takes 1404
<seok>
thats a big difference eh?
<aeth>
CLOS is doing a runtime generic dispatch.
phlim has quit [Remote host closed the connection]
<seok>
ah
<Odin->
It's kind of like the comparison between addition in C and addition in CL.
caltelt has quit [Remote host closed the connection]
<Odin->
They're not really the same thing.
caltelt has joined #lisp
<seok>
Ok, I timed CLOS again
<seok>
and it takes 2900 cycles
prince1 has quit [Ping timeout: 260 seconds]
<seok>
so not too bad
Jesin has quit [Quit: Leaving]
<aeth>
I guess it must sort of JIT it?
ljavorsk has quit [Ping timeout: 265 seconds]
<Odin->
Probably stores dispatch information somewhere.
<seok>
dunno, there seems to be some overhead in setting the variable the first time I call it
<aeth>
I wonder if adding a check-type before it is faster.
shka_ has joined #lisp
<aeth>
because now it knows what it is
<Odin->
In any case, the general rule is that you shouldn't bother trying to carefully optimise something unless you have evidence it's a hot path.
<Odin->
Surprisingly often, the real wins aren't where you expect them.
<seok>
Right
<seok>
Ya, I don't get any work done overthinking things
<Odin->
It's also worth remembering that CL implementations differ massively on the performance choices made.
v_m_v has quit [Remote host closed the connection]
ljavorsk has joined #lisp
v_m_v has joined #lisp
Jesin has joined #lisp
<aeth>
I only do detailed optimizations on SBCL because it actually provides the ability to do so without working too hard at it. My testing on the other implementations is more general rather than optimization.
<aeth>
The general advice is to avoid writing new macros where possible... but it kind of flips on its head if your program requires performance... Essentially, the more you can do in a macro, the less you have to do at runtime, and you don't have to care about the macro's performance at all (unless you're doing something really elaborate, which you won't be doing) so it can actually be easier.
<aeth>
But... most programs don't need that kind of performance.
<aeth>
(What I mean is that macros can be full of naive pure functions on lists without caring about if there are faster ways... so they can actually wind up being easier than normal high-performance code, in high-performance code.)
v_m_v has quit [Ping timeout: 255 seconds]
v_m_v has joined #lisp
v_m_v has quit [Remote host closed the connection]
v_m_v has quit [Remote host closed the connection]
vms14 has joined #lisp
v_m_v has joined #lisp
v_m_v has quit [Remote host closed the connection]
cosimone has quit [Quit: Quit.]
narimiran has quit [Quit: leaving]
EvW has joined #lisp
vms14 has quit [Remote host closed the connection]
zulu_inuoe has joined #lisp
v_m_v has joined #lisp
v_m_v has quit [Remote host closed the connection]
nowhereman has quit [Ping timeout: 256 seconds]
gravicappa has quit [Ping timeout: 258 seconds]
varjag has joined #lisp
v_m_v has joined #lisp
v_m_v has quit [Remote host closed the connection]
v_m_v has joined #lisp
v_m_v has quit [Remote host closed the connection]
hiroaki has joined #lisp
varjag has quit [Ping timeout: 256 seconds]
<jfb4>
Xach, no-defun-allowed, pjb: belated (weeks) but many thanks for the several explanations above on tagged integers in CL, very interesting. #lisp is a great community
<no-defun-allowed>
seok: What do you mean by "benchmark CLOS"?
<no-defun-allowed>
Yes, many implementations will compile generic functions into a dispatch function, reducing the overhead for subsequent calls.
random-nick has quit [Ping timeout: 256 seconds]
refpga has quit [Remote host closed the connection]