freenode/lisp - IRC Chatlog
Search
22:58:24
Baggers
Is there any way to have thread-local storage other than via special variables & let? That mechanism is great but often then threads are started outside of my control (e.g. by slime) and so I believe I can't set the local storage on that thread
23:01:33
Bike
though i don't understand why you'd want to alter storage for a thread that's not your problem.
23:05:32
Baggers
Bike I want to make a variable called *context* which contains the gl context bound to that thread. When I run things in the REPL (or call C-c C-k) I'm running code on a thread I didnt make but I do want to be able to store the gl context bound on that thread. Maybe there is a better approach. A hashtable keyed by #'bordeaux-threads:current-thread seemed slow
23:08:42
Baggers
phoe: Im not using that approach. It seemed subpar. I was hoping to get away with thread-local storage
23:09:12
Baggers
Bike: hehe yeah, multiple gl windows is a requested feature..so multiple contexts and all that madness :)
23:15:46
Baggers
Bike: unforunately the following did still change the binding for all threads (make-thread (lambda () (setf (symbol-value '*tst*) -10) *tst*)) was I misunderstanding your 'symbol value' comment. It's works as expected if I use 'let' in the new thread, but then I still have the original issue
23:19:24
Bike
it seems like it would be kind of ugly anyway. changing contexts halfway through a draw sounds bad.
23:21:25
Baggers
each context has its own command queue, I dont neccesary need to be drawing on both at the same time. GL (IIRC) is fine with 1 context being 'current' on each thread
23:22:54
Baggers
nyef: it definitely isnt something I'm forcing. Just supporting for those who want it
23:27:11
nyef
Baggers: And, changing the subject a bit, does your software allow using quad buffers if the underlying GL supports it?
23:32:08
Baggers
nyef: Should do. I havent tested it but it should be case of adding it to the 'context' in when making a pipeline. (cepl:def-g-> some-name (:450 :quad) #'vert #'frag)
23:34:04
pmc
I was reading on Wikipeida that GNU CLISP doesn not support the full ANSI Common Lisp standard.... does anyone know what they have left to implement to be fully compliant?
23:36:44
Baggers
nyef: just checking the wiki I realized why I dont support them, they are deprecated for modern gl https://www.khronos.org/opengl/wiki/Primitive#Quads
23:50:12
Baggers
nyef: Gotcha. Doubt its working yet but some brief googling suggests it should be too bad to add. I'll add a ticket
23:51:11
Baggers
seems very related to multiple render targets which is already done, but I need to find more on this, and maybe a machine that supports gl_stereo if this doesnt
23:51:36
aeth
In case anyone's interested, my Brainfuck is probably finally ready enough to be put on git. And I guess I just barely got it ready in time for its official release in almost exactly a week from now. http://paste.lisp.org/+7BGT/2
23:53:39
nyef
Baggers: Fair warning: Basically nothing supports GL_STEREO in Linux these days, unless some proprietary driver has something.
23:55:04
aeth
Oh, and I had to make my Brainfuck program a full Brainfuck compiler as a response to objections that it wasn't a compiler in here earlier. As in, producing .fasl (or whatever the implementation calls them) from a source .bf or .b file.
23:57:11
nyef
Yeah, basically the only reason I have installed windows systems around here at this point is for stereoscopy work.
23:57:45
nyef
... Mostly to try and figure out how to get some of my stereo hardware to work in Linux.
23:57:54
Baggers
nyef: do you know you can render to left and right in one pass? (like multi render targets with regular fbos)
23:59:17
nyef
I'd heard something about that, but not dug into it. I haven't done much at all with OpenGL, and the software that I have for the one use-case that I've been trying to get working still uses MIT SHM and XSHMPutImage() or whatever it's called.
0:00:29
nyef
I could get it to run in stereo if I rewrote it to hit the KMS APIs directly, but... Bleh.
0:00:57
Baggers
Havent heard of that before, interesting. what hardware are you using? has razer's headset looked any good to you?
0:03:08
nyef
On the upside, I did finally get nouveau to output a suitable HDMI 3D signal for frame-packing modes recently. (-:
0:06:57
aeth
nouveau is disappointing. When I first went with nvidia in 2010 or so, nouveau was the best choice. Now, my new (GeForce 10 series) card can't even run on nouveau
0:10:07
nyef
aeth: Because nVidia started requiring signed firmware, and while they have said that they will provide the necessary firmware to the nouveau project, they've only recently provided *most* of the necessary firmware.
0:11:05
aeth
If AMD actually released competitive hardware on the high end, they'd capture a lot of the Linux market just because you'll be able to not have a buggy experience.
0:11:11
Baggers
nyef: Had a quick read. Requesting stereo looks easy (just pass :stereo to cepls init function). Rendering to multiple fbo attachments work fine (and should do the same for the default fbo) but rendering to each in its own pass isnt supported in CEPL yet, that a bit of a gap in the api actually. Filing an issue for that
0:12:02
aeth
CUDA locks a lot of people into nvidia, though, so AMD might not even be able to capture a majority of the Linux market even if they released superior hardware.
0:35:13
BusFactor1
is there a way to directly load a .asd file into a running lisp without dealing with paths and such?
0:37:29
BusFactor1
the library i'm trying to load is busted in quicklisp so i'm trying to directly load the development version i got from git
0:38:36
BusFactor1
i've had so many problems with paths and libraries i'm trying to learn a more direct way to load project sources
0:38:40
jasom
If anyone wanted to play around with my geany plugin, I have a "not too broken" verion here packaged up for ubuntu: https://github.com/jasom/geany-lisp/releases/download/0%2C2/geany-lisp-plugin_0.2.0_amd64.deb
0:44:06
aeth
Fare: Is it possible to use ASDF with other programming languages? i.e. If I can produce a valid Common Lisp foo.lisp for some foo.otherlanguage.
0:44:21
aeth
Well, it's probably possible once a bunch of (temporary?) .lisp files are generated, but before that?
0:44:39
BusFactor1
I'm livestreaming right now for those that are intersted in watching me try and get a machine learning library working: https://www.liveedu.tv/busfactor1-inc/RavAJ-general-work/
0:48:39
aeth
I have about 2/3 of a Scheme (but I probably am only 1/3 complete at best) and I can obviously take foo.scm and produce a temporary foo.lisp and run compile-file on foo.lisp and then load foo.fasl (or whatever the implementation-specific extension is)
0:52:50
Fare
you can subvert the reader in various ways, see for instance my reader-interception package
0:52:56
aeth
Right now I'm playing around with Brainfuck because I get to get some experience with stuff that are much, much later on in the process of creating an implementation than I am with Scheme.
0:54:59
Fare
or you can share the same pseudo .lisp file with a magic global #. form that references some special variable you set up in a wrapper form
0:55:42
aeth
Once a reader function has been written, there are at least three trivial things that can be done with it. At least, three that I've found with my Brainfuck. One's a reader macro, another is a regular macro that uses with-input-from-string on a source string, and a third is reading a file and compiling it.
0:57:25
Fare
BusFactor1, it's CL, you can do whatever you want, but for simple solutions, use the recommended patterns, and put your overrides in e.g. ~/common-lisp/ so you don't even have to configure anything
1:03:37
aeth
#4f(+++++++[>++++++++++<-]>++.<+++[>++++++++++<-]>-.+++++++..+++.>+++[>++++++++++<-]>++.<<<++[>----------<-]>----.<++[>++++++++++<-]>++++.+++.------.--------.>>+.<++++++++++.)
1:08:40
akkad
(deliver 'kunabi:main "../dist/lispworks/kunabi" 0 :keep-package-manipulation t :multiprocessing t :keep-eval t :keep-fasl-dump t :keep-editor t :keep-foreign-symbols t :keep-function-name t :keep-gc-cursor t :keep-keyword-names t :keep-lisp-reader t :keep-macros t :keep-modules t :keep-top-level t :license-info nil :keep-walker t :KEEP-PRETTY-PRINTER t) ;; works
1:41:00
reepca
So I'm in the situation of having a SLIME REPL I want to keep alive during a loop. So far I'm using code exactly like https://github.com/cbaggers/swank.live/blob/master/swank.live.lisp but have noticed that certain features of SLIME don't work during that, for example the parameter lists in the minibuffer. Any idea how I can make those work as well? They're awfully convenient...
1:50:36
reepca
I'm not sure how well that would work with manipulating global variables - that's currently how I control what my program does while it's running. Is there any reason I should be worried about that?
2:38:47
krwq
does anyone know if there is some portable way to escape argument when using uiop:run-program?
3:06:26
krwq
akkad, if you know that input is ascii then you can do it, if you do not define your encoding (or in other words - how to map from byte to character) you can't do it in any portable way
3:08:35
krwq
it's not CL thing, it's a general thing for any language. some languages will try to read BOM or assume encoding but that usually works only in countries which use letters similar to english
3:12:30
krwq
akkad: take a look at alexandria:read-stream-content-into-string 's implementation this should be fairly close to what you want
3:13:26
krwq
akkad: although as i told you - if you do not have enconding this will be working heuristically
3:24:45
Bike
i don't know what compressed json is though. google suggests it could be gzipped, in which case you don't want it in a string.
3:28:49
akkad
e.g. gzip-stream:with-open-gzip-file works fine with (loop for l = (read-line in nil nil)
3:56:22
krwq
does anyone know a way to start a process and set a working directory for that process?
4:55:52
krwq
shaftoe: i knew about chdir but this seems to be changing state which never works well with threads
4:57:34
shaftoe
how often would you change into different working dirs in different threads in the lifetime of a program?
4:59:45
krwq
i saw a lisp library for git (some ffi to c) but it is using native compontents which i want to avoid
5:01:17
krwq
yes i'm just shelling to git - do not know better way yet - i was considering parsing git files but decided to leave it as last optiob
5:07:16
krwq
this is pretty nice, thanks! but still - i know that when you create a process it is possible to do it on all platforms
5:07:42
shaftoe
i just looked at the cost of the "hobbyist" version of lispworks... $750 USD... if it were $50-99 that'd be more realistic
5:10:55
shaftoe
i wanted to check out their multiplatform UI library: http://www.lispworks.com/products/capi.html
5:11:19
akkad
shaftoe: email them for a free time trial. very useful in deciding if you want to buy it
5:23:06
shortCircuit__
I had a question. in https://github.com/arrdem/sad/blob/master/test/lisp.bnf this bnf . how are + * and other functions defined ..
5:27:18
Bike
or do you mean that the grammar disallows functions with asterisks in their name and so on?
5:28:53
shortCircuit__
yes the first one.. the grammar doesn't actuaaly have those symols .. I want to understand how this grammar works ...
5:31:06
shortCircuit__
:P so is there a link to a proper grammar for the lisp syntax .. I am trying to write a simple language with assignement, function and a pipe operator .. but I have no clue how to do it . looking for codes :P
5:31:44
Bike
well common lisp, the subject of this channel, doesn't fit a context free grammar anyway.
5:32:38
Bike
But this has the basics. An expression is an atom or a (possibly dotted) parenthesized list of expressions. And that's about it.
5:36:59
shortCircuit__
that I understand .. so there is already some table that has this + setf defined . and then a lisp program is parsed and then whereever a (string ... ) occurs the string is looked up in the heap and then in the symbol table ?
5:56:03
beach
IRC is a great communication tool, but it can be frustrating at times. Luckily, #lisp is populated with smart and knowledgeable people, so it is a fantastic source of information.
5:58:32
dingusman
Cool, great to hear. I've gotten very interested in lisps lately. Working through practical common lisp
6:01:11
dingusman
I'm liking it a lot. I've been trying to find resources to demonstrate practical macros. Most of the examples I've found online are silly toy examples. I think PCL does a good job
6:02:39
beach
oleo: I don't have time to work on McCLIM myself at the moment. Right now, jackdaniel is maintaining it. If you need more information, ask in #clim.
6:03:21
beach
dingusman: There is an entire book dedicated to Common Lisp macros. It is called "On Lisp" and the author is Paul Graham.
6:08:00
dingusman
krwq: I might've misrepresented my experience a bit. Before I started PCL I had been reading a lot about racket. It's probably tougher to find good racket macro examples than common lisp
6:09:04
dingusman
beach: thanks for the recommendation. didn't know On Lisp was focused on macros. shouldn't suprise me after reading his essays viaweb
6:13:06
beach
Well, Paul Graham is a strange one. He has also written "ANSI Common Lisp" which is more of an introduction. But he really doesn't like Common Lisp very much. His books don't use the object-oriented aspects of it at all, and he designed a new language called "Arc" as an alternative to Common Lisp. It never became popular, though. And the coding style in his books is a bit off compared to accepted conventions.
6:15:22
beach
I don't know. I meant the language, not any particular implementation. Languages are not proprietary.
6:20:44
dingusman
There's at least a community-managed fork on github. Apparently it's built on racket, didn't know that
6:22:42
aeth
Yes, this is the living Arc, for some definition of living. https://github.com/arclanguage/anarki
6:22:56
aeth
At least, if you don't work for Y Combinator and thus don't have access to their Arc and the Hacker News code
6:24:05
beach
dingusman: Anyway, I just mentioned Arc in the context of Paul Graham. Despite the name, #lisp is dedicated to Common Lisp.
6:26:42
aeth
To compare the relative health and activity of the communities, there are possibly up to 6 Common Lisp game engines that are more active than Anarki.
6:27:25
aeth
And I wouldn't be surprised if the combined output of #lispgames is several times larger than that of the Arc community.
6:37:22
aeth
It doesn't look like there is any notable usage of Arc outside of Hacker News. https://github.com/trending/arc?since=daily
6:38:11
aeth
Compare with this where you see some large web and graphics projects (which seems to match my experience with what is popular in CL): https://github.com/trending/common-lisp?since=daily
8:20:29
jackdaniel
quantity doesn't always come with quality, so comparing raw numbers says nothing. If they do, I'd be programming in Java, not CL.
8:29:36
beach
I wrote a new view class for Second Climacs, and forgot to check for empty strings, so my X server crashed again. But it's OK, I needed to update my software anyway, which, as we all know, still requires me to restart all applications and the operating system, because we still use software technology from 50 years ago.
8:43:08
beach
Visiting a file with 11k lines in Fundamental mode takes around one second. And this is without any kind of optimization on my part. And of course, I always have DEBUG 3, SAFETY 3, and SPEED 0.
8:45:11
beach
It is reading the file one character at a time, and calling the generic function INSERT-ITEM for each character read.
9:08:53
akr[m]
Hello, I'm looking for some example in Lisp (be it a blog post or a section of a book) which showcases some interesting usage of some combination of metaprogramming and the ability to modify programs while they are running
9:09:54
beach
We don't usually modify programs when they are running. Stuff like that is typically done only during development.
9:11:06
jackdaniel
but during development mutating application while it runs is a standard technique
9:11:21
akr[m]
Fair enough, but this doesn't have to be something you would want actually do in production
9:12:01
jackdaniel
well, having ability to do that may be great or debugging, but some security measurements would be necessary if you plan to enable swank on production
9:13:54
jackdaniel
akr[m]: you may try to pick something from the resources mentioned on reddit: https://www.reddit.com/r/Common_Lisp/
9:14:52
akr[m]
As an example of the kind of thing I'm looking for, I was wondering how feasible it would be to have a program which would modify parts of its own code using a genetic algorithm in response to external stimuli (i.e. user input)
9:15:22
beach
akr[m]: Also, the concept of a "program" is not well defined in Common Lisp. Basically, a program is just a collection of functions that are called in some pre-defined way. So whenever you define a new function or redefine an existing one, you are basically modifying a running program.
9:15:56
jackdaniel
it's not something what programmers would do every day, but that's definetely possible. You'd have to declare function as notinline and evaluate new function definitions compilation
9:19:24
beach
akr[m]: Definitely feasible. Here is an example: (defun f (x) (setf (fdefinition 'f) (compile nil `(lambda (x) (+ x ,x)))) x)
9:22:54
beach
I am going to work on Fundamental mode in Second Climacs for a while to make sure it works, and to do some performance tests. And I will clean up the build process and document it so that others can try it out. Common Lisp mode needs to be restructured, and I don't feel like doing that at the moment.
9:23:27
akr[m]
beach: interesting, although I have to admit that I don't know what it does from looking at it
9:24:18
minion
akr[m]: look at 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).