freenode/#lisp - IRC Chatlog
Search
18:32:34
koenig
jackdaniel: I thoroughly enjoyed your post on /r/lisp a week ago called "Fun ECL hack" where you wrote a simple C REPL.
18:33:30
koenig
I keep telling myself that I'll write a WeeChat module to integrate ECL into WeeChat but never seem to find the time to do it. But your post may inspire me to follow through and get started!
18:48:07
p_l
I don't remember the nick, but someone here used ECL to make (commercial) plugins for MS Office
18:50:25
koenig
I keep thinking that using Common Lisp in general and ECL in specific could be a "secret weapon" in a lot of the work I do.
18:51:00
koenig
I guess it'd probably take just diving in and doing it for a few projects and then I'd have my own design patterns for how it works best with my style.
18:51:22
koenig
But having an accessible ECL REPL linked to a lot of my C/C++ code would probably be pretty neat.
18:55:30
jackdaniel
koenig: wait a few days, I'm going to expand this joke into something hilarious (at least to me)
19:37:46
phoe
dim: which APIs exactly do you mean? maybe we can split the work into tasks and I could grab one when I have a while
20:39:09
katco
folks should not be doing things like this, right? https://github.com/AccelerationNet/cl-csv/blob/master/cl-csv.asd#L35-L38
20:41:56
katco
selwyn: i incorrectly jumped to the conclusion that the code here was overwriting the method definition. i guess i haven't worked with clos in awhile
20:45:49
katco
Xach: the preferred way is now a `:in-order-to ((test-op (test-op cl-csv/test)))`, right?
21:50:49
anamorphic
defunkydrummer: think I got that ccl problem with iup-controls on windows sorted out
22:09:50
anamorphic
I think iupcontrol was loaded ahead of iup. SBCL didn't seem mind (and CCL too, on Linux)
22:21:12
defunkydrummer
anamorphic: i'll have to try on my windows machine then. last time i thought the right version of MS VC runtime DLL was not being present, but upon checking, it was. So i'll have to take a look what was causing the problem. Because i'm not very sure loading iup-controls before iup will cure it.
22:22:49
anamorphic
I started setting up appveyor to catch these kinds of things, but had to rage quite after an hour or so.
22:23:01
defunkydrummer
IUP lovin' had me a blast / IUP lovin', happened so fast / I met a GUI crazy for me / Met a framebuffer cute as can be // QT days drifting away / To uh, oh those IUP nights (BRIDGE) Oh well, oh well, oh well oh, uh / Tell me more, tell me more / Did you get very far? / Tell me more, tell me more / in CCL did it start?
22:25:27
defunkydrummer
anamorphic: I am not convinced of the use of Continuous Integration when you can do interactive development with a repl
22:29:20
defunkydrummer
anamorphic: No. I still have the DLL problem: can't load iupcontrols.dll, and this must be because a missing dll. I need to use those dependency walkers to find out what the f"!/#! is going on
22:32:14
phoe
make sure that you are *very* comfortable with Practical Common Lisp before you dive into it.
22:32:53
vms14
phoe: I'm just starting it, but it seems it will teach very important stuff of lisp than other books won't cover. It's right that assumption?
22:33:02
defunkydrummer
phoe: The error is the same i have on Issues: Error opening shared library <path>iupcontrols.dll : The specified module could not be found. .
22:33:29
defunkydrummer
phoe: the "The specified module could not be found" message comes straight from the Windows OS and means "I can't load some DLL that is required by your DLL, so fuck you."
22:34:04
defunkydrummer
vms14: Lisp (or Scheme) is the most powerful mainstream interactive language
22:34:42
defunkydrummer
phoe: When you load a 32-bit DLL under CCL64bits, the error message is different. In any case, I will double-check again
22:35:12
defunkydrummer
vms14: You will get the fucking enlightenment. I guarantee you. Lisp: Guaranteed enlightenment or TRIPLE your money back
22:35:30
anamorphic
defunkydrummer: I will take another look tonight. Thanks for trying it out again though.
22:36:15
phoe
Lisp doesn't magically give you galactic brain or anything, it just shows you how programming languages are and should be done
22:36:30
phoe
and once you understand that, and different layers of that, then you start utilizing that knowledge
22:36:39
defunkydrummer
vms14: the best part of using Lisp is that you can increase your smugness levels up to the max, that's when you simultaneously achieve enlightment and turns you into a Smug Lisp Weenie (TM)
22:36:41
vms14
but I guess all that stuff it's just the tools you have to create abstractions, and how thanks to having all those tools you learn and improve your knowledge about how to create abstractions
22:37:05
vms14
also, you'll get used, so your programs will be very different than what would be with C
22:37:33
phoe
on one hand it's abstractions to hide what isn't required, but on the other hand Lisp can bring you all the way to the most basic units of computation - see the SICP lecture videos for that
22:37:57
defunkydrummer
ACTION is recruiting submitters for r/LispMemes. Work compensation plan includes a Space Cadet Keyboard, an autographied copy of the Chine Nual, and a dinner with Conrad Barski
22:38:56
phoe
keep on going - one part I really liked is how s&a explain how to implement objects using closures
22:38:57
vms14
I saw them when I was just starting to learn lisp, the fibonacci recursive function fucked my mind xD
22:39:59
phoe
also how they first showed you that you don't need mutable hidden state at all, only to end with a conclusion that you actually need to have mutable hidden state
22:41:37
phoe
vms14: Common Lisp gives you a taste of Perl, see http://www.99-bottles-of-beer.net/language-common-lisp-114.html
22:44:19
defunkydrummer
anamorphic: IT SEEMS I OVERCAME THE DLL PROBLEM. Thanks to your updated Readme: "Usually this means setting LD_LIBRARY_PATH on Linux or PATH on Windows."
22:44:41
defunkydrummer
anamorphic: i didn't know i need to set the PATH, considering that CFFI was already directed to the correct directory
22:45:56
anamorphic
I was really hoping the (push (asdf:system-relative-thing :tecgraf-libs "lib") cffi:*foreign-directories-somehting*) was going to be the best way
22:46:47
selwyn
i wonder how much the lisp world would benefit from the contributions small number of windows developers maintaining the sbcl windows port, writing a windows backend form clim etc.
22:47:43
defunkydrummer
anamorphic: So it isn't enough. One really needs to set the PATH environment variable. This is counterintuitive because AFAIK when one DLL requests to load another DLL, Windoze should search in the local path too... But perhaps it looks in the local path of the process, not the path where the DLL sits in.
22:49:24
defunkydrummer
selwyn: Also, Steve Ballmer is the one and only CEO which really loves developers --> https://www.youtube.com/watch?v=rRm0NDo1CiY
22:50:53
selwyn
at ELS, christophe rhodes told me that many people requested the warning message on sbcl windows startup be removed
22:50:55
vms14
defunkydrummer: in linux,bsd sbcl has no history and no editing features like move between characters if you use sbcl from the terminal
22:51:31
defunkydrummer
vms14: this doesn't matter at all since one would be really crazy to use SBCL directly, instead of doing it through SLIME, SLY, SLIMV etc
22:51:34
selwyn
not because it is no longer necessary, but because it puts off users who may see it..
22:52:37
defunkydrummer
selwyn: I also want that damn warning message to be removed. Real fact: I had to use CCL instead that SBCL on a production system i made, because I had fear of the customer looking at this message and questioning me.
22:53:09
defunkydrummer
the fun fact is that now i use CCL more than SBCL. CCL = motorcycle, SBCL = truck
22:59:08
anamorphic
I'd say it's resonable realtive to other lisps, but relative to sbcl it could do better execution wise
23:00:10
defunkydrummer
anamorphic: Cells demo and Canvas demo work just fine :) :) :) . Thanks for your awesome lib mr. Lispnik from Austin.
23:00:59
defunkydrummer
selwyn: CCL was actually a commercial, production-quality implementation honed through many years, that is now free for the world to enjoy. Execution speed is good, not as fast as SBCL but still faster than many other implementations.
23:01:45
defunkydrummer
anamorphic: It was all a fault of the PATH environment variable not set. Sadly the Tecgraf page didn't mention one needed to do that (or i'm a bit blind.) But thanks to your wonderful, pimped-out brand new README, no noobie will make my mistake.
23:01:51
PuercoPop
The Kitten of death message may be suppressed by passing the --noinform option since quite a while ago, sbcl-1.1.11
23:03:39
defunkydrummer
thanks PuercoPop. It was long ago though, when I started entering the world of Lisp. It was a time of excitement and illusion.
23:04:32
defunkydrummer
anamorphic: the tecgraf-libs package makes IUP one of the easiest to setup GUI multiplatform libs for CL.
23:06:11
defunkydrummer
selwyn: Execution speed among Lisp implementations will vary a lot depending what you're trying to do. For example, it's not the same if you're -say- doing data compression vs something that is IO heavy, vs something that requires lots of CLOS method calls, etc. I was suprised when some math code I made ran quite fast in ABCL, despite ABCL being a
23:06:52
defunkydrummer
selwyn: as for compilation speed, CCL is much faster than SBCL. And ABCL is dramatically slow.
23:09:35
PuercoPop
CCL's CLOS is not derived from PCL right? If so, wonder how it compares performance-wise to PCL-derived CLOS implementations
23:10:21
PuercoPop
selwyn: try removing all the FASL caches and loading a system from scratch. Even starting up SL{Y,IME} should take considerable more time
23:11:28
PuercoPop
anamorphic: that seems to be my impression. There plans for some information aggregation on top of that though.
23:12:08
anamorphic
selwyn: the main thing is as a common lisp coder, you've got all these implementations to pick from when trying to satisfy some criterea. Those poor bastards in other languages, like rust, go, java and node are all stuck with whatever comes down their pipe
23:17:16
defunkydrummer
Uploaded file: https://uploads.kiwiirc.com/files/33ae4c607b56ecce176cf23f936530e3/image.png
23:18:18
anamorphic
You're missing a bit at the bottom fyi. Had the same trouble on my thinkpad x220 screen
23:18:52
defunkydrummer
anamorphic: Yes. Some part of the bottom is missing. Mine is a Thinkpad T470.
23:36:00
vms14
guys do you often see lispers being involved in things like pentesting or cracking stuff?
23:37:15
vms14
I mean, I know it's wrong to generalize, but... lispers are usually advanced programmers
23:37:42
vms14
and I want to think they are the kind of programmer who does not like to fuck other people
23:37:59
pjb
Also to work for the mob, you have to be able to crach stuff under pressure. I doubt you'd really appreciate it.
23:40:02
vms14
I mean, if I publish my code (bad code, sorry) only lispers will understand the code. Parens obfuscate the code for non lispers
23:41:39
no-defun-allowed
vms14: I wrote a pentesting program (like a less annoying metasploit), since I wanted to mess with designing one I could actually use
23:42:34
no-defun-allowed
I wouldn't try to correlate morality and programming language choice, but...
23:42:44
vms14
no-defun-allowed: yeah, but that does not mean you like to fuck other's software, or yes..
23:43:02
no-defun-allowed
... it's just that in C++ and the like, you don't trust anybody, and in CLOS you basically trust everybody. the practical result is that thieves and bums use C++ and nice people use CLOS.
23:44:13
vms14
they don't know how to program, but some of them learn and some of those create pentesting software
23:44:34
no-defun-allowed
Well...I did that once, using a 0day in a web server. I think it was justified though, and I told the developers after.
23:45:01
vms14
but I guess once you learn to program, you end by the time doing other things instead
23:45:39
no-defun-allowed
What you're thinking of is a "skiddie". There's not many skiddies that write Lisp, since JS or Python are the usual tools for doing skiddie things.
23:48:11
no-defun-allowed
Exactly. You could make a fancy scanner using CL if you liked though using those.
23:49:52
no-defun-allowed
One idea I had was to automatically analyse a firmware update for a device. You could try to find any compressed archives or file systems, decompress them, and search for hidden passwords or backdoors. It wouldn't be hard to write a declarative DSL for it.
23:52:01
vms14
I want to go for dsl, but I should read the onlisp book since I know nothing about macros
0:02:11
vms14
"Thanks to LISP, I was able to write a large, complex application which might ordinarily require a whole team of programmers to complete. Also, LISP is very easy to customize so that as users become more sophisticated, applications written in LISP can grow along with those users."
0:30:25
aeth
vms14: CLISP used to be very popular. That stopped about 10 years ago, when it stopped getting stable updates.
0:32:16
aeth
vms14: I mean there hasn't been a "stable version" since 2010-07-07, not that the implementation is "unstable".
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))