freenode/#lisp - IRC Chatlog
Search
5:12:16
drmeister
Does anyone have insight into how to implement the optimization where functions that call each other within a compilation unit call each other directly?
5:43:18
mfiano
pillton: I got your message. I actually get a warning when quickloading specialization-store now
5:50:20
beach
drmeister: Instead of going through the function name, you do a relative jump since the two functions are in the same code body.
5:51:19
beach
But, if you do that, you can no longer redefine the callee by hitting C-c C-c in SLIME.
5:55:33
beach
Also, functions can have more than one entry point. You don't need to check the number of arguments for such a call.
6:05:19
drmeister
We are stuck on a couple of fronts. Inlining is still broken and so we can't bring the new cst compiler online. That is very frustrating.
9:42:39
ebzzry
littlelisper: the canonical answer is http://www.gigamonkeys.com/book/files-and-file-io.html
10:15:55
beach
It is tricky stuff. I am pretty sure you don't have the right to recompile callers from source code. The environment may have changed since last compilation.
10:17:05
littlelisper
compiling my defpackage gives me "bogus DEFPACKAGE option: (:USE-IMPORT-FROM :CL-PPCRE :SCAN-TO-STRINGS)"
10:17:49
beach
p_l: At the very least, the direct call contains a relative callee address and after update, it must have an indirection through the symbol or the environment.
10:18:27
p_l
beach: I was thinking of using absolute addresses instead, and essentially handling it the same way one would handle GC-movable code
10:20:49
p_l
also, one could patch the callee location with a jump to new code, and have GC hooks that fixup it later
10:21:09
p_l
though the latter requires that all code moves only in the area supported by relative call
10:23:53
p_l
AMD64 for example only gives 32bit relative addressing, which is something I once considered for a rather "larger" compilation unit
10:26:16
p_l
beach: doing it like that would also fit with my ideas of marrying your single-level-storage for OS with some robust real hw :)
10:28:36
beach
Perhaps the easiest thing to do is to require the programmer to us NOTINLINE for a function that can be redefined separately. Then there is no obligation to make it work otherwise, because the callee could very well have been inlined, so that redefining it won't have any effect anyway. Then for NOTINLINE, generate a full call so that redefinition works as expected.
10:28:43
p_l
then compilation unit becomes essentially a "segment" which has a external reference table, a table of its own contents, and can be as big or as small as it needs to be (because we could do transparent segment nesting)
10:30:54
p_l
and inside a segment, the IP-relative offsets could be market by debug data and updated when necessary (done right, one could also "fork" segments)
10:45:16
budRich
hello lisp people. Im currently in the transition phase of going from i3 to stumpwm and sublime to emacs (don't ask why). And it feels like i need to get a good understanding of and learn some lisp. It's all a bit overwhelming right now, with all the different dialects and stuff, just thought i would ask here how YOU got started: book, cource, emacs, dialect, whatever.
10:47:40
pjb
budRich: have a look at http://cliki.net/Getting+Started and http://cliki.net/Online+Tutorial
10:47:49
budRich
great, this is what i thought and planned, i try to conf stump and get used to that first, before starting with emacs, it feels like it can get confusing. And wm hacking is my cup of tea.
12:12:54
beach
OK, I created an appendix describing how I plan to adapt Doug Lea's allocator to SICL. I would appreciate if y'all would take a look. It is the first draft so far, and I will likely work on the details later: http://metamodular.com/allocator.pdf
12:29:08
edgar-rft
I don't think it rally matters what acronyms like WRKZTG really mean because people using such things don't show the slightest interest to be understood by others, so their opinion should be totally ignored.
12:32:47
Bike
i'm just imagining that beach types like a champion texter, but we can't tell because of all the abbreviation expansions
12:32:55
beach
I mean, when I type (say here in IRC) "gme", it expands to "Good morning everyone!", and when I type "hs" it expands to "Common Lisp HyperSpec", so I don't need to expose other participants to such abbreviations.
12:33:32
edgar-rft
beach: what if I wrote my doctioral thesis with vim? would emacs abbrevs expanded there?
12:34:11
shka1
"Forgetting how to implement a Prolog system is as hard as learning how to build one."
12:37:11
edgar-rft
beach: My original rambling was about abbrevs like AFAIUI in text intended to be read by humans. Of course I have no problem if anyone uses the capabilities of his/her editor to make life less painful, as long as I don't need to read unexpanded abbrevs like AFAIUI in plain text.
12:38:03
beach
I just pointed out an easy way to avoid that, without having to manually expand those abbreviations. But I take it very few people use that way.
12:39:09
edgar-rft
Many people like tp use computers to make life *more* complicated than otherwise around.
12:58:19
pjb
https://www.emacswiki.org/emacs/AbbrevMode https://www.gnu.org/software/emacs/manual/html_node/emacs/Abbrevs.html
12:58:41
pjb
I'm lazy, I've been using emacs for at least 26 years, and I never had a look at abbrev…
13:01:04
malice
Hi! Macro question: I'm struggling with creating this macro. Here's my effort: https://pastebin.com/4t0mGHaB
13:01:07
malice
The macro is basic with simple twist: it defines another macro(with macrolet) so that I don't have to pass the variable (parser) all the time in there.
13:01:28
malice
However, I get errors and I'm not sure how to get it right. The error is either "variable parser is unbound" or "variable parser-name is unbound"
13:01:57
malice
parser is unbound if parser-name is double-unquoted, parser-name is unbound if parser-name is single-unquoted
13:02:39
shka1
malice: i have this issues all the time, just use ,', instead of ,, for variable name
13:04:43
shka1
malice: https://github.com/sirherrbatka/cl-data-structures/blob/252fa0442dfc2c28b4075d96ba63339be9ebe502/src/utils/macros.lisp#L311
13:06:41
pjb
malice, it's not obvious that previous needs to be a macro. If it was a flet, you could call the outter previous function from an inner previous function with a different signature.
13:08:51
malice
pjb: I wanted to avoid it overwriting the function slot of the previous since I wasn't sure if that wouldn't affect other functions that call it
13:13:02
pjb
beach: after having read (only) C.1 we don't understand why the in-use bit is stored in the next chunk. And the diagrams don't even show the next of the next chunk, so the information displayed is incomplete.
13:13:53
pjb
beach: what use are the chunks that don't have free space in them? bin 0 seems useless.
13:21:15
beach
Only free chunks have 4 words with valid data. A chunk in use has only 1, so there are 3 words for user data.
13:22:24
beach
The in-use bit is stored in the next chunk so that when a chunk is freed, you can check whether the previous chunk is in use. If it is not in use, the previous word is the size and you can use it to find the beginning of the previous chunk.
13:22:59
beach
If it is in use, you can't do that because the size field is then used by user data, so you must have this bit to check which case it is.
13:26:29
beach
pjb: I have yet to write the section on freeing a chunk, so it is normal that this is not clear from the current document.
14:16:11
beach
Interestingly, since these chunks are going to be used for the racks, and many racks need a size stored in them (like for arrays), I can sometimes use the size field of the chunk instead of storing the size separately.
14:50:43
montxero
someone has a gun to your head and says, show me a simple example of a macro in under 7 lines! It must be simple enough for a non lisper to understand once some basic rules are explained
14:54:42
beach
Sure, prog1 will do. (defmacro prog1 (first-form &rest more-forms) (let ((result-var (gensym))) `(let ((,result-var ,first-form)) ,@more-forms ,result-var))) something like that.
14:54:58
trittweiler
montxero, how about (defmacro while (condition &body body) ...)? There are many ways you can base the expansion on. Which one depends on your intended pedagogy.
14:58:46
loke
When I deonstrated macros to a non-Lisp audience I created a reverse-if, basically something that worked like IF but reversed its arguments: (IF C T F) ⇒ (REVERSE-IF C F T)
14:59:42
beach
montxero: I don't think you are ever going to be happy with the answer, so I give up.
15:01:05
loke
I still have the slides from that presentation: https://docs.google.com/presentation/d/1mIHAruC3nbI-CZPVjX7AuRp-bj9xjJima0l6XrHUI6Y/edit?usp=sharing
15:07:09
montxero
beach: How about this... BANG! now I've shot the tip of your right shoe missing your toes by inches... c'mon gimme one
15:08:31
loke
beach: It is another CAS, separate from Maxima, although the maintainer of Maxima started the Axiom project as well, back in the 70's or something
15:09:25
loke
It's still maintained, which is fine (but odd that I didn't know about it). It runs in Common Lisp, but it's written in lterate style (like Knuth does) and it seems as though they actually don't write the code in Lisp, but rather in the Axiom language that is converted to CL.
15:10:01
loke
The source files bascially contains the axiom code in comments + the CL code. it seems they pass it through a translator that converts the axiom code in the comments to respective Lisp functions.
15:11:03
loke
It's a bit strange, but at the same time perhaps a good example of how you can leverage Lisp to get natively compiled Lisp code even if you use a different language.
15:12:18
loke
wonder how this is maintained. Dothey write the code in comments, or do they paste the result manually after making modifications?
15:15:29
loke
I'm looking at some changes in the git history. The git change records a change to oboth the code in the comment, along with the corresponding Lisp code in the same diff
15:23:28
makomo
but there's an interesting talk from one of the the authors (and the current maintainer) on literate programming
15:55:51
oni-on-ion
this tripped me out yesterday, it is one of two things ive seen yesterday which really opened my mind and respect for lisp : http://www.lispology.com/show?JHE
15:59:28
beach
oni-on-ion: That one doesn't take into account the published results that write floating point numbers so that reading it back gives the same exact value.