freenode/#sicl - IRC Chatlog
Search
5:23:29
beach
Here is a suggestion for an important project that can be done in a weekend or so: Implement the algorithm for reading and writing floating-point numbers designed by Aubrey Jaffer, and described in his paper "Easy Accurate Reading and Writing of Floating-Point Numbers".
5:24:47
beach
It should be possible to implement these algorithms in portable Common Lisp, so they could be turned into one of the portable SICL modules, or even better, into a separate repository.
5:29:45
ck_
I know I read something like that while working on some project at a previous employer, years ago. I'll check later today
5:31:16
beach
The article is from 2015 and claims to improve on Steele & White, on Clinger, and on Dybvig.
5:36:46
ck_
I'll atone for the mistake by posting a link to the paper, for the record: https://arxiv.org/pdf/1310.8121.pdf
5:55:58
beach
In case it is not clear, this suggestion is one in a collection of small projects that I have been asked to suggest by several people in order to facilitate contributions to SICL.
6:25:33
beach
There is of course also this (not so small) project that I would like to see worked on: metamodular.com/POSIX-API/
6:58:07
heisig
beach: I need to differentiate whether CST-to-AST is used by the file compiler or not. Only the former case requires hoisting of non-trivial constants.
7:25:32
beach
Thinking ahead a bit... I see this library: https://github.com/eschulte/elf for manipulating ELF files. Any opinions about it, or information about others?
7:47:34
heisig
One 'problem' could be that the library is GPL licensed. So using it would put SICL under GPL :)
7:49:52
heisig
Just saying. All in all, is great to see that there is already a library for handling ELF files.
8:39:48
beach
So the thing to do in order to test this library would be to write a Common Lisp program that creates a minimal ELF executable that just does a syscall of exit with some value greater than 0.
8:46:09
beach
Trying to figure out all the information that is required to make it work, like what sections are needed, what format they have etc.
8:49:14
beach
If I were to do it, I would probably write an assembly program, link it and see what sections are created. From GCC there is just way too much information present.
8:50:34
beach
Well, I managed to use the Common Lisp library "elf" to read an ELF executable, so I can use that.
8:53:54
beach
Of course I also forgot the NASM syntax, even though I have actually used it to write some test programs in the past.
9:21:48
beach
Well, this was precisely the kind of result that I feared. I made a 64-bit NASM program, turned it into a .o file, tried to link it, and ld says it's a 32-bit relocatable file. Reading it with the ELF Common Lisp library says it's a 64-bit file.
9:30:04
beach
I have a feeling that I must make my program start at this address, or else inform ld otherwise.
9:30:05
no-defun-allowed
Hm, isn't that supposed to be in the C runtime? start calls main and calls exit with main's return value I think.
9:30:58
no-defun-allowed
Yeah, in that case I believe your program's entry point has to be _start, not main or anything else.
9:34:02
beach
I mean, I don't know what I need to do to convince ld to treat my first instruction as the entry point.
9:34:40
ck_
https://stackoverflow.com/questions/17898989/what-is-global-start-in-assembly-language ?
9:34:45
no-defun-allowed
I can't remember nasm too well either, so I'm reading the Hello World example in https://jameshfisher.com/2018/03/10/linux-assembly-hello-world/