Search
Friday, 13th of October 2017, 23:05:50 UTC
23:32:04
drmeister
I merged your changes - crossing fingers
0:39:31
drmeister
There appears to be a problem compiling std-accessors.lsp std-class-optimized-accessors.
0:39:42
drmeister
This function contains core::bind-va-list
1:00:18
drmeister
Bike: core::bind-va-list is being turned into a function call.
1:00:44
drmeister
Whoops - called it bind-va-rest
1:00:51
drmeister
Never mind, trying again...
1:01:30
drmeister
https://www.irccloud.com/pastebin/h6LDMcZR/
1:02:10
drmeister
https://www.irccloud.com/pastebin/Qk5tihKb/
1:03:51
drmeister
How can I do this incrementally - generate an AST, HIR, MIR and so on.
1:04:14
Bike
you can just copy what's in translate
1:04:26
Bike
(cleavir-generate-ast:generate-ast form *clasp-env* *clasp-system*) will get the ast
1:04:50
Bike
you can't do the rest incrementally because you need to hoist, which is impossible outside of the right context - kind of unfortunate
1:05:05
Bike
but you can get pseudo-hir by just doing (cleavir-ast-to-hir:compile-toplevel-unhoisted ...)
1:05:14
Bike
itll have most of the logic but the load time values will be messed up
1:07:08
drmeister
(defparameter *f* '(lambda (core:&va-rest r) (core::bind-va-list (x &rest y) r (list* x y))))
1:07:20
drmeister
(cleavir-generate-ast:generate-ast *f* clasp-cleavir::*clasp-env* clasp-cleavir::*clasp-system*)
1:07:58
drmeister
So: (cleavir-ast-to-hir:compile-toplevel-unhoisted *f*) ?
1:08:03
Bike
this is what you're trying to compile?
1:08:14
Bike
and no, you call compile-toplevel-unhoisted on the resulting ast
1:08:44
drmeister
It's not what crashed originally - but it crashes when I use (clasp-cleavir:cleavir-compile 'foo *f*)
1:09:12
drmeister
https://www.irccloud.com/pastebin/6pCWGpYy/
1:11:28
drmeister
(cleavir-ast-to-hir:compile-toplevel-unhoisted *a*) --> #<CLEAVIR-IR:ENTER-INSTRUCTION>
1:11:38
drmeister
After (defparameter *a* (cleavir-generate-ast:generate-ast *f* clasp-cleavir::*clasp-env* clasp-cleavir::*clasp-system*))
1:12:33
Bike
hang on, what's this other thing
1:12:39
Bike
"NIL is not of type HASH-TABLE"
1:24:03
drmeister
Something screwing up
1:24:19
drmeister
I can trace translate-simple-instruction
1:24:28
drmeister
https://www.irccloud.com/pastebin/JHT5Qlmk/
1:27:27
drmeister
Ok, I copy pasted code from bclasp - I need to fix some things up.
1:29:22
drmeister
I would have appreciated some better error messages
1:44:27
drmeister
When that translate-simple-instruction on bind-va-list failed because of undefined functions.
1:44:50
Bike
well i mean, what better message
1:46:09
drmeister
Error: Your compiler failed because it is bad - and you should feel bad. If you are a glutton for punishment it is TRANSLATE-SIMPLE-METHOD ((EQL 'BIND-VA-LIST) ...)
1:46:54
drmeister
It looks like there is still a fair amount of noise in the generic function calls.
1:47:26
Bike
i would think translate-simple-instruction should show up in the backtrace, at least ideally
1:47:40
Bike
but if not we could throw some handler-binds into the compiler to give more specific locations
1:48:50
Bike
and it would be good to mark any error that stops the compiler as a bug, so that users can orient themselves
1:52:26
drmeister
I'm running the cleavir workbench in bclasp+slime now.
1:52:29
drmeister
That's working well.
1:54:24
drmeister
I'm still getting that weird error about no function being bound to CORE:UNQUOTE
1:54:25
drmeister
https://www.irccloud.com/pastebin/KHhY03ZL/
1:54:39
drmeister
That's the relevant part of the sldb backtrace
1:55:25
drmeister
The problem seems to start wiht this: (DISPATCH-MISS #<FUNCALLABLE-INSTANCE CLEAVIR-IR:LAMBDA-LIST> #<VA-LIST: (#<CLASP-CLEAVIR-HIR:BIND-VA-LIST-INSTRUCTION>)>)
1:57:03
drmeister
It should be: clasp-cleavir-hir:lambda-list
1:57:29
Bike
checking... i think you'd get that error if there was a comma outside of a backquote
1:57:36
Bike
(if this is the case, we should put in a better error)
1:58:20
drmeister
Yes - I do get that error when there is a comma outside of a backquote - but I don't see any commas
1:59:00
drmeister
Maybe it's in no-applicable-method
2:00:11
Bike
since cleavir-ir:lambda-list is a generic function, we should just edit the bind-va-list definition to use that, really
2:00:18
Bike
i already did for cleavir-ast:lambda-list
2:02:02
Bike
i can put something in to catch stray commas at read time. no reason not to, basically
2:02:07
Bike
though i probably have to go into C++, don't i
2:04:36
drmeister
I found the comma
2:04:43
Bike
that's what we call a "learning opportunity"
2:04:57
drmeister
Yeah - I write too much C++
2:05:11
drmeister
I start putting commas into Common Lisp code
2:05:41
Bike
hang on, there's already a backquote level variable
2:05:59
Bike
but it's not checked for this. whatever, makes life easy
2:06:00
drmeister
Ok, so use the generic function cleavir-ir:lambda-list for the accessor
2:07:22
Bike
if i have a Fixnum_sp, can i do normal arithmetic on that? Like (x == 0) where x is a Fixnum_sp
2:10:06
drmeister
The low 2 bits are zero.
2:10:19
drmeister
That allows comparisons, additions and multiplications without shifting.
2:10:22
Bike
oh, so if it was == 1 it wouldn't work?
2:11:06
drmeister
What do you want to compare?
2:11:18
Bike
well, just 0, but i'm asking for future reference
2:11:49
drmeister
If you want to compare to the quantity 1 (one) use (x == 4)
2:12:02
Bike
or n << 2 generally, right
2:12:47
drmeister
But use the fixnum_shift - hang on - I'll check the name
2:13:33
drmeister
Yeah - in C++ it's gctools::fixnum_shift and it's exposed as one of the values in cxx-data-structures-whatever (if not - it should be).
2:14:04
drmeister
Is type inference turned off at the moment?
2:14:16
drmeister
Will ironclad build - is the question.
2:15:19
Bike
i didn't push my change turning it off
2:15:22
drmeister
If not - how do I turn type inference of
2:15:37
Bike
comment out the let in my-hir-transformations with #+(or)
2:16:41
drmeister
Ok - progress... The slot CLASP-CLEAVIR-HIR::%LAMBDA-LIST in the object #<CLASP-CLEAVIR-HIR:BIND-VA-LIST-INSTRUCTION> is unbound.
2:18:09
Bike
put :lambda-list lambda list in make-bind-va-list-instruction in hir.lisp
2:19:13
drmeister
https://www.irccloud.com/pastebin/q0QpIEP0/
2:19:14
Bike
or... let me double check
2:20:09
Bike
sorry, probably :lambda-list (cleavir-ast-to-hir::translate-lambda-list lambda-list)
2:20:47
Bike
no, i already do that. just :lambda-list lambda-list like in the paste.
2:27:37
Bike
reader error thing works, i'll push that later
2:29:39
drmeister
You mentioned that the datums passed to translate-datum would probably be llvm::Value's - they are - I didn't expect that.
2:30:14
Bike
that's because the translator for enter instructions translates all data in the body
2:30:18
Bike
or something like that
2:30:37
drmeister
So #'identity would work?
2:35:00
drmeister
Ok - some values passed to translate-datum are allocas and some are lexical-locations
2:35:02
drmeister
https://www.irccloud.com/pastebin/lTNBH7eA/
2:35:18
drmeister
Compiling this: (clasp-cleavir:cleavir-compile 'foo '(lambda (core:&va-rest r) (core::bind-va-list (x &rest y) r (list* x y))))
2:38:52
Bike
...why are you even getting six locations?
2:39:11
drmeister
I was going to ask you that.
2:40:04
Bike
those are the outputs of the bind-va-list instruction?
2:40:32
drmeister
I don't know - I'm recompiling bclasp to export a symbol - I'll check once slime is back up
2:42:09
drmeister
Slime is working nicely - I've whipped through about a dozen problems in the TWENTY LINE PIECE OF CODE!
2:47:07
drmeister
(clasp-cleavir:cleavir-compile 'foo '(lambda (core:&va-rest r) (core::bind-va-list (x &rest y) r (list* x y))))
2:47:29
drmeister
(cmp::foo 1 2 3 4 5) --> (1 2 3 4 5)
2:47:42
drmeister
That's kind of a stupid example
2:47:52
Bike
sure, but dmeonstrative
2:48:25
drmeister
(clasp-cleavir:cleavir-compile 'foo '(lambda (core:&va-rest r) (core::bind-va-list (x y z &rest a) r (list* z y x a))))
2:48:42
drmeister
(cmp::foo 1 2 3 4 5) --> (3 2 1 4 5)
3:02:12
drmeister
Is the FUNCALL optimization in place?
3:04:03
Bike
should be. it's just a compiler macro in inline
3:23:17
drmeister
Ok - cclasp built.
3:24:13
drmeister
I'm going to push this to dev and testing to get some timing data.
3:25:04
drmeister
There is still a lot of noise in the backtraces:
3:25:04
drmeister
https://i.imgur.com/quJ8G9m.png
3:31:54
drmeister
Pushed to testing.
3:50:40
drmeister
It takes 10.5 minutes to compile ASDF
4:06:36
drmeister
A little more timing
4:08:09
drmeister
https://www.irccloud.com/pastebin/TsvOVOyB/
4:08:34
drmeister
https://www.irccloud.com/pastebin/FXtUEyKp/
4:09:21
drmeister
https://www.irccloud.com/pastebin/Q5ziTkdF/
4:13:03
Bike
well, it's 14.248/2.105 on this machine (which is worse, but also i'm chewing up the cpu), for pre-this, so that would be a reduction from 6.77 to 4.82
6:19:24
beach
Good morning everyone!
Saturday, 14th of October 2017, 11:05:50 UTC