freenode/#lisp - IRC Chatlog
Search
0:35:19
no-defun-allowed
well Clozure CL is good if you're running on a Raspberry Pi (read: potato) cause it's got a faster (compile-time) compiler and want threads too
0:38:15
no-defun-allowed
SBCL (probably, not familiar with either compiler) knows more optimisation tricks, which makes the compiler slower but code faster
0:38:43
no-defun-allowed
sure, hunchentoot usually only consumes 100MiB but the pi3 also only has 1GiB of memory
0:39:20
no-defun-allowed
and that's only hunchentoot, you have a program, some libraries, SQL server, probably would be under 500MiB though
0:41:46
vms14
well a raspberry pi is not meant to be a huge server, so I guess it could do something with little websites
0:42:39
no-defun-allowed
i tested my parallel chess program on a Pi since everything's slow and you can use htop to watch utilisation at that speed
0:43:28
no-defun-allowed
turns out it didn't make enough "work" pieces so cores would run out of work early
0:44:14
no-defun-allowed
it wasn't that hard, but i have to redo it since i didn't implement quite a bit of chess and is messy as hell
1:29:39
vms14
and what I mean is https://stackoverflow.com/questions/14171849/compiling-common-lisp-to-an-executable
1:30:17
vms14
I've tried a hello world in archlinux, a friend tried the executable in ubuntu and worked
2:06:50
aeth
clothespin: If you're using reddit, I would use /r/lisp instead of /r/common_lisp because while /r/lisp is "Lisp family" like ##lisp (and not like #lisp) it is probably 90% CL and is more active than /r/common_lisp.
2:09:41
aeth
clothespin: Depending on the project, you may also want to announce on Hacker News. A lot of Lisp stuff winds up on there even though in general it's more like /r/programming. https://news.ycombinator.com/news
2:15:24
aeth
Personally, I very rarely post on reddit, but other than that I have wound down most of my social media usage. I lurk on reddit and on HN, at least for now. Both seem increasingly like a waste of time, though.
2:16:06
loke`
aeth: All social media is a waste of time. However, Masotodon tends to not try to make it seem as though you're doing anything important.
2:16:33
aeth
loke`: The quality of everything goes down considerably over time. I probably missed the good old days of Mastodon already.
2:18:09
aeth
For pretty much my entire IRC life, IRC has been that old thing that people who don't want to use the shiny new thing use. Of course, I've been using IRC since 2002 or 2003 or so, so at this point almost all of those shiny new proprietary chat apps are not only old, they're dead.
2:18:45
aeth
(And I can't wait for the new batch to go away. Discord, in particular, seems to be pushed very aggressively, but it's very limited in configuration. I don't think you can even have 24 hour timestamps, local logging, etc., on it.)
2:19:16
aeth
clothespin: The difference is that there's no company that can shut down Common Lisp when its numbers drop low enough
2:19:53
clothespin
Common Lisp is now so obscure it doesn't even get mentioned on the "Least Popular Programming Languages" surveys
2:19:55
PuercoPop
What I really dislike is how Slack has taken over the workplace and displaced email.
2:20:09
defunkydrummer
clothespin: plz announce on /r/lisp . Comp.lang.lisp is full of spam and annoyng people like Gavino
2:20:54
defunkydrummer
clothespin: Liso is still above Rust and Kotlin on the last TIOBE index so it can't be that obscure.
2:22:01
aeth
And lie detectors are commonly used as an indicator of lying. And horoscopes are commonly used as an indicator of personality.
2:25:39
PuercoPop
Btw which do check to for the 'sign bit' of a signed integer, (logbitp 31 i) vs (>= i #.(1- (expt 2 31)))
2:28:02
aeth
The location isn't fixed since it can be an arbitrary length. Iirc, it's just a bunch of leading 1s infinitely, or something like that.
2:29:54
PuercoPop
aeth: Sorry for got about the context, you are in the process of 'building' it. You have an integer from sticking together a sequence of octets and you want to know what number they represented
2:30:18
aeth
Bike: You could use INTEGER-LENGTH instead of 31 to make sure that it's always "short enough"
2:31:20
aeth
PuercoPop: You can only reconstruct it if you know its size and if it's signed or unsigned. If it's a (signed-byte 32) then whatever works works.
2:33:24
PuercoPop
aeth: you, we know the size, both when dealing with X11 requests or OSC (which is the context of the code)
2:39:20
aeth
PuercoPop: So I'm guessing you have combined a bunch of bits to get a number from 0 to (1- (expt 2 32)) and you want to shift that so it's an (unsigned-byte 32). Iirc, the conversion for e.g. 2^32 - 1 is (let ((number (1- (expt 2 32)))) (- (mod number (expt 2 31)) (expt 2 31)))
2:41:14
aeth
PuercoPop: Iirc, there's a neat branchless trick you can use here. I think this is it. (multiple-value-bind (quotient remainder) (floor number (expt 2 31)) (- remainder (* quotient (expt 2 31))))
2:43:36
aeth
PuercoPop: This works because if it's (expt 2 31) or higher its quotient will be 1 instead of 0, which means it will become negative.
2:44:00
Bike
isn't it the opposite direction? you have thirty two bits off the wire and now want a signed integer?
2:44:55
aeth
Bike: This goes unsigned->signed. So you're combining the four bytes as if it was an (unsigned-byte 32) and then you're turning it into the equivalent signed representation for the same bits.
2:46:59
aeth
If it's 0 to (1- (expt 2 31)) this does nothing, if it's (expt 2 31) to (1- (expt 2 32)) it converts it properly, and it's not valid past that because it's only for ub32s
2:49:30
aeth
i.e. (defun ub32-to-sb32 (number) (declare (type (unsigned-byte 32) number)) (multiple-value-bind (quotient remainder) (floor number (expt 2 31)) (- remainder (* quotient (expt 2 31)))))
2:55:43
aeth
My function is correct because I just compared its behavior to this function in a loop and every ub32 had an = result. (defun cffi-abuse (number) (declare (type (unsigned-byte 32) number)) (cffi:with-foreign-object (i :unsigned-int) (cffi-sys:%mem-set number i :unsigned-int) (cffi-sys:%mem-ref i :int)))
3:06:12
PuercoPop
Bike: iiuc you and aeth are talking about the same direction. But yeah this is the code in question https://github.com/zzkt/osc/blob/master/osc.lisp#L332
3:06:54
PuercoPop
And nyef's code (defun u32->s32 (value) (if (logbitp 31 value) (logior #x-80000000 value) value))
9:21:54
dim
I've heard about the BBC initiative for exposing kids to programming, the Micro-Bit, a kind of very cheap arduino board with many popular extensions; and to program it in Lisp all I can find at the moment is http://www.ulisp.com/show?2672
9:22:20
dim
do you guys know if there's an implementation of Common Lisp that would target this little board?
9:29:26
no-defun-allowed
also, it has one of those separated code and data models that make COMPILE pretty useless
10:07:46
vaartis
wanted to ask if there's a way to bundle static files when building the program with something like program-op?
10:08:54
vaartis
and is it a decent idea to bundle a dynamic library with an asdf system that someone might install from quicklisp, and if so, how do i do it
10:18:55
vaartis
I see.. I want to write bindings for a certain library that isn't in linux package managers, but takes less than a minute to build and doesn't have any dependencies, so i though about maybe just building it for most platforms and bundling like this python thing does http://www.pymunk.org/en/latest/index.html
10:19:28
loke`
vaartis: You can ship the source code as part of the package and then build it if needed.
10:20:06
loke`
THat's something I believe IOLIB should do with libfixposix, but the author don't agree
10:22:15
loke`
vaartis: Windows is an oddball. Personally I don't really pay much attention to that one.
10:23:25
vaartis
The problem is, asdf doesn't copy static fles to the destination directory when using e.g. program op
10:36:50
vaartis
https://common-lisp.net/project/asdf/asdf/Predefined-operations-of-ASDF.html#Predefined-operations-of-ASDF