freenode/#lisp - IRC Chatlog
Search
12:32:21
phoe
madrik: please start using quicklisp instead. apt sources are often outdated and are not widely supported.
12:32:58
phoe
Also, I don't think other linuxes are less friendly for Lisp. Implementations run anywhere, Quicklisp runs everywhere. Debian and its derivs are simply popular.
12:38:17
Cymew
Canonical/Ubuntu has made an effort to conquer the desktop, that's probably why it's so common.
12:50:02
edgar-rft
i think Ubuntu / Suse / Fedora are heavily GUI desktop oriented Linux distos while the very first thing a progammer does on a GUI desktop is opening a shell window :-) I myself am using Debian because it's dead easy to reduce the GUI stuff to the minimum I need for working with aufio / video/ images and all the rest I do either in Emacs or in a shell window.
14:52:07
lf94
Hey guys, just diving into the curiousity that is lisp once again like everyone does. Question: is there any lisp that has implemented a type system in itself?
14:52:45
lf94
Secondly: is there a type system where you can define the most basic of structures? Like integers and floating point?
14:53:38
lf94
For this I was thinking using regular expressions could work well, but no, there are some limitations. Like defining the order of integers...
14:56:51
Bike
lf94: i'm not sure what exactly you mean, but (a) this channel is about common lisp specifically, and (b) it has a standard type system.
14:58:42
Bike
i wasn't talking to you. but yes i'm sure people are around who have used with hunchentoot. i've only barely worked with it and probably can't help you, sorry.
15:01:47
Shinmera
just state your problem. it's annoying to have to wait to see whether one could help or not. people with or without hunchentoot experience may or may not be able to help you.
15:03:37
shidima
I'm trying to make define a handler for the base uri / , but it keeps giving me the default hunchentoot page.
15:07:14
Shinmera
if you want to simply catch all requests ever, you should define an acceptor instead.
15:11:11
Shinmera
just doing that with a string for return and starting hunchentoot does give me the correct string page.
15:12:27
shidima
Ok, ill look into it some more than. Thanks for confirming the code should work tho.
15:38:42
pfdietz
Is there an existing library for "self specializing methods"? These would be methods that, when given parameters in a particular set of classes, would produce a specialized version of themselves for those classes.
15:45:11
lf94
I'm looking around the Internet but can't find much on the subject: how's memory usage in lisp vs other compiled languages?
15:46:43
pfdietz
It can depend on the garbage collector. Copying collectors, for example, might copy between two large spaces, which might double the memory footprint. But all modern languages with GC face this issue.
15:47:54
pfdietz
A very old concern about Common Lisp was that all the standard parts of it took up a lot of space. But now that footprint is quite small, comparatively.
15:48:16
beach
lf94: Second, there is no such thing as a compiled language. Whether a compiler or an interpreter is used, is a function of the implementation, not the language.
15:48:46
beach
lf94: It very much depends on the strategy of garbage collection used by the implementation.
15:49:24
jackdaniel
lf94: these points are important in Common Lisp case, because there is five or more actively maintained implementations with very different traits
15:49:47
beach
lf94: Third, you may want to study the works of Jim Newton and Didier Verna. They have type descriptors for Common Lisp that work like regular expressions on lists.
15:51:16
beach
lf94: Such a thing does not exist, unless you mean reference counting, which is not used by any Common Lisp implementation that I know of, and for good reasons.
15:52:16
Shinmera
shidima: are you perhaps not returning anything from the function? I believe returning NIL will cause hunchentoot to skip the dispatch.
15:52:34
jmercouris
if this is the deciding factor about whether you will choose lisp or not, save everyone's time and just learn rust
15:52:52
jackdaniel
if something may be allocated on the stack, it is very possible that optimizing implementations would do that
15:55:19
beach
lf94: You may want to look at the GC literature. There are some formulas that relate memory overhead and GC frequency for different types of GC techniques.
15:55:58
lf94
My fear is GC is overkill - I only hear about "sweep-mark" GC all the time for embedded systems
15:56:54
jmercouris
either learn Lisp or don't, questions about performance characteristics aren't going to be the silver bullet to draw you to it
15:56:56
lf94
It's fragmented, and I'm hoping talking a bit here will fill some more holes around my concerns :P
15:58:02
jmercouris
reminds me of the guy who "knew" some Perl and wanted to see the equivalent in Lisp and _death wrote a funny little program :-)
15:58:18
beach
lf94: If you don't appreciate the superior performance in terms of execution time of automatic memory management in the form of a tracing garbage collector compared to that of reference counting or manual memory management, I think you should stay away from implementations that use tracing garbage collectors.
15:59:27
beach
lf94: There is always a trade-off between memory use and execution time. If you are that short of memory and don't care about execution time, garbage collection is not for you.
15:59:37
lf94
So moving away from memory: are there any type systems written in lisp, and then used in a lisp?
16:01:40
beach
lf94: You can try ##lisp, but you should know that there is no widely agreed-upon definition of "Lisp".
16:04:08
beach
lf94: Seriously, read the works of Jim Newton and Didier Verna. They will tell you everything you need to know about type systems relative to Common Lisp.
16:54:17
pjb
lf94: and for the question of the language letting you define the basic types such as integer and floating point numbers, while Smalltalk let you do such a thing theorically, in practice, the compiler will do magic on them so it won't be easy anyways. Similarly, in lisp and CL you can go the metalinguistic way to do it. But your definitions won't take over the system one unless you recompile your implementation.
16:55:09
pjb
lf94: from the user point of view, however, you can define your own types of "numbers". See for example, how I defined the currency numbers in https://github.com/informatimago/lisp/blob/master/common-lisp/invoice/invoice.lisp
17:00:38
pjb
lf94: the trick is that a symbol named "+" can be a different symbol than CL:+ ; it can be your-package:+ ; so it can be anything.
17:01:13
pjb
lf94: you can define a color:+ to mix colors; a string:+ to append strings; or a quaternon:+ to add quaternons…
17:13:15
jasom
GF dispatch is more akin to overloading, but it's dynamic dispatch rather than static dispatch.
17:14:37
Bike
it can be elided sometimes, but if you want to use both in the same area of code at least one will need to be qualified
17:14:47
jasom
lf94: for each package you can determine which symbol will resolve to a given name; so you could import color:+ but cl:* and then (+ x y) would use color:+ and (* x y) would use cl:*
17:16:45
jasom
I looked it up. It's an error, but there is also shadowing-import which will not throw an error.
17:17:51
jasom
I looked it up. It's an error, but there is also shadowing-import which will not signal an error.
17:44:27
_death
you can of course define your own kitchensink:+ that dispatches to the appropriate +
18:43:28
PuercoPope
What is the easiest way to evaluate the initform of a slot if I don't want to instantiate an instance of the class? I can get the form from the slot's initform slot but I'd like not avoid evaling it
18:46:25
scymtym
PuercoPope: would this work: (defclass foo () ((%x :initform (random 10)))) (funcall (c2mop:slot-definition-initfunction (first (c2mop:class-slots (c2mop:ensure-finalized (find-class 'foo)))))) ?
19:18:58
pjb
PuercoPope: or, you could do it in pure CL (not using the MOP), like this: (defun x-initform () (random 10)) (defclass foo () ((%x :initform (x-initform)))) (x-initform)
19:55:41
PuercoPope
I won't work for what I'm trying to do. The initform is a constructor, (rgb r g b), so I can't reuse a function. The jury is still out wether using the mop is a good idea though.
20:06:43
verisimilitude
I'm here to share a style document I've written for Common Lisp programmers:
20:06:45
PuercoPope
From the class definition. https://gist.github.com/PuercoPop/602c1fb39204d181aec7e413bdb5bdb5
20:09:28
pfdietz
Trying to determine which lisp unit testing frameworks define functions with the names of the tests. Stefil is one; are there others?
20:12:42
jackdaniel
when 3am and 4am are written, I can imagine 4:30 will follow, then 4:45am etc up to 4:59am and beyond, to 4:59:59am
20:27:02
_death
verisimilitude: most of it looks ok, though there are peculiarities that make it hard to recommend to those in need of such a document
20:27:43
verisimilitude
I expected such; what peculiarities do you find particularly egregious, _death?
20:29:22
verisimilitude
Also, if you've a style guide you prefer, do make me aware of it; those I did read were terrible in my eyes.
20:31:10
verisimilitude
I've already read that one, I recall, although it's been too long for me to recall my particular criticisms thereof.
20:32:11
_death
verisimilitude: likely the most offensive is disregard of special variables naming convention.. there's also usage recommendations for when/unless/and/or/#./##/comments/&aux/loop-keywords
20:33:16
verisimilitude
I'm still amused with the dislike of &AUX; it's part of LAMBDA, such a critical part of the language, and yet many don't seem to learn of it.
20:34:22
z147
verisimilitude, I'd suggest simplifying the language if You're going for an international audience. Non-natives won't necessarily understand "infeasible" but won't have a problem with "less practical" or "not practical".
20:34:22
_death
verisimilitude: the dislike is not due to ignorance of it.. likely it's due to the fact that the lambda list is not considered the right place for internal bindings
20:36:03
verisimilitude
I appreciate your thoughts, z147, but I'm unwilling to simplify my English for those who merely may not know the language well.
20:36:43
verisimilitude
Words exist for a reason and I find it best to use them where appropriate; I don't believe I've used any particularly obscure words therein.
20:37:38
verisimilitude
Fret not, z147, I'd like to eventually learn Esperanto and translate some of my work.
20:38:47
z147
The manuals and edu. materials I've participated in producing have all been done with a core vocabulary in mind
20:39:51
verisimilitude
One could argue many style guides are like this and that I'm more honest about it, say.
20:39:51
jackdaniel
style is not consistent: at one point you write "I do something" in another you write "something is preferable" -- by whom then?
20:41:00
verisimilitude
It's a style document, wherein I list how I write Common Lisp and give other preferences, along with other advice.
20:41:22
jackdaniel
back to the first concern, maybe some people are less onest, but they put more work to provide compelling argumentation why something is better
20:42:46
verisimilitude
I've seen few style guides which bother making compelling arguments. I don't feel the need to; they're my opinions and what I use.
20:45:06
jackdaniel
I've given feedback on the actual guide, but if you do not appreciate it then it's up to you.
20:46:10
jackdaniel
as of actual style, it touches very few style concerns so there is not much to comment either. and since there is no argument in favour, then it is hard to argue with it; I believe it is in line with your taste (so I won't argue with that ;)
22:08:27
jmercouris
I'm working with: https://github.com/atlas-engineer/cl-webkit/blob/master/webkit2/webkit2.web-view.lisp#L171
22:21:19
jmercouris
https://webkitgtk.org/reference/webkit2gtk/2.5.1/WebKitWebView.html#webkit-web-view-run-javascript
22:21:30
jmercouris
so the thing is, we are catching the error in webkit_web_view_run_javascript_finish