freenode/#clasp - IRC Chatlog
Search
19:58:29
Bike
not sure how to work multiplication. but as it happens i don't think i totally understand the existing fixnum arithmetic anyway...
19:58:56
Bike
it's set up as branch on overflow, which makes perfect sense in the object code, but does cleavir need to know about it?
19:59:18
Bike
if we had an addition where we knew the result would be a fixnum, would we indicate that by having both fixnum-add branches go to the same place? that seems weird.
20:01:49
Bike
for multiplication, we end up with a result that's twice as wide as the intake, which we could represent with two locations, but do we really need that? the only ways to multiply that i can see are the normal case of possibly making a bignum, and the occasional case where you want wrapping
21:51:34
drmeister
I think Cleavir does need to know about it. Did I have fixnum addition already implemented? I recall that I did - I recall doing something with an add with overflow and then handling the overflow case in the HIR.
21:53:45
drmeister
Isn't multiplication the same then. Or I don't understand what you mean by "does cleavir need to know about it".
21:54:45
Bike
if addition overflows it's easy to get the bignum without doing more arithmetic, but with the same pattern with multiplication we'd need to multiply twice
21:55:17
Bike
by cleavir knowing about it i mean this branch pattern, or whatever we do for multiplication, being in the HIR
21:59:11
Bike
If we can do it with a builtin we don't need cleavir? Well, no, we can do whatever we want with a builtin
21:59:55
Bike
For example, since typeq is in cleavir, it can find and eliminate type checks. if type checks were implicit in builtins or functions we couldn't do so
22:01:07
drmeister
Ok, if I follow you then I don't think cleavir can do anything with it - but this is not a question I can answer with authority. You or beach may come to a different answer.
22:01:58
drmeister
The one thing I might add (and may be incorrect) is that it seems that C++/C aren't good at detecting overflows, but the llvm intrinsics do return overflows.
22:04:01
Bike
so, sign extend so that multiplication gives the full answer, then truncate and detruncate and compare that to the original to see if it overflowed
22:05:09
drmeister
Well, there is also this: https://llvm.org/docs/LangRef.html#llvm-smul-with-overflow-intrinsics
22:05:29
robink
drmeister: Looking through your latest commit; it seems to be looking in the Contents subdir of whatever directory it finds for CLASP_HOME. Does it make sense to maintain that OSX directory structure?
22:06:48
robink
drmeister: Also, build/boehm/Contents contains only an empty directory called Resources.
22:07:24
drmeister
robink: I've only moved partway from OS X directory structure to linux. More like - it supports Linux if you pull the executable out of the OS X directory structure and put the Contents directory in /usr/local/lib/clasp/Contents or /usr/lib/clasp/Contents.
22:09:11
robink
drmeister: There's probably something (or somethings) that succeed it at this point, but it was the original filesystem organization standard for Linux and recent UNIXlikes.
22:10:00
robink
drmeister: but of course, one of the still-unwritten rules of organizing things in /usr/local is once you get into using a package-specific subdir, you're sort of allowed to do whatever you want.
22:11:10
robink
drmeister: ...but under FHS, I think the idea is that having a subdirectory entitled contents is most suited for /opt or /usr/local/opt.
22:11:50
robink
drmeister: *really* nice would be to have the hardcoded search path specifiable at configure time.
22:12:24
robink
drmeister: but really, anything that allows for hinting to Clasp as to where things are as well as staging things into a quasi-Linux-y arrangement is also a plus.
22:43:46
robink
drmeister: Either as an argument to './waf configure', which would be put in something analagous to a config.h, or in a distribution-wide (and -specific) environment file.
22:44:10
robink
drmeister: ...or in their .bash_profile or whatnot, if they were using a private build.
22:45:24
robink
drmeister: Oh, I might've missed it. Is it specified in the configure phase, or during a waf-aided install?
22:49:10
drmeister
But Clasp may still be a bit weird because say if you say: ./waf --prefix=/usr/local/lib/clasp
22:52:13
robink
That way, the resulting file locations may not be 100% ideal, but at least Clasp should know where they are.
22:53:07
robink
Also, if Clasp is prefixed into /usr, that should put (a symlink to) clasp in /usr/bin, correct?
22:55:30
robink
drmeister: Will the Clasp build/install process default to putting stuff in /usr/Contents if --prefix=/usr?
22:56:22
robink
Bike: Normally we do not, unless we're putting it in a place where each package can define its own rules.
22:56:36
drmeister
I haven't put the time into developing two separate install systems - this stuff is fussy and time consuming.
22:57:02
robink
drmeister: I can wait, and see if it's not horrendously hard to start massaging the wscript to the point where it more closely follows the FHS.
22:58:36
robink
Bike: (...and GNUStep, but that probably sees even less usage than NextStep for M68K)
23:03:01
drmeister
If we said --prefix=/usr I would put the executable in /usr/bin and the clasp ancillary files at /usr/lib/clasp/**
23:03:57
Bike
robink: sure, just forcing the OS X structure onto linux didn't seem like a good strategy (i say from the sidelines)
23:04:06
robink
drmeister: That works in Gentoo, especially since Clasp will only build for a single ABI (there are several packages (and maybe a LISP or two) that'll build for a 32-bit ABI on top of a 64-bit for some archs).
23:04:37
robink
drmeister: Well, I mean if the whole mess is going into a package-private dir, it's not the end of the world, but that kind of approach tends to nudge things towards ending up in /opt.
23:05:19
robink
drmeister: On 32+64-bit multilib systems, /lib is a symlink to /lib64 (same w/ /usr/lib & /usr/lib64).
23:06:04
robink
drmeister: *Technically* the most kosher thing to do is to explicitly specify which libdir you're using, even if you're only ever building for a single arch, but it's not too big a deal not to bother.
23:06:32
Bike
my /opt experience was DRMful tools i'd rather not remember, so if clasp can avoid that all the better
23:06:52
robink
drmeister: ...and given that 100% of the files in /usr/lib(\d\d)?/clasp aren't being dealt with by ld.so, I'd say it really doesn't matter all that much.
23:22:23
robink
drmeister: OK, no hurries on a FHS-friendlier twiddle of the wscript, but changes are welcome, of course :)
23:22:33
robink
drmeister: I'll try to get the ebuild to meet you at least halfway once the commit's up.
1:18:35
drmeister
I spent the evening retooling the build system to install FHS-style and then got stuck because OS X expects the OS X directory structure.
1:41:48
drmeister
I dug deeper - it's not the debug info that is the problem - it's the source code.
2:26:30
drmeister
If you install with --prefix=/usr it will put the executable in /usr/bin and the ancillary files in /usr/lib/clasp/**
2:29:56
drmeister
No, it's different now - but not that much different. All of the ancillary files end up in ${PREFIX}/lib/clasp/** and clasp knows to look there.
2:35:59
drmeister
(procedure-has-debug-on (policy-anywhere-p initial-instruction 'maintain-shadow-stack))
2:40:36
drmeister
https://github.com/drmeister/clasp/blob/dev/src/lisp/kernel/clos/hierarchy.lsp#L342
2:49:24
drmeister
I can't use DECLARE on an eval-when or defconstant - +class-hierarchy+ list and so I thought I would move the long list that describes the class-hierarchy into a function (generate-class-hierarchy) and use (defconstant +class-hierarchy+ (generate-class-hierarchy))
2:50:08
drmeister
I want to use (declare (optimize (debug 0))) on it so that it never gets debug turned on even if it's proclaim'd or declaim'd
2:50:37
Bike
but, besides that, would it be possible to just have all top level ufnctions have debug 0, since we don't need to know about those
5:19:12
beach
I think the multiplication instruction should take two unboxed fixnums and produce two unboxed fixnums as a result. No overflow detection is needed.