freenode/#lisp - IRC Chatlog
Search
7:32:05
beach
Sure, some Common Lisp systems can have many things in a shared object file. I think ECL does that.
7:33:02
beach
nij: Unix-like operating systems are a very bad fit for Common Lisp. Imagine instead that the Common Lisp REPL is the shell, and FASLs are your executable files.
7:34:26
beach
On the other hand, 42MB of RAM (assuming that everything has to be in RAM which is not true if you have demand paging) cost how much these days? A few cents?
7:35:52
beach
nij: So as it turns out, the maintainers of SBCL did not bother to make the Unix executable files small. I fully understand their priorities.
7:36:21
flip214
nij: you can produce an image with all of the shared libraries, and use that image to load the app-specific FASLs.
7:36:57
flip214
nij: as long as the base image is uncompressed and can so be mmap()ed into memory directly, all of the running processes should share the common libs.
7:37:26
flip214
nij: do you want to save space _on_disk_ or _in_ram_ (when using 50 different applications)?
7:38:28
beach
nij: Seriously though, forget about the defective Unix model and just use the Common Lisp REPL.
7:38:56
flip214
nij: just add up all the libstdc++, libgcc, gcc, ld, .h, and other files required for the same task, and _the_ compare again ;)
7:39:38
nij
But it's nice to have a keybind in my window manager, that executes something right away.
7:39:43
flip214
an image that comes up with the HTTP port 18msec after starting is quite nice... but if you reload all the libs first it takes longer
7:42:33
White_Flame
nij: re the executable size, compare to the size of an installed JVM, and if that were baked into the executable itself
7:47:34
aeth
nij: CL is basically in the same situation JVM is, as White_Flame said. It's just... installed by default on far fewer machines.
7:48:14
aeth
Bundling the (large) runtime executable with each executable seems more appealing when you're distributing it to someone who doesn't have it, even if it's wasteful.
7:48:34
White_Flame
you can have a running lisp process, then make a new slime connection to it from emacs and have a full repl. Disconnect, and the lisp process stil runs
7:51:08
White_Flame
yeah, sly does the same, see "Running the server standalone" https://github.com/joaotavora/sly
8:00:07
beach
nij: While it is possible (as ECL shows) to put a lot of system code in a shared object file, it would not be appropriate for Common Lisp to use the kludge that Unix calls "dynamic linking".
8:04:31
beach
I suppose it would be possible for a Common Lisp system to use Unix dynamic linking, but it would be a lot of work to adapt the system implementation that way, or to special case some functions like the compiler.
8:08:32
beach
If I were to split a Common Lisp system into a shared object and an executable, I would probably put just executable code in the shared object, and mmap it to some known location at system start-up.
8:09:39
beach
But that might not work in the future. Because the Unix model is so broken, they add hacks to kludges that make it more and more difficult to do things like that. ASLR is a case in point.
8:13:50
beach
... all so that they can continue to use unsafe languages on an unsafe operating system also written in an unsafe language.
8:16:09
flip214
well, json at least keeps number/string types intact, and compatible to other systems as well
8:17:36
pranavats
There are also object stores like manardb (https://www.cliki.net/manardb). I haven't tried using them, however.
8:18:26
White_Flame
postgres has strong support. I haven't used sqlite from cl before, but libs are there,t oo
10:31:18
flip214
Xach: https://github.com/xach/zpng: any plan to allow b/w images (ie. indexed, 1 bit per pixel)?
13:01:46
jackdaniel
if you want to put something else as a key (except from the string designator) use #'equal
13:24:48
jackdaniel
or, if you want to work with locatives: (defvar *place* (assoc "b" …)) and then (setf (cdr *place*) 9)
13:25:12
jackdaniel
and when you bind it to 8, the immediate object is associated with that variable
13:26:01
jackdaniel
when you define *place* as you did above, you simply assign to it a result of the operation, that is a number 8
13:26:19
jackdaniel
how updating the variable from number 8 to 9 could influence the association list? *place* has no knowledge about that structure
13:26:56
jackdaniel
on the other hand, when you bind a certain cons to the variable *place*, then you may manipulate this cons freely (and assuming that it is part of the assoc list, modifying the cons will be reflected in the association list)
13:27:59
jackdaniel
common lisp features something called a symbol macro which would allow saying (setf *place* 9), but don't get distracted by that, it is a syntactic noise
13:57:44
jackdaniel
eql seems to be more sensible, but I don't see the appropriate entry on the assoc page (neither for eq or eql)
13:59:34
jackdaniel
yes, my point was that a default test won't work on a string, but indeed I've mistaken the default test
14:30:31
dbotton
Xach this page's search goes to a dead site now - https://www.quicklisp.org/beta/releases.html
14:43:37
flip214
when printing compound objects, floats in there are written with too many digits; can I bind some variable (like *PRINT-LENGTH*) to change the format of floats within a block?
14:44:47
phoe
the only way I can imagine is using FORMAT with a format control argument passed via a dynamic variable
14:57:32
[d]
<jackdaniel#0000> eql seems to be more sensible, but I don't see the appropriate entry on the assoc page (neither for eq or eql)
14:57:34
[d]
<jackdaniel#0000> maybe it is settled in some normative statement for default test values
15:01:49
andreyorst`
their client supports message edits, which are simply sended to IRC as new messages with [edit] mark
15:02:27
jackdaniel
it is a bridge, note that there is a nick in these "logs" that does not appear here
16:03:51
nij
Tried cl-pdf.. but there's no doc. The examples it provide seem to be too fancy. I just want to read nice plain texts on a paper.
16:05:44
jackdaniel
(clim-pdf:with-output-to-pdf-stream (stream "/tmp/foo.pdf") (format stream "HI!~%"))
16:09:00
nij
Error: Invalid index 24039 for (SIMPLE-VECTOR 256), should be a non-negative integer below 256.
16:57:49
dim
yeah also if you target the JVM that's where you will find the greatest number of already available libs to integrate with everything that exists, I believe
16:58:16
jackdaniel
what is more bothering is that python libraries tend to work longer - that means that the joy of computing lasts longer
16:59:07
nij
mfiano: beach: .. Well we certainly don't want to write libs when it's needed as an auxialiry tools, right?
16:59:21
pranavats
nij: We deal with it by staying focused on our needs, (for which CL libraries are often enough), rather than what's fashionable.
17:00:05
jackdaniel
nij: see "section 5, performance" for the inspiration of the previous joke: https://cliki.net/Infrequently%20Asked%20Questions
17:00:40
beach
nij: No, I meant the "deal with" part. I am not sure what kind of answer you want. "We are all suicidal!"?
17:01:12
beach
nij: I think if I needed libraries more than I need the Common Lisp features that I use on a daily basis, I would probably use Python instead.
17:02:07
dim
I don't suppose you would like it beach ;-) (I have done a lot of Python over the years, and well, well... I like Common Lisp a lot)
17:03:27
jackdaniel
who would won't to limit themself to programming strictly inside the cmucl compiler package though?
17:04:46
jackdaniel
https://files.mastodon.social/media_attachments/files/105/595/091/206/086/972/original/5dc9f1e10b9b61e6.png
17:07:28
jackdaniel
it was hello, but then I had it aligned so I couldn't verify, that the flipping ink works in the middle of the single letter
17:17:13
nij
I bet someone can re-write a python implementation (in particular, its "read") in python.
17:22:35
aeth
shka_: I mean, it's not going to be a complete Python 3, and even if it is, it's not going to run any meaningful library like Tensorflow, which expects Python's particular way of calling into C/C++/Fortran
17:23:05
aeth
But you should be able to turn e.g. print("Hello world") into (python:print "Hello world")
17:23:21
aeth
And the latter is the interesting part, because now you'd be able to write a real s-expressioned Python, rather than e.g. Hy
17:24:07
aeth
nij: It would parse print("Hello world") into (python:print "Hello world") rather than directly translating it into the equivalent CL-native print/write/format because then you could use macros on the intermediate language
17:25:46
aeth
I think Hy might work on the AST of Python, but that's a low-level interpreter-specific AST used for internals
17:27:38
aeth
well, I don't quite know how it works, but in my experience, the various Lisp-like languages for non-Lisps don't really... do Lisp.
17:28:32
aeth
Although this is a lot less than you think it is because (1) Python has a GIL so there are implicit, undiscovered race conditions in the code meaning you can't multithread libraries and (2) Python is slow so there's a lot of FFI, which wouldn't be compatible
17:31:37
aeth
The way I'm going to implement non-s-expression languages (I currently only have a partial Scheme) is to essentially write an s-expression language that preserves the semantics of the language.
17:32:53
aeth
Lispy languages that compile to other languages like Lua or Python tend to do either (lisp-like-language -> source-code) or (lisp-like-language -> exposed-interpreter-AST), but you're still restricted by the semantics of the target
17:33:24
Josh_2
Basically Im trying to check if a bunch of symbols are boundp as they correspond to variable names
17:33:48
aeth
nij: What I'll be attempting is (foreign-source-code -> lisp-like-language -> Common-Lisp) which means it will have the performance characteristics of, say, SBCL and you will be able to use all of SBCL in both the compiler stage and the actual runtime.
17:34:08
aeth
nij: I'll do it on Lua, not Python, though. Lua's much, much smaller. If it works I might do Python and/or JS at some later time.
17:36:02
nij
aeth: so do you mean to write a textual translator that first translates "print("hi")" to "[print "hi"]" and then to "(print "hi")"?
17:36:32
nij
aeth: (By the way, I wonder where you can find the very definition of the lang python.)
17:36:37
Josh_2
Basically I need to construct a large plist with many key values pairs however all of the keys are optional and I want to construct the list using the &key option in λ lists
17:37:17
aeth
nij: no, it would go from print("hi") to (whatever-language:print "hi") with the caveat that various "-related syntax would be part of the reader, so e.g. "hi\nworld" would already turn the \n into a newline by the s-expression step, although a reader macro could be used to get the desired foreign behavior of " for literally writing the s-expressions
17:37:28
Josh_2
I don't want to go through and check which are bound manually, I just want to construct my list from the bound variables
17:38:32
aeth
You could go, say, Markdown string -> HTML string, but you better have a bunch of s-expressions in the intermediate or you lose the advantages of using CL
17:38:42
Josh_2
Say I have the symbol 'limit, which may or may not be bound, I need to construct a list like '("limit" <value of limit> ... )
17:40:13
Josh_2
I can maintain a list of corresponding symbols like (let ((args '(limit .. )))) and use those to check if my arguments are bound
17:40:14
White_Flame
if the keyword is not given in the function, the parameter is bound to the default, which is by default NIL
17:41:51
Josh_2
this isn't my problem though, im trying to avoid having to write something like this
17:42:01
aeth
mfiano: eh... the thing is, alexandria:make-keyword is correct, but this sort of thing should probably be inline and alexandria's isn't, so it's justifiable to reinvent the wheel here imo
17:42:37
Josh_2
(when (boundp <var>) (setf mylist (append (list <mysymbolasstring> <symbol-value>)))) about 10 times
17:43:14
White_Flame
btw, you can just append your optional changes to the head of the default plist
17:44:01
White_Flame
eg, if defaults are (:a 1 :b 2), and you prepend your change so you end up with (:b 3 :a 1 :b 2), then :a = 1 and :b = 3. the later value is overridden by the earlier value
17:50:56
Josh_2
In this case It's part of an API where you don't have to provide defaults, you just dont send the values
17:51:31
jrm
jackdaniel: Whatever you prefer. It's also not difficult for us to package the latest from master. If you could just share your plans, I'll adapt. I just wanted to make sure we were offering what you (authors) felt was best for users.