phoe changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <http://cliki.net/> <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.16, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
smasta has quit [Ping timeout: 268 seconds]
smasta has joined #lisp
<White_Flame> (format str " ") to simply spit a space out a stream
<aeth> right, character vs. string
<aeth> You could also do (string #\Space) if you insist on working with characters. but if you're going to do (format stream (string character)) you can just do (format stream "~c" character)
<aeth> There are many, many ways to work with this sort of thing
smasta has quit [Ping timeout: 245 seconds]
<aeth> I would recommend not using "str" here because it's ambiguous whether that means "stream" (correct) or "string" (the format string goes second, not first)
lumm has quit [Quit: lumm]
ltriant has joined #lisp
smasta has joined #lisp
ltriant has quit [Ping timeout: 244 seconds]
<pjb> madmuppet006: (format nil "~C" #\space) #| --> " " |#
<pjb> madmuppet006: (format nil "~{~A~^ ~}" '(1 2 3)) #| --> "1 2 3" |#
smasta has quit [Ping timeout: 255 seconds]
<pjb> aeth: unless it's a string with a fill-pointer.
<pjb> (let ((str (make-array 80 :fill-pointer 0 :element-type 'character :adjustable t))) (format str "Hello ~A!" 'world) str) #| --> "Hello world!" |#
<aeth> well, now that's niche
<pjb> it's probably quite efficient.
<aeth> I expect with-output-to-string is the normal idiom there, and that kind of duplicates it
<aeth> s/expect/suspect/
<pjb> with-output-to-string ist Die große Artillerie.
<pjb> It goes thru streams, probably gray streams; it probably tries to manage memory _asymptotically_ efficiently, which says that for short outputs, it will be worse.
<pjb> It's good when you need to pass the stream around, but ifyou just have a little local formatting, using a string with fill pointer will be better. Notably if you don't need to have it adjustable because you know the maximum length of the output.
<aeth> pjb: note, though, that the fill pointer equivalent does a full copy of the string at the end to get a "normal" string if you want the same output
<aeth> with-output-to-string's copying can cheat at the implementation level, although I'm not sure if any implementation optimizes that copy
<pjb> Nope, you just keep the string with the fill pointer. No need to copy it. CL is a generic programming language!
<pjb> So indeed, there's less copying with the fill pointer, less memory acceses. At least half if not a quarter.
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
<aeth> pjb: To get the identical output, though, you do have to copy it.
<aeth> So that is worth noting.
<aeth> I probably would copy, too, unless it was very large.
<pjb> aeth: nothing says that with-output-to-string won't return an adjustable array with fill-pointer!
<pjb> aeth: notably, check the string-form argument.
sdumi has quit [Remote host closed the connection]
sdumi has joined #lisp
<aeth> pjb: If you wanted maximum portability, you could check the type with typep and copy there, too, conditionally on not getting a simple-string. This would be close to a no-op (just the typep returning T) on all popular implementations afaik.
<pjb> aeth: for one thing, an implementation could make all arrays adjustable. (it would simplify the implementation).
Kundry_Wag has quit [Ping timeout: 244 seconds]
<pjb> typep doesn't distinguish vectors with fill pointers or adjustable arrays.
<pjb> the specifications says they return strings, not simple-string.
<aeth> pjb: If simple-strings are adjustable with fill pointers in that implementation (if that's allowed) that doesn't matter. The issue is when you have an API that expects a simple-string and you don't give it
rumbler31 has quit [Read error: Connection reset by peer]
<pjb> aeth: then you're using a broken library. :-)
<pjb> again, CL is a generic programming language.
<pjb> But in anycase, if you want to pass the string returned by with-output-to-string or get-output-stream-string to a function expecting a simple-string, you need to copy it to be conforming.
<aeth> pjb: This fixes your portability concerns with the return type of w-o-t-s: (let ((string (with-output-to-string (out) (format out "Hello, ~A!" "world")))) (if (typep string 'simple-string) (copy-sequence 'simple-string string)))
<aeth> Unless, of course, copy-sequence there doesn't have to copy up to the fill pointer, then you have to add some more complicated logic
<pjb> Yes. WHich shows you that using libraries expecting simple-string is idiotic.
<pjb> It makes you copy stuff all the time.
Kundry_Wag has joined #lisp
<aeth> that's a conditional copy that's close to a no-op (it does have to do the typep) in most if not all implementations, I don't see a problem with that
<aeth> If you're not using SBCL it doesn't have to be fast, anyway. ;-)
Kundry_Wag has quit [Read error: Connection reset by peer]
Kundry_Wag has joined #lisp
rumbler31 has joined #lisp
<pjb> (coerce (replace (make-array 80 :fill-pointer 5 :element-type 'character) "Hello") 'simple-string) #| --> "Hello" |#
<aeth> my bad, I deleted an important part of the logic, this is the correct code: (let ((string (with-output-to-string (out) (format out "Hello, ~A!" "world")))) (if (typep string 'simple-string) string (copy-sequence 'simple-string string)))
<aeth> in case someone was following along at home
<aeth> (the intent was pretty clear, though)
<pjb> copy-sequence doesn't exist.
<aeth> pjb: alexandria:copy-sequence, which then fixes my concerns about portability :-)
<pjb> Anyways, since you already have to do that, you can use strings with fill pointers instead of streams.
<aeth> (copy-sequence 'simple-string (make-array 10 :element-type 'character :adjustable t :fill-pointer 2 :initial-element #\#)) => "##" ; note that it doesn't copy the trailing 8 characters, which is exactly the behavior we want
<pjb> and neither does: (coerce (replace (make-array 80 :fill-pointer 5 :element-type 'character) "Hello") 'simple-string) #| --> "Hello" |#
<aeth> I guess that's the more correct approach because it doesn't use alexandria, my bad
smasta has joined #lisp
smasta has quit [Client Quit]
mindCrime has joined #lisp
elderK has joined #lisp
pierpal has joined #lisp
aindilis has quit [Read error: Connection reset by peer]
aindilis has joined #lisp
mindCrime has quit [Ping timeout: 246 seconds]
ebrasca has quit [Remote host closed the connection]
Aruseus has quit [Remote host closed the connection]
t58 has quit [Quit: Night]
khisanth_ has quit [Ping timeout: 246 seconds]
Kundry_Wag has quit [Remote host closed the connection]
aeth has quit [Ping timeout: 255 seconds]
aeth has joined #lisp
khisanth_ has joined #lisp
grewal has quit [Remote host closed the connection]
torbo has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 268 seconds]
_whitelogger has joined #lisp
esrse has joined #lisp
quazimodo has quit [Ping timeout: 264 seconds]
anewuser has joined #lisp
ltriant has joined #lisp
ltriant has quit [Ping timeout: 245 seconds]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 244 seconds]
rumbler31 has quit [Read error: Connection reset by peer]
fanta1 has joined #lisp
rumbler31 has joined #lisp
fanta1 has quit [Quit: fanta1]
loke has quit [Read error: Connection reset by peer]
<aeth> Might as well ask it again (has it been a week?) because it's Sunday-night-into-Monday-morning. What's going on in the CL world? Any interesting projects?
gravicappa has joined #lisp
orivej has quit [Ping timeout: 268 seconds]
<beach> Good morning everyone!
loke has joined #lisp
kajo has quit [Ping timeout: 268 seconds]
cyberoctopi has quit [Ping timeout: 244 seconds]
p0a has joined #lisp
cyberoctopi has joined #lisp
<p0a> Hello
<minion> p0a, memo from pjb: https://pastebin.com/uDqfg7fR
<p0a> oh that's good stuff, thank you
electrosnake has joined #lisp
refpga has quit [Remote host closed the connection]
torbo has quit [Remote host closed the connection]
Aurora_iz_kosmos has joined #lisp
<Aurora_iz_kosmos> Does cl-irc dispatch events only when the `read-message-loop' function is running, or also in the background?
<electrosnake> Hi to all! I have a question on Common Lisp. I began to study that interesting language just yesterday, I chose a simple but quite brilliant book "Land of lisp", but here's a place I cannot fully understand: "The eq function is the simplest of all the Lisp comparison functions, and it’s also very fast. It doesn’t really work for comparing items besides symbols, but if you consider the central role symbols play in Lisp, you’ll
<electrosnake> that a common place or just an SBCL-specific thing, and is there any ideology behind that ?
<electrosnake> how useful this function can be. Experienced Lispers might look down on code if it compares two things, known to be symbols, with something other than eq". So I've tried, and that's what I see in my SBCL session: (eq 1 1) is T, (eq 1 '1) is T and even (eq 1.23 1.23) and (eq 1.23 '1.23) are both T. But there is a difference with rationals: (eq (/ 2 4) (/ 1 2)) is NIL, even (eq (/ 1 2) (/ 1 2)) is NIL, but (eq (/ 2 1) (/ 2 1)) is T.
<z3t0> Is there a way to tell slime where the source files for a project are? (that is after connecting to a swank server)
<beach> electrosnake: That would be typical behavior.
<p0a> electrosnake: it's not an SBCL thing
<beach> electrosnake: EQ compares pointers. It so happens that small integers are represented directly in the pointer. They are called fixnums.
<beach> electrosnake: However, ratios are allocated on the heap, so two ratios with the same value are represented as two different chunks of memory, so the pointers are different.
<stylewarning> z3t0: slime doesn't know about "projects"
<stylewarning> it knows about things like interned symbols and where they came from
<stylewarning> DEFGLOBAL should be a part of common lisp, so should global lexical variables
<Aurora_iz_kosmos> z3t0: Slime has a compatibility blob for asdf
<Aurora_iz_kosmos> `slime-asdf'
<electrosnake> beach and others, thank you very much for your thorough explanations. I see now that you are right:
<electrosnake> CL-USER> (eq 12345678901211114 (+ 1 12345678901211113))
<electrosnake> CL-USER> (eq 123456789012111111114 (+ 1 123456789012111111113))
<electrosnake> T
<electrosnake> NIL
<electrosnake> CL-USER> (eq 123456789012111111114 123456789012111111114)
<p0a> pjb: can you explain (reduce #'* indices) ? Doesn't look right. Is that for multi-arrays?
<electrosnake> NIL
<stylewarning> electrosnake: (eq (1+ most-positive-fixnum) (1+ most-positive-fixnum))
<electrosnake> stylewarning Wow ! I think I understood, just one moment: why
<electrosnake> CL-USER> (eq '123456789012111111114 '123456789012111111114)
<electrosnake> NIL
<electrosnake> CL-USER> (eq 'a123456789012111111114 'a123456789012111111114)
<electrosnake> T
<electrosnake> Does CL convert symbols to numbers automatically ?
ltriant has joined #lisp
<stylewarning> No, '1 is (quote 1) which is (quote <the integer 1>)
<stylewarning> 'x1 is (quote x1) which is (quote <the symbol named "X1">)
<stylewarning> quote/' don't "make symbols", so indeed, '<integer> will just give you back an integer
<stylewarning> you can make a symbol which is named by digits by using |...|, like so: '|123|
<stylewarning> but 123 is an integer, and |123| is a symbol whose name is "123"
<p0a> stylewarning: I think you can't have symbols with just numbers but I could be wrong
<stylewarning> p0a: you absolutely can
<electrosnake> Am I right that quote is not a function, but a special form, that @evaluates" integer (or floating) numbers to themselves, but otherwise creates symbols ?
<p0a> stylewarning: thank yuo, was wrong
quazimodo has joined #lisp
<stylewarning> electrosnake: there's a more nuanced answer than that, consider: '(x 1)
<stylewarning> electrosnake: this will return a list containing the symbol x and the integer 1
ltriant has quit [Ping timeout: 246 seconds]
<stylewarning> electrosnake: quote is more like "return the object literally, don't evaluate"
<stylewarning> electrosnake: 'x says "return the symbol X literally, don't try to find its value", similarly, '1 says "return the value 1 literally (which is itself) and don't evaluate (there's not even a need to)"
<stylewarning> '(F 1) says "return the list (F 1) literally, don't try to call a function named F on the argument 1"
<electrosnake> stylewarning - and '(x 1) is synonim to (quote (x 1)) ?
<stylewarning> correct
<pjb> electrosnake: (eq (1+ most-positive-fixnum) (1+ most-positive-fixnum)) #| --> nil |#
<stylewarning> p0a: you can make a symbol out of any string. Try it yourself: CL-USER> (make-symbol "Hello! My name is *stylewarning* and my phone # is 555-1234!")
<stylewarning> #:|Hello! My name is *stylewarning* and my phone # is 555-1234!|
<p0a> stylewarning: thanks, I believe you
<pjb> electrosnake: anyways, LoL is mostly wrong. Never use EQ. Use EQL when you want to test the identity of objects.
<pjb> p0a: you're right.
<p0a> pjb: thanks
<p0a> Here's a question: How can I write f better? https://pastebin.com/MeMxc4YJ
<p0a> What it does is it copies #(10 20 30) to v and then sets the fourth element to i squared.
<aeth> '|More directly you can just do this to use basically any string as a symbol.|
<p0a> But isn't there some call to MAKE-ARRAY to make the #(10 20 30) copying shorter?
Aurora_iz_kosmos has left #lisp ["WeeChat 1.6"]
<p0a> aeth: good stuff for obfuscation!
<stylewarning> p0a: yes it can be written better
<p0a> '|{*_*}'|
<p0a> stylewarning: I'd appreciate any comments
<electrosnake> pjb thanks ! I think I would not use EQ, but still I want to understand how it works deep inside :) Now this is quite weird:
<electrosnake> CL-USER> most-positive-fixnum
<electrosnake> CL-USER> (eq (+ 1 most-positive-fixnum) (+ 1 most-positive-fixnum))
<electrosnake> 4611686018427387903
<electrosnake> NIL
<electrosnake> CL-USER> (eq 4611686018427387904 4611686018427387904)
<electrosnake> NIL
<electrosnake> CL-USER> (eq 461168601842738790.4 461168601842738790.4)
<electrosnake> T
<electrosnake> CL-USER> (eq 4611686018427387904.1 4611686018427387904.1)
<electrosnake> T
<electrosnake> So floating points are always eq if they are equal ?
<stylewarning> p0a: this is based off of your description: http://codepad.org/cL2xcGql
<stylewarning> electrosnake: no, depends on implementation, but most implementations have EQ-able single-floats
<jeosol> morning guys.
<aeth> electrosnake: if you want to be more concise in lines, the convention is to use => before the output so e.g. (1+ 1) => 2
<stylewarning> electrosnake: if you use double floats, it won't be the case anymore
<edgar-rft> electrosnake: floats are only EQ if it's two times the same float stored at the same memory location
<stylewarning> p0a: but I can offer better advice still, if you have a more concrete thing you're implementing
<p0a> stylewarning: I haven't yet looked at your code but let me describe what I'm doing
<aeth> stylewarning: It's not as simple as it seems. In SBCL: (eq 1d0 1d0) => NIL
<aeth> but (defun foo () (eq 1d0 1d0)) (foo) => T
<aeth> :-)
<p0a> stylewarning: I have a score function and some data (a vector). I want to run N=100000 trials say; I want to score data + one more random element
<stylewarning> aeth: yes, all of this is pretty implementation dependent and location dependent and w/e. Using EQ with numbers is bad from the get-go.
<aeth> exactly
<aeth> especially once you go beyond fixnums
<jeosol> How would you deploy a CL application with some code protection and the application will use data that can't must be on client's premise (data can't live country)?
<pjb> electrosnake: the standard doesn't enforce unicity of characters or numbers. Since they are immutable, implementations are free to make copies of them at any time.
<p0a> jeosol: I don't understand you
<stylewarning> jeosol: what counts as "code protection"?
<jeosol> p0a, stylewarning: I guess IP protection, wrong choice of words there
<pjb> electrosnake: so even (let ((x 1)) (eq x x)) can return nil: the implementation could copy the integer 1 upon passing it as parameter (and thus two different instances can be created before EQ is called).
<p0a> jeosol: IP protection for the code itself?
<p0a> jeosol: can you offer an example in another programming language?
<pjb> electrosnake: the point is that it's implementation dependent. Conforming code cannot depend on that.
<stylewarning> p0a: what does each trial do?
<jeosol> an example will be a desktop installed software the client currently uses
<jeosol> from a large corporation
<stylewarning> jeosol: you can compile Lisp code into native executables, just like a C++ program
<p0a> stylewarning: data has n elements; v has n+1 elements; each trial replaces (svref v n) with some random number and then scores v
<p0a> stylewarning: btw your code is awesome
<p0a> stylewarning: so v contains data in the first n elements and only the last element is being replaced every time
<stylewarning> p0a: how do the data elements and v elements interact?
<jeosol> stylewarning: So I compile, ship to them to run it? Still exploring options. These guys are not very savvy to run things on the command line and so may need a GUI interface
<p0a> stylewarning: just explained
<p0a> jeosol: you can write a wrapper in python for the gui interfac e
<pjb> p0a: you can use REPLACE or :INITIAL-CONTENTS
<stylewarning> jeosol: you might do well with a commercial implementation of Lisp then, like LispWorks
<jeosol> is anyone licensing CL application and if so how are they doing it?
<p0a> jeosol: or use LispWorks
<stylewarning> jeosol: we did, but we open sourced it
<jeosol> stylewarning, p0a: ok, haaaa.
<p0a> pjb: I didn't find :initial-contents to work if v is larger than data
<pjb> p0a: (let ((n 3)) (let ((v (make-array 4 :initial-contents #(10 20 30 0)))) (loop for i upto n do (setf (svref v 3) (* i i)) collect (copy-seq v)))) #| --> (#(10 20 30 0) #(10 20 30 1) #(10 20 30 4) #(10 20 30 9)) |#
<p0a> pjb: say (make-array 4 :initial-contents #(1 2 3))
<pjb> you can pad.
<aeth> You generally have two options. The Java option of assuming the runtime is installed and just loading the FASLs (like JARs) or the other option, which is to bundle an entire Lisp runtime with each application as an executable. I don't think you can safely assume the presence of the runtime like Java people can, unless (1) you're using ABCL on the JVM or (2) you're using your own computer
<p0a> pjb: the problem is that I have to pad yes.
<jeosol> stylewarning: this is your rigetti work?
<p0a> pjb: that's inefficient though
<stylewarning> jeosol: yes
<pjb> (let ((n 3)) (let ((v (make-array 4))) (replace v #(10 20 30 0)) (loop for i upto n do (setf (svref v 3) (* i i)) collect (copy-seq v)))) #| --> (#(10 20 30 0) #(10 20 30 1) #(10 20 30 4) #(10 20 30 9)) |#
<stylewarning> jeosol: at one time the apps were closed source and deployed to various customers
<pjb> p0a: not for 1. make-array will usuall fill the array anyways.
<jeosol> I have done all my development on SBCL?
<stylewarning> jeosol: Who?
<p0a> pjb: what I mean is that it's inefficient to transverse data twice
<jeosol> stylewarning: which implementation are you guys using mostly and with the open-sourcing, how does that impact licensing. Novice there
<p0a> pjb: once for the pad and once for the make-array copy
<jeosol> stylewarning: I meant I have done all my development on SBCL
<aeth> p0a: what are you trying to do?
<p0a> aeth: I have a score function and some data (a vector). I want to run N=100000 trials say; I want to score data + one more random element
<p0a> aeth: I think stylewarning already helped me with a solution
<jeosol> stylewarning: meant i'm novice on licensing of things
<p0a> jeosol: LispWorks is pretty good. You can get a free copy if you provide your information to the company
<p0a> jeosol: it streamlines the whole process. the premium versions have a lot more features too
<p0a> if you have some money to throw around to save yourself a headache go for it
<stylewarning> p0a: http://codepad.org/NPuYCW1H
<aeth> p0a: and why do you think there's going to be copying?
<stylewarning> jeosol: Licensing is a legal aspect and has nothing to do with deployment, usually.
<p0a> aeth: I have data of n elements; I don't want to modify it
<jeosol> p0a: Is this the version that limits the size of the application. Tried this a while ago in the past
<stylewarning> jeosol: Licensing are terms that your customers/users abide to with respect to the usage of your software.
<p0a> aeth: I have v of n+1 elements; copy data to v; run N trials replacing the last element of v with a random element and scoring v; keep the best v
Arcaelyx has quit [Ping timeout: 245 seconds]
<p0a> aeth: that requires copying data to v; so you transverse data once. That's all. Any other solution is suboptimal in the sense that it does more
<stylewarning> p0a: I'm not sure why you want V to have a copy of DATA, but the above code does sort of what you're saying
<jeosol> stylewarning: thanks for that.
<pjb> p0a: for such small arrays, it's more efficient to do it like you did, with copy-seq.
<p0a> pjb: actually it's a large array though
<pjb> Notice that to initialize the array with :initial-contents, you need already a sequence allocated!
<p0a> don't worry I got it, I know how to do this now lol
<pjb> for a larger array it's different.
<p0a> I think I want to make-array without intiializing the contents
<jeosol> p0a: is this free copy version limited in features or time-limited (set to expire) but will most features?
<p0a> jeosol: look up lispworks and see if it works for you
<p0a> the details are on the website
<pjb> But still, you could have a static array pre-filled, and mutated, and make a copy of it. This would be the best.
<stylewarning> jeosol: the free version is very limited in features/times/etc.
<p0a> pjb: exactly that's what I'm doing
<pjb> Unless you choose to use closures instead of arrays, in the case they're big.
<pjb> p0a: you can use load-time-value to define a "static array".
<pjb> (let ((n 3)) (let ((pattern (load-time-value (make-array 4 :initial-contents #(10 20 30 0))))) (loop for i upto n do (setf (svref pattern 3) (* i i)) collecting (copy-seq pattern)))) #| --> (#(10 20 30 0) #(10 20 30 1) #(10 20 30 4) #(10 20 30 9)) |#
<p0a> What is load time value?
<pjb> clhs load-time-value
<p0a> Also, can you define an array without initializing the contents?
<pjb> next time you enter the function the same pattern array is reused, not re-initialized.
<stylewarning> I highly recommend not going down this rabbit hole without understanding the application at hand
<pjb> p0a: you can. depending on the optimization the implementation may or may not actually initialize it.
<pjb> This is why it's not conforming to read a slot that hasn't been initialized yet.
<p0a> stylewarning: I'll avoid it then
<p0a> It's a bit weird
<stylewarning> L-T-V is very useful when it's actually needed, but that's very rare
CuriousCain has quit [Quit: WeeChat 2.2]
<p0a> pjb: ah, I see. That's a good thing
<pjb> But the thing is that you initialize it partially with a fixed value. So you can avoid re-initializing it all the time.
<aeth> this doesn't seem like the simplest solution, but I'm afraid I'm missing details so I can't provide a simple one
<jeosol> p0a, stylewarning: thanks for your inputs. Will explore Lispworks again, but free option is limited, so will have to purchase when I get some users or investment.
Arcaelyx has joined #lisp
<electrosnake> pjb yes, now I think I understood. Now after some experiments I have another question. What is |...| ? I see that '|123| => |123| and (make-symbol "123") => #:|123|. Can you explain, please, what these answers mean ?
<p0a> jeosol: if money is an issue I'd recommend you read some articles on deploying software with SBCL
<stylewarning> jeosol: LispWorks is the "easiest" if you want GUIs, executables, commercial support, etc. You can get far with free things like SBCL though.
catchme has joined #lisp
<aeth> jeosol: I'd describe it as "extremely limited", not "limited"
<pjb> electrosnake: it's just a syntax to read symbols containing non-constituent characters.
<p0a> jeosol: PySimpleGUI (python) wrappers to commandline CL applications can be useful too.
<aeth> pjb, p0a, stylewarning: Sounds like it would just be easier to make the initial-contents as a list in a macro
<pjb> electrosnake: basically, spaces or terminating symbol-macros, or also, characters of different cases when the reader is configured to map them to uppercase, or lowercase or to invert them, instead of preserving the case.
<p0a> aeth: Agreed
<p0a> aeth: basically a better make-array.
<pjb> aeth: copy-seq will do that. (make-array (length original) :initial-contents original)
<pjb> but better use a vector as initial content rather than a list.
<pjb> electrosnake: check chapter 2 of clhs.
<aeth> pjb: I mean something like this: `(make-array 42 :initial-contents ',(loop :for i :from 0 :below 42 :collect i))
<stylewarning> (I personally find it bad form to use INITIAL-CONTENTS when the contents aren't the same size as the array.)
<jeosol> p0a: Money is definitely an issue. I have read up on options for deploying with SBCL. I can deploy executable to aws instances/ or other machines. The issue is that users tend to run things off a GUI and commandline or slime will be very foreign
<pjb> aeth: again, it's more efficient to use a vector instead of a list.
<pjb> stylewarning: it's not bad style, it's impossible.
<p0a> jeosol: like I said, write a wrapper.
<p0a> jeosol: PySimpleGUI will have you with a GUI in seconds
<stylewarning> pjb: then i misunderstood what you guys are saying with this stuff about using initial-contents for an array that's not the same size
<aeth> pjb: Something seems wrong here because in a reversal of roles I'm the one who is saying that the performance here doesn't matter. Well, as long as it's in the macro, not at runtime. Unless it's *really* huge.
<p0a> stylewarning: bad form? I think you can't even do it
<jeosol> stylewarning: To align with the users using other software, I will check Lispworks, but cost issue
<aeth> jeosol: Unfortunately the cost will probably be a major issue. Niche language compilers are why niche languages stayed niche in the 1990s and 2000s. Way more expensive than you think.
<pjb> electrosnake: #: means the symbol is not interned in any package. We use INTERN to create normal symbols (interned symbols): (list (intern "123") (intern "abc") (intern "ABC") (make-symbol "ABC")) #| --> (|123| |abc| ABC #:ABC) |#
<jeosol> p0a: ok, I will look into pySimpleGUI, but my recent experience working with python wasn't the best. I have no choice.
<aeth> s/Niche language compilers/Commercial niche language compilers/
<jeosol> aeth: Yes, cost is a major issue now for me.
<pjb> aeth: it's just for the sake of discussion :-) We're both right. p0a will have to decide what matters in his case.
<p0a> jeosol: python is crap I agree, but PySimpleGUI is a really fast way to get GUI out there.
<p0a> once the money pours in you can do something better
electrosnake has quit [Ping timeout: 257 seconds]
<jeosol> p0a: thanks, I will check it out.
<pjb> p0a: or most of https://cliki.net/GUI
<jeosol> I am also concerned about scale if Lispworks may just be the best route, or work with SBCL and related tools, staying in CL as much as possible
<pjb> including https://cliki.net/pgl
<jeosol> by scale, I mean size of my application
<p0a> jeosol: I'm very inexperienced with common lisp
<p0a> jeosol: and others here are better so take my advice with a grain of salt
aindilis has quit [Ping timeout: 246 seconds]
<stylewarning> p0a: my advice is to really just start spending time writing your app, get as far as you can with sbcl without writing GUIs and stuff
<aeth> jeosol: if you need a GUI afaik the only option right now is the Qt bindings unless (1) you want it to be 3D-accelerated and use OpenGL (massive amount of work and you wouldn't get native look and feel) or (2) you want to use McCLIM which is still a work in progress
<p0a> why do I get #(0) is not of type SIMPLE-VECTOR?
<p0a> stylewarning: thanks, that's for jeosol thogh I think
<stylewarning> whoops, yeah
<stylewarning> sorry
<aeth> jeosol: (I'm talking about a portable GUI)
<aeth> I'm not sure which library is the mature QT bindings. Maybe commonqt?
<aeth> Oh sorry, you can't use McCLIM right now if you want native-feeling Windows support. It looks like it currently only has the CLX (X11) backend.
<jeosol> aeth: Thanks. While I need 3d support, I can do without that for now. I normally write vtk files to be viewed in paraview (opensource 3d tool)
<jeosol> stylewarning: The backend/engine works well. Been working on this for years. It's the deployment and interaction that I'm having to deal with now.
<jeosol> if I do a consulting gig with the application, then I can get some dough to get Lispworks and write the GUI pars and commercial side
cyberoctopi has quit [Ping timeout: 246 seconds]
<aeth> jeosol: if you can get another GUI solution to work that's more money for you, though.
<stylewarning> jeosol: What does your application/engine do?
<jeosol> aeth: Yes, that is true and I'll prefer that option
<jeosol> stylewarning: Its a large system that I wrote over the years. I'll say mathematical and stochastic optimization with application in different areas. This link is a dump of the repo Jan 2018: https://www.youtube.com/watch?v=sgdiRh-alfQ
<aeth> jeosol: Imo, and I don't have the numbers so it might not be true, it would probably be more productive to pay someone to work on either existing/new GUI toolkit bindings or a Windows McCLIM backend or an OpenGL-based GUI (e.g. like what Blender uses), and probably not that much more expensive.
<aeth> And the Qt bindings might just work, anyway.
cyberoctopi has joined #lisp
<stylewarning> jeosol: cool
karlosz has quit [Quit: karlosz]
<jeosol> apologies if that is not clear enough. It is objected oriented and relies on CLOS "heavily"
Kundry_Wag has joined #lisp
<jeosol> stylewarning: thanks.
<jeosol> aeth: I work with Linux mostly. I can't afford to pay anything now, but if I get some gig with this sure
<jeosol> reason for my deployment and data question above, I spoke a guy in middle east about possible application, he said their data can't leave the country, otherwise, I could have gotten the data, worked on it remotely
Kundry_Wag has quit [Ping timeout: 255 seconds]
<p0a> then go to the middle east and work there
<p0a> if you have a job there I mean
<p0a> otherwise why are you writing software for free for someone whose data cant' leave the country lol
<jeosol> p0a: I am not writing software for them, it was just a potential user. Different countries have different data specifications in different industries
Folkol has quit [Read error: Connection reset by peer]
<p0a> Oh okay, I see
<p0a> jeosol: they should be able to provide you with fake data
<p0a> jeosol: if you want to do test runs
<jeosol> They use locally installed software most times. Moving there, if I get a box, I could prove the concept
<jeosol> p0a: I have done all that. I can generate research data, and there are various open source data in the space. That is what I used to develop and test the codes
<p0a> then what's hte rpoblem?
varjag has joined #lisp
<jeosol> not a problem. I am only exploring CL deployment options something that could be scalable. For now, I can try the consulting approach. Issue is the data and I can't live in the ME for now.
<p0a> ok
cyberoctopi has quit [Ping timeout: 246 seconds]
<jeosol> aeth: will explore CL qt-based option. Hope I didn't bite more that I can chew
<aeth> Unfortunately, this stuff is hard in most languages because native GUIs are uncool these days.
<p0a> How can I cdr n times in a list?
TikityTik has joined #lisp
<TikityTik> can i get an example of two functions that compute the same thing but one returns the value and the other returns nil?
<TikityTik> computing (+ 2 2) is fine
<p0a> TikityTik: huh?
<TikityTik> i want to know how you can choose returns values in lisp
<TikityTik> like progn prog1
<TikityTik> how prog is able to do that if you can't use prog
<aeth> p0a: you cdr n times in a list with nthcdr
<p0a> aeth: thank you
<aeth> p0a: (nthcdr 10 (list 0 1 2 3 4 5 6 7 8 9 10 11)) => (10 11)
<p0a> aeth: If I have a list L, how can I append to it without transversing it N times in a loop that runs N times?
<aeth> p0a: do you want to append to the front or append to the back?
<TikityTik> how do i explicity not return a value or return a value with when making a function via defun?
<p0a> aeth: ah, it doesn't matter. Thanks for bringing that up, it makes it easier
<TikityTik> if i'm making a side-effect function
<p0a> aeth: can I trust the GC in lisp?
<aeth> p0a: what do you mean?
<p0a> aeth: say I have (cons x (cons y (cons z L))) and this runs 1000000 times. I use the new list (x y z . L) and then I forget about x,y,z.
<jeosol> thank you guys for the input. Will explore the recommendations
<p0a> aeth: can I trust that x,y,z are forgotten ?
<aeth> TikityTik: If you want to not return a value, you can return (values) which returns 0 values. It's probably just better to return NIL because most of the time (but not all of the time) returning no values is equivalent to returning NIL.
<TikityTik> aeth: can i see an example of a defun that does and doesn't but does the same side effect?
<aeth> (The missing value is filled in with NIL by default in most cases, but not in multiple-value-call or multiple-value-list.)
<TikityTik> i'm trying to understand how side effect functions work
<aeth> TikityTik: (defun foo (a) (setf (aref a 2) 42)) ; sets the 2nd element of a to 42 and returns 42
<aeth> TikityTik: (defun foo (a) (setf (aref a 2) 42) (values)) ; sets the 2nd element of a to 42 and returns nothing
<aeth> And it's very similar to return NIL instead of (values) which I personally prefer.
<TikityTik> interesting
<TikityTik> thanks
<aeth> (values 1) is equivalent to ending the function with 1. (values) returns nothing. (values 1 2 3 4 5) will return 5 values.
pierpal has quit [Ping timeout: 246 seconds]
<p0a> How can I write a reader macro? Like #P(a b) ?
<aeth> TikityTik: and yeah if you're not used to lots of side effects it is pretty strange to see that extra value in the end just for the return value. It's a bit less strange when it's on more than one line, but only a bit
<aeth> p0a: two kinds of reader macros. Normal reader macros are basically anything goes. The kind you're talking about, beginning with #, are dispatch reader macros.
<p0a> I want #P(a b) to be (make-point a b)
<p0a> got it
<aeth> basically you need to parse a character stream
<p0a> aeth: thanks, CLHS has an example
<p0a> aeth: http://clhs.lisp.se/Body/f_set__1.htm this actually
<aeth> p0a: that's the other half, yes.
<p0a> aeth: I'm a bit confused but I'll try to figure it out
aindilis has joined #lisp
<aeth> it's very confusing
<aeth> I think the only one I wound up keeping instead of abandoning was my bf reader macro
<p0a> that's sweet of you doing that for your bf
<p0a> but is it turing complete? :P
<aeth> I like how Gitlab correctly identifies it as 10.7% brainfuck
<p0a> tape length 30000, standard conforming I see
<p0a> that's messed up
<p0a> lol
<aeth> You can have a number there before the dispatch character, so I made that be tape length, as a memory optimization, if you want to push your luck at guessing how small the tape can safely be
<aeth> (#4f(+++++++++[>++++++++<-]>.<+++[>++++++++<-]>+++++.+++++++..+++.>++++[>++++++++<-]>.<<<+++[>--------<-]>.<+++[>++++++++<-]>.+++.------.--------.>>+.<++++++++++.))
<p0a> there's no safety in brainfuck
<p0a> just different behavior
<p0a> if you want a tape length of 1, you're welcome to do that. assuming of course cyclic memory :P
<p0a> can you imagine if we had "the BF'19 conference"
<aeth> Notice two things with this reader macro. First, I don't have it directly evaluate, I have it return a lambda, so I wrap it in outer ()s to evaluate it. Second, I make sure to delimit it with ()s on either side, which isn't required, but good luck dealing with reader macros without that
dddddd has quit [Remote host closed the connection]
<aeth> It could technically really mess with things because while it does end with the first ) I think it will accept as many (s as you want in there.
vlatkoB has joined #lisp
<p0a> well, I did it.
<p0a> I used the #P-reader stuff from cLHS
<p0a> coffee and rock music is where it's at
rjid has joined #lisp
cyberoctopi has joined #lisp
rumbler31 has quit [Remote host closed the connection]
rjid has left #lisp [#lisp]
cyberoctopi has quit [Ping timeout: 246 seconds]
<loke> aeth: THat's amazing. Don't listen to the haters.
<aeth> loke: what it really is is a test for my Scheme implementation because as long as the parentheses-balancing is overriden to end on the final ) that closes the reader macro's opening (, what that shows is that I can basically just use any CL-implemented programming language as long as that language's reader (designed to read .foo files) is written in a compatible way.
<p0a> How can I refer to the last evaluated expression in slime?
<p0a> i.e. (+ 1 2) ==> 3 and now do something like (f 3) ?
karlosz has joined #lisp
karlosz has quit [Client Quit]
cyberoctopi has joined #lisp
<aeth> p0a: it's not actually a slime feature it's a built-in REPL feature
<p0a> okay
<p0a> that makes sense
<aeth> + is the last expression evaluated so + will return (+ 1 2)
<aeth> You probably mean the last result though?
<aeth> * will return 3
<p0a> nice, thank you
<p0a> heh, that's funny
<aeth> the see also links are actually broken and link to the functions rather than the variables
<aeth> e.g. + links to #'+
fanta1 has joined #lisp
ltriant has joined #lisp
<p0a> why is gnuplot such a pain in the ***
<no-defun-allowed> vgplot <--
<no-defun-allowed> (vgplot:plot '(1 2 3) '(4 5 6)) ; no big deal
<p0a> what does that do?
<p0a> I want a heat map
<p0a> of z values only
<no-defun-allowed> That plots a line graph. I think there are many graph types supported, there is a demo for vgplot too.
<p0a> I really hate gnuplot but vgplot doesn't look right
<p0a> the README is almost empty
<p0a> why did that person even bother writing it
<p0a> the README I mean...
<p0a> nevermind, there's a doc/ lol
ltriant has quit [Ping timeout: 244 seconds]
<aeth> p0a: did the readme mention that?
sdumi has quit [Quit: Quit]
<p0a> yeah
<p0a> I'm just being stupid
Ukari has quit [Quit: Leaving.]
Ukari has joined #lisp
nowhere_man has joined #lisp
anewuser has quit [Quit: anewuser]
<p0a> damn I'm so frustrated with common lisp
<p0a> spend close to 2 weeks rewriting this in CL
<p0a> and it's not fast
<p0a> my C++ solution was better
<no-defun-allowed> Have you tried profiling your code?
<p0a> no I haven't to be honest but I'm sick of learning more and more stuff lol
<p0a> originally I wanted to write it in CL so that I can have better interactivity with the code
<p0a> because in C++ I had to dig in the source code and add more features with command line flags every time I wanted something new
<p0a> but now somehow even a 100x100 array is making it give up
<p0a> well it takes like 10 seconds for the 100x100 file, but the operation I run is O(1) so that's about 10000 operations. Idk.
<no-defun-allowed> Here's an excerpt from my "Making Lisp Go Faster" For Dummies book which may or may not exist:
<p0a> huh? lol
<p0a> let me also note that the CL version has like +300 lines of code and my C++ one has ~ 150 with code repetition lol
<p0a> you can't replace experience with features
<no-defun-allowed> You can do these, roughly in order - Make sure you aren't using lists (conses) for random access since those are O(n) - Run the profiler (SBCL has sb-prof:profile and sb-prof:report) - Add type declarations and inlines (but then remove them if they don't change much, since they hinder your performance as a programmer and limit flexibility)
<no-defun-allowed> That's very odd for CL, usually you would expect the inverse ratio for LOC
<p0a> yeah well.
<p0a> well, whatever. back to C++ for this one
<p0a> also I cant' run (sb-prof:profile) for some reason
<p0a> neither require it
<p0a> but anyway I'm giving up now fukc I'ms o frustrated lol
p0a has quit [Quit: bye]
SaganMan has joined #lisp
* no-defun-allowed sighs
<aeth> I would ask in #sbcl for optimization advice, arrays of numbers can get quite optimized
catchme has quit [Quit: Connection closed for inactivity]
<fiddlerwoaroof> Weird, emacs is now indenting forms wrong
TikityTik has quit [Ping timeout: 246 seconds]
<fiddlerwoaroof> If I put each argument of a + on its own line, the second and following lines are indented a column too far
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 255 seconds]
Lord_of_Life has quit [Ping timeout: 246 seconds]
Lord_of_Life has joined #lisp
orivej has joined #lisp
pierpal has joined #lisp
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #lisp
pierpal has quit [Ping timeout: 244 seconds]
orivej has quit [Ping timeout: 250 seconds]
angavrilov has joined #lisp
Arcaelyx has quit [Ping timeout: 255 seconds]
ltriant has joined #lisp
ltriant has quit [Ping timeout: 246 seconds]
CrazyEddy has joined #lisp
orivej has joined #lisp
pankajgodbole has joined #lisp
electrosnake has joined #lisp
Kundry_Wag has joined #lisp
shka_ has joined #lisp
Kundry_Wag has quit [Ping timeout: 244 seconds]
rumbler31 has joined #lisp
rumbler31 has quit [Ping timeout: 255 seconds]
SaganMan has quit [Ping timeout: 245 seconds]
kucli has joined #lisp
defaultxr has quit [Ping timeout: 245 seconds]
ltriant has joined #lisp
kucli has quit [Remote host closed the connection]
electrosnake has quit [Ping timeout: 258 seconds]
ltriant has quit [Ping timeout: 255 seconds]
kucli_ has joined #lisp
lumm has joined #lisp
elderK has quit [Quit: Connection closed for inactivity]
kucli_ has quit [Quit: Page closed]
pjb has quit [Ping timeout: 250 seconds]
fanta1 has quit [Quit: fanta1]
fivo has joined #lisp
ltriant has joined #lisp
ebrasca has joined #lisp
orivej has quit [Ping timeout: 246 seconds]
madmuppet006 has quit [Remote host closed the connection]
orivej has joined #lisp
cosimone has joined #lisp
refpga has joined #lisp
_whitelogger has joined #lisp
lumm has quit [Remote host closed the connection]
lumm has joined #lisp
orivej has quit [Ping timeout: 255 seconds]
lumm has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
cosimone has quit [Quit: WeeChat 2.3]
Kundry_Wag has quit [Ping timeout: 246 seconds]
amerlyq has joined #lisp
cosimone has joined #lisp
orivej has joined #lisp
makomo has joined #lisp
nowhere_man has quit [Remote host closed the connection]
lumm has joined #lisp
nowhere_man has joined #lisp
ltriant has quit [Ping timeout: 268 seconds]
lumm has quit [Client Quit]
lumm has joined #lisp
hiroaki has joined #lisp
dddddd has joined #lisp
cyberoctopi has quit [Ping timeout: 244 seconds]
nowhere_man has quit [Ping timeout: 258 seconds]
cosimone has quit [Quit: WeeChat 2.3]
fanta1 has joined #lisp
orivej has quit [Ping timeout: 245 seconds]
amerlyq has quit [Quit: amerlyq]
esrse has quit [Ping timeout: 245 seconds]
t58 has joined #lisp
rumbler31 has joined #lisp
igemnace has quit [Quit: WeeChat 2.4]
rumbler31 has quit [Ping timeout: 250 seconds]
orivej has joined #lisp
pjb has joined #lisp
<pjb> aeth: on the contrary, functions and data structure must match. Otherwise you incur multiplied complexities!
<pjb> aeth: for example, if you have a list, you must use a function that processes (first list) and (rest list). If you use a function that process the elements in random order with elt, then you get O(n) factors in your algorithm.
<pjb> aeth: similarly if you have a vector, then you must use a function that processes (elt vector i). If you use (first-vector v) and (rest-vector v) = (subseq v 1), you get again a O(n) time and space factor in your algorithm complexity!
salamad has joined #lisp
<pjb> aeth: you may abstrat some uninteresting details of your data structure but the fundamental overall structure of it in your functions!
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
salamad has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
cosimone has joined #lisp
amerlyq has joined #lisp
Kundry_Wag has quit [Ping timeout: 250 seconds]
__jrjsmrtn__ has joined #lisp
wxie has joined #lisp
orivej has quit [Remote host closed the connection]
quazimodo has quit [Ping timeout: 245 seconds]
orivej has joined #lisp
quazimodo has joined #lisp
cosimone has quit [Ping timeout: 257 seconds]
cosimone has joined #lisp
Bike has joined #lisp
jmercouris has joined #lisp
q3d has joined #lisp
kajo has joined #lisp
kayront has quit [Quit: ZNC 1.7.1 - https://znc.in]
hvxgr has quit [Ping timeout: 246 seconds]
hvxgr has joined #lisp
hvxgr_ has joined #lisp
ltriant has joined #lisp
grewal has joined #lisp
ltriant has quit [Ping timeout: 245 seconds]
cosimone has quit [Quit: WeeChat 2.3]
aindilis has quit [Ping timeout: 246 seconds]
cosimone has joined #lisp
rumbler31 has joined #lisp
cosimone has quit [Quit: WeeChat 2.3]
rumbler31 has quit [Ping timeout: 246 seconds]
cosimone has joined #lisp
cosimone has quit [Client Quit]
cosimone has joined #lisp
cosimone has quit [Client Quit]
wxie has quit [Ping timeout: 264 seconds]
Lord_of_Life has quit [Excess Flood]
Lord_of_Life has joined #lisp
X-Scale has quit [Ping timeout: 246 seconds]
LiamH has joined #lisp
X-Scale has joined #lisp
rumbler31 has joined #lisp
rumbler31 has quit [Read error: Connection reset by peer]
rumbler31 has joined #lisp
rumbler31 has quit [Ping timeout: 246 seconds]
cosimone has joined #lisp
Arcaelyx has joined #lisp
cyberoctopi has joined #lisp
mindCrime has joined #lisp
fivo has quit [Quit: WeeChat 1.9.1]
scymtym has joined #lisp
shifty has quit [Ping timeout: 246 seconds]
rippa has joined #lisp
TikityTik has joined #lisp
igemnace has joined #lisp
Achylles has joined #lisp
rumbler31 has joined #lisp
ltriant has joined #lisp
kajo has quit [Ping timeout: 257 seconds]
kajo has joined #lisp
ltriant has quit [Ping timeout: 244 seconds]
rpg has joined #lisp
jmercouris has quit [Remote host closed the connection]
<rpg> Has anyone tried to use Gary King's LIFT test library recently? I have fixed a bug in TRIVIAL-BACKTRACE, and was trying to run the tests, and now I'm going down a rabbit hole. Lift seems pretty completely bit-rotted. Tempting to just rewrite the minimal number of tests into 5AM...
oni-on-ion has joined #lisp
orivej has quit [Ping timeout: 250 seconds]
cyberoctopi has quit [Ping timeout: 244 seconds]
lumm has quit [Ping timeout: 245 seconds]
refpga has quit [Read error: Connection reset by peer]
jmercouris has joined #lisp
<scymtym> rpg: i did the same for a lot of my legacy code
CuriousCain has joined #lisp
<rpg> scymtym: I looked at lift for a couple of hours, but fixing one bug just led me to another. My copy of TRIVIAL-BACKTRACE on gitlab.common-lisp.net (soon to be pushed) will use 5AM for testing. Tweaking the tests for compatibility was *much* easier.
sjl has joined #lisp
<scymtym> rpg: i arrived at the same conclusion
jmercouris has quit [Remote host closed the connection]
karlosz has joined #lisp
pankajgodbole has quit [Ping timeout: 246 seconds]
Fade has joined #lisp
<Xach> Out of curiosity, how is lift busted now?
snits has quit [Ping timeout: 245 seconds]
<rpg> Xach: Doesn't work at all with logical pathnames, and I get recurring errors where the standard config says "put test results in lift-results/" and LIFT says "I don't want a directory name here I want just a filename."
<rpg> My guess is that LIFT was never tested with systems whose COMPONENT-PATHNAME was a logical pathname.
<rpg> FiveAM is, AFAICT, not broken, so I just translated the tests for TRIVIAL-BACKTRACE. See https://gitlab.common-lisp.net/rgoldman/trivial-backtrace if you are interested.
<rpg> (asdf:test-system "trivial-backtrace") now works, at least on SBCL. Haven't tested it on other implementations yet.
abhixec has quit [Ping timeout: 255 seconds]
* rpg wishes someone would write "Travis for CL programmers" blog post...
<rpg> Xach: Just was sick of the deprecated function warning on SBCL
Jesin has quit [Quit: Leaving]
abhixec has joined #lisp
karlosz has quit [Quit: karlosz]
Jesin has joined #lisp
snits has joined #lisp
Zaab1t has joined #lisp
lumm has joined #lisp
sauvin has quit [Read error: Connection reset by peer]
cosimone has quit [Ping timeout: 258 seconds]
Achylles has quit [Remote host closed the connection]
cosimone has joined #lisp
CommanderViral has joined #lisp
cosimone has quit [Client Quit]
karlosz has joined #lisp
orivej has joined #lisp
mindCrime_ has joined #lisp
mindCrime has quit [Ping timeout: 246 seconds]
ltriant has joined #lisp
ltriant has quit [Ping timeout: 246 seconds]
cyberoctopi has joined #lisp
cyberoctopi has quit [Ping timeout: 250 seconds]
cyberoctopi has joined #lisp
karlosz has quit [Quit: karlosz]
techquila has joined #lisp
techquila has quit [Read error: Connection reset by peer]
techquila has joined #lisp
mindthelion has quit [Ping timeout: 255 seconds]
milanj has joined #lisp
amerlyq has quit [Quit: amerlyq]
Ancyleus has joined #lisp
<alandipert> is anyone aware of a JS impl. of CL with anything like DELIVER or SAVE-LISP-AND-DIE?
cyberoctopi has quit [Ping timeout: 246 seconds]
<phoe> I don't think such a thing exists
<phoe> the only JS implementation is JSCL, and, hmmm
<phoe> I think it has an option of compiling Lisp files into JS
<phoe> and those, you can somehow deliver
<phoe> but I don't know if it has a complete solution that saves a restartable Lisp image
<alandipert> thanks, yeah, of the ones i'm aware of JSCL seems closest
Zaab1t has quit [Quit: bye bye friends]
wigust- has joined #lisp
<phoe> are there any others at all?
wigust has quit [Ping timeout: 246 seconds]
<alandipert> parenscript and slip are 2 others i know of, slip is interesting because it includes VM and green threads http://lisperator.net/slip/. no longer being developed though, and impractical for me for a few reasons
<Xach> alandipert: what would you do if you had what you were asking about?
<oni-on-ion> i had a good time with parenscript. even does macros
orivej has quit [Ping timeout: 250 seconds]
<alandipert> Xach i find most JS build toolchains are batch oriented and so antithetical to keeping as much tooling as possible resident in the target environment. so i'm curious about ways to develop lisp in the browser as "natively" as possible, including producing deliverables
<phoe> parenscript isn't a Lisp implementation, it's a cl->js compiler
cyberoctopi has joined #lisp
<alandipert> i am working on my own hobby lisp to this end, more of a clojure flavored lisp though. but i'd use a CL thing if one was available :-)
<oni-on-ion> yeah phoe. don't see how that is any less dynamic though
<phoe> oni-on-ion: it's still very useful, just not a full Lisp implementation that you can run in the browser
<phoe> which means you have no Lisp-style interactivity, which *does* make it less dynamic
<oni-on-ion> yeah =( i am also looking for that. raw JS tools are close however
jlarocco has joined #lisp
dddddd_ has joined #lisp
dddddd has quit [Ping timeout: 245 seconds]
dddddd_ is now known as dddddd
rumbler31 has quit [Remote host closed the connection]
<aeth> pjb: What I mean is, if there's one part of the language where you're going to get near-C++ performance (well, probably matching a compiler that doesn't do SIMD optimizations) fairly easily, it's going to be arrays of numbers.
<aeth> alandipert: JSCL is missing most of the fun parts of the language last time I looked, so I doubt it would have s-l-a-d.
skidd0 has joined #lisp
snits has quit [Ping timeout: 255 seconds]
<zagura> win 32
<skidd0> if anyone here has used cl-irc before, i'm curious if you've been able to verify that a user/nick is registered with NickServ
<aeth> you probably want Win64 CL binaries, not Win32 ones.
<dlowe> skidd0: it depends on the server, but some of them have a mode where it prepends + to a nick when it's registered
<dlowe> skidd0: this works with freenode
<dlowe> skidd0: I decided not to do this with my bot and just have a login/out auth system
<skidd0> hmm, i'll have to check on that. I looked at find-user and tried to check the user's modes slot, but they were empty
<dlowe> cl-irc isn't going to support this automatically, I don't think
<skidd0> i see
<skidd0> have you worked with Maiden? or Colleen?
<dlowe> No, I made one a long time ago that predates them.
<skidd0> I gotcha
<skidd0> i'm wondering how best to handle authorization for bot commands
<skidd0> the bot would be sitting on a server full of over-eager bot-breakers
<skidd0> also, who updates cliki?
<dlowe> Just deny everyone and drive them all completely crazy.
<dlowe> Every command just returns "access denied"
<skidd0> hmm
<skidd0> sad i missed April Fool's
<skidd0> that'd be a good prank
<dlowe> but if you explicitly auth/deauth and automatically deauth on disconnect, that handles most of your problems
<skidd0> oh i see. so a nick "skidd0" joins the channel, sends a query over to the bot to auth, then can give commands
<skidd0> and on part, i could add a hook to deauth parted users
snits has joined #lisp
<dlowe> and on quit and kick
<skidd0> right
<dlowe> bonus points for tracking nick changes
<skidd0> well i'd be keeping a list of authorized nicks, so if they change nick, they lose auth
<aeth> dlowe: "access denied" vs. "I'm sorry, %A. I'm afraid I can't do that." nick
<aeth> oops, ~A
cyberoctopi has quit [Ping timeout: 276 seconds]
<jasom> skidd0: I believe cliki is a wiki, so anyone can register to update it.
<phoe> registration is optional on cliki
<phoe> just edit it
<jasom> how has cliki not devolved into all spam then?
<phoe> AFAIR it requires some lispy captchas
<skidd0> i just had to do one
<skidd0> what is (TRUNCATE -13 9): to register
<jasom> CAPTLNA: Completely Automated pulbic Test to tell Lispers and non-Lispers Apart
<phoe> #'compute-applicable-protocols-towards-linguistic-network-authorization
<phoe> #'c-a-p-t-l-n-a
rpg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gravicappa has quit [Ping timeout: 246 seconds]
jmercouris has joined #lisp
karlosz has joined #lisp
Lord_of_Life has quit [Ping timeout: 246 seconds]
ebrasca has quit [Read error: Connection reset by peer]
ebrasca has joined #lisp
Lord_of_Life has joined #lisp
karlosz has quit [Quit: karlosz]
defaultxr has joined #lisp
ltriant has joined #lisp
cosimone has joined #lisp
fanta1 has quit [Quit: fanta1]
ltriant has quit [Ping timeout: 245 seconds]
nowhere_man has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
cosimone has quit [Quit: WeeChat 2.3]
vlatkoB has quit [Remote host closed the connection]
vlatkoB has joined #lisp
<aeth> This was mentioned in #lispcafe, but I think #lisp might appreciate this. I finally found a case where "RETRY" is the correct solution for handling a type error with the SLIME debugger.
<aeth> (let ((x `(progn (format t "Hello, world!~%") (make-random-state) (zerop (random 2))))) (check-type x (satisfies eval)) x)
rpg has joined #lisp
<pjb> aeth: well, this is a very good example against types I would say. You should not use check-type here, but (assert (eval x) (x)).
<jmercouris> I actually use RETRY a lot if the operation depends on the network or something
<jmercouris> only when debugging of course, I wouldn't have such a restart in production code..
<pjb> aeth: But right, assert from random is no good either. So you may be right.
<Bike> good job managing to say something entirely reasonable in the face of "(satisfies eval)"
<pjb> (incf aeth) ; indeed
<pjb> You can frame it and display on the wall behind you with your diplomas.
<Bike> the make-random-state is pointless, isn't it
<pjb> with eval, it should yes.
<pjb> But in a fresh image, it may still be useful.
<aeth> Bike: Couldn't there be an implementation where eval always starts with the same random state so that will be always t or always nil?
<aeth> I'm just being safe
<Bike> make-random-state just makes a random state. it doesn't set the random state.
<Bike> and even if it did, with no argument it just copies the current random state.
<aeth> So should I let (make-ranodm-state) and pass that into the random?
<pjb> aeth: I don't think so. eval shall use the nil environment, which is the global environment. If it took a fresh environment, it couldn't use the user defined packages and functions, and it couldn't mutate the current environment.
<Bike> you shouldn't bother with making a random state
<aeth> pjb: okay, so if that gets caught one way or the other I guess it's non-conforming, then
<aeth> s/caught/stuck/
<pjb> ccl -x '(let ((x `(progn (format t "Hello, world!~%") (zerop (random 2 (make-random-state t)))))) (check-type x (satisfies eval)) x)'
<pjb> without the random-state, you could have always 0 as first random.
<pjb> Inside a running image, it can be non-deterministic, if you run random expressions before this one.
john2x has joined #lisp
shka_ has quit [Ping timeout: 246 seconds]
vlatkoB has quit [Remote host closed the connection]
angavrilov has quit [Remote host closed the connection]
orivej has joined #lisp
hiroaki has quit [Ping timeout: 245 seconds]
TikityTik has quit [Ping timeout: 244 seconds]
moldybits has quit [Quit: WeeChat 2.4]
moldybits has joined #lisp
rwlisp has joined #lisp
jmercouris has quit [Remote host closed the connection]
pent has quit [Ping timeout: 250 seconds]
jhei has quit [Ping timeout: 240 seconds]
chewbranca has quit [Ping timeout: 252 seconds]
tazjin has quit [Ping timeout: 264 seconds]
billstclair has quit [Ping timeout: 258 seconds]
tehidiot has quit [Read error: Connection reset by peer]
adulteratedjedi has quit [Ping timeout: 264 seconds]
tazjin has joined #lisp
jhei has joined #lisp
tazjin has quit [Max SendQ exceeded]
XachX has quit [Ping timeout: 258 seconds]
chewbranca has joined #lisp
makomo has quit [Quit: WeeChat 2.2]
rvirding has quit [Ping timeout: 252 seconds]
sjl has quit [Ping timeout: 250 seconds]
jhei has quit [Ping timeout: 255 seconds]
adulteratedjedi has joined #lisp
tazjin has joined #lisp
jhei has joined #lisp
rvirding has joined #lisp
XachX has joined #lisp
tehidiot has joined #lisp
pent has joined #lisp
billstclair has joined #lisp
lucasb has joined #lisp
john2x has quit [Ping timeout: 255 seconds]
X-Scale` has joined #lisp
sjl has joined #lisp
varjag has quit [Ping timeout: 244 seconds]
X-Scale has quit [Ping timeout: 244 seconds]
X-Scale` is now known as X-Scale
aindilis has joined #lisp
pbadams has joined #lisp
mindCrime_ has quit [Ping timeout: 268 seconds]
<no-defun-allowed> pjb, aeth: (satisfies eval) was a meme i made late last night when i couldn't sleep
Bike has quit []
<whartung> how often do folks use restartable conditions outside of interactive scenarios?
abhixec has quit [Ping timeout: 245 seconds]
mindthelion has joined #lisp
wxie has joined #lisp
<stylewarning> whartung: you have to be mindful of it in the API!
techquila has quit [Ping timeout: 276 seconds]
<whartung> sure, I’m just curious if folks use them in the wild, and how much they’re used.
<stylewarning> whartung: here's an instance of CERROR: https://github.com/rigetti/quilc/blob/master/src/transformable-mixin.lisp#L128 and here's a case of taking advantage of that restart: https://github.com/rigetti/qvm/blob/master/src/qvm.lisp#L159
Folkol has joined #lisp
caltelt_ has joined #lisp
PuercoPope has joined #lisp
gabiruh_ has joined #lisp
<whartung> I see the (invoke-restart 'continue), but I don’t find “continue” anywhere else in that code.
techquila has joined #lisp
X-Scale` has joined #lisp
<stylewarning> whartung: the first link has CERROR, which has a continue restart
<stylewarning> the second link invokes a restart of the first link
PuercoPop has quit [Ping timeout: 246 seconds]
gabiruh has quit [Ping timeout: 246 seconds]
loke has quit [Read error: Connection reset by peer]
X-Scale has quit [Ping timeout: 246 seconds]
aeth has quit [Ping timeout: 246 seconds]
vxe has quit [Ping timeout: 246 seconds]
alandipert has quit [Ping timeout: 246 seconds]
hvxgr has quit [Ping timeout: 246 seconds]
troydm has quit [Ping timeout: 246 seconds]
kbtr has quit [Ping timeout: 246 seconds]
derrida has quit [Ping timeout: 246 seconds]
Nikotiini has quit [Ping timeout: 246 seconds]
kbtr has joined #lisp
<whartung> so in this case, what does the restart do?
Lord_Nightmare has quit [Ping timeout: 246 seconds]
bitch has quit [Ping timeout: 246 seconds]
caltelt has quit [Ping timeout: 246 seconds]
Aritheanie has quit [Ping timeout: 246 seconds]
Ekho has quit [Ping timeout: 246 seconds]
MetaYan has quit [Ping timeout: 246 seconds]
Wojciech_K has quit [Ping timeout: 246 seconds]
kini has quit [Ping timeout: 246 seconds]
rotty has quit [Ping timeout: 246 seconds]
Nikotiini has joined #lisp
X-Scale` is now known as X-Scale
<whartung> does it just run (transform xform-to-do instance) again?
alandipert has joined #lisp
jfe has quit [Ping timeout: 246 seconds]
mindthelion has quit [Ping timeout: 246 seconds]
rotty has joined #lisp
<stylewarning> whartung: to goes back to the site of the CERROR, and continues just after that error
derrida has joined #lisp
aeth has joined #lisp
troydm has joined #lisp
<stylewarning> whartung: it keeps track of how many times it "retries" so that it doesn't go into an infinite loop of CERROR -> INVOKE-RESTART -> CERROR -> ...
hvxgr has joined #lisp
gabiruh_ has quit [Ping timeout: 246 seconds]
<whartung> sure, but, I mean, I haven’t studdied this in detai, but where does it do anything to try and mitigate the missing dependancy when it discovered the issue?
Lord_Nightmare has joined #lisp
jdz has quit [Ping timeout: 246 seconds]
Aritheanie has joined #lisp
LiamH has quit [Quit: Leaving.]
<stylewarning> whartung: it calls (transform xform-to-do instance), which satisfies one of the required dependencies, decreases the no. of allowed attempts to recover, and loops back to check if all deps. are satisfied
bitch has joined #lisp
rwlisp has quit [Ping timeout: 276 seconds]
<stylewarning> whartung: here is another example of a custom-defined restart called TRY-NEXT-COMPILER. If a compilation function fails, it gives either the user (interactively) or the caller (non-interactively) an option to keep on trucking with compilation. https://github.com/rigetti/quilc/blob/master/src/compilation-methods.lisp#L71
<whartung> coudn’t this have been readily done without a restart? just not sure how this case highlights the use of a restartable condition vs not.
<whartung> yea, but does anyone use the non-interactive option for that case.
gabiruh has joined #lisp
kini has joined #lisp
Ekho- has joined #lisp
jdz has joined #lisp
rwlisp has joined #lisp
dale_ has joined #lisp
dale has quit [Disconnected by services]
dale_ is now known as dale
<p_l> whartung: the crucial difference is that the stack is not unwound, so you don't have to do crazy things to checkpoint and restore state
<whartung> yea, I get that, I’m just wonder how often it’s applied.
irdr_ has joined #lisp
funnel_ has joined #lisp
quazimod1 has joined #lisp
specbot has quit [Disconnected by services]
specbot has joined #lisp
zcid has quit [Ping timeout: 250 seconds]
froggey has quit [Ping timeout: 250 seconds]
pacon has quit [Ping timeout: 250 seconds]
interruptinuse has quit [Excess Flood]
wigust- has quit [Ping timeout: 250 seconds]
Xach has quit [Ping timeout: 250 seconds]
quazimodo has quit [Ping timeout: 250 seconds]
dyelar has quit [Ping timeout: 250 seconds]
irdr has quit [Ping timeout: 250 seconds]
cset has quit [Ping timeout: 250 seconds]
funnel has quit [Ping timeout: 250 seconds]
rlp10 has quit [Ping timeout: 250 seconds]
eMBee has quit [Ping timeout: 250 seconds]
hvxgr has quit [Ping timeout: 250 seconds]
nopf has quit [Ping timeout: 250 seconds]
samebchase has quit [Ping timeout: 250 seconds]
gabiruh has quit [Ping timeout: 250 seconds]
myrkraverk has quit [Ping timeout: 250 seconds]
dim has quit [Ping timeout: 250 seconds]
AdmiralBumbleBee has quit [Ping timeout: 250 seconds]
shka__ has quit [Ping timeout: 250 seconds]
funnel_ is now known as funnel
shka__ has joined #lisp
dim has joined #lisp
AdmiralBumbleBee has joined #lisp
Xach has joined #lisp
wigust has joined #lisp
Folkol has quit [Quit: Textual IRC Client: www.textualapp.com]
ltriant has joined #lisp
zcid has joined #lisp
hvxgr has joined #lisp
froggey has joined #lisp
myrkraverk has joined #lisp
<stylewarning> whartung: The latter one is certainly used interactively, I forget if there are non-interactive invocations
<stylewarning> whartung: most of these can be avoided if you can sufficiently pass data about decision-making up and down the call stack
gabiruh has joined #lisp
salamad has joined #lisp
salamad has left #lisp [#lisp]
<sjl> I use them in my option parsing library. If the library parses command line options and sees an unknown option, it signals a condition and lets you choose between a number of different restarts if you're working interactively: https://github.com/sjl/adopt/blob/master/src/main.lisp#L362
bexx has joined #lisp
<sjl> But if you're writing a program that uses my option parser and want to just ignore unrecognized options, you can choose to invoke the restart programtically https://github.com/sjl/adopt/blob/master/src/main.lisp#L302
<sjl> or choose the "treat as normal argument" restart programtically instead https://github.com/sjl/adopt/blob/master/src/main.lisp#L314
<sjl> etc etc
<sjl> whartung: ^
orivej_ has joined #lisp
orivej has quit [Ping timeout: 245 seconds]
actuallybatman has quit [Ping timeout: 268 seconds]
Bike has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
cyraxjoe has quit [Remote host closed the connection]
karlosz has joined #lisp
pacon has joined #lisp
anewuser has joined #lisp
wxie has quit [Ping timeout: 276 seconds]
pbadams has quit [Ping timeout: 258 seconds]
pierpal has joined #lisp
john2x has joined #lisp
Ekho- is now known as Ekho
makomo has joined #lisp
oni-on-ion has quit [Quit: Leaving]
lumm has quit [Remote host closed the connection]
q3d has quit [Quit: Page closed]
cyberoctopi has joined #lisp
bexx has quit [Remote host closed the connection]
aeth has quit [Ping timeout: 258 seconds]
aeth has joined #lisp
oni-on-ion has joined #lisp
makomo has quit [Ping timeout: 246 seconds]
shifty has joined #lisp
t58 has quit [Quit: Night]
skidd0 has quit [Quit: WeeChat 2.4]