libera/#commonlisp - IRC Chatlog
Search
14:41:28
dbotton
My first paid for program was 40 years ago. A program for the psych department of Nova university (south Florida us) running on trs-80s attached to a cables so could load the app to many machines from the same tape recorder
15:02:14
pjb
dbotton: nice. Mine was a program in basic on TO7 to drive some lights on an advertizing panel for some conserve can manufacturer.
18:11:35
jcowan
It probably can't cope with VNC. Safari also has problems, but Chrome/Firefox/Edge all work fine
18:13:00
opalvaults[m]
This is very neat. I had no idea what I was signing up for lol. This reminds me of the OpenBSD default WM
18:17:36
opalvaults[m]
https://interlisp.org/docs/20211015-interlisp-book-2.pdf -- looks like this is the docs for anyone interested in tinkering
18:18:58
jcowan
Volume 1 is https://interlisp.org/docs/1986-Interlisp-language-book-1.pdf; it's about the language itself.
18:24:04
opalvaults[m]
for instance man window gets you information about interaction with the windows manager, etc.
18:25:11
Catie
Embarassingly, I didn't even think to run "man". I figured Interlisp had some other mnemonic
18:30:41
Catie
I think it's interesting how much older GUI systems used the right mouse button. We've kind of settled on using left click for most things, but for example scrolling up on the scroll bar is done with a right click. A lot has changed
18:30:42
opalvaults[m]
for instance I can define a function that evaluates as soon as it recognizes the last paren.
18:31:36
opalvaults[m]
oh! It might be. I was under the impression that Xerox CL Exec meant that it was an offshoot of CL
18:33:25
opalvaults[m]
There was another WM that allowed you to create windows very similarly to how this Interlisp VM does and I can't for the life of me remember it.
18:33:30
jcowan
It just means you are in the CL readtable and the XCL user package. There is no law that says `read` has to wait foor a newline.
18:34:03
opalvaults[m]
It's actually kind of interesting how much of this technology we still use and take for granted today! This is actually really great. Reminds me a bit of windowmaker on GNU/Linux.
18:34:41
opalvaults[m]
Are there any (aside from GUIX) operating systems being currently developed in Lisp?
18:35:19
Catie
I think that's largely the work of one person though, and I haven't seen an update from her in a while (please correct me if I'm wrong)
18:38:40
jcowan
Both Interlisp and Genera show their origins on the bare metal, and rewriting maiko for bare metal would certainly be possible
18:45:38
jcowan
Both systems (also MIT Scheme) were born on programmable-microcode shipe. Even now Interlisp has no native compiler.
18:51:34
jcowan
Spoons; https://www.healthline.com/health/spoon-theory-chronic-illness-explained-like-never-before
18:55:15
jcowan
Which is also why we don't have Medley working natively on Windows, only through WSL.
18:56:43
jcowan
We do have an SDL back end, though, so eventually there may be a native Windows build without X
19:17:28
lisp123
I read somewhere that LW was better than SBCL for CLOS-related matters, which this (old) set of benchmarks seems to support http://zeniv.linux.org.uk/~ober/clb/
19:30:23
rotateq
lisp123: when you look at the Franz Inc website "Allegro Common Lisp is the most powerful dynamic object-oriented development system available today, and ..."
19:32:37
lisp123
rotateq: ACL looks nice, but currently only looking at LW for its ability to create ObjC shared libraries
19:35:14
nij-
A naive question on how CFFI is designed: when I call C within CL, does my code get translated into C-code, passed to C, evaluated there, output passed back, and transformed to a CL data type?
19:37:41
opalvaults[m]
boring troubleshooting topic, I'm trying to have Nyxt browser load Quicklisp. I have quicklisp added to my .sbclrc file, and a ~/quicklisp directory exists, yet I'm unable to get Nyxt to (ql:quickload 'slynk). Any suggestions?
19:38:21
opalvaults[m]
I get WARN - Warning: Error on separate thread: Package QL does not exist. Stream: #
19:39:11
lisp123
opalvaults[m]: Might be a question for the developers directly, but you can try first making sure. you do all the steps here: https://www.quicklisp.org/beta/
19:40:46
opalvaults[m]
I tried there but the one person helping me had to go. I was thinking its more a me and CL issue than with #nyxt directly.
19:40:55
nij-
opalvaults[m]: By running your CL implementation from the terminal (e.g. `$ sbcl`), does QL get loaded (try `ql:quickload 'slynk'`)?
19:41:30
rotateq
nij-: there's a wonderful 2h video by baggers about it from which i learned a bit more in the summer
19:42:33
lisp123
opalvaults[m]: You can try and see if QL works from a Lisp implementation like SBCL, if so, then perhaps the issue is the nyxt config, if not, then the issue is around QL config (but the link I gave you is pretty much perfect in setting up QL, hence I shared it)
19:43:33
lisp123
I would raise it with them and see if there is a way they can bundle QL going forward
19:44:52
opalvaults[m]
It was suggested by another user that I load slynk in order to call functions for nyxt inside of Emacs
19:47:23
opalvaults[m]
I think you're right, I'll ask aartaka in #nyxt. Thanks for helping me troubleshoot that!
19:47:57
etimmons
It's highly unlikely nyxt (or any CL application, really) will load your user unit files
19:49:27
nij-
Or maybe.. if you get nyxt from a package manager, it might pull down another configured CL implementation that doesn't read your config..
19:51:38
opalvaults[m]
nij-: there are some good examples in the packages repo if you need examples fwiw. that's how I've packaged
19:53:48
etimmons
opalvaults: yes, even if it uses SBCL. Files like .sbclrc are typically written for dev use. Applications may provide their own way to to user init, but loading .sbclrc is almost certainly the wrong thing to do and has a high chance of causing weird bugs if folks have an esoteric init
19:54:59
opalvaults[m]
that's a good point erc. I'll add the ql package init to the nyxt/init.lisp. I believe that's teh way you have to do it in StumpWM as well
21:25:29
nij-
I see a quote in py4cl's readme: "It (py4cl) uses streams to communicate with a separate python process, the approach taken by cl4py. This is different to the CFFI approach used by burgled-batteries, but has the same goal." Does anyone know what's the approach mentioned that's used by burgled-batteries?
21:26:53
etimmons
nij-: Pretty sure burgled-batteries loads libpython (or whatever it's called) into your CL process
21:28:21
nij-
By using implementation-dependent #'load-shared-library? I didn't know that we can do that for non-C library (e.g. for SBCL)..
21:57:41
phoe
nij-: no need to use implementation-dependent stuff if you use CFFI which is a compatibility library
22:12:41
nij-
phoe: Can you use CFFI to talk to python directly, without using other bindings (like cython)?
22:13:16
phoe
either you load libpython and talk to it via CFFI or you spawn a python process or you talk to it via its standard input/output or network sockets
22:13:39
phoe
if you are crazy enough you can try shared or transactional memory for communication, but I don't think it's worth it for python
22:17:53
rotateq
opalvaults[m]: one of the standard dispatch readmacros to create a pathname from the given string
22:20:04
Xach
i have had some interesting issues with using strings vs. pathnames when it comes to resolving pathname hosts
22:21:05
opalvaults[m]
I was told that you have to use Uiop, and/or implementation specific ways to get a reliable path to $HOME (~), so someone mentioned user-homedir-pathname and I assume that it's pretty unixy?
22:22:06
opalvaults[m]
I'm trying to make sure that I'm not going with (load "~/quicklisp/setup.lisp"), as apparently ~ is a bit nebulous to CL (although I was under the impression that ~ is POSIX)
22:23:00
phoe
you can always (merge-pathnames #p"quicklisp/setup.lisp" (user-homedir-pathname)) if you want to be cautious I think
22:24:05
pjb
opalvaults[m]: I've found that more implementations do the right thing with #P"~/foo" than with "~/foo".
22:24:10
opalvaults[m]
however it's not unreasonable to expect POSIX compliance for CL functions right?
22:24:46
pjb
opalvaults[m]: yes, it's unfortunately unreasonable, to expect common behavior of CL implementations on POSIX platforms. :-(
22:27:51
etimmons
nij-: from what you quoted it seems like py4cl uses launch-program or similar to start a separate python process and communicate with it
22:30:21
rotateq
opalvaults[m]: and if, you can use #+ and #- too for giving extra options (that should be orthogonal to each other in this case)
22:32:51
random-nick
I'm pretty sure posix compliance would be to not perform tilde expansion when opening files and the like
22:38:31
opalvaults[m]
see https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/utilities/V3_chap02.html#tag_18_06_01
22:39:47
random-nick
functions on the C side would use functions like open and the like which don't perform tilde expansion
22:40:13
random-nick
and I'm guessing the C interfaces would be more appropriate for mapping to CL's file functions
22:40:14
opalvaults[m]
right, however nonetheless tilde expansion is supported in most languages, including POSIX complaint shell
22:41:35
opalvaults[m]
I'm also unsure I would rely too much on C for just about anything as far as CL is concerned. Relying on standards and specifications is the way imo.
22:42:28
opalvaults[m]
Not that I'm in any way authorized to make that claim, but I've coded enough Algol related families and done enough Linux admin to be miffed at a lot of things C does.
22:46:48
opalvaults[m]
after a bit of extra research it appears the scheme family does tilde expansion as well.
22:47:08
opalvaults[m]
now I'm curious because I can't find anything in hyperspec, what makes ~ so unreliable in common lisp then?
22:47:35
rotateq
opalvaults[m]: and we can have it at readtime with #p before anything out there is messaged
22:48:34
rotateq
no, it's one of those things which won't make much sense to specify too precise in the standard, like with say regular expression grammar
22:51:01
rotateq
or not specifying at all as it's not a special purpose "close" to hardware thing like C
22:52:07
phoe
opalvaults[m]: what if you're running on an OS where ~ does not denote a home directory
22:52:36
random-nick
I think CL doesn't specify anything related to tilde expansion because of portability to different systems
22:52:37
phoe
it's better to leave stuff like that to implementers rather than hardcode it and risk it becoming obsolete at some point in time
22:54:11
opalvaults[m]
it's kind of off-topic, but windows is the only ones that uses %% to specify home directory as an environmental variable
22:54:18
phoe
and lots of OS-specific code already made it into the compatibility library that UIOP is
22:54:46
opalvaults[m]
right, would would make sense in otherl anguages as well like python's os module.
22:55:02
opalvaults[m]
so if uiop has that functionality and is standardized I don't see any reason not to use it
22:57:33
opalvaults[m]
So does ANSI CL have a reliable methodology for detemrining $HOME? or expanding variables to point to it?
22:57:35
phoe
linux is an implementation of POSIX in a way, just like SBCL is an implementation of CL
22:58:09
pjb
It doesn't say that random program should do it. In particular, open("~/foo",O_RDONLY) definitely DOES NOT expand the tilde !!!
22:58:10
phoe
it only has user-homedir-pathname which is equivalent to $HOME, but nothing for other environment variables
22:58:27
opalvaults[m]
I don't see how its' relevant. The practical matter is that if someone needs a reliable methodology to point to $HOME, or %HOME%, or what have you, it's not quite unreasonable to expect a language to implement it
22:59:19
opalvaults[m]
POSIX specifies it is allowed period. If it wasn't allowed, you wouldn't be able to do it in the shell. It's a reliable method if pointing an environment to a specific filesystem directory correct?
22:59:32
phoe
since ANSI CL is from 1994, UIOP and other compatibility libraries have a lot of stuff that is commonly used and differs between OSes and implementations but isn't a part of ANSI CL
22:59:47
random-nick
pjb: that was my point, POSIX specifies tilde expansion only in the shell language
23:00:34
pjb
opalvaults[m]: note how the C language has no way to get a HOME or doesn't specify a structure in the path strings!
23:00:41
opalvaults[m]
I may ask the most reliable methodology in CL so that I don't create bugs where (user-homedir-pathname) doesn't resolve to rubbish on unix operating systems.
23:01:25
opalvaults[m]
I think I said before, but almost every language has this. I'm aware C does not, but I don't care whata specific language does or doesn't do.
23:01:41
pjb
opalvaults[m]: CL implementations provide FFI, and you can therefore link to the getenv and putenv posix library functions. #+ccl (ccl:getenv "HOME") #| --> "/Users/pjb" |#
23:01:48
phoe
opalvaults[m]: u-h-p won't resolve to rubbish - if it does, you are free to file a bug with the implementation :D
23:02:00
rotateq
but what you said may make sense in a language which has just one impl and its spec is bound to that directly :)
23:02:32
phoe
the standard specifies that the definition of a home directory is implementation-dependent, but "defined in Common Lisp to mean the directory where the user keeps personal files such as initialization files and mail."
23:03:12
random-nick
other languages probably don't perform parameter expansion and other parts of shell expansion, so bringing up posix is a weird point
23:03:15
opalvaults[m]
However, it still begs the question why CL decides to buck the trend of reliable tilde expansion
23:05:31
random-nick
from r6rs: Some of the procedures described in this chapter accept a file name as an argument. Valid values for such a file name include strings that name a file using the native notation of filesystem paths on an implementation's underlying operating system, and may include implementation-dependent values as well.
23:06:04
phoe
but, to answer your question: standard CL does not expand tildes because standard CL has no notion of tildes
23:06:19
opalvaults[m]
C does not, but as I poitned out many times before I don't think any language shoudl model itself after C :P
23:07:18
opalvaults[m]
If STRING is identical to "~" or if it begins with "~/", return the argument with the "~" substituted by the current user's home directory. If the current user cannot be determined or does not exist, a condition of type (exn pathname-expand username) is raised.
23:07:18
opalvaults[m]
If STRING begins with "~USERNAME", return the argument with the "~USERNAME" substituted by the provided user's HOME directory. On Windows, this will be the value of the environment variables USERPROFILE or HOME (or "." if none of the variables is set). On Unix systems, the user database is consulted. If the user does not exist, a condition of type (exn pathname-expand username) is raised.
23:07:57
random-nick
is that from another rnrs or is that from a particular rnrs implementation's documentation?
23:08:47
phoe
the standard is stuck in 1994, yes, and the implementations and compatibility libraries take over from there
23:09:14
phoe
at least on my implementation (SBCL), the tilde in a pathname is recognized: https://plaster.tymoon.eu/view/2795#2795
23:09:24
random-nick
SBCL manual on specifying the home directory: http://www.sbcl.org/manual/index.html#Home-Directory-Specifiers
23:10:34
phoe
lots of pathname stuffs are implementation-dependent, so implementation manuals like this is what you should be consulting when it comes to implementation-dependent behavior
23:11:21
opalvaults[m]
:home is represented in namestrings by ~/ and (:home "username" by ~username/ at the start of the namestring. Tilde-characters elsewhere in namestrings represent themselves.
23:11:22
opalvaults[m]
Home directory specifiers are resolved to home directory of the current or specified user by native-namestring, which is used by the implementation to translate pathnames before passing them on to operating system specific routines.
23:12:09
phoe
the ANSI CL standard doesn't care about tildes, it says it's implementation-defined stuff
23:14:44
opalvaults[m]
ah, but it was told do me that tilde was unreliable. a point that is only just now being refuted by SBCL
23:15:21
pjb
opalvaults[m]: CL defines logical pathnames. You can define a logical host named HOME with translations to the user home directory. SO you can use logical pathnames suchas : #P"HOME:QUICKLISP;SETUP.LISP"
23:15:25
phoe
the way to achieve reliability in the CL world is to check which implementations are consistent in their implementation-defined behavior
23:15:47
phoe
so check if tildes are expanded the proper way in the most commonly used implementations, and you're golden
23:15:55
pjb
opalvaults[m]: these logical path will work everywhere, as long as you provide the logical pathname translation.\
23:16:26
phoe
and wherever they don't work the same way, write a compatibility library that provides a uniform API
23:17:39
opalvaults[m]
So wait doesn't having x number of implementations kind of defeat the purpose of standardizatino?
23:17:40
phoe
on another note, my amb implementation/tests/manual is sorta ready for first public reviews - https://github.com/phoe/amb
23:18:12
pjb
opalvaults[m]: standardization defines a common set. It's necessarily limited. Implementations define a superset.
23:19:02
random-nick
Shinmera made a site which lists some portability libraries and their status on various CL implementations: https://portability.cl/
23:23:33
random-nick
I've heard there are many niche embedded microprocessors which have a very poor ad-hoc C implementation as the only available programming language
23:24:03
random-nick
but I haven't personally done any embedded programming so I don't know from experience
23:24:05
phoe
opalvaults[m]: MSVC is the most famous one - see e.g. https://docs.microsoft.com/en-us/cpp/c-runtime-library/compatibility?view=msvc-170
23:24:47
opalvaults[m]
Which kind of nicely goes back to your original question of asking what if a users home was %HOME%. that's not what I'd ever be concerned about, to answer your question.
23:25:20
phoe
well, obviously, if you assume that your code only runs on unices then don't be surprised when people complain it only runs on unices
23:26:03
opalvaults[m]
I'm not concerned with Windows users (or Unix users) that complain that whatever I write isn't cross-platform with their proprietary software.
23:26:36
jcowan
Vacietis is the World's Most Awesome C Compiler, but its standards compliance is a bit technical: sizeof(char) = sizeof(int) = sizeof(long) = sizeof(double) = 1.
23:26:40
opalvaults[m]
I perhaps should have communicated that I'm looking for reliable methodology for Unix systems, and for that I apologize for not being clear from the onset.
23:27:22
phoe
I'm kinda sad that you conflate "free software" with "unix" - we have Mezzano around :(
23:28:43
opalvaults[m]
As is temple OS but you'd never run into a dev asking for reliable tilde expansion on Temple OS or haiku
23:29:18
phoe
opalvaults[m]: https://discuss.haiku-os.org/t/porting-sbcl-common-lisp-to-haiku/8928/16 looks like there's some work on that
23:31:29
random-nick
opalvaults[m]: no, Mezzano is froggey's personal project with some contributors you'll find in #mezzano
23:32:04
opalvaults[m]
okay well what was a configuration setting in Nyxt turned out to be a whole discussion and I thank everyone for teaching me a bunch of new things about common lisp
23:33:20
random-nick
being single user, having a hierarchical filesystem, using a (concurrent ml like?) event abstraction for IO and being more of a traditional CL implementation than SICL
23:34:34
opalvaults[m]
I may have to spin Mezzano at some point. The CLOSOS paper was an incredible read, so to tinker with current implementations of Lispy OS's could be a cool rabbit-hole
23:35:57
opalvaults[m]
also, I've forked the UltraSpec project as its currrently unmaintained. Is it a worthwhile endeavor to fix the repository? Does anyone think it would gather community participation?
23:37:08
opalvaults[m]
I'm not aware of anything except the proprietary HyperSpec and the book ANSI Common Lisp that is used as reference for CL
23:37:58
opalvaults[m]
Someone here may enlighten me to projects that have already done so in the FLOSS-sphere.
23:41:12
random-nick
Turning dpANS into new Specification Documents - Online Lisp Meeting #12, 17.12.2021 https://www.youtube.com/watch?v=aZn8dKmXbOw
23:45:15
opalvaults[m]
I'm a little confused. The original UltraSpec used Tex documents and became a mess. I'm assuming as sthat meeting was really, really new that it's something that's already underway and about to be released.
0:00:45
opalvaults[m]
I've had luck in automating the recreation of those documents into markdown, but I get the same impression of the dpANS project (although I would have done this in Markdown for ease of community contribution + the ease of translating markdown into PDF from sites such as readthedocs.io).
0:01:36
phoe
scymtym has a working TeX parser that outputs HTML, so it should be bendable to output markdown as well
0:01:48
opalvaults[m]
I appreciate the hard work you put into that. It was interesting going through the documents.
0:03:29
opalvaults[m]
It was to be my attempt at teaching myself through re-implementing referential documentation. :P
0:04:13
opalvaults[m]
However honestly for one person, I imagine that there's no best way to approach something of that scope if you've never done so beforehand.
0:05:48
opalvaults[m]
I found the same problems documenting security procedures at work. It becomes a constant battle to automate and implement and keep up to date (and find the time to do anything in between, or get anyone to agree on any scent of nebulous-ness)
1:44:50
hobo
if I have to windows, how does croatoan know which window is receiving keyboard events?