freenode/#lisp - IRC Chatlog
Search
17:44:02
mfiano
jmercouris and I have used it in a commercial project. Other than that, probably not
17:45:19
gendl
The CLF has a rudimentary payments webapp where we have our own half-assed stripe interface intertwined into it (only for single transactions).
17:46:14
mfiano
Yes, it was developed at a time when I needed such a thing for a commercial project, and didn't document it because of time concerns. I have not used it since, but it was used successfully in a large commerical application.
17:46:24
gendl
Now we want to add subscription capability and i'm ready to rip out our half-baked stripe interface code and try to use your :stripe package... I'm also open to adding to the README.md
17:47:37
gendl
would you consider coaching me through getting started? I can show you what we are doing currently which will probably give you a good laugh as well (hopefully not nightmares)
17:48:59
mfiano
Sadly, I think all that knowledge has slipped my mind. But if jmercouris approves, I could publicize snippets of proprietery code, as that project dissolved.
17:50:51
gendl
so you were using it to do subscriptions, right? I see subscription.lisp and subscription-item.lisp.
17:51:46
mfiano
as far as i remember the stripe library covered the entire api at the time i wrote it
17:58:10
mfiano
gendl: here, i wrote an example without any of our business logic: https://gist.github.com/mfiano/aa526ecfe4987b7b60ecbb18190ba5db
18:03:46
exit70[m]
hi, lisp newbie, looking for a native cl on apple m1. so far I found sbcl and ccl needs porting. ecl looks kinda portable but i got error at configure stage. clisp requires porting in libsigsegv.
18:05:22
shka_
exit70[m]: perhaps you can take a look at the ABCL? It runs on the JVM so it is bound to work (I HOPE!)
18:06:29
shka_
ECL should work, but i have no idea what you need to do to actually run it on the OSX
18:07:42
exit70[m]
openjdk does not work on m1 mac right away yet. give me a second to post the ecl configure log
18:08:20
astronavt
does anyone have experience here using CFFI to write bindings to libraries that depend on GLib? i've worked through the CFFI tutorial that uses curl to download a URL, but i'm not sure how to proceed in this more-complicated case
18:11:00
astronavt
im not sure honestly. the docs for libnotify file:///usr/share/gtk-doc/html/libnotify/libnotify-notify.html show that it uses types like gboolean
18:13:45
astronavt
so i'd just use defctype or define-foreign-type on the few specific glib things i need, and then go from there making bindings to libnotify?
18:16:32
fiddlerwoaroof
You have to use the zulu openjdk, which is the only arm64 JDK I can find atm
18:17:10
fiddlerwoaroof
https://jp.azul.com/downloads/zulu-community/?os=macos&architecture=arm-64-bit&package=jdk
18:18:42
exit70[m]
I see. Thanks! I think most people simply use rosetta homebrew for now but I'm just curious about how many packages would not work natively.
18:19:15
fiddlerwoaroof
I did manage to do a bunch of the porting work, I'm just stuck on an error with mmap
18:19:39
fiddlerwoaroof
(and I'm sure there's more subtle issues too, haven't gotten something that even gets to a REPL yet)
18:20:09
fiddlerwoaroof
If anyone wants to try to go further, my changes are here: https://gitlab.com/fiddlerwoaroof/sbcl/-/snippets/2041970
18:29:33
exit70[m]
haha I was like that too. the arm64 devices are kinda nice though as they are fanless. and they run x86 applications like a real celeron (or slower)
18:37:26
fiddlerwoaroof
Apple's arm64 devices blow even relatively high-end x86 computers out of the water.
18:39:28
iarebatman
lol this is super frustrating.. I'm pretty sure I need to compile a CL environment within msys2 to get things going. I've tried sbcl, ccl, and ecl. All fail to compile with various issues.
18:44:43
iarebatman
I figured at least one of those 3 popular implementations would 'just work' - but no.
18:46:57
fiddlerwoaroof
My general impression is that implementation developers don't really use it as their primary platform
18:47:26
iarebatman
I'm probably just asking for trouble by even attempting to use it for actual business use-cases and should just do something else.
18:48:16
iarebatman
Well here's the thing TBH.. I can download sbcl binaries and they work fine on windows.. I can get the development environment setup just fine..
18:49:24
iarebatman
they assume gcc is setup like it is on linux and I've got libs & headers ready for it to do some stuff with.
18:50:51
iarebatman
I just didn't like the startup times involved mainly. I know that's a sort of shallow reason, but it bugs me lol.
18:51:25
fiddlerwoaroof
Maybe also Corman Lisp? That is/was a windows-first implementation that has been revived recently
18:56:07
jmercouris
mfiano: feel free to publish any snippets as long as you remove identifying information
18:58:05
jmercouris
fiddlerwoaroof: I don't think Corman Lisp is a sound reccomendation, I would still suggest SBCL on Windows
18:59:06
fiddlerwoaroof
I still think that, if you have to connect to something like Oracle or Kafka, ABCL or LispWorks is your best choice
19:05:43
iarebatman
Yeah that's unfortunate for me. I'm in a position where it'd probably be frowned upon to require the developer to use linux in order to get things done here.
19:06:07
exit70[m]
so Corman Lisp could be built use msvc? let me try if it builds cleanly for arm64 ...
19:06:11
iarebatman
I did just manage to get sbcl to compile inside msys2 finally - via roswell. Not sure if that'll magically solve my problems or not yet.
19:09:58
iarebatman
I've already got too many side projects lol, but I've definitely thought, 'gah! why doesn't this exist yet?'
19:11:33
iarebatman
lol scratch that 'sbcl builds on msys2 via roswell' comment. It builds, sort of. segfault immediately upon launching sbcl
19:12:06
astronavt
do quicklisp and/or asdf permit creating "environments" local to a project? like how python has venv, and ruby & nodejs/npm by default install packages to an isolated project-specific location
19:12:10
iarebatman
I have to do some other work, I'll revisit this later I guess. maybe look at wsl2 or possibly abcl. *sigh*
19:12:58
fiddlerwoaroof
But, I've never felt a need for that, the libraries generally maintain backwards-compatibility pretty nicely
19:14:05
fiddlerwoaroof
Yeah, the issue I have with version pinning is that, if you pin versions, they slowly get out of date
19:14:24
fiddlerwoaroof
And, eventually rather than relatively small version updates, you have a three-week+ project
19:15:01
astronavt
yeah, usually i dont pin specific versions. it's moreso that i'd like to keep libraries for one project separated from other projects
19:15:43
astronavt
i am also starting to learn about / read about ASDF and i'm a bit confused - does it expect me to put all of my lisp source code in a few specific places?
19:17:10
fiddlerwoaroof
One issue with venvs in lisp is that I don't normally restart my lisp when I switch projects
19:17:57
astronavt
again maybe this is very un-lisp of me, but i definitely want to do a clean restart and re-run from scratch now and then
19:18:40
fiddlerwoaroof
I used to do that all the time, these days I rely on CI to make sure that my systems can be reloaded from scratch
19:18:48
astronavt
ive just had too many bad experiences in jupyter notebooks with losing track of what i defined and encountering subtle bugs as a result
19:27:45
shka_
astronavt: CL with slime is actually really nice for things you would typically use jupyter for
21:23:52
jeosol
When working with macros, is it a 'code smell' to be use 'eval' (albeit sparingly) or its ok
21:24:25
phoe
there are very few specific use cases where eval might be required, such as with constantp values
21:25:15
jeosol
phoe: I have been using lots of macros to reduce and typing. Definitely provides more clarity with lots of the calculation happening behind the scenes in the automatically generated functions.
21:26:15
jeosol
when getting the value of a variable that's constructed from a string, I used eval there ....?
21:29:24
jeosol
phoe: no, it's fairly involved, but the section is messy as I am still debugging it. I can share that part with code
21:39:43
fiddlerwoaroof
jeosol: I've found it's useful to generate a form that gets the value rather than to try to actually get a value
21:39:58
fiddlerwoaroof
I've found that, in general, stateful macros end up being defficult to maintain
21:40:42
jeosol
fiddlerwoaroof: oh men ....; I am doing a refactor to automate a lot of things I do by hand.
21:42:28
jeosol
fiddle: btw, what I mean was, say I create variable from a string name (interned, etc) and assigned a value to it. To retrieve the value I did (eval (get-parameter-name name))
21:44:04
fiddlerwoaroof
My early macros used eval, but as I've used lisp I've found ways around most of those use-cases
21:44:36
fiddlerwoaroof
I think there are a couple of exceptions for some advanced CLOS stuff: but, even there, (compile nil `(lambda ()...)) is often better
22:03:22
fiddlerwoaroof
So, this is a case where your macro that wants the value of *test-property* should probably just expand to *test-property*
22:04:45
jeosol
Basically, I am going to use *test-property* as an argument to a function. So now I do (some-function (eval (make-property-name "test")))
22:56:14
fiddlerwoaroof
jeosol: why not have your macro expand to `(some-function ,(make-property-name "test"))?
22:58:04
fiddlerwoaroof
When that code eventually gets evaluated, some-function will get the right value of *test-property*
23:10:37
jeosol
fiddlerwoaroof: I forget to mention that the evaluation I am trying to do is inside another macro -- i get your point about this being nasty
23:18:51
White_Flame
jeosol: if you want the value at compile-time, then that's likely wrong, unless you're absolutely certain that the property has been set before compiletime
23:20:30
White_Flame
if you want the value at runtime, as above you're still macroexpanding to the symbol to allow that to be evaluated at runtime, so nothing changes if it's 1 macro, a macro that uses another macro in its output, or a macro that needs another macro's expansion at compile-time
23:26:50
jeosol
White_Flame: no, it's not compile time. I think symbol-value did the trick - I wanted to understand how to do it for one case. It's one macro per se but I am trying to paste the correct variable values during the macroexpanding.
23:33:27
phantomics
Like I have a function used within a macro to generate code, and that function can take a pathname as one of its parameters
23:34:28
phantomics
But it could either be a literal pathname, like #P"/tmp/stuff.txt" or a pathname generated by code like (pathname (format nil "~a/stuff.txt" "/tmp"))
23:35:02
phantomics
The function used within the macro will just receive '(pathname (format nil "~a/stuff.txt" "/tmp")) if that's what gets passed to the macro
23:35:45
jeosol
fiddlerwoaroof, White_Flame: my chrome crapped up, not sure last message got through, but thanks for your brainstorming
23:35:53
White_Flame
of course, if it receives (pathname (format nil "~a/stuff.txt" my-dir)) with my-dir as a lexical variable,it wouldn't work
23:37:10
phantomics
Yeah, that's a shortcoming, so literals are always preferred in a case like that
23:38:01
Xach
phantomics: one common option is to put the code that produces the value you want into the expansion, rather than trying to compute the result at macroexpansion time, defer it to runtime.
23:38:27
White_Flame
but if you're generating code from that .txt file, then you'd just be deferring the EVAL until later
23:38:45
White_Flame
either EVAL the filename, or EVAL the expansion of the contents; the former is probably safer
23:38:46
jeosol
I was saying I was doing have two-levels of the indirection (creating the variable from string and using the value from that variable again ...)
23:38:48
phantomics
Yeah, this is for the April APL compiler, the contents of the file would be the code it's going to compile
23:39:24
jeosol
maybe mine is a bad design, I am trying to construct and paste variable names in the macro and when its run, those variables will have values
23:41:00
White_Flame
and the fun thing that most people have to have an "aha!" moment with is that the value usually doesn't even _exist_ when the macroexpansion code is run ;)
23:41:21
jeosol
The refactoring I did has simplified the interface greatly and pushing a lot of the functionality later.
1:19:44
save-lisp-or-die
there's a cool use for when you want to stack allocate a value http://www.sbcl.org/manual/#Dynamic_002dextent-allocation for efficiency reasons.
1:23:52
save-lisp-or-die
So if you're consing a tonne of memory in a hot loop that the garbage collector is hiccuping to free, stack allocation might be useful there.
1:31:16
no-defun-allowed
Well, allocation with a moving GC is almost comparable to stack allocation. It's sometimes useful, but I don't bother with dynamic-extent.
1:32:54
save-lisp-or-die
does ECL respect it? I could see maybe on resource constrained devices it might be useful.
1:35:08
no-defun-allowed
I am not sure if ECL is the right implementation with small resources; don't you either need a C99 compiler or bytecode interpreting?
1:37:52
no-defun-allowed
Also, see "Garbage collection can be faster than stack allocation" <ftp://ftp.cs.princeton.edu/reports/1986/045.pdf>. That should be read with heavy emphasis on "can".
1:37:59
mfiano
Additionally, implementations need only to honor NOTINLINE, and SPECIAL declarations, and conform to the safety rules for OPTIMIZE
1:39:16
no-defun-allowed
If you can free enough in one GC cycle, it eventually becomes faster to not un-bump the stack pointer.
1:40:08
no-defun-allowed
But really, the memory overhead for that to happen is ridiculous. The moral of the story is everthing is a time-space-sanity tradeoff.
1:40:57
no-defun-allowed
(And Firefox crashed after sending that. I'm not one for conspiracy theories though.)
1:41:52
no-defun-allowed
The SPECIAL declaration means that variable will use dynamic binding, instead of lexical (like you usually expect, and is default in Common Lisp). I usually prefer to write (defvar *foo*) to make *foo* a special variable though.
1:44:59
no-defun-allowed
Usually people write a program like this to demonstrate: (let ((x 3)) (defun g () x)) (defun f () (let ((x 2)) (g)))
1:45:21
no-defun-allowed
If X is lexically bound, then (F) returns 3. If X is dynamically bound, it returns 2.
1:49:09
no-defun-allowed
Dynamic binding will give you the last value bound, no matter where it's bound; and lexical binding will give you the last binding you can see where the variable is used.
1:50:18
no-defun-allowed
For example, *standard-output* is a special variable. If I evaluate (with-output-to-string (*standard-output*) (room)), it will be bound to the string output stream WITH-OUTPUT-TO-STRING makes, and ROOM will write to that.
1:52:30
lotuseater
or if you do something like (let ((*print-base* 16)) ...) or (let ((*gensym-counter* 1)) ...)
4:09:18
phantomics
A question about SICL: what kind of support will it have for ASM generation? Anything like define-vop in SBCL?
4:10:40
beach
phantomics: Since all the stages are programmable, it should be possible to customize at will.
4:10:57
phantomics
Lets you implement functions in assembly: https://pvk.ca/Blog/2014/08/16/how-to-define-new-intrinsics-in-sbcl/
4:13:21
phantomics
I'm looking into it to optimize my project; unfortunately, it will only work under SBCL and there's no ASM generation faculty that works across implementations
4:13:43
beach
phantomics: I have not thought of a similar way in SICL. However, since code generation is done with generic functions that take a CLIENT object that can be specialized to, then code generation is very easy to customize.
4:14:35
beach
phantomics: It is also easy to define new IR instruction classes, new AST classes, and new primitive operations (primops) to use at the source level. I do that all the time.
4:18:42
beach
Since SICL uses the Cleavir compiler framework, and Cleavir was designed to be implementation independent, we designed it from the start to be extremely flexible and adaptable to different implementations.
4:20:22
beach
But I haven't given enough thought to a consistent protocol for tweaking code generation within an implementation.
4:37:15
phantomics
You can see a lot of define-vop examples in this directory: https://github.com/sbcl/sbcl/tree/master/src/compiler/x86-64
4:38:27
phantomics
You can see optimized functions for handling arithmetic, arrays, etc. It's the x86-64 specific stuff, in the neighboring directories you can see implementations for ARM, Power, RISC-V, etc.
4:40:18
pillton
I need help figuring out the noun for something. Assume X is an instance of the class C. (apply #'F X args) returns Y and (funcall (apply #'F C args) X) returns Y. Is there a noun which describes the function F?
4:41:38
pillton
The closest thing I have found is lazy evaluation but I am not sure if that is correct.
4:44:29
beach
The function F is a bit strange since it can take arguments of different "meta" levels.
4:45:15
pillton
Knowledge of the class C is important. I was wondering if Cleavir would be useful for optimising the graph generated by successive compositions e.g. (funcall (optimize-computation (apply #'G (apply #'F C args) args2))).
4:48:16
pillton
No worries. I have lost track of the time and I need to pick up kids. I'll be back in a bit.
4:48:55
lotuseater
speaking of currying and nouns, did you know, another noun for it is Schönfinkeln :)