freenode/#lisp - IRC Chatlog
Search
8:35:18
Shinmera
Woo, got a complete, working implementation of geometry clipmaps in my Lisp game engine! https://www.youtube.com/watch?v=_qAARn1nOSw
8:48:54
Shinmera
And by the way, my engine uses CLOS all over the place, and pays practically no attention to consing or anything, and it still runs just fine for pretty much everything I've done so far.
8:50:16
Shinmera
Just to give a counterpoint to all the games people (even in here) that constantly brag about how optimised their stuff is.
8:52:03
Shinmera
It has been an issue for me in some cases, like real time audio processing, but most of the time it has not impacted me at all.
8:54:21
Shinmera
Sample conversion and interpolation, various effects and mixing of multiple channels, etc.
8:59:59
dim
I think it boils down to not using generic function in your inner-loops processing, at least that's what I do in pgloader
9:00:39
dim
I mean I use them extensively for preparing the catalogs and all, and not at all when actually reading and re-formating and writing bytes over the network
9:01:42
Shinmera
For my game engine I use GFs in the main draw and update steps all over. It's fine.
9:03:10
shka_
i am under impression that notion about performance of GF is not relevant with current hardware
9:03:29
Shinmera
It depends on the workload. There's definitely overhead and that can be enough to matter
9:03:58
jackdaniel
if you process (say) images, you have loops going over each pixel, so even if gf gives you 1ms, you lose 1s etc
9:07:59
jackdaniel
I don't know what's that supposed to mean: you start to implement fast methods only after you prove that you wrote a complete application which is painfully slow?
9:09:54
shka_
I mean: write prototype, benchmark it. Don't attempt to perform microbenchmarks because results are misleading
9:14:31
heisig
Oh, microbenchmarks can be quite enlightening. Otherwise I wouldn't have figured out that if you do certain MOP things (e.g., calling ADD-METHOD yourself) SBCL switches from fast methods to slow methods.
9:15:09
heisig
That can be an order of magnitude slower. Of course, whether that matters depends on your application.
11:56:13
dim
I can find https://github.com/haskell-lisp/yale-haskell which seems to be a project from 26 years ago
11:57:54
LdBeth
yes. many haskell implementations are deprecated. and i can't find one can be compiled without GHC
12:01:27
LdBeth
beach: it's a compatblity layer made by wrapping a few CL utils and write the rest of world in Scheme style
12:46:03
smokeink
does this look like the proper way to delete an object from the manardb database? http://pastecode.ru/944ee43/
12:54:08
smokeink
by calling that (gc _everything_except_the_obj_I_don't_need_any_more :verbose t) ? that doesn't look right to me, I think I must be missing something
12:55:34
LdBeth
ie, it's the CDR of anthor list which is in everything_except_the_obj_I_don't_need_any_more
12:56:58
smokeink
if other objects don't hold references to it, then that obj gets destroyed. I pushing adding that obj into a list but that doesn't make it count as "referenced"
13:00:32
Bike
not that i'm familiar with this system, but if you deal with things through a garbage collector, is "delete this particular object" even a thing the system wants you to be able to do?
13:01:45
smokeink
I want to understand in such a system how am I supposed to delete a blog post from the db, for example
13:04:14
smokeink
http://git.elangley.org/edwlan/blogerate.git/blob/ef839cbf4d96b5ee4aa02ab6d82aa6bf64293301/blogerate.lisp
13:05:00
smokeink
this small app here can add blog posts, but shouldn't I also be able to delete them? (by ID for example, since each post has a unique ID)
13:06:36
smokeink
when I create a blog post, I create a unique ID for it. Then in the HTML I can output that ID for the action of a "delete" button for example
13:07:01
jdz
I may have come to the discussion at a wrong moment, but if you know what you want to delete, then obviously you have some kind of a reference, so it seems very wrong to want to "make object referenced".
13:07:57
smokeink
:) you'll have to explain why you think that if an object exists then it must be referenced by something else.
13:08:28
smokeink
it just exists by itself, it's there, floating in the database. And I want to delete it, since nobody wants it any more (and nobody actually rferences it )
13:09:23
Bike
"you'll have to explain why you think that if an object exists then it must be referenced by something else" because otherwise the gc would delete it
13:09:43
Shinmera
No, because if it's not referenced it simply doesn't exist by the programmer's view.
13:10:19
LdBeth
smokeink: if (1 2 3 FOO) is excluded then other references to FOO alse won't be wiped
13:11:29
LdBeth
since after save into db, the #'lisp-object-to-mptr to the save symbol will always return the same mptr
13:16:38
Bike
i'm just saying, practically speaking, if the post isn't referenced from the database, surely gc will axe it
13:18:35
smokeink
if I make another class (let's call it posts) that references individual post objects, and I tell the gc that I don't want to gc posts, then it'll spare all the referenced individual post objs
13:19:14
smokeink
now, is that the right way to work? to have a class post and then another class posts that references post objects ??
13:22:11
smokeink
I used a class with a slot of type sequence. I 'd like to use a simple sequence directly but I am not sure how to access it
13:34:10
smokeink
but after I restart the lisp system I shouldn't call make-instance again, I should read it from the db
13:44:17
smokeink
yes, sure. The issue was how to delete an individual post. It's solved. Now the second issue is whether it's possible to use make-marray for posts , instead of defmmclass
13:45:21
smokeink
you need an array or a class, that references those posts, otherwise you won't be able to delete individual posts
13:46:59
smokeink
you'll be able to store post objects, ... and you'll be able to delete them all. But if you want to delete them individually, you need a parent structure that references them, and call (manardb:gc (list parent_struct1 parent_struct2) :verbose t) , and that will delete only those objects which are not referenced by these parent structures
13:55:16
smokeink
I also hoped for an elegant way... there shouldn't be a need to have both post and posts objects. And then user & users, comment & comments, and so on...
13:57:45
jdz
The documentation says "manardb is just starting out...", and some ways to improve it include the things you want.
14:12:07
smokeink
I tried elephant and it was always crying and making things complicated, (I forgot the details)
15:17:27
bateman
Hi guys, I'm having some trouble with a basic common lisp program. Could someone look at my code and tell me what I'm doing wrong?
15:19:08
bateman
It's supposed to sum the multiples of 3 and 5 between 0 and LIM. Currently it gives an error when I try to run it.
15:19:16
jackdaniel
bateman: your indentation is all wrong, let doesn't require explicit progn,, you call reduce with an unbound symbol
15:20:42
sabrac
For those of you who. like smokeink, think that postmodern has stuff half implemented, I am interested in hearing people's priorities.
15:20:44
jackdaniel
your question is probably about reduce, try (reduce #'+ mltlst), but this code is not very readable
15:20:50
jackdaniel
bateman: check out http://www.cs.umd.edu/~nau/cmsc421/norvig-lisp-style.pdf for style hints
15:21:43
minion
bateman: direct your attention towards pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
15:22:18
beach
bateman: If you use incorrect indentation, you force the people reading your code to count parentheses, which is not what Common Lisp programmers do. They rely on correct indentation to understand the code. As you noticed I immediately though i was out of scope.
15:26:22
sabrac
Shinmera: Still struggling a bit with method documentation. E.g. all those sql-ops in s-sql in postmodern. Otherwise, I like it. I need to find time to publish a review.
15:46:44
bateman
"Evaluation aborted on #<TYPE-ERROR expected-type: (OR FUNCTION SYMBOL) datum: (+ 1 3)>"
15:48:56
bateman
So is the rule with #' that you have to use it when you're using a function as an argument?
15:49:20
LdBeth
Weirdly, almost all other languages use same namespace for both functions and variables
15:53:03
bateman
Do you ever need to do that with a symbol right after an open paren? (eg, (myfunc arg1 arg2) )
15:55:29
Shinmera
Eg the first and second pairs of parens within this let are not forms, but expressions: (let ((foo 0)))
15:57:50
fouric
actually, on that note, why have i seen older code that has #'(lambda ...) instead of (lambda ...) in it?
15:58:12
Shinmera
Because before CL got standardised, LAMBDA was not yet a macro that expanded to (function (lambda ...))
15:58:28
slyrus1
Xof: would love to take a look at it if you can dig it up. Was thinking of starting my own, but, obviously, starting with yours would be preferable.
16:00:27
Shinmera
"If name is a lambda expression, then a lexical closure is returned. In situations where a closure over the same set of bindings might be produced more than once, the various resulting closures might or might not be eq."
16:01:55
Shinmera
I actually consider #'(lambda ..) an anti-pattern nowadays because some things do expect lambda expressions, and not function expressions, so #'(lambda ..) does not work everywhere, while (lambda ..) does.
16:02:29
Shinmera
Examples being a lambda-expression as the name of a form, and the condition report function.
16:07:23
fouric
to clarify: not all expressions are valid forms, but all valid forms are expressions?
16:09:36
Shinmera
So (let ((a b))) is a form, ((a b)) and (a b) are expressions and b is another form.
16:10:05
Shinmera
well, let and a as symbols are also expressions in that example, just to be complete.
16:12:26
Shinmera
On a tangent, #' and ' are great ways to obfuscate your code! (let #'null (setf null 'null) (funcall null function))
17:06:36
Shinmera
Clearly the ANSI committee had no concern for code obfuscators. We need a new standard to address this.
17:13:40
Shinmera
Here's another progress video from my clipmap implementation. https://www.youtube.com/watch?v=jv3SS_l6Q5I&feature=youtu.be
17:20:17
jasom
Shinmera: Lexical bindings of dynamically determined values doesn't make any sense IMO
17:21:05
jasom
You could imitate a dynamic binding of those via symbol-function and unwind-protect though.
17:26:37
cgay
Is there a thing that takes a type, e.g. (member :a :b :c) or (integer 1), and turns it into an English description of the type? I imagine it being a format directive written by the same person who wrote ~@R, for example.
17:27:20
Bike
check-type allows you to specify your own string, since it sometimes depends on context.
17:28:18
cgay
I have CL type specs leaking into command-line flag --help output and thought it would be fun if there were a converter. :)
17:58:42
Shinmera
I found CLON to be much too heavy-weight. Fare's command-line-arguments is nice and simple.
18:01:40
jasom
for programs with a lot of arguments clon can be nice. If you consider "cat -v" harmful then you probably don't need it
18:08:41
LdBeth
http://www.softwarepreservation.org/projects/LISP/parallel#Connection_Machine_*Lisp_(StarLisp)_
18:34:32
dim
and rather than CLON I wrote my own simple stuff for parsing commands and subcommands ala git, but didn't separate it out from some of my stuff
18:35:13
dim
https://github.com/dimitri/pgcharts/blob/master/src/utils/cli-parser.lisp is used in https://github.com/dimitri/pgcharts/blob/master/src/pgcharts.lisp if you're curious