freenode/#lisp - IRC Chatlog
Search
2:03:06
pjb
All FS I know are using blocks as the smallest thing they can write. Also, most random-access devices use sectors as the smallest thing they can write.
2:03:50
pjb
You will also observe that some FS will optimize reading and writing from hard disks by using the track or the cylinder as unit of read or write.
2:04:22
pjb
The idea of files as a sequence of bytes is a figment of the imagination of the POSIX standard.
2:05:45
pjb
Now, as for how one would write 9 bits to a file, well, basically what will occur ultimately, is that a sector is read from the hard disk and copied in a memory buffer, then you will modify 9 bits (or more) in that memory buffer, and then that memory buffer will be copied back to write a sector (possibly the same, often a new one).
2:06:37
pjb
Knowing that, how you use the POSIX file abstration to write 9 bits is rather irrelevant; several solutions are possible.
2:07:06
nirved
pjb: you can create an one byte file, so this is the smallest thing; internally there might be blocks, but this is not exposed
2:07:29
pjb
Or you can use the write and read (byte buffer) abstraction of POSIX, and spread the 9 bits over two bytes. Or 9 bytes as non-clisp implementations do.
2:09:28
pjb
nirved: notably, controller-less disk media (eg. Apple floppies), had just hardware to read the tracks as a sequence of bit. Mapping track bits to sectors of bytes was done by software.
2:32:19
nirved
pjb: files with element-type bit are really strange in clisp - there is a 4-byte file-length prefix at the beginning
2:33:52
no-defun-allowed
makes sense, you couldn't count bits just by file length without some information
2:35:04
aeth
Going back to both of the earlier topics of McCLIM and my game engine, I'm not going to be integrating McCLIM because that would go against my two goals of (1) leaving anything that could hurt performance to the user of the engine to do and (2) all-in-one binary distribution (my interpretation of McCLIM's LGPL license would mean that it should ship separately from a binary)...
2:35:15
aeth
...but what does it take to become a McCLIM backend? Because I suspect that there would be interest there.
2:37:47
pjb
With files with more than 1-bit bytes, you can reserve a header and update it to contain the total bit length header, or just the bit-offset in the last byte. Using just the bit-offset would be easier, since it takes only one byte to write.
2:38:32
aeth
pjb: re "The idea of files as a sequence of bytes is a figment of the imagination of the POSIX standard." it seems like it's more than just POSIX
2:39:44
aeth
Even in CL you see either bytes or characters, which are usually UTF-8 translated into the internal format (probably UTF-32) unless there's some configurable encoding support.
2:42:03
aeth
pjb: Well, yes, I'm aware that there's a lie there, I think that's why you have to 'safely remove' external hard drives.
2:42:53
pjb
and again, if you read above, I wouldn't have to repeat that to write a byte to a disk you have to first read a fucking whole sector!
2:44:23
pjb
There's also the case of networks. Both serial and Ethernet are bit-based transmission protocols (level 2).
2:45:29
aeth
pjb: And I don't think you mentioned solid state drives yet, which are afaik extremely elaborate internally.
2:47:36
pjb
Usual hardware UART let you configure the number of data bits and mark bits, and the presence of parity bit, but really, they just transmit bits. When you program a GPIO on raspberry you can send the bits yourself.
2:48:56
pjb
Actually, if POSIX specifies files as sequences of bytes, it's only because it's inspired from unix which was written in C. If it had been written in Lisp, we'd have variable length bytes just as in CL read-byte and write-byte.
2:51:43
pjb
I can't wait the singularity. We'll be able to ask the AI to evole a whole field such as computing, starting from different premices…
3:04:21
aeth
This is why it would be safer to augment human intelligence instead of developing superhuman artificial intelligence from scratch. You know humans will want to benefit humans (or at least themselves)
3:05:05
aeth
In a sense, tools like SLIME already do that, but things will really take off once we get a more efficient brain-computer interface than keyboards.
9:34:47
beach
The 300€ I offered to extract the Cleavir environment code is no longer available. I have almost finished the work myself.
9:38:36
phoe
I know beach and jackdaniel have some, there is the current CCL one for PLNs, and I know stylewarning also has some posted.
9:40:08
beach
Not for what I am proposing. I don't want any old person to apply. Then I would have to deal with explaining to them that they are unqualified, with looking at their existing code, etc, etc.
9:40:46
beach
Oh, and I would like the applicant to have the desire to learn things. Not just make money.
9:56:29
no-defun-allowed
There are libre software funding pages, a lisp presence on some would be interesting.
9:57:02
no-defun-allowed
Also, I have a very small bounty since websocket implementing is not the best use of my time.
9:58:32
no-defun-allowed
Such a client should have methods for reading and writing events, but the client only should pass data events to the user and raise conditions for disconnects.
9:58:34
beach
Posterdati: Maybe you don't know what "bounties" are. They are not employments. Just small amounts of money for specific tasks.
9:59:29
no-defun-allowed
Also, admittedly, I don't know if PayPal will let me use the $3.80 as I don't have a credit card. I think it should, hopefully.
10:01:39
beach
no-defun-allowed: That is a very small amount of money. I doubt you will have any takers.
10:03:31
no-defun-allowed
I do have a rough prototype for a websocket client like I describe, but most of the required features are missing.
10:04:38
beach
Posterdati: In the case of McCLIM, we get regular (monthly?) support from a bunch of contributors.
10:04:41
Posterdati
no-defun-allowed: why don't you read the UNIX Networking Programming manual and Network Programming in ANSI Common Lisp with IOLib?
10:05:21
Posterdati
beach: I see, I'm looking at the site you posted, I'm interested in usign McCLIM
10:05:40
no-defun-allowed
Cause I retch at seeing Unix documentation and streams are much more natural for CL.
10:07:16
Posterdati
no-defun-allowed: I did a client/server using iolib, not easy, but not impossible!
10:07:21
no-defun-allowed
Also, again, the less CFFI, the better. I'm sorry, but it'd give me more shit to maintain and deploy.
10:07:51
no-defun-allowed
CFFI won't work too well on Heroku, and I want to avoid it for everything other than SSL.
10:08:13
Posterdati
no-defun-allowed: since you have to use system libs I do not understand the CFFI problem...
10:09:37
no-defun-allowed
The only C library I want to pull in is SSL, since that's definitely going to be present, everything else is more work.
10:11:04
no-defun-allowed
Additionally, more C means more things that go wrong that I can't gracefully recover from. I'm terrible at prototyping and I've killed a few images from being stupid with CFFI.
10:13:33
no-defun-allowed
Yeah, I have to spawn two threads instead of one to get cl-decentralise talking to it too.
10:14:01
no-defun-allowed
But I suppose the synchronous requirement can be worked with, it's easy to hack on to the other.
10:14:31
no-defun-allowed
There was some kind of fast-io which used static vectors which used CFFI, which I can't disable.
10:16:02
no-defun-allowed
Maybe I need to update the buildpack, since there is an issue with a uiop macro from what I remember.
10:16:24
no-defun-allowed
>i got a very, very weird error using websocket-driver on heroku: https://pastebin.com/4XjhbYQ4
10:18:45
no-defun-allowed
Would that come with sbcl? I think asdf did and they're fairly related libraries.
10:20:25
no-defun-allowed
I don't know, honestly. Heroku does not let you get at a remote repl too easily.
10:21:20
phoe
Though by now I expect it to ship ASDF2 which is ancient as well and many modern libraries refuse to run on it.,
10:26:38
no-defun-allowed
I suppose the SBCL developers have forgotten to add the finewine(tm) program longevity improving libraries.
10:35:23
phoe
So, not SBCL's fault either. Complain to CFFI maintainers that they dropped support for earlier UIOP versions.
12:05:04
dimpase_
their FAQ is rather unclear on it, and in my setup (require :ecl-quicklisp) starts installing things into ~/quicklisp straight away.
12:11:19
dimpase_
one does not want 100 students creating ~/quicklisp and downloading stuff there...
12:13:52
phoe
quicklisp operates with the assumption that users can download arbitrary stuff into the Quicklisp directory
12:15:00
phoe
if you want read-only access to systems, you can run Quicklisp as a privileged user, download the packages from the Internet into a directory that is read-only by other users
12:15:35
phoe
then other users add that directory to their ASDF registry so they can (asdf:load-system :foo) from it.
12:15:56
Inline
like a main base on some dir then everyone with his own clutter of their own quicklisp dir
12:16:52
phoe
you have a system-wide registry (Quicklisp mirror) that is scanned first, and if a system is not found there, then QL/ASDF can search for it
12:18:32
dimpase_
in fact, it's about adding a package into ECL embedded into SageMath... (http://sagemath.org)
12:21:11
Inline
phoe: i.e. installing some libs to arbitrary paths, and keep the pointers in the registry ?
12:24:22
phoe
so: use an external ASDF registry, and Quicklisp on the clients, while making sure that QL is aware of the external registry.