freenode/lisp - IRC Chatlog
Search
0:30:00
no-defun-allowed
is there an equivalent to with-hash-table-iterator that can be used outside its dynamic extent?
0:33:54
no-defun-allowed
that said, there won't be that many values to store in a list if the hash table fits in memory
0:42:22
aeth
no-defun-allowed: alexandria has a hash-table-keys but it iterates over the whole hash-table and conses up a list of keys
3:27:22
hectorhonn
haskell's reader monad mechanism is basically achieved by common lisp's special variables. yes?
7:38:03
quazimodo
i asked what the strategy is when streaming an audio file, playing & saving it to disc simultaneously. Does the stream go straight to disk & the player just reads from there, or is the data stream multiplexed, one lot into a buffer for audio player consumption and the other lot into a buffer for the disk writer
7:38:24
quazimodo
and if it's the 2nd approach, at what point do you swap from memory buffer from the stream to the disk?
7:45:03
quazimodo
lieven: so some sort of coherent 'write this new stuff from this position x', and 'read this other stuff from this position y' on an open file handle?
7:46:27
quazimodo
and if the network is fast enough, the write's would happen at faster or more of the reads, where you'd check the current write position(x) against the read position(y) to see what can be read, thus putting the actual audio player into a 'pending' state until more info comes in and a read is allowed?
8:49:15
madrik
Would Lisp, Common Lisp in particular, and the Lisp language family in general, is a good language for newbies to programming?
8:50:55
beach
madrik: It is not widely agreed upon what languages belong to some "Lisp family" so it is hard to say anything about languages other than Common Lisp. Plus, this channel is dedicated to Common Lisp.
8:51:22
ioa
madrik i also think so. In fact, I think it's better to start with lisp, especially because of the REPL and the debugger.
8:51:24
beach
madrik: The Common Lisp programming model is MUCH simpler than that of languages such as C or C++.
8:52:03
schweers
It also gives better error messages (no SEGFAULT nonsense, unless you’re doing something naughty)
8:53:07
schweers
beach: do you have experience teaching Lisp to people who have never programmed before?
8:53:48
beach
I can't say I do, no. But I am utterly convinced that it would be much better to start with Lisp than with something like C.
8:54:50
schweers
I would have guessed the same, but I’ve never taught anyone how to program, and I’ve never taught anyone Lisp. So I don’t have any experience to back this up. Hence my question.
8:56:18
schweers
As teaching scheme as a first language was widespread practice at a time, this idea may not even be that radical or novel.
8:57:11
madrik
Doesn't /Winston and Horn/ presume that the reader is a newbie not simply to Lisp, but also to programming?
8:57:58
madrik
Most of the good Lisp books suppose that the reader is at some level beyond the beginning stage.
8:59:51
madrik
And keeping it in the family, /How to Design Programs/ by Felleisen et al is, I understand, a tour de force in pedagogy.
9:00:37
madrik
I think I read somewhere it was a sort of spiritual successor to /The Little Lisper/.
9:01:23
beach
madrik: The second edition looks like it assumes very little prior programming knowledge. But the code looks old and not so idiomatic by today's standards.
9:02:28
minion
madrik: look at gentle: "Common Lisp: A Gentle Introduction to Symbolic Computation" is a smoother introduction to lisp programming. http://www.cs.cmu.edu/~dst/LispBook/
9:03:09
madrik
beach: I just checked the 3rd edition of /W&H/, and it uses Common Lisp as it was around 1989. So, not quite ANSI CL, but good enough.
9:03:10
beach
madrik: I found that book tiresome to read, but I wasn't a beginner when I did read it, so I may not be representative.
9:04:16
madrik
beach: I thought the design recipe was a gimmick at first, but I learned to appreciate it later on. It proved most useful in two Common Lisp projects of mine.
9:10:42
shrdlu68
madrik: I can't think of a language whose proponents would say is not good for beginners to learn. Well, maybe Scala.
9:11:35
madrik
While on this topic, would you say that a Lisp system ought to have an interpreter along with a compiler, or would a compiler suffice?
9:12:04
shrdlu68
beach: I think they would say "C++ may not be the best for beginners", but they would not go as far as say that it is not good.
9:13:13
schweers
I had the impression that C++ folks think its the end-all and be-all of languages, and that none other need to exist. So, yes, according to some, one should start with C++.
9:13:26
beach
madrik: There are no intrinsic reasons why an interpreter would have better debugging support. But it depends on how much energy the developers put into the debugging support.
9:15:41
madrik
SBCL has a compiler, Clozure CL has a compiler, CMU CL has both, Allegro CL has both, and LispWorks has both.
9:17:22
beach
madrik: As an implementer of Common Lisp, I would not include both. It would be a waste of my time and it would result in an increased maintenance burden. I would much rather spend my time making the compiler emit excellent debugging support.
9:17:56
madrik
loke: But doesn't the SBCL manual say, "SBCL is essentially a compiler-only implementation of Common Lisp"?
9:19:12
loke
There is a global variable you can set to force interpretation. It's a bad idea to use it :-)
9:22:52
scymtym
the interpreter can be useful in very specific situations like changing the compiler in a running image or parallel compilation
9:23:40
jackdaniel
it may be also useful in case of limited platforms like ios (where you can't compile in your application)
9:24:05
jackdaniel
or to be more precise, you can, but your application won't be accepted to their repositories
9:24:43
madrik
I was reminded of this old discussion in comp.lang.lisp regarding the relative advantages of interpreters and compilers:
9:25:04
loke
schweers: They ban (or can ban, it's apparently not consistently applied) anything that allows you to do anything resembling programming.
9:25:16
no-defun-allowed
i assume so, but they have a swift playground app which is ok cause they made it >:(
9:25:58
no-defun-allowed
i remember when i was knee-high to a cons, there was a port of scratch to iOS which got removed by apple
9:26:23
no-defun-allowed
though, yeah, two years ago i remember a python interpreter that ran on iOS
9:26:39
madrik
It was said that the merit of an interpreter is that modified macros will affect their users immediately.
9:26:50
loke
jackdaniel: There is a SageMath (which includes Maxima) on Iphone. I assumed it was based on ECL.
9:27:19
loke
jackdaniel: Then again, it's so horrifyingly slow that I believe it runs ECL in interprted mode, and restarts the image for each command.
9:27:22
jackdaniel
either way this is a silly limitation which makes me glad I don't own any Apple devices
9:27:29
no-defun-allowed
old news (2010) but it did happen despite scratch being a very, very stupid interpreter
9:32:39
madrik
I use Debian myself as I'd like security support for all packages in the archives. I understand that Ubuntu has no such complete coverage.
9:39:42
madrik
LdBeth: While perusing the archives (late 1990s-early 2000s) of the newsgroup, I recall he had plans for an intermediate to advanced book on Common Lisp.
9:40:50
madrik
I've read some of his prose works, and I thought to ask whether he had published anything new.
9:46:40
madrik
schweers: You joked earlier that C++ people thought of C++ as the alpha and omega of languages, and that one could (should?) begin with C++.
9:48:05
madrik
"Steve Heller teaches C++ from scratch, through a one-on-one conversation with an intelligent beginner who asks the questions you'd ask. Heller's unique dialog format is brilliantly designed to clarify the concepts you might otherwise find confusing, so you can quickly learn today's most powerful and valuable C++ development techniques."
9:51:45
beach
madrik: I firmly believe that the feature that I describe as "uniform reference semantics", i.e. that Common Lisp behaves AS IF every object is manipulated through a reference to it, makes the programming model way easier to understand than that of languages such as C and C++.
9:53:33
madrik
beach: Indeed. I now think of C, at least, as a language left for more advanced stages of learning.
9:54:39
schweers
I still don’t have a satisfying answer on what to do on embedded devices (apart from simply not going there). Lisp still seems to need too much memory. Maybe forth?
9:56:08
no-defun-allowed
uLisp exists, but it's not suitable for doing any processing given it interprets
9:56:30
no-defun-allowed
(there's no way to compile on an Arduino, that said, the program and volatile memories are in separate address spaces)
10:07:12
loke
madrik: (loop for n = (read-sequence ...) while (plusp n) do (something-with-sequence))
10:13:35
jackdaniel
maybe my eye is not very used to loop, but one looks pretty the same as another one (i.e I don't see any adventage of one over another)
10:14:54
jackdaniel
that said, judging if something is a good approach based on a snippet without a context may be hard
10:22:16
loke
madrik: That version gives you access to N, the return value, which you probably need when processing the result.
11:10:46
pjb
beach: it's clear that uniform reference model simplifies things a lot. This is the "everything's an object' of Smalltalk. And unfortunately, Java distinguishes C-line int from OO Integer. Objective-C Cocoa Frameworks too have a NSNumber class and must inherit C integers since Objective-C is a strict superset of C.
11:12:00
pjb
beach: like in Objective-C, we can in C use a programming style where uniform references are used most systematically. There's some boilerplate, some repeative code to be written, because of the C type system, but this can be wrapped in cpp macros…
11:12:34
beach
Yes, when I still programmed in C, I would use pointers for basically everything (except integers, etc.)
11:13:20
r13l
morning all! is there a supported way to handle signals in SBCL? i’ve been googling & reading docs, but to no avail. found trivial-signals, which appears to be broken, and sb-unix has some stuff vaguely related, but it states that it’s not intended for end users (also, is UTF-8 okay on #lisp?)
11:33:01
jackdaniel
r13l: long story short: (sb-sys:enable-interrupt sb-unix:signame (lambda (signal code scp) (sb-sys:with-interrupts (bla-bla))))
12:06:39
madrik
Are implementations supposed to notify or otherwise enter the debugger when they read a DEFCONSTANT from in a file on successive loads?
12:09:05
shka_
"A constant defined by defconstant can be redefined with defconstant. However, the consequences are undefined if an attempt is made to assign a value to the symbol using another operator, or to assign it to a different value using a subsequent defconstant. "