MerlinTheWizard has quit [Ping timeout: 260 seconds]
orivej_ has joined #lisp
orivej has quit [Ping timeout: 272 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
stereosphere has joined #lisp
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 260 seconds]
Lord_of_Life_ is now known as Lord_of_Life
pjb has quit [Ping timeout: 272 seconds]
FreeBirdLjj has joined #lisp
orivej has joined #lisp
orivej_ has quit [Ping timeout: 272 seconds]
FreeBirdLjj has quit [Ping timeout: 272 seconds]
MerlinTheWizard has joined #lisp
msk has quit [Remote host closed the connection]
msk has joined #lisp
pjb has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
MerlinTheWizard has quit [Ping timeout: 260 seconds]
bitmapper has quit [Ping timeout: 256 seconds]
marusich has quit [Quit: Leaving]
orivej has quit [Ping timeout: 256 seconds]
bhartrihari has left #lisp ["Disconnected: closed"]
shifty has joined #lisp
shifty has quit [Ping timeout: 258 seconds]
shifty has joined #lisp
dale_ has joined #lisp
dale has quit [Disconnected by services]
dale_ is now known as dale
dale_ has joined #lisp
dale has quit [Disconnected by services]
dale_ is now known as dale
v3ga has quit [Ping timeout: 260 seconds]
<White_Flame>
drmeister: kebab-style vs snake_case vs camelCase vs probably other animal & food related ones
akoana has left #lisp ["Leaving"]
gxt__ has quit [Remote host closed the connection]
EvW has quit [Ping timeout: 244 seconds]
toorevitimirp has joined #lisp
gxt__ has joined #lisp
lalilulelo has joined #lisp
lalilulelo has quit [Max SendQ exceeded]
<pjb>
drmeister: I object to this name for lisp style.
arpunk has quit [Remote host closed the connection]
Oladon has joined #lisp
msk has quit [Read error: Connection reset by peer]
msk has joined #lisp
ag` has joined #lisp
ag` has left #lisp [#lisp]
ag` has joined #lisp
<ag`>
Hi. Total noob here. Can someone help me to get (format) right. I need something like this (format nil "first item ~second ~first" "1st" "2nd")
<ag`>
Basically I need to get nth item either from a given list or the arguments
<Bike>
i'm not sure i understand. could you give an example of a format call with arguments and what you'd like to see output. without the format string, of course, if you don't know how to write it
<ag`>
Let's say I have a list ("1st" "2nd" "3d",,, etc) I want a string (using (format)) that interpolates arbitrary nth element, something like this: "second item is 2nd first is 1st" ... etc
<ag`>
If I say I need a string that iterates through the elements, that's straightforward, but I need to "pick" nth element from the list
Aurora_v_kosmose has quit [Quit: Пока, мир.]
<Bike>
okay, but what would the call look like? (format nil string-goes-here '("1st" "2nd" "3rd") 2 1)?
<Bike>
well, format doesn't really do counting anyway, at least not in any way that would work for what i think you're thinking of
<ag`>
I don't really care the call may look like (format nil string-goes-here "1st" "2nd" "3d") or (format nil string-goes-here '("1st" "2nd" "3d"))
<Bike>
and in that case it would print "first item is 1st second item is 2nd third item is 3d"?
<Bike>
How does the "picking" enter there?
<ag`>
That's what I meean. If I ask to grab elements in order i.e.: through iterating the list - that's straightforward.
<ag`>
but the string may go like this "fist ~1, second ~2, and first again ~1"
<ag`>
I just started playing with CL, and I LOVE it but having to deal with (format) magic makes me feel stupid.
<Bike>
well, it's another language.
ech has quit [Ping timeout: 265 seconds]
<ag`>
can you show me an example where something like ~n* is used? I don't get this shit like at all
<Bike>
(format nil "first is ~a, second is ~a, first again is ~0@*~a" "harpsichord" "VASIMR") => "first is harpsichord, second is VASIMR, first again is harpsichord"
<beach>
Good morning everyone!
<ag`>
@Bike holy shit... this is pure magic... so I understand that ~0@* goes to the first argument, but why do you need ~a right after it?
<ag`>
ah... I see it now... it's basically like a "pointer".. it just moves it into the position
<Bike>
right, it doesn't print an argument itself.
<ag`>
OMG
<ag`>
cool.. awesome. Thanks!
<Bike>
no problem
ag` has quit [Quit: ERC (IRC client for Emacs 28.0.50)]
hvxgr has quit [Quit: Lost terminal]
_whitelogger has joined #lisp
_whitelogger has joined #lisp
farooqkz__ has joined #lisp
MerlinTheWizard has joined #lisp
farooqkz__ has quit [Ping timeout: 264 seconds]
MerlinTheWizard has quit [Remote host closed the connection]
pjb has quit [Ping timeout: 272 seconds]
_paul0 has joined #lisp
paul0 has quit [Ping timeout: 272 seconds]
catchme has quit [Quit: Connection closed for inactivity]
azimut has quit [Remote host closed the connection]
azimut has joined #lisp
pjb has joined #lisp
Bike has quit [Quit: leaving]
gko has joined #lisp
<stylewarning>
Nice harpsichord
dddddd has quit [Ping timeout: 272 seconds]
lerax has joined #lisp
jesse1010 has quit [Ping timeout: 258 seconds]
Bourne has joined #lisp
bhartrihari has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
FreeBirdLjj has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
SGASAU has quit [Remote host closed the connection]
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
SGASAU has joined #lisp
bhartrihari has joined #lisp
v3ga has joined #lisp
froggey has quit [Ping timeout: 256 seconds]
toorevitimirp has quit [Ping timeout: 260 seconds]
froggey has joined #lisp
<v3ga>
so for anyone with strong common lisp and clojure experience what do you like about common lisps repl opposed to clojure?
toorevitimirp has joined #lisp
<v3ga>
I ask because I mostly deal with clojure but I do like the books that deal with common lisp but I don't feel i've experienced enough to say what it is that feel different about the development process
mibr has joined #lisp
<beach>
v3ga: The channel ##lisp is probably better for comparisons like that. This channel is dedicated to Common Lisp.
<beach>
v3ga: But feel free to ask specific questions about Common Lisp if you want.
_whitelogger has joined #lisp
<beach>
Also, as I understand it, Clojure is a functional programming language, but Common Lisp is a multi-paradigm language with a strong object-oriented paradigm possible. So I am guessing that the comparison is going to be more than just about the REPL.
andrei-n has joined #lisp
toorevitimirp has quit [Remote host closed the connection]
<no-defun-allowed>
The more developed condition system in Common Lisp allows one to handle some errors in a Common Lisp REPL in a nicer way than with some other language implementations' REPLs.
<no-defun-allowed>
One small example is that if I made a mistake in a file in an ASDF system, the debugger would present me with some restarts, including trying to recompile the file. I could then fix my mistake and invoke that restart.
Jeanne-Kamikaze has quit [Quit: Leaving]
<no-defun-allowed>
The object system also has a protocol for updating instances for redefined classes, so "hot reloading" a program is much less difficult.
<v3ga>
beach: ahh well then also i'd like to ask which is preferable for working through how to design programs. racket or would i be safe with guile?
Aurora_v_kosmose has joined #lisp
<beach>
v3ga: Again, this channel is for Common Lisp.
<v3ga>
no-defun-allowed: hmm thats what I felt I was getting closer to. Again I only toyed with it for a short period but it felt like it would be a great debugging tool.
<beach>
v3ga: Common Lisp with its object system is a great tool for designing modular and extensible code.
<beach>
v3ga: In fact, in many situations it turns out that auxiliary methods are necessary in order to avoid breaking an API while still allowing for significant updates to the implementation.
<v3ga>
beach: i'm slow. those both are Scheme. lol sorry. i'm reading a few books at once but i've been forcing examples to clojure though now i've decided to get my feet wet again
<beach>
v3ga: So unless your other language choices have generic functions with auxiliary methods, I think Common Lisp is the best choice.
<beach>
v3ga: Yes, I know that Guile and Racket are both Scheme based.
<v3ga>
well yeah for any projects I'd go CL from what i've seen. this is more so down time. Funny enough I had a cynical answer to someone asking what language they should use for task. After they mentioned that it was for learning purposes I asked them why not both. I suppose that answer fits my questions as well
farooqkz__ has joined #lisp
<beach>
When I give talks to industry, I strongly advice against languages that do not have an independent standard. Common Lisp is one of the few languages that that do that. If a language does not have an independent standard, it can change at the whim of the person or organization that controls it, and your investment may be destroyed.
<beach>
With Common Lisp, you also have several different, often very good, implementations available to you. You can then choose the implementation that corresponds to your needs, and if one implementation ceases to be maintained, you can choose a different one with very few problems.
<v3ga>
beach: yeah, makes sense. I have sbcl at the moment installed. i suppose another annoyance but saving grace is you roll a lot of things togehther yourself.
<beach>
Furthermore, while an independent frozen standard would be a disaster to traditional languages, this is not the case for Common Lisp, since the language itself is extensible through its macro mechanism.
<beach>
v3ga: Like what?
<beach>
v3ga: There are many libraries available for Common Lisp these days.
<v3ga>
well as you said via macros...or your own dsl. it seems to be the same for most lisps where a library may no longer be updated but that seems to be beause it just works or you've molded your own toold over a period. i have no working experince there, that just seemed to be the case.
pjb has quit [Ping timeout: 272 seconds]
<beach>
I mentioned the macro system because some people object that the standard is old. But that doesn't matter as much for Common Lisp as it does for other languages, since we do not have to wait for a new standard in order to get additional functionality.
<beach>
But there are several good libraries (available in Quicklisp) that work for many of the popular Common Lisp implementations.
<beach>
There is a lot less need to roll your own these days, depending on what you want to do of coruse.
<beach>
course
<solrize>
no-defun-allowed, v3ga hot reloading is one of erlang's marquee features but after a while i decided it was more trouble than it was worth, and i actually talked with joe armstrong (RIP) about it and he felt the same way. it's better to just launch the new version of the program separately and then transfer the active network connections etc from the old to the new. that's not trivial but it's how phone switches have traditionally worked for ages
Blukunfando has quit [Remote host closed the connection]
<solrize>
SICL will be able to have sandboxed applications if i understand it right, so that might be a good setup for hot reloading that way
guicho has joined #lisp
<no-defun-allowed>
I see. So far, I have had relatively few issues with updating at a function or class level.
shifty has quit [Ping timeout: 260 seconds]
pve has joined #lisp
pjb has joined #lisp
mangul has joined #lisp
<v3ga>
solrize: yeah i'm familiar with it =P I read a bit on erlang when I played with scala years ago and actors.
farooqkz__ has quit [Ping timeout: 260 seconds]
Oladon has quit [Quit: Leaving.]
gaqwas has joined #lisp
hineios6 has joined #lisp
liberliver1 has joined #lisp
marusich has joined #lisp
hineios has quit [Ping timeout: 256 seconds]
hineios6 is now known as hineios
cosimone has joined #lisp
liberliver has quit [Ping timeout: 272 seconds]
liberliver1 is now known as liberliver
rgherdt has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
ldb has joined #lisp
ljavorsk has joined #lisp
<ldb>
goot eveing
<no-defun-allowed>
Hello ldb
<ldb>
today i read about extensible effect handler
<ldb>
which seems to be very close to condition system
<ldb>
no-defun-allowed: hello
FreeBirdLjj has quit [Ping timeout: 260 seconds]
madnificent has joined #lisp
SGASAU has quit [Remote host closed the connection]
<ldb>
it is called "extensible" because like condition system, unhandled effects are passed to upper level handlers.
niklasl has quit [Remote host closed the connection]
<no-defun-allowed>
I thought the condition system does check "upper level handlers".
<beach>
We need to do something about this ambiguous stack-direction terminology.
<beach>
I can't imagine a stack of (say) plates growing "downward".
<no-defun-allowed>
True.
<v3ga>
hmm
<beach>
We have to use two different words.
<no-defun-allowed>
How about "I thought the condition system does check handlers that were bound earlier"?
mangul has quit [Ping timeout: 256 seconds]
<beach>
Now, that I understand.
<solrize>
that eff looks interesting
<solrize>
dunno if i'd compare it to lisp conditions though
<no-defun-allowed>
For example, (signal 'b ...) in (handler-bind ((b something)) (handler-bind ((a something-else)) (signal 'b ...)) would have an applicable handler from the outermost HANDLER-BIND form.
FreeBirdLjj has joined #lisp
ldb has quit [Ping timeout: 246 seconds]
ldb has joined #lisp
FreeBirdLjj has quit [Ping timeout: 244 seconds]
<phoe>
no-defun-allowed: if I understand algebraic effects correctly, they *are* condition handlers, just wrapped in enough mathematics to make them implementable in Haskell and other strictly statically typed strictly functional languages.
<no-defun-allowed>
Alright.
<phoe>
Like, algebraic effects are to condition handlers what the IO monad is to #'write and #'read.
<phoe>
ldb: thanks for the links, I'll write about them. How should I credit you in my book?
<ldb>
phoe: Qifan Wang
<phoe>
ldb: thanks.
gaqwas has joined #lisp
gaqwas has quit [Changing host]
DGASAU has quit [Read error: Connection reset by peer]
DGASAU has joined #lisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
SGASAU has quit [Remote host closed the connection]
<ldb>
ok, apple has break my shell somehow.
SGASAU has joined #lisp
FreeBirdLjj has joined #lisp
gravicappa has joined #lisp
FreeBirdLjj has quit [Ping timeout: 260 seconds]
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
sdumi has quit [Ping timeout: 240 seconds]
ldb has quit [Ping timeout: 260 seconds]
ldb has joined #lisp
cosimone has quit [Remote host closed the connection]
sdumi has joined #lisp
cosimone has joined #lisp
shifty has joined #lisp
ljavorsk has quit [Ping timeout: 246 seconds]
oldtopman has joined #lisp
wxie has joined #lisp
anticrisis has quit [Read error: Connection reset by peer]
heisig has joined #lisp
oxum has joined #lisp
nicktick has joined #lisp
orivej has joined #lisp
<White_Flame>
is it possible to compile new functions that can share the bindings in closures that are already compiled?
<White_Flame>
eg (let ((count 0)) (defun next () (incf count))), then add more defuns that can access COUNT as directly as NEXT can
<White_Flame>
after the fact
<beach>
I don't see how that would be possible.
<phoe>
not via any standard means
<White_Flame>
closures are just that much more optimal, vs accessing dynamic bindings, that it would be nice for optimization to somehow wrangle that
<phoe>
you'd need to extract locatives for that binding and then use these
<ldb>
White_Flame: the most close thing I can think of is first class pointer
<ldb>
or so called locatives
<phoe>
and there's no locatives in CL other than via reader/writer closures
<White_Flame>
right, but that wouldn't be direct access in terms of compiled cost to access them in the same way as the original defun
<White_Flame>
well yeah, I use cons cells for poor man's locatives, as they tend to be the least overhead
<White_Flame>
but then one has to pass them around etc, they aren't just ever-present on the function pointer like closure bindings are
<axion>
You can imitate something similar with symbol macros. See "pandoric" macros from Let Over Lambda.
dale has quit [Quit: My computer has gone to sleep]
<ldb>
acesss bindings in compiled closure breaks the abstraction that programming languages provide
<White_Flame>
well, it wouldn't ideally be accessing from the outside, but rather putting a new function inside
<White_Flame>
(which is unexpressable in pretty much every language, I'd guess)
orivej has quit [Quit: No Ping reply in 180 seconds.]
<White_Flame>
I guess langs that have an eval that can see & close over the caller's lexical environment might be able to pull that off, but that is not lisp
<White_Flame>
at least not CL
orivej has joined #lisp
pjb has quit [Ping timeout: 260 seconds]
<ldb>
in many languages other than lisp, defining a global function inside a let binding is impossible
rixard has quit []
frgo has quit [Remote host closed the connection]
orivej_ has joined #lisp
frgo has joined #lisp
<aeth>
I guess you could add a locative, but then that adds a layer of indirection and would remove a lot of the efficiency of the clsoure.
<aeth>
The easiest way would probably be to use a symbol-macrolet instead of a let... does a top-level symbol-macrolet create a closure like let?
orivej has quit [Ping timeout: 272 seconds]
<aeth>
But then you're not really restricting access except by convention... One of the good things about a lexical closure in CL is that it's one of the few ways to truly restrict access.
gareppa has joined #lisp
<aeth>
Cons cells (or similar) are actually pretty clever because then you could have a %foo accessor and use this as the basis to copy the locative, which doesn't have to exist globally except as part of that accessor.
ldb has quit [Ping timeout: 264 seconds]
<White_Flame>
well, what I'm seeing now (and smacking myself on the forehead abotu) is that the stuff I'm closing over really is mutating arrays & structures, so sharing the actual binding itself actually doesn't matter.
<aeth>
White_Flame: Off the top of my head, you could do a LET containing conses (or 0D arrays or 1-elt vectors or 1-element structs, etc.) over a SYMBOL-MACROLET (to make them look like variables to the user functions, since this will probably be wrapped in a macro except for the &body) over DEFUNs/etc.
<White_Flame>
since the binding doesn't change; it just points to a shared mutable composite
<White_Flame>
and so multiple closures just simply share the same final reference, not binding
<aeth>
White_Flame: This can be macro-generated including with an "inheritance" system done by calling a function that copies all of the LET bindings into new bindings (so the inherited setup would actually be LET over MULTIPLE-VALUE-BIND over SYMBOL-MACROLET over DEFUNs/etc.)
FreeBirdLjj has joined #lisp
<aeth>
White_Flame: e.g. (define-global-closure give-it-a-name-for-the-inheritance-function (bindings-go-here) (inherit-from-parents-or-this-can-be-nil) ...) ; where "..." would be the DEFUNs/etc. and in those DEFUNs you would pretend that the bindings are variables instead of a CAR/AREF/etc. accessor because of symbol-macrolet.
<aeth>
e.g. (define-global-closure foo ((bar 42) (baz 53) (quux 64)) () (defun foobar (x) (incf bar x))) (define-global-closure barfoo ((qwerty 75)) (foo) (defun decbar (x) (decf bar x)))
<aeth>
With the caveat that this will be less efficient because of the indirection, both directly because of the indirection and because the compiler isn't smart enough to know that bar is going to remain a number.
ldb has joined #lisp
<aeth>
White_Flame: and, yeah, if it's just arrays/lists/etc. anyway you don't need to do this, but this solution's perfectly general.
johntalent has joined #lisp
random-nick has joined #lisp
ldb has quit [Ping timeout: 264 seconds]
orivej_ has quit [Ping timeout: 256 seconds]
orivej has joined #lisp
dddddd has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
sdumi has quit [Ping timeout: 272 seconds]
sdumi has joined #lisp
wxie1 has joined #lisp
wxie has quit [Remote host closed the connection]
wxie1 is now known as wxie
ldb has joined #lisp
pjb` has joined #lisp
orivej has quit [Ping timeout: 260 seconds]
orivej_ has joined #lisp
ldb has quit [Ping timeout: 258 seconds]
cosimone has quit [Quit: Quit.]
rixard has joined #lisp
bhartrihari has left #lisp ["Disconnected: closed"]
karlosz has quit [Quit: karlosz]
karlosz has joined #lisp
bhartrihari has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
ralt has quit [Quit: Connection closed for inactivity]
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
ldb has joined #lisp
gareppa has quit [Quit: Leaving]
hvxgr has joined #lisp
tankman has joined #lisp
tankman has quit [Client Quit]
sdumi has quit [Ping timeout: 272 seconds]
ldb has quit [Ping timeout: 260 seconds]
sdumi has joined #lisp
pjb` has quit [Ping timeout: 260 seconds]
orivej_ has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #lisp
karlosz has quit [Quit: karlosz]
ldb has joined #lisp
ldb has quit [Ping timeout: 240 seconds]
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #lisp
ralt has joined #lisp
<ralt>
White_Flame: not sure why you're not using a class instead
ldb has joined #lisp
<phoe>
Somewhat-Lisp-related question. What would be a good example program where using dynamic bindings can greatly simplify code?
<phoe>
Or show something that is otherwise hard to achieve without dynamic bindings?
<madnificent>
phoe: Lik special variables?
<madnificent>
s/lik/like/
<phoe>
madnificent: yes
<madnificent>
Extending unexpected things has been major for me with mu-cl-resources.
<madnificent>
Such cases are possible, but super hard to do when you're not allowed to pass things through deep down.
ldb has quit [Ping timeout: 256 seconds]
<phoe>
I don't want to depend on external libraries here; I want to write an example program where I demonstrate the things that dynamic bindings allow that would otherwise be hard.
<phoe>
Which means that I need to figure out what that program would need to be, in the first place.
<madnificent>
Say, for example, that somewhere deep down in the call stack you want some behaviour to be different, it gets super hard to pass that information through to the lower layers without having to re-architect the code.
<_death>
RANDOM
<madnificent>
A specific case we have this way is caching. I'll lay down what the issue there was, then we check if that works for you?
<phoe>
_death: uhhhh?
<phoe>
madnificent: OK
<_death>
imagine if you had to explicitly pass down the random-state
<phoe>
oooh, that is correct
<madnificent>
mu-cl-resources gives you a jsonapi.org compliant response for data that is in a triplestore. It uses bindings for that. We want to cache the response and clear the cache when something relevant is updated. Hence, the system creates a "cache key" for each resource it needs to construct a response. Because there are various code-paths creating parts of the response, there are various code-paths creating cache-keys.
<madnificent>
cache-keys is not trivial without special variables.
<madnificent>
We have a similar case where we did something like that in Elixir and it was a lot less fun :)
<phoe>
I see
<madnificent>
Cases where you are not linearly executing code become hard. You end up passing arguments to functions which don't have too much to do with the function at all. You can do it, but it's harder to read and more error-prone.
<madnificent>
The random state is a nice example of that too.
<_death>
this use-case is mentioned in SICP in relation to global state.. basically special variables are useful for context.. they also provide a stack-like, thread-local behavior (shadowing bindings)
<_death>
they make it easy to implement REPL-friendly operators
ldb has joined #lisp
ldb has quit [Client Quit]
bhartrihari has joined #lisp
orivej has quit [Ping timeout: 256 seconds]
wxie has quit [Ping timeout: 260 seconds]
orivej_ has joined #lisp
Aurora_v_kosmose has quit [Remote host closed the connection]
Aurora_v_kosmose has joined #lisp
FreeBirdLjj has joined #lisp
wxie has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
Bike has joined #lisp
<madnificent>
phoe: We probably have more cases like this which are used in the wild.
<phoe>
same with restart cases, same with restart bindings...
<phoe>
thanks! I'll add this to my book
<pve>
yes, that was exactle my problem
stentroad_ has quit [Ping timeout: 272 seconds]
<pve>
exactly
<phoe>
that is not an issue if you have the compiler handy, since you can (funcall (compile nil `(lambda () (with-simple-restart (,name ,string) (funcall ,thunk)))))
<phoe>
but that's invoking the compiler
<phoe>
which might quirk quite a few brows
<phoe>
damn! I never noticed that issue until now
<phoe>
I guess no one really specifies handler/restart details at runtime, even though it seems like a decent addition...
* phoe
adds this to the bag of ideas for the Hypothetical Future Revision
<Bike>
clisp has some kind of handler-case or handler-bind instruction in its bytecode, so i wonder if type specifiers can be dynamically specified or not
<phoe>
obviously they do not need to be
<phoe>
the specification does not mandate that anywhere.
<phoe>
that's why I must use the compiler
sdumi has joined #lisp
<Bike>
well, i wonder. i'm curious what clisp does. every other implementation i'm familiar with does the dynamic variable thing in which case it's fine (though you can probably optimize constant type specifiers better)
<phoe>
I mean, even if clisp does that, it has to get the type specifier and restart name from somewhere
<phoe>
so, at least in theory, they could be provided dynamically, too - which means via a functional interface
orivej has quit [Read error: Connection reset by peer]
orivej_ has joined #lisp
Snaffu has joined #lisp
<pve>
while I'm here, can I ask you, will this come back and bite me in the behind later, or do I need to rethink it?
<pve>
I do this because it's a little inconvenient that conditions can't be defined using defclass
FreeBirdLjj has joined #lisp
<pve>
so I would prefer if "conditions" could be defined using the normal subclass method
<Bike>
phoe: i mean like, if there was only handler-case and not handler-bind, you could have the type specifiers not to be accessible to signal. might be doable with handler-bind too.
<Bike>
pve: might be slower, but since you have your own language here it doesn't seem like there'd be a problem
<phoe>
pve: seems OK to me.
<phoe>
Bike: correct; we can implement handler-case via handler-bind though, so we are lucky
<pve>
ok great!
<phoe>
pve: the return-from in line 34 is superfluous
<pve>
thanks for your input, bike, phoe
<phoe>
required in handler-case, not required in handler-bind
<pve>
oh right
<pve>
will remove
<Bike>
like for example if you compiled a type check into the function with the handler, and unwound to that frame with handler-bind, and then rewound if there was a restart
<Bike>
with that implementation there wouldn't be any way to do a type specifier dynamically short of the compile
<phoe>
correct
<phoe>
an implementation is allowed to leverage the fact the condition types are not suppliable at runtime
<phoe>
and optimize the hell out of such code by e.g. turning a runtime TYPEP with a Lisp type specifier into a compiled, more efficient one
wxie has joined #lisp
<phoe>
a functional interface with variable condition type would make it hard to optimize that.
ech has joined #lisp
orivej_ has quit [Read error: Connection reset by peer]
orivej has joined #lisp
<TwoNotes>
If I use Quicklisp to load both :SHA1 and :DEXADOR I get this: "BASE64" is a package name, so it cannot be a nickname for "CL-BASE64".
Lycurgus has quit [Remote host closed the connection]
<phoe>
TwoNotes: sounds like an ugly package name conflict between different base64 libraries.
<beach>
Both those names are badly chosen actually.
<TwoNotes>
groan
<TwoNotes>
I am looking at the code for dexador and I do not see that it actually defines BASE64. It does however 'depend-on' a bunch of other things, including cl-base64
<phoe>
that's where the nickname comes from
<phoe>
please complain at the authors of the relevant systems to unclobber the package namespace and/or the authors of sha1 that the package is unloadable with dexador and/or the authors of dexador that the package is unl... nah, don't complain at dexador, I sadly don't expect the author to change anything
<TwoNotes>
In the first link, the author says he doesn't feel like changing it because he likes his own base64 implementation so much
<_death>
or use ironclad.. its sha1 implementation is more performant
<phoe>
it's different than the PR that _death linked since it provides a real-life breakage case (which you provided to us!)
<phoe>
_death: and also *huge*
rme has quit [Read error: Connection reset by peer]
<phoe>
needing to pull all of ironclad just to use its sha1 implementation is why the sha1 system actually came into life
orivej has quit [Ping timeout: 258 seconds]
<TwoNotes>
All I need is a hash function that returns a string. It doesn't *have* to be sha1
jmercouris has quit [Read error: Connection reset by peer]
<_death>
well, usually you need more than sha1..
<TwoNotes>
I am using it to make small Merkle Trees
orivej has joined #lisp
gendl has quit [Read error: Connection reset by peer]
mpontillo has quit [Ping timeout: 272 seconds]
rme has joined #lisp
<_death>
what's surprising is that ironclad doesn't include base64 ;)
<_death>
though it mentions it might need to do that in the TODO
<phoe>
_death: it's good that base64, cl-base64, qbase64, and s-base64 do
<phoe>
there's a pbase64 missing though, where p stands for "phoe"...
<phoe>
brb
<_death>
phoe: plus a bunch of inline implementations written in 10 mins throughout the years
<phoe>
_death: oh no!
<TwoNotes>
I can call cl-base64 myself. I just need the hashing. Ironclad looks interesting to play with itself, but I don't need all that for this particular project.
<phoe>
we need to extract these into separate ASDF systems and upload them to quicklisp
<phoe>
TwoNotes: you can pull in the sha1 code and either gut out the base64 parts or tweak them to use cl-base64
<phoe>
;; if you don't need base64 encoding, I suggest the former
<TwoNotes>
I could start with SHA1, strip out the base64 stuff, and call cl-base64 instead.
mpontillo has joined #lisp
<_death>
there should be a choose-system system that baffles you with choices for test/base64/utility/portability libraries
<phoe>
sure - or just throw out all base64 and cl-base64 stuff altogether if you don't ever want to use that encoding.
<TwoNotes>
It does not HAVE to be base64. I use it as a key into an LMDB database.
<phoe>
_death: ...
<TwoNotes>
LMDB doesn't care
<_death>
and a pick-system too
<phoe>
trivial-base64
terrorjack has quit [Ping timeout: 260 seconds]
stentroad has joined #lisp
rme has quit [Ping timeout: 264 seconds]
<_death>
maybe asdf has a user hook for "do this after that system loads".. or is it too simple minded
<phoe>
_death: I guess that defining methods counts...
<phoe>
I think you could defmethod on asdf:operate
<phoe>
that looks like uiop:define-package :reexport, am I right?
<_death>
so now the symbol is interned in package foo, but the definition (say, a function definition) is made in bar
orivej_ has quit [Quit: No Ping reply in 180 seconds.]
oxum has quit [Remote host closed the connection]
<_death>
no, it's not about re-exporting
mibr has quit [Quit: mibr]
oxum has joined #lisp
orivej has joined #lisp
<_death>
the original code made no use of packages (had in-package :cl-user)
<phoe>
ouch
<_death>
do you understand what I did?
<phoe>
yes
<phoe>
you separated it into packages in a way that still makes it work
ralt has quit [Quit: Connection closed for inactivity]
<_death>
yes.. I could define a single package that both foo and bar modules share
<phoe>
where the latter packages use and reexport all symbols exported by the former packages, therefore allowing definitions to work on the same symbols
<phoe>
nice
X-Scale` has joined #lisp
<_death>
but package-inferred-systems style fit this code base better
X-Scale has quit [Ping timeout: 272 seconds]
X-Scale` is now known as X-Scale
oxum has quit [Ping timeout: 265 seconds]
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #lisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
sz0 has joined #lisp
orivej has joined #lisp
bhartrihari has left #lisp ["Disconnected: closed"]
bhartrihari has joined #lisp
gravicappa has quit [Ping timeout: 272 seconds]
gravicappa has joined #lisp
oxum has joined #lisp
<TwoNotes>
Package names are *supposed* to be long, like internet names. But nobody likes to type all that each time so they have nicknames too. Trouble is, the nicknames are part of the defpackage and then you can have conflicts if two developers pick the same nicknames. Better to let the end-user pick the nicknames, as in done in Python
aeth has quit [Read error: Connection reset by peer]
FreeBirdLjj has quit [Remote host closed the connection]
<beach>
Or use package-local nicknames which are now available nearly everywhere.
aeth has joined #lisp
<_death>
or :import-from with the long name
wxie has quit [Ping timeout: 260 seconds]
stentroad has joined #lisp
<phoe>
TwoNotes: package-local nicknames are a form of python's import
<phoe>
or rather, Python import ... as
stentroad has quit [Client Quit]
oxum has quit [Remote host closed the connection]
<TwoNotes>
It is the ".. as .." construct I was htinking of
quazimod1 has quit [Ping timeout: 260 seconds]
<phoe>
package-local nicknames then
<phoe>
they work everywhere except CLISP
<luis>
phoe: what do you mean everywhere?
<beach>
In every significant Common Lisp implementation.
<_death>
the declaration form should be placed where the bindings are introduced (in your case, outside the let form)
sdumi has joined #lisp
ralt has joined #lisp
<beach>
TwoNotes: When you expose your code for others to read, it is important that you make sure it follows elementary conventions about indentation and spacing.
Bourne has quit [Remote host closed the connection]
<beach>
TwoNotes: A closing parenthesis should never be preceded by whitespace, in particular not by a newline.
<beach>
TwoNotes: And the list of variables introduced by your MULTIPLE-VALUE-BIND is not indented correctly.
<beach>
TwoNotes: What programming environment do you use?
kpoeck has joined #lisp
<beach>
TwoNotes: You should use three or four semicolons for comments outside a top-level form.
<beach>
TwoNotes: The arguments starting at HOUR to your format are not indented correctly.
<beach>
TwoNotes: And there is no point in having a LET with no bindings introduced. In this case, since the declaration should go outside the LET, you can remove it. If you do need a declaration but no bindings, use LOCALLY.
orivej has quit [Ping timeout: 258 seconds]
orivej_ has joined #lisp
<_death>
may also consider using *x* for special variables rather than +x+ (some think it makes sense for constants, but...)
<TwoNotes>
I was under the mistaken impression that multiple-value-bind only allowed one form. So I removed the let and now it works.
<_death>
also, you may want to use vectors instead of lists
<pjb>
White_Flame: remember closures are equivalent to objects. What you want to do is done with classes and methods!
<phoe>
pjb: I've mentioned it.
<pjb>
White_Flame: your example must be written: (defclass anonymous-1 () ((count :initform 0))) (defmethod next ((s anonymous-1)) (incf (slot-value s 'count))) #| AND THEN: |# (defmethod previous ((s anonymous-1)) (decf (slot-value s 'count)))
<phoe>
pjb: your example is equivalent in semantics but not equivalent in performance, and this is what I think White_Flame was concerned about; closures have less overhead than classes and methods.
<pjb>
phoe: totally wrong!
Jeanne-Kamikaze has joined #lisp
<pjb>
phoe: this is precisely because this is totally wrong, that the equivalence was discovered!
<phoe>
pjb: I don't understand, which *exactly* part is wrong? that the two are equivalent in semantics, that the two are not equivalent in performance, that this is what I think White_Flame wac concerned about, or that closures have less overhead than classes and methods?
<phoe>
Since you used "totally", I assume you mean all four of them.
oxum has joined #lisp
<TwoNotes>
So the correct way to balance parens to to pile all the close-parens at the end of the last line?
<phoe>
TwoNotes: correct
<TwoNotes>
ok. The Style Guide does not directly address this point, but all of its example do.
<phoe>
a line with only whitespace and closing parens is a line that should be folded into the above one
<TwoNotes>
I'm a big beleiver in coding style, so I will go over all these, thanks. Over the *cough* decades I have had to read other people's badly written code in that other-language-who-shall-not-be-named-that -is-about-coffee
<TwoNotes>
It is amazing how much "professionally" written code contains zero comments.
<pjb>
phoe: "Then came a crucial discovery. Once we got the interpreter working correctly and had played with it for a while, writing small actors programs, we were astonished to discover that the program fragments in apply that implemented function application and actor invocation were identical! Further inspection of other parts of the interpreter, such as the code for creating functions and actors, confirmed this insight: the fact th
<pjb>
functions were intended to return values and actors were not made no difference anywhere in their implementation."
<pjb>
TwoNotes: what's amazing, is that actually most code is considered to be basically throwable. The situation where you have code that last long, and be maintained over generations of programmers is rather rare.
<TwoNotes>
My primary audience for the code I write is a future me.
ljavorsk has joined #lisp
cosimone has joined #lisp
stereosphere has joined #lisp
ljavorsk has quit [Ping timeout: 258 seconds]
orivej has quit [Quit: No Ping reply in 180 seconds.]
<MichaelRaskin>
pjb: forget generations, I am OK with reclaiming mere ten years
orivej has joined #lisp
EvW1 has joined #lisp
<p_l>
heh
<pjb>
Indeed. Remember that every 5 years, the number of programmers doubles. Which means that at all times, half the programmers have less than 5 years of experience. Which explains why there are new fads all the time, new silver bullet programming languages, etc.
<p_l>
meanwhile I'm in a project where Python was chosen because the code will have to run for 20 years under probably random maintainers
<pjb>
but also, code written doubles every 5 years, so (more than) half of the code written is less than 5 years odl.
<p_l>
pjb: It compounds with technological advances into "great generational knowledge death", as I call it
<pjb>
p_l: bad choice. python 2.7 is dead. In the meantime, CL is still going…
<p_l>
pjb: Python 3 fortunately
<p_l>
the thing is, availability of CL programmers is lower
<phoe>
jackdaniel: I remember that you mentioned some sort of server that has asynchronous and synchronous components; the async parts were realized by calling handlers
<phoe>
is it published anywhere?
<pjb>
p_l: will be dead soon… :-) for python 4 or viper or grass-snake?
<p_l>
pjb: the question was "do we want support calls for next 20 years or do we want ability to throw someone else under the bus"
<TwoNotes>
LISP and FORTRAN are the two oldest languages still in use. But does anyone really still use FORTRAN?
<pjb>
p_l: this is wrong. Everywhere I've worked, programmers knew lisp (or scheme). They've been taught it in university.
<p_l>
that said, the experience with this project is convincing others to learn Lisp
DGASAU has quit [Ping timeout: 256 seconds]
<pjb>
p_l: only since it's not a hiring bullet-point, they don't talk about it.
<TwoNotes>
Some places consider LISP their secret sauce
<p_l>
pjb: the only university that still had serious lisp course closed it exactly when I wanted to go there so I'd have been in the first year without list
<p_l>
*lisp
<p_l>
(only university that was within "range" let's say)
<phoe>
TwoNotes: fortran is still used in academia and physics computations; tons of battle-tested scientific code is written in Fortran and there's no need or money to rewrite it in elsething
<TwoNotes>
Places like CERN
<p_l>
I'd have way higher chances depending on Haskell, because then I can always put up adverts in Scotland
<p_l>
TwoNotes: not only
<p_l>
actually CERN is heavily in C++, iirc
<p_l>
though I think they have mixed up code
<p_l>
TwoNotes: however if you need to run MPI calculations on arrays it tends to be much easier to just grab fortran 90 with OpenMP and hack
<MichaelRaskin>
pjb: meh, remind me when pypy2 stops working
random-nick has quit [Ping timeout: 256 seconds]
orivej_ has joined #lisp
orivej has quit [Ping timeout: 272 seconds]
<p_l>
anyway, next such project will be mix of C and Lisp :V
<MichaelRaskin>
Nice
<TwoNotes>
Last time I hung out with high-energy physics people was at uni 50 years ago. Not a lot of options then.
<p_l>
MichaelRaskin: the C is only there because we would need a kernel module for a realtime bit
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
<p_l>
unless I end up getting rt gc for a lisp on top of a *proper* RTOS (something that implements OSEK/AUTOSAR or ARINC-653 or similar)
<TwoNotes>
Stop-the-world GC is a bad idea. I like the way Erlang does it.
<p_l>
Stop the world is good for certain kinds of work
<p_l>
what I'd be happy with is something that worked on the metronome pattern
DGASAU has joined #lisp
jw4 has quit [Read error: Connection reset by peer]
rogersm has joined #lisp
rippa has joined #lisp
jw4 has joined #lisp
<beach>
TwoNotes: It is not surprising that professionally written code is bad. Remember that a "professional" (by definition) is a person who does something for money, whereas an "amateur" (again by definition) is a person who does something out of love.
random-nick has joined #lisp
oxum has quit [Remote host closed the connection]
orivej_ has quit [Ping timeout: 265 seconds]
orivej has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
<jackdaniel>
phoe: no, but I've described how that could be implemented
<phoe>
jackdaniel: OK, I see - I'll think about that
cosimone has quit [Ping timeout: 260 seconds]
<TwoNotes>
Can a sub-class override a slot :type from the superclass?
oxum has joined #lisp
<phoe>
TwoNotes: it can, but the provided type must be a subtype of the original
cosimone has joined #lisp
<Bike>
it can't override it, they're combined
<phoe>
otherwise LSP does not hold
<phoe>
Bike used better words than me
rogersm has quit [Ping timeout: 240 seconds]
<Bike>
specifically, if C2 is a subclass of C1, and they both declare a slot with the same name, with types T2 and T1 respectively, the type of the effective slot of C2 is equivalent to (and T1 T2)
oxum has quit [Ping timeout: 240 seconds]
<TwoNotes>
What if the superclass does not mention :type at all, can the subclasses *add* a :type?
<Bike>
if a slot doesn't have a :type mentioned the type is implicitly T
<phoe>
yes
rogersm has joined #lisp
rogersm has quit [Client Quit]
<Bike>
so, yeah go for it
rogersm has joined #lisp
<Xach>
temper your expectations for how useful it will be beyond documentation for the human reader
Josh_2 has joined #lisp
<Bike>
mhm
<phoe>
I mean, SBCL now typechecks stuff based on :TYPE
<Bike>
though i have some ideas for how packed data in standard objects might usefully be supported in sicl and clasp. we'll see how that goes
<phoe>
CCL did it for a long time™
<TwoNotes>
It is a b-tree structure, which can be in memoery or on disk. The concept of a 'left' and 'right' downward pointer is common to both. But in memory those slots contain references to other nodes, while on disk they contain strings where are DB keys. I was thinking of possible optimizations the compiler might do
<Xach>
none
<rogersm>
Hi guys, what is the prefered library for PEG parsing?
<Bike>
yeah, it's none on any implementation i'm aware of that actually exists
<Bike>
the problem is that CLOS supports redefinition heavily so the compiler generally can't rely on any information like that
<p_l>
_death: regarding recursion and BASIC... it hits you hard when you end up working on a platform that does *not* support recursion. or reentrancy
<_death>
good thing you know about stacks :)
orivej has quit [Ping timeout: 272 seconds]
orivej has joined #lisp
<p_l>
can't fix it because we're not allowed to program the cpu directly
<p_l>
and as insane as I am, writing a lisp in IEC ST is a bit beyond me
SGASAU has quit [Remote host closed the connection]
<_death>
you could write lisp to write it for you
<pjb>
p_l: you can always implement your own stack, modulo we're not using turing machines!!! (much less universal turing machines).
SGASAU has joined #lisp
<p_l>
_death: the problems are limitations of the execution environment even if you somehow get a lisp through
<phoe>
us lambda calculus fanboys don't need no ugly stacks
<pjb>
p_l: LISP was implemented on a machine that didn't support recursion or reentrancy (no stack).
<emacsomancer>
what prefix is sbcl's make-timer under?
bitmapper has quit [Read error: Connection reset by peer]
<pjb>
p_l: that said, I agree that LISP wasn't implemented using libraries from github!
<p_l>
pjb: if we could program the CPU directly, we wouldn't have an issue
<_death>
emacsomancer: check out the APROPOS operator
<pjb>
p_l: there's always a turtle under.
<pjb>
just ask Intel!
<p_l>
pjb: sometimes the turtle has already been cooked
<emacsomancer>
it works when I just sbcl --load it, but not with ql
<p_l>
pjb: instead my solution for any future project involving similar environment is Lisp running on hardened PC, possibly with a C kernel module to handle realtime network
<pjb>
When we'll have quantum processors, the fun!
<TwoNotes>
emacsomancer, sb-ext. See Chapter 14
<emacsomancer>
thanks _death, TwoNotes
<p_l>
pjb: generally PLCs disappointed me a lot over last few months ;)
<pjb>
actually, my point is that without those numerous layer, directly to the CPU, we could eventualy reach the physical layer. Then things become funny. Early computers had some of that fun…
<pjb>
it doesn't have to be quantum physics, it can be anything the computer is implemented on.
bitmappe_ has joined #lisp
johntalent has quit [Quit: leaving]
<pjb>
We should really use legos to implement a lambda calculus on braids of wool…
karayan has quit [Remote host closed the connection]
<White_Flame>
pjb/phoe: yeah, I was purely looking at disassembly-based optimization options, and how to use the tightest shared access to data (closures) in an extensible way
bitmappe_ is now known as bitmapper
<White_Flame>
accessing a slot of a closure is a simple indexing of the function pointer that was entered
<White_Flame>
(in SBCL, speed 3, etc)
<p_l>
White_Flame: beware, speed 3 allows editing function constants :D
<White_Flame>
well yeah, speed 3, safety 0, debug 0, etc
<p_l>
yep
<White_Flame>
with a switch to flip it to fully safe for debugging purposes
<p_l>
I wondered at that time how far I was from simply overwriting the entrypoint
oxum has quit [Ping timeout: 265 seconds]
oxum has joined #lisp
corpix has joined #lisp
oxum has quit [Ping timeout: 240 seconds]
parentheses has joined #lisp
<parentheses>
Hello
<parentheses>
are hash tables really important to common lisp, or can i just skip them over on pcl and then come back?
zulu-inuoe has quit [Read error: Connection reset by peer]
<TwoNotes>
Depends what you are doing. I use them all the time.
jeosol has joined #lisp
<parentheses>
what do you use lisp for?
<Josh_2>
if I have a function that either returns t or signals a condition should I still use -p or not?
<seok>
Hi guys
<Josh_2>
seok: hi
<seok>
Hi Josh!
<seok>
How do I print and flush output to make stuff like progress bars?
<TwoNotes>
parentheses Speech recognition, natural language parsing, database access
<Josh_2>
parentheses: they aren't that important but certainly worth knowing. They are pretty simple ¯\_(ツ)_/¯
<parentheses>
thats neat!
<TwoNotes>
seok (finish-output)
<Josh_2>
seok: (finish-output) (force-output) ?
<seok>
hm, is there one I can do with strings?
<seok>
Do I have to make streams first?
<Josh_2>
Well when you "print" those strings are being written to a stream
<TwoNotes>
seok if outputing to the temrinal, just use T for the stream
<parentheses>
when i finish my lisp study and after making some simple software i might try to develop a roguelike, are they important for roguelikes? tho i will explore everything i can do with lisp and find what i like mre
<Josh_2>
parentheses: It's worth just reading about hashtables because there isn't much to them
<TwoNotes>
Hash tables are the primary "associative memory" of Lisp. Just make sure you set the :test properly
<TwoNotes>
It takes me few lines of code to do most things. And it has an extensive library
<seok>
TwoNotes I don't think library availability is an advantage of CL
<nwoob>
seok: mostly js
<seok>
if you want big community and lots of library probs should head to other big languages should you not?
<ralt>
seok: I think TwoNotes meant the standard library.
<TwoNotes>
When all else fails, there is FFI
<TwoNotes>
And quicklisp
<seok>
What kind of library does he mean?
<nwoob>
it takes few lines of code to do things in JS too and it has very vast library
<TwoNotes>
Does JS even have lexical scoping? I cant remember
<nwoob>
yes
<seok>
JS as in node?
<nwoob>
seok: as in vanilla JS
<seok>
JS is not a programming language though
<nwoob>
but yes node too I have enough exp
<nwoob>
seok: and from where did you learn that
<seok>
its a scripting language is it not? and node is the programming version
<ralt>
seok: that's just being pedantic :)
<seok>
xD
<seok>
Idk, I think the difference matters
oxum has joined #lisp
<seok>
It depends on what you want to get out from programming
<ralt>
and no, it's not a scripting language, that term is not even defined. If you want to be pedantic, at least be correct. The language is ECMAScript. The implementations are: nodejs. v8, etc.
<ralt>
well, not even that
<seok>
If you want a job.. stay away from lisp?
<ralt>
v8 is node's runtime as well
<Josh_2>
CL's incredible metaprogramming abilities is certainly an advantage over basically all other languages
<Josh_2>
while remaining extremely performant
<nwoob>
seok: these type of arguments scripting vs programming attracts shallow arguments
<TwoNotes>
You are not going to be writing raw databases and web servers in JS
<ralt>
you are...
<seok>
ralt I see
kpoeck has left #lisp [#lisp]
<seok>
nwoob what are you looking for in a language?
<Josh_2>
CL also has much nicer syntax that most other languages, much more consistent, creates elegant code :P
<ralt>
I mean, if y'all want to bash on js, go for it, but at least present good arguments. Josh_2 is the only one who had a good one so far.
<nwoob>
looking to widen my knowledge, looking to learn other paradigms
<ralt>
seok: given cl-launch, is Common Lisp a scripting language?
<Josh_2>
Oh right, well I don't think you are gonna find any "new" paradigms in CL, but you will find support for many, and then you can jimmy them together
<seok>
and it says scripting languages are programming languages
<ralt>
"scripting language" is just an ill-defined term those days
<seok>
I guess
<Josh_2>
And if you have no experience with homoiconicity then I think Lisp is a better choice that Julia
<Josh_2>
than Julia*
oxum has quit [Ping timeout: 260 seconds]
<seok>
lisp is a general purpose language
<ralt>
nwoob: I would recommend Common Lisp because it has all the features of all the other languages since the 80's, plus many more (condition system, CLOS, first-class functions, macros, etc etc). Some of those have been implemented in JS. (Did you know that JS was originally inspired by lisp?)
<Josh_2>
haha yes "inspired" It's also apparently a "scheme" XD
pve has quit [Quit: leaving]
<ralt>
JS is a mix between java (the C-like syntax), Scheme (e.g. first-class functions, which was one of the few algol-family languages to have it back then), and Self (the whole prototype stuff)
<aeth>
CL has uniform syntax, which means that language extensions don't look any different from language built-ins. So e.g. (:html (:head #| header stuff goes here |#) (:body (:p "Hello, world!"))) can exist in a macro and it can generate an HTML string at compile time.
<aeth>
And you can usually mix in a variable inside that macro like (:body (:p "Hello, " name)) and it will just turn everything surrounding the variable(s) into a constant string
parentheses has quit [Quit: WeeChat 2.7]
<nwoob>
cool!!!
<aeth>
But trivial macros exist, too. e.g. Someone was complaining about CL not having a simple for loop, but that's just (defmacro for (&rest forms) `(loop for ,@forms)) ; e.g. (for i in (list 1 2 3) do (print i))
<nwoob>
aeth: and I believe one cannot do that in any other language. right?
aeth_ has joined #lisp
<nwoob>
extending the langauge like you showed with for loop example
<MichaelRaskin>
Complicated question
<MichaelRaskin>
Lisp family languages mostly support that
nicktick has joined #lisp
whiteline has joined #lisp
<MichaelRaskin>
Julia requires prefixing macros with @ (and standard library includes quite a few macros)
SAL9000 has joined #lisp
aeth has quit [Disconnected by services]
aeth_ is now known as aeth
<MichaelRaskin>
Simple constructs can sometimes be shoehorned into Ruby's block support to look as if they were native
<MichaelRaskin>
There is Metalua…
<MichaelRaskin>
etc.
<aeth>
Most languages want to restrict the power of the programmer, sometimes for performance or sometimes for simplicity. It's often seen as a problem that macros are indistinguishable from functions, although in practice the various conventions make them easy to spot.
<aeth>
Metaprogramming is generally possible but it's usually (1) hard and (2) distinguishable from something built into the language
andrei-n has quit [Quit: Leaving]
rogersm has joined #lisp
oxum has joined #lisp
rogersm has quit [Ping timeout: 256 seconds]
nwoob has quit [Ping timeout: 272 seconds]
corpix has quit [Ping timeout: 240 seconds]
corpix has joined #lisp
lucasb has quit [Quit: Connection closed for inactivity]
random-nick has quit [Ping timeout: 258 seconds]
oxum has quit [Ping timeout: 256 seconds]
orivej has quit [Ping timeout: 256 seconds]
orivej_ has joined #lisp
nicktick has quit [Ping timeout: 272 seconds]
cosimone has quit [Quit: Quit.]
msk has joined #lisp
<ralt>
is there some tutorial about using cffi groveler/wrapper?
<fe[nl]ix>
no
orivej_ has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #lisp
pjb has quit [Ping timeout: 272 seconds]
<ralt>
would it be an accepted contribution to the manual?
quazimod1 has joined #lisp
<fe[nl]ix>
sure
<ralt>
great. I need to write one for myself.
quazimodo has quit [Ping timeout: 265 seconds]
<ralt>
essentially, the groveller is to write lisp code that goes through C and generates Lisp (the typical use case is being able to grab constants in C macros), whilst the wrapper is to write Lisp code that ends up generated to C and linked as a shared library? What is the typical use case for wrappers? Did I get those correct?
rgherdt has quit [Ping timeout: 260 seconds]
<fe[nl]ix>
wrappers are needed when you need to expose C entities that are not available as ELF symbols: either macros that execute code or built-in operators
<ralt>
macros executing code makes sense, what are built-in operators?
<ralt>
also; ELF symbols is linux-only, right? what would be a common terminology with windows? or is there not, and we should just use "ABI"?