freenode/lisp - IRC Chatlog
Search
22:29:09
jcowan
I think what I have sorta figured out is that a compiler macro should be associated with a function, not with the function's name
22:35:24
_death
I suppose in a Scheme attitude it makes sense.. but in practice what will it give you that the current approach, with a compiler-macrolet operator, is lacking? assuming (setf (fdefinition ...) ...) is quite rare
22:44:06
jcowan
yes, probably nothing much, since compiler macros are only applied during direct calls
22:54:20
Bike
also, if you didn't get an answer on why compiler macxros aren't great, it's just because most optimizations require more information than just surface syntax.
23:22:08
pillton
I'm struggling with why you would want a local compiler macro for a local function which is also invoked as a function object.
23:25:22
Bike
maybe you have a with- macro that makes some local function available, and sometimes it can be compiled easier
23:29:52
Bike
(apply #'call-next-method args...) could be inlined as (funcall next-method-function (list* args...) more-methods), incidentally
23:49:46
jcowan
Bike: when you say "most optimizations", you are talking about bog-standard compiler optimizations, not things like optimizing (+) to 0, right?
23:50:42
Bike
for +, for example, you want to reduce that to zero, and reduce (+ a) to a, and probably (+ a b c) to (+/2 a (+/2 b c)) or such
23:50:59
Bike
but you also want to constant fold and maybe group numbers of the same kind together, and you can't do that syntactically
23:52:30
jcowan
well, okay, you can't do value propagation followed by constant folding, but the problem is with the value propagation
23:52:57
fiddlerwoaroof
should quicklisp rebind *print-case* inside of quickload? It's probably not ideal to mess with people's settings like that, but a bunch of libraries seem to assume that *print-case* is :upcase in their macros, which often leads to mysterious breakages.
23:53:34
jcowan
one example I've seen is optimizing exponentially growing functions when their arguments are fixnums
23:56:01
fiddlerwoaroof
This frequently is done incorrectly because the library author only ever tests with *print-case* :upcase
23:56:58
fiddlerwoaroof
While, in an ideal world this wouldn't be a problem, I'd generally prefer to have quicklisp temporarily normalize the value of *print-case* rather than having the library break mysteriously later on.
23:57:09
Bike
but of course compiler macros aren't useless, it's just that they're not capable of describing all or probably even most function-specific optimizations
23:57:32
fiddlerwoaroof
I only ever notice this because I set *print-case* to :capitalize in .sbclrc
23:57:52
Bike
i really don't think this is quicklisp's problem. you can rebind it yourself, or you can file bugs with the libraries
23:58:13
fiddlerwoaroof
Sure, it's not quicklisp's problem, strictly speaking, but it might be a useful feature
0:00:18
jcowan
Bike: one of the things I ask people when I interview them is how to compute fibonacci(n) in Blub in O(1) time
0:01:08
fiddlerwoaroof
First you write a Scheme runtime with TCO, then you implement it the obvious way :)
0:01:23
jcowan
the answer is that fib(42) or so is the largest representable Fibonacci number in typical Blubs (not Python, though)
0:08:55
jcowan
supposing you needed a fibonacci function in your program, you could supply a compiler macro that would avoid calling it all for less than bignum results
5:38:17
burzos
Is there a variable I can toggle to force `format` to always show the dot in proper lists?
5:40:14
beach
I don't think so. FORMAT probably just calls the appropriate PRINT function, so ultimately PRINT-OBJECT. But you are not allowed to modify the standard behavior of PRINT-OBJECT. You can try doing it anyway and see. Why do you need this?
5:41:39
burzos
I have assoc lists and I'm `format`ing them in a user console, but it's confusing when some of the entries are dotted and some aren't (because the value can be a list or an atom).
5:44:31
beach
You can always print it "manually". I mean, the REPL is not meant to be used for end-user stuff.
5:46:26
burzos
Yeah. The frontend def needs a lot of work, this is just for debugging in the interim.
5:47:16
loke
He only wants to display the first level using ditted notation, and doing that is trivial with format (FORMAT T "(~s . (~{~s~^ ~}))")
6:22:44
beach
More generally, it is impolite, because you kind of encourage dozens of people to click on links that might be of no interest to them. So you are wasting people's time.
6:34:04
onion
what about notes and comments about someone's behavior, i can see this being more productive if it was a personal concern, kept privately. but i notice some people are looking at CL implementations on the web so i thought i would share that right where those people have been asking. maybe my timing is off
8:33:11
johnnymacs
I have done an apt-get install ecl and when I check the filesize of /usr/bin/ecl it appears to only be 6 kilobytes
8:33:29
johnnymacs
Somehow that does not seem posible to me. Can embedded common lisp really be that small?
8:37:39
beach
Usually, systems like that define a minimal subset of Common Lisp written in some other language, then the remaining Common Lisp functionality is written in that minimal subset.
8:40:33
johnnymacs
Is there a ftp where I can find some precompiled binaries for different architectures for ecl?
8:42:12
johnnymacs
on the busybox website they have a list of all the main archs, a few arms, windows, linux x86 linux x64
8:44:30
jackdaniel
so you either have to rely on your distribution packager (i.e Linux package managers, Windows has freebox, there is package on Google Play maintained by Polos), or you build it yourself
8:45:05
johnnymacs
I guess buxybox does come with dpkg or rpm so it should be able to install the debian or fedora packages
8:47:46
jackdaniel
one more thing: given you use busybox I assume you won't have C compiler on the machine
8:48:46
jackdaniel
(one example of maintaining prebuilt binaries: say we had one you like, you download it and it doesn't work, because it was built with assumption C compiler is on the host)
9:00:04
stacksmith
johnnymacs: Raspberry Pi works really well with CCL and reasonably well with SBCL, and you can get a decent linux going. I used it as my main system for a few months. US$35
9:00:48
Shinmera
SBCL unfortunately does not have threads on 32 bit ARM, and I think there's still no distro that really offers ARM64 for the Pi 3.
9:03:17
stacksmith
Originally I wanted to use it as a secure computer of sorts, but it uses the GPU to boot with god knows what code...
9:03:23
flip214
debian removed all the "incompatible" warnings for rpi3 in the last few months, so I'm about to try booting the 4.15.0-1-arm64 directly.
9:05:19
stacksmith
I wound up switching to a bigger box because my monitor is too big for the Pi, but otherwise I hardly ever noticed any issues with speed or memory...
9:06:21
stacksmith
Actually I stepped on it once and destroyed it. But it took about 30 seconds to swap SD cards and cables with another RPI.
9:32:41
beach
loke: The reason that the visible area in the buffer of Second Climacs is not adjusted when the cursor goes outside it is that there are two cases.
9:32:46
beach
One is when the cursor is moved as the result of the execution of a command, in which case, the visible area should follow the cursor.
9:32:47
beach
The other is when the user scrolls so that the cursor is outside the visible area, in which case, the cursor should be moved instead. I need to think about how to distinguish those two cases.
9:34:04
beach
I guess maybe I can try to detect when this situation happened as a result of executing a command.
9:36:33
beach
But sometimes the cursor must be moved to be inside the area, and sometimes the area must be moved so that the cursor is inside it.
9:36:39
loke
So, if you decide to not allow it, then the situation is quite simple, IMHO. When cursor moves: Adjust scroll location. And when scroll location changes, adjust cutsor.
9:38:12
beach
Come to think about it, maybe you are right. I was afraid that the first case would then trigger the second case.
9:39:04
loke
beach: Well, it could. I seem to recall Emacs having that problem. But... It was caused by a callback function executing after a scroll. That callback function moved the cursor, triggering a loop.
9:40:48
beach
I think I'll do the following: After the execution of any command, check whether the cursor is outside the visible area, and if so, adjust the viewport.
9:41:26
beach
Then, when replaying the contents of the visible area, first check whether the cursor is outside it, and if so, move the cursor first.
9:41:28
loke
But, the fact that the discussion was quite recent, and they survived for a couple of decades before anyone stumbled on it suggests that the issue is less common than one might think.s
9:42:25
beach
If the cursor moved as a result of a command, it will then be in the visible area, so no action will be taken in the second case.
9:42:43
beach
If not, then the area moved as a result of scrolling, so the cursor will be moved first.