freenode/#lisp - IRC Chatlog
Search
9:22:23
edgar-rft
Okay, I agree that for USAian education standards Wikipedia would be more appropriate.
9:48:32
theothornhill
What is a good way to use own tools in common lisp? Right now I just use save-lisp-and-die, then alias that executable.
9:53:46
theothornhill
Seems a little slow to run small utilities that just produce some info, say like some weather info from an api etc
9:53:59
no-defun-allowed
What do you mean by tools though? Would you have any reasonable interface that isn't the shell?
9:57:12
theothornhill
By tools I mean the unixy I/O style small apps. The ones where you don't need a living image, when it is "done"
10:22:58
edgar-rft
theothornhill: I usually use Emacs Lisp for small-n-dirty shell programming gimmicks, Common Lisp always inculudes the entire compiler and lots of other stuff in its executables.
10:26:56
jackdaniel
not /always/, i.e in ecl libcmp.fas is loaded only after the compiler is invoked for the first time
10:29:07
edgar-rft
thanks for the info, and please built lots of money into ecl to that I can load it as an option :-)
10:29:59
jackdaniel
I don't think that anyone would tell you *not* to use ecl for small-n-dirty shell programming gimmics, but I don't know what is a nature of your job
10:31:36
edgar-rft
I first wanted to suggest using C instead of Lisp but I hadn't thought aboout the option that ecl uses C under the hood
10:39:32
theothornhill
Yeah, I've used elisp and c for that previously (and still do). Perhaps its not the best fit for cl anyways
10:49:11
edgar-rft
theothornhill: One of the reasons why Unix and its "small and simple" philosophy was created was to overcome the "monolithity" of programming environments like Lisp (at that time). So it's not really a surprise that Common Lisp and the Unix shell are not best friends. But ecl shows that there *are* people who care about the interoperability between C (Unix) and Lisp.
10:57:31
edgar-rft
According to Dennis Ritchie C is the most inappropriate language to write big programs in :-)
13:03:47
grewal
fwiw, for small tools like that I've had luck using a long running lisp image in the background and writing a tiny script that passes command line args through a pipe
13:05:05
grewal
If you have enough tools, you can turn it into a busybox-like sort of thing where the image contains all the tools and it dispatches based on the name used to invoke it
13:29:57
MichaelRaskin
Me, I just have a prebuilt image with the tools I want to invoke, and pass it '--eval'. Start-up overhead is quite low
15:15:10
paines
I am fiddeling around with a smaller project which uses SDL2 and now I am wondering why I cannot call a function which seem to be there, sdl-set-hint\
16:50:44
jcowan
beach: I don't think it's correct to say Python is not a general-purpose programming language. "Scripting language" is basically a way of saying "language I don't like"
16:52:19
jcowan
Indeed, that is not strong enough: there are, it seems, many C interpreters, so C is indeed a scripting language.
16:56:42
scymtym
maybe saying /cpython/ is a scripting /environment/ would be more accurate since it ticks several of the boxes: cannot make (afaik) standalone binaries, does not compile to native code, is effectively single-threaded and arguably executes slower than "non-scripting languages". but i agree that "scripting language" is not a very useful way to categorize languages or even implementations
16:58:58
jcowan
There's a number of tools that let you create Python standalone files. The CPython interpreter is bundled in with necessary .pyc and .so/.dll files, and everything just gets set up.
17:01:41
jcowan
Compiling into native code has the problem that it is neither portable nor stable. Larceny Scheme compiles into 32-bit x86, for which you have to load special libraries on Linux, and I expect support for them to rot over time (already WSL1 does not have it). Fortunately it also compiles to C in a version known as Petit Larceny.
17:14:54
p_l
jcowan: it's possible to make a stable binary on linux - it's the Glibc that doesn't want to cooperate
17:15:29
p_l
(Go for example makes binaries that depend only on kernel being above certain version when you use certain command line flags)
17:34:27
White_Flame
"scripting" tends to indicate that its primary behavior is to invoke behavior of other things outside the script
17:34:51
White_Flame
while "programming" tends to indicate defining the primary behavior in the code itself
17:35:28
White_Flame
while those definitions still exist on a gradient, I think that's likely the common intention of those terms
17:36:42
White_Flame
if what you're doing is managing calls to external C libraries, then probably yeah
17:37:31
White_Flame
while Lisp is kinda weak at scripting, because of its strong focus on its own image
17:37:42
p_l
Well, anything else can quickly hit performance limits that result in red-eyed sysadmin going all BOFH on you
17:42:41
jcowan
The last few jobs have involved programming in Python and occasionally scripting in bash.
18:00:26
beach
I was under the impression that the term was used by the creator of a language to mean "I hav no intention, or not enough knowledge, to make it fast enough for general use."
18:33:15
jasom
I agree that scripting is primarily about automating external tools. The bourne shell is the clasic example of a scripting language. This actually gells with beach's definition because if you spend 90+% of your time in external tools then there really isn't a point in making the language fast enough for general use.
19:57:47
jcowan
p_l: What's bad about Python exception handling other than only having termination semantics?
19:58:43
p_l
jcowan: I don't know if it's just the library I'm using, or the exception system itself, but nested exceptions, or specifically, when you catch an exception inside exception handlers, lead to very hairy failures
20:02:32
jcowan
https://stackoverflow.com/questions/3208566/nested-exceptions shows how a handler within a handler works; it's what you expect from dynamic scope (which in this case happens to be static scope as well).
20:25:29
grewal
The more I use python at work, the more tempted I am to write an implementation of python in cl
20:27:49
p_l
I nearly rewrote a noticeable chunk of a product in DAYJOB[-5] in *anything compiled*... but I was too sleepy from fighting python over night to do so
20:34:52
aeth
grewal: there are a bunch of these projects going on right now (not Python, though, but I think there's at least one ancient Python in CL, probably Python 2) so it's probably best to wait until some common code gets moved into libraries
20:37:28
aeth
Yes, with different approaches. (1) cl-python https://github.com/metawilm/cl-python (implements Python in CL); (2) burgled-batteries https://github.com/pinterface/burgled-batteries (bridges into Python via CFFI); (3) py4cl https://github.com/bendudson/py4cl (uses textual streams to bridge with Python)
20:38:31
aeth
However, cl-python is the one that uses the approach that grewal would want and that's essentially abandoned, is only Python 2 (afaik), and uses the LLGPL (NEVER license your code under a license that isn't FSF and OSI approved! NEVER!)
20:39:08
aeth
It looks like it's more on life support than abandoned, getting patches when it actually breaks, but nothing more. https://github.com/metawilm/cl-python/commits/master
20:40:49
aeth
library #2, burgled-batteries, also looks inactive, but since it's not a complete reimplementation of a living and actively-developed language that would have needed quite a bit of work to keep up, it could just be stable.
20:49:12
aeth
For those unfamiliar with Python, a Python 2 in 2020 (cl-python gives no indication which Python it is even though it should have; its tests use Python 2 syntax, though) basically means it will run no current Python code, but it could be useful to help rewrite a ton of "legacy" Python into CL.
20:54:34
aeth
ah, this... I didn't find that page on my initial look at it. https://common-lisp.net/project/clpython/manual.html
20:55:19
aeth
This is... quite possibly the most important piece of information and should have been in the readme instead of a string in a manual you can only find if you search for it.