libera/#commonlisp - IRC Chatlog
Search
3:52:18
ns12
White_Flame: Most sb-posix functions do not seem to be documented in the SBCL manual http://www.sbcl.org/manual/
3:53:04
ns12
I guess the full list can only be found in the source code https://github.com/sbcl/sbcl/blob/sbcl-2.2.1/contrib/sb-posix/interface.lisp
4:00:28
White_Flame
I guess open FDs would be a thing if you want to share them with pipes or whatever
4:04:43
White_Flame
and signal handling should not be done with raw posix calls from inside lisp. Use the implementation's wrappers for them
4:09:24
White_Flame
I do wonder what you're doing, though, as many of these things should more be viewed in terms of the functionality you're going for, not the specific posix api
4:11:59
ns12
White_Flame: I have no particular project. I have been learning about the POSIX API, and I am evaluating Common Lisp's existing ability in this area.
4:17:40
beach
Maybe I should mention this embryonic idea for POSIX protocols: http://metamodular.com/POSIX-API/
4:31:48
Guest74
how many implementations have posix functions? is there much difference between the implementations? I figure everybody would stay pretty close to the c definitions.
4:35:14
ns12
Guest74: "how many implementations have posix functions?" - From my observations, it is not a priority for many Common Lisp implementations.
4:36:11
ns12
There's osicat https://osicat.common-lisp.dev/manual/osicat.html but it provides limited features.
4:37:09
Guest74
beach: i've been thinking about that, and maybe just treating structs as arrays. It's the pointers that make things tricky.
4:37:51
White_Flame
also the actual C memory layout needs to be consistent, and I don't know how packing plays into that
4:39:05
Guest74
just treat everything as arrays of ub8 with accessing functions that assemble the bits.
4:40:52
White_Flame
I only ever implemented the reader, though. Can read an entire java .class file into list-based structures
4:41:31
ns12
Is there any Common Lisp implementation that provides a larger POSIX API than what SBCL has?
4:41:31
ns12
I am used to the POSIX functionality provided out of the box in OCaml (https://ocaml.org/api/Unix.html) and in Standard ML (https://smlfamily.github.io/Basis/posix.html).
4:43:01
beach
But I don't think that's the protocol you would want to expose to Common Lisp application code.
4:43:30
Guest74
I'm sure there's a few. I've taken to using nibbles for the reading/writing that everything deconstructs to.
4:43:43
White_Flame
but it's the spec (and knowledge that it is unambiguously implementable) that's the important part
4:49:58
Guest74
white_flame: I hope to have some that reads more like common lisp with a small precise specification.
4:50:33
White_Flame
well, this is a declarative data specification. the lisp stuff then uses it to interpret how to pull in a file into a tree of values
4:51:24
White_Flame
because all sorts of file formats do all sorts of crazy things, it needs a very comprehensive library
4:53:24
Guest74
Many years ago I thought I would write a buffer replacement for clx to work with modern extensions. but it's just too stupid.
4:53:36
beach
Guest74: We seem to be talking about different aspects. I think as an implementation technique, stuffing things in a Common Lisp vector might work. I am more interested in what data structures will be presented to the Common Lisp application programmer. That's what my page on that link is about.
4:56:38
Guest74
beach: for my current work on ioctls I autogenerate a lisp struct with the same fields, and also generate a reader for that struct that populates the c struct. I find it a bit tedious. I also have the option for the lisp function to take an alist of slots and values which populates the c structs/arrays for the ioctl.
4:57:51
Guest74
I'm guessing lisp function built upon those autogenerated structs/readers/writers will just take keywords?
5:00:19
Guest74
though I think I need still allow to pass lisp structs(and maybe even c structs?) for things where it makes sense. e.g. force feedback effects for controllers are nicely contained within c-structs, and having a library of them you could send to the device seems like something useful.
5:03:22
White_Flame
it wouldn't seem like the end of the word to marshall between a reused lisp struct and a reused C struct
5:04:24
Guest74
I don't reuse any c structs at the moment. A new one is created for every ioctl call. I don't know if that's as bad as I think it might be.
5:12:35
Guest74
thankfully it doesn't seem like there's anything too crazy in c stuff for ioctls. The worst I've run across so far is nested structs and pointers to arrays within the struct, but it's all seemed to work out so far.
5:13:28
Josh_2
beach: Has anyone worked on a practical implementation of a posix interface like the one you have started specifying?
5:17:54
Guest74
well, except sb-posix:ioctl doesn't really work and I have to use sb-unix:unix-ioctl, but besides that, i'm not sure how much more lispy you can get for posix calls.
5:20:34
Guest74
actually, i shouldn't say it doesn't work. It probably works as specified by posix but linux changed how it works and bsd users were made sad.
5:35:36
Guest74
i guess it depends on what OS functionality you are talking about. We could write our own interfaces to file systems.
5:38:45
pillton
I am not sure that is true. I can't open a file which connects to a website for example. I also can't open a file to execute a command.
5:40:51
opcode
anyone here run a swank/slynk repl on a remote server accessible via the internet? if so how do you secure it?
5:52:48
pillton
beach: I'd have to think about it. I'd rather people write libraries which solve specific problems rather than offer interfaces to APIs of other languages.
5:55:18
White_Flame
opcode: I mean its default is secured away from outside connections, so it's less of a concern. But anybody with access to execute code on the box can access swank
5:56:01
opcode
White_Flame: maybe i'm not clear, but I want to have a long-running lisp process on a server, and i want to expose a repl so I can hack on it from home
5:57:00
White_Flame
and I don't think you should open the listener to anything but the loopback device, and externalize the access via ssh or whatever
6:16:57
Josh_2
I have 3 lisp images running on one of my VPS's and I can just open my ssh connection with tunnelling and then I can connect to them
6:20:33
pillton
beach: For example, asynchronous I/O, synchronous I/O and non-blocking I/O. I think CL can do a much better job of offering interfaces to these I/O strategies that actually helps the user organise /their/ application. The underlying C API does not do that. The functionality is "exposed" by a convoluted set of C constants, functions and file descriptor modes, obfuscating each individual strategy. I think the C constants aren't even
6:20:34
pillton
consistent across the different unixes. And, once you're done with the unix world, you also have to consider the non-Unix world as well.
6:23:03
beach
The idea of my suggested protocols was to do it in 2 layers. The lower layer would be closer to the C API, and the upper layer would present something much more convenient to the Common Lisp application programmer. Perhaps the upper layer would be the place to do a better job.
6:48:26
dirtcastle
i installed slime. but If I M-x slime , it shows " searching for program: No such file or directory,lisp"
6:56:27
White_Flame
dirtcastle: you probably have to define which lisp it's going to call, and is just defaulting to "lisp"
6:56:54
White_Flame
however it's easier to use portacle for an all-in-one solution, or quicklisp-slime-helper to install slime individually
7:29:02
jmes
Question for Parenscript users: how do I call a macro inside a PS form? When I want to use MY-MACRO (which should spit out some Parenscript code) and I write (ps (my-macro)) it gets compiled to myMacro. I tried to RTFM but my brain might be too small
7:32:26
jmes
I have a situation more like this, where if I use Parenscript's LISP like so (ps (let ((something 1)) (lisp (my-macro something)))) then SOMETHING will be unbound
7:46:53
hashfunca51
White_Flame: i did the exercise of constructing a templated macro without using quasiquotes. but i've been stuck on how i get around splicing lists without using ,@
7:58:08
hashfunca51
White_Flame: especially arguments given to an &body parameter in said macro, because the argument passed is wrapped in a list ... (1 2) => ((1 2)) ... thus the list must be spiced, since, if not, an erroneous function call is made. e.g., ... (1 2) => ((1 2)) => "illegal function call". i've been at it for a long time and still haven't found a way around not using ,@
8:15:20
hashfunca51
White_Flame: sorry, you were involved in that conversation but it was @moon-child that recommended that exercise
8:51:07
flip214
depending on the input data an (alexandria:flatten (cons list1 (cons list2 (cons list3 nil)))) might work for you as well ;)
9:32:47
neominimum
Anyone know of projects that are looking for hands? I have two brain cells that I would like to put to good use.
9:44:20
neominimum
I'd like to take the opportunity to work in a variety of domains to further my knowledge. I don't think I really have a preference as to what I want to work on, as I hope the problems can be interesting in and of themselves. That being said I have recently begun some study into basic computer architecture, up through to high-level language compilers and I found it pretty interesting. I am sorely lacking in theoretical foundations, but am
9:56:08
neominimum
I've been developing an actor runtime for message passing style concurrency, it's rather primitive still, but it has been the vehicle by which I've been learning common lisp. I have coupled that with a basic syntax for coordinating the execution of lisp code using an asynchronous evaluation semantics, so that one can continue to code in direct style as opposed to a continuation passing style.
11:47:21
neominimum
I like the world building aspect of game development, not so much gameplay mechanics though, but I'd like to have a go at creating some imersive 3d environements one day. AIUI there is an absolute ton of work that goes into the implementation of game engines.
12:09:42
jackdaniel
usually you start from something that is interesting to you and you end god knows where :)
12:30:08
neominimum
true! :) Honestly sometimes I feel overwhelmed with how many forks and detours there seem to be in the path. Theres way to much to master in a single lifetime, I get a bad case of analysis paralysis at times.
12:34:19
jackdaniel
no worries, if it is true that the world is just, then everyone must have the same share- in other words we reincarnate as each possible person in each possible time with all possible scenarios ,-)
12:47:51
neominimum
Personally I can't wait to reincarnate as a sea cucumber. No care in the world, gently being tossed around by the warm sea currents. Magnifique.