libera/#commonlisp - IRC Chatlog
Search
15:31:52
ggole
There's also a trick for hoisting (some) exception-raising constructs, which is that you catch and test whether the exception would have been excluded by the loop condition logic, jumping after the loop if so
15:32:27
beach
nyef: Yes, I assume that global value numbering has been applied so that I am sure that the tests test the same thing.
15:35:10
beach
nyef: Right. Whether or not the transformation is desirable is a different story. And the test must not signal a condition of course.
15:39:10
beach
Then I can write for example POSITION using tests for :START :END :KEY :TEST inside the loop.
15:39:51
beach
Furthermore, I can write AREF in the inner loop, and the implementation might specialize it to different kinds of vectors.
15:40:14
beach
Then, when I apply this transformation, I automatically get special versions of the loops.
15:44:49
beach
As I may already have said, my first SICL module was the sequence functions, and it was a disaster because I created the special versions manually. It meant there were way to many cases to test. So I abandoned it, hoping that a better solution would pop up. Now I am hoping I have such a solution.
15:57:48
ggole
The movement stuff is interesting. It seems to correspond fairly closely to availability in a numbering pass.
16:02:05
beach
They assume all values are equal. Then they split the graph when they discover evidence of a difference.
16:05:08
beach
Anyway, I think my colleague (in her inimitable way) hinted that she might work on it starting April or so.
16:43:27
Ralt
so I thought about doing (cl-ppcre:split "\\s+" foo), then strip off the first element, then join the rest... but it's ugly. And will lose spaces... although that doesn't matter in my case
16:46:14
pjb
beach: IIUC, the choice of guile as an implementation language for GNU emacs comes mainly from the fact that guile is a GNU project, and the designated scripting language for GNU applications (cf. eg. Gimp and more http://en.wikipedia.org/wiki/GNU_Guile#Programs_using_Guile). Unfortunately, the GNU CL implementations are 1- the "official" gcl (which is not even yet fully compliant), 2- GNU clisp (which wasn't originally a GNU project,
16:48:36
pjb
beach: In any case, switching to guile might provoque the defection of Common Lispers to another (or multiple other) emacs(en). We would only need to port slime to Hemlock or climacs to make us switch. :-)
16:51:36
beach
You missed a talk in Montreal by Stefan Monnier. He seems to be leaning more toward Common Lisp.
16:52:33
Ralt
is there anything that prevents us to write emacs in CL, embedding an elisp interpreter? (except time)
16:54:25
pjb
Ralt: the elisp part is rather easy. It's the emacs library that takes more time to implement completely enough to have elisp application run seemlessly.
16:54:34
wasamasa
beach: if anything, the comment was hinting at extending elisp to become sufficiently CL-like
16:55:18
beach
wasamasa: I didn't mean to say that Stefan would write a new Emacs in Common Lisp. I meant what you said, move Elisp toward Common Lisp.
16:55:18
pjb
Now of course, as beach suggests, it might not be a bad idea to rewrite applications, because there's some wild code in the emacs lisp ecosystem…
16:56:11
pjb
For one thing, if you integrate threads from the beginning, you might want quite a different structure for apps, modes, etc.
16:56:35
beach
If anyone really wants their preferred Emacs application, I can see providing an Elisp -> Common Lisp translator as a temporary solution.
16:57:27
beach
Also Emacs is *very slow* in general. I think we could do much better with a Common Lisp implementation that generates native code.
16:59:06
beach
Though, providing a Common Lisp interpreter in C for those other platforms wouldn't necessarily be slower than Elisp is now.
17:00:26
nyef
What platforms are there that are powerful enough to run emacs, that people would WANT to run emacs on, aren't supported by either CCL or SBCL?
17:02:18
beach
I recall an email exchange that I had with RMS a few days after his announcing GNU Emacs. I wrote to him and said it would be better to write a general Lisp system (Common Lisp didn't exist at the time) and then write Emacs in it. He answered almost immediately saying "Sounds good. Let me know when you have implemented it!".
17:02:48
nyef
Don't know what the coverage on BSDs is like, particularly with respect to threads and less-common CPU types.
17:05:37
beach
Even if we (or someone else) were to propose an Emacs in Common Lisp, nobody would be forcing Eli to give up the current version.
17:06:35
pjb
beach: of course. There'd be a war on killing applications. We'd have to have a better org-mode :-)
17:07:41
pjb
Which means that either we have something radical, such as an AI implemented in CL to integrate into it, or we more programmers than elisp. but the later is not the case.
17:12:16
dim
well what about providing the same API as Emacs (buffers/windows/etc) and an elisp "reader"?
17:21:13
xyh
ggole: I see. when using two arrays, how to declare "a nature-number and less-then 1000" ?
17:26:34
nyef
And we really mustn't let a discussion of array upgrading go by without mentioning (ARRAY NIL).
17:31:11
nyef
It's also a subtype of BIT, which is a required specialized array type, and upgrading can only move upwards in the lattice, so there must be an array type specialized to NIL.
17:31:44
nyef
I somehow doubt there are three implementations that actually follow this interpretation, though. Even two is unlikely.
17:41:37
pjb
xyh: but you might want to consider instead: (defstruct named-length (name (error ":name must be given") :type string) (length (error ":length must be given") :type (integer 0 999))) (make-array 100 :element-type 'pair)
17:42:49
pjb
So for example, if we could provide an emacs written in CL that would be able to read your mind about simple refactoring such as renaming a defstruct, that'd be a killer app I'd say.
17:45:03
pjb
xyh: or perhaps in your case, you could rather use: (vector (make-array 100 :element-type '(integer 0 999)) (make-array 100 :element-type string)) and (defun ref (a n sel) (aref a (ecase sel (:length 0) (:name 1)) n))
18:09:30
copec
Programming in CL as a noob sometimes feels like I'm setting up a Rube-Goldberg device starting with the last step and not know what prior steps need to take place.
18:10:03
pjb
copec: that's strange. Programming in all programming languages should be done in the same systematic way.
18:11:15
pjb
copec: perhaps you'd want to read Structure and Interpretation of Computer Programs http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html http://swiss.csail.mit.edu/classes/6.001/abelson-sussman-lectures/
18:12:17
nyef
* feels like he's setting up a Rube-Goldberg device starting with a bag of undocumented, badly-documented, and just plain weird parts, and trying to figure out which way around they go in order to make something happen. Like playing The Incredible Machine, but with computer hardware.
18:12:59
pjb
Perhaps this would be a good time for everybody to watch: Alan Kay "Programming and Scaling" 2011 http://www.tele-task.de/archive/video/flash/14029/
18:14:01
copec
I have actually read that before, I just haven't actively programmed as much as I probably should have
18:15:24
pjb
It's also visible on youtube, split in four parts: https://www.youtube.com/watch?v=gZmcmdsoAXU
18:19:40
pjb
Notice that you are allowed not to use :initial-element, if you don't read a slot before setting it.
18:25:21
xyh
I am writing a hash-table of string, I will not declare the type to be 'string any more, and use 0 to test if an entry is used before.
18:28:06
pjb
and hash values are not between fixed bounds in general, but the upper bound may change depending on the size of the hash-table. Also, it's preferable to use prime sizes for hash-tables.
18:34:57
xyh
(defparameter *size#name-hash-table* 100333) [1000003 1000033 1000333 are all prime numbers]
18:35:01
xyh
the hash-table is for the symbol datatype (i.e. name) in my VM, I have my own hash-function.
18:39:43
xyh
oh I see. my language will not have a common-lisp-like general NIL. false and empty-list will be of two different types.
18:45:35
ggole
Hmm, I guess pjb meant that NIL was the right thing and it doesn't stop being the right thing in assembly.
18:47:58
White_Flame
the instruction is a lot bigger than keeping a constant register, but it's not a multi-step process
18:48:41
White_Flame
(disassemble #'null) for instance, and you'll see NIL and T in their literal form (in my SBCL at least)
18:52:19
Bike
having only one symbol be an immediate sounds about as weird as sbcl's fixed address crap, really
18:56:07
ggole
What does "fixed address crap" mean? It doesn't put placeholder values and link them into place?
18:56:55
Bike
well, i don't understand it very well honestly, but i think sbcl has to have nil at a particular location in memory, like compile-time specified or something
18:57:43
ggole
I remember asking about something like that, but it was particular to NIL if memory serves.
18:59:53
White_Flame
Right, the GC can't modify the code in functions to use different immediate addresses in its instructions, so it has to lock it into place
19:00:28
White_Flame
whereas most other variable references keep a table of symbol references before the function, which the GC is aware of and can patch up
19:07:20
nyef
Part of the problem is that there are a number of references to read-only and static space that simply aren't kept track of.
19:51:12
White_Flame
Is there any interactive way in SLIME + SBCL to macroexpand macrolet bodies, like C-c Ret does?
20:24:48
drmeister
Noted - I thought you would just apply the patch to your version of quicklisp.lisp and if you hadn't made a change to quicklisp.lisp in the past couple of weeks then you would end up with exactly the file that I just sent you.
20:30:15
drmeister
I misunderstand something then. I had to make a three sets of changes to quicklisp.lisp to add support for clasp. Had I created a patch file, you would have applied the patch to your quicklisp.lisp to add support for clasp.
20:58:05
drmeister
Ok, FYI - I made changes to the quicklisp.lisp file that I downloaded from here: http://www.quicklisp.org/beta/
21:18:01
yenda
how is clim developpement going ? it looks like nothing happened since 2008. Are all lispers using bindings to foreign interface libraries or web interfaces nowadays ?
21:23:19
puchacz
however when I do something occasionally in REPL and I make a mistake, the image dies - as expected
21:28:25
puchacz
on one hand I want almost all errors to be caught and neutralised by hunchentoot so no thread is blocked by error and consumes resources, but on the other hand I want safety net when I play with it interactively
21:33:30
Xach
puchacz: no. tbnl caught and logged them. sometimes it would crash hard (what would put sbcl in ldb)
21:34:18
puchacz
ah, ok, got you. so while true start my website; sleep is in bash or similar, isn't it?
22:25:49
drmeister
I'm turning on trace and then switching through all the *xxx* buffers/frames - I don't see any trace messages.
22:37:07
drmeister
Well, when I defun a function and trace it and call it - I see the trace in *inferior-lisp*
22:41:56
pjb
You can always redirect streams: (setf *trace-output* *standard-output*) ; but the problem is when you have threads; you need to do that in the threads you're interested in.
0:02:45
dim
it's more like I know nothing about windows, don't really want to learn, and maybe it would be easier if I could just use LispWorks to produce the binary? but that's too much work and there's the licensing issues
0:06:46
dim
https://github.com/dimitri/pgloader/issues/159 and http://stackoverflow.com/questions/28130419/pgloader-error-sqlite3-dll-but-am-not-using-sqlite for the whole story
0:17:51
dim
is there a legal way to get a windows activation key for open source development for free or something?
0:22:33
nyef
(I know, given my stance when it comes to emulators, suggesting using WINE is pretty weak.)
0:26:11
nyef
For that matter, I'm somewhat disappointed that SBCL runs on WINE, given that SBCL changed to make it work rather than WINE changing to make it work.
0:27:01
pjb
But you can run MS-Windows directly on Apple hardware, or you can run it on VirtualBox on MacOSX. Works nicely.
0:54:50
xyh
I tryed this :: (defparameter l (list *load-pathname* *compile-file-pathname* *load-truename* *compile-file-truename*))
0:54:53
xyh
and it gets me :: (#P"/home/xyh/.cache/common-lisp/ccl..." NIL #P"/home/xyh/.cache/common-lisp/ccl..." NIL)
0:59:32
pjb
The compile-time effects of defparameter don't include evaluating the initial value: this is done only at load time, either of the source or of the compiled file.
1:00:14
pjb
xyh: what did you want? why did you want it? what if the "program" is moved to some other place?
1:00:45
pjb
xyh: what happens if user U compiles the program on system A, and user V uses it on system B?
1:01:55
pjb
Output the report where the user tells it to put it. Or by default, you may use (user-homedir-pathname).
1:02:51
pjb
(merge-pathnames (make-pathname :directory '(:relative "Documents") :name "test" :type "report" :case :local) (user-homedir-pathname)) ; for example
1:06:34
pjb
the functional code should use parameters, and you can have some user interface (just a command function) that get the parameters from whatever source is convenient (environment variables, command arguments, interactively, or even as parameter).
1:19:32
quazimodo
actually the monoid of functions and the way monads keep things composing is intersting for me
1:24:01
xyh
(switch from line-mode to key-mode and to read a key, should be as easy as READ, but it is not)
1:24:46
pjb
xyh: Have a look at coml.informatimago.common-lisp.interactive.browser and coml.informatimago.common-lisp.interactive.interactive
1:28:09
pjb
Theorically, read-char-no-hang could implement it, along with listen: an implementation could switch off the canonical mode when they're called, and switch it back on when you call READ, READ-LINE or READ-SEQUENCE, for example.
1:28:58
pjb
xyh: notice that if you use clisp, then it's trivial: you use the KEYBOARD package (and the SCREEN package to perform 2D terminal output).
2:02:32
pjb
Xach: sure, you can use ffi to deal with the terminal, but the problem is that this is not necessarily well integrated into the CL implementation.
2:03:03
pjb
eg. You can't use format when you use ncurses. (but you can when you use the #+clisp screen package which uses ncurses).
3:28:03
pjb
(also names ending with ~ are considered as backups by emacs (by default) and made invisible (by emacs and gnu ls and various other tools).