freenode/#lisp - IRC Chatlog
Search
20:16:10
anamorphic
In my project I have a bunch of static files I need at runtime. I have them all referenced in ASDF e.g ((:static-file "foo") (:static-file "bar"...), but it's starting to get a bit unwieldy. They're all in the one path though -- Is there a way to just specific, "all the files in this path" somehow?
20:22:47
_death
elderK: yep.. it's a good idea to replace #<%structure ...> in the expansion with the form to create that instance
20:24:40
elderK
I'd like to evaluate the "literal" only once, but I'm not sure how to do that when I've got the eval-whne as it is.
20:26:01
elderK
Right - but then how would you handle redefinitions? You'd have to be able to differentiate between "This was defined in the compile, now we're loading" and "We're redefining the entire thing"
20:26:07
_death
could have a FIND-BINARY-STRUCTURE and a (SETF FIND-BINARY-STRUCTURE), like FIND-CLASS and (SETF FIND-CLASS)...
20:27:02
elderK
It's used to associate type metadata with a symbol in general - for any "binary type." Not just structures.
20:35:09
elderK
Aye. You're right. Given defstruct's semantics, if you redefine it, you really should reload the system, rihgt?
20:37:21
buffergn0me
zhlyg: That CPS vs SSA comparison still has some valid points (IDK of any recent work on common subexpression elimination, which seems to be a sore point), but there is recent work to show you can do things with CPS that don't have SSA equivalents yet: https://smartech.gatech.edu/bitstream/handle/1853/16289/might_matthew_b_200708_phd.pdf https://dimvar.github.io/ (CFA2)
20:37:27
_death
in some implementations it's ok to redefine, if you also recompile code using the access functions and such
20:51:50
elderK
I imagine it is the same if you like, redefine deftypes and stuff you've used elsewhere. Obviously, if you have check-types and stuff using them, compiled into functions, you'd need to redefine them I guess.
20:56:50
_death
elderK: kind of a broad question.. I wrote things like that years ago after I read PCL, and I tried different approaches when I needed to do "binary parsing", but I did not need to create anything like that in recent years..
20:58:24
elderK
_death: Broad indeed. I basically want to use CL for the stuff I'd normally use C for. That is why I need something like this.
20:58:43
elderK
And, while I could use say, frodef's binary-types or... a few others, I thought building my own would be a good learning experience.
20:58:59
elderK
I get the feeling though that I simply need to let go of any... desire for "static typingness" :P
20:59:17
_death
elderK: there are many libraries to do that, and other languages also have features of interest (e.g., I remember erlang's bit pattern syntax was neat, or some python library that used similar syntax to define packet structure), but I guess you already checked them out.. so if you're writing it to fix issues with other people's libraries you should already have a good idea of what you want
21:00:04
elderK
_death: I haven't looked into how other languages like Python deal with this. But, I have spent quite a bit of time studying various "binary parsing libraries" on Cliki, and Github.
21:00:46
elderK
Of course, it's not a once-off "skim the code", I refer to them often, over and over, as I encounter new things or want to double-check something
21:01:29
dim
elderK: you'll find very good inspiration in Erlang binary syntax (with pattern matching) for binary, really
21:01:40
_death
elderK: well python had that struct thingy.. which I tried some years ago https://github.com/death/constantia/blob/master/struct.lisp but I'm thinking about some specific library whose name I don't remember.. at the time I thought it was cute
21:02:47
_death
elderK: sometimes it's easy to just use nibbles or simple stuff like with-binary-readers in https://github.com/death/dbus/blob/master/utils.lisp
21:04:11
_death
elderK: nowadays the things I write are aimed at concrete problems, so I don't have any grand designs for such a library..
21:04:53
elderK
:( I feel that my ambitions here are pretty modest, really. I'm not trying to create anything overly advanced. Just, useful for my purposes.
21:05:57
_death
elderK: the define-binary-class -like stuff I wrote were proprietary (it was 10 years ago or so) so can't give a link.. but they were similar to the PCL stuff, I guess
21:08:06
elderK
:P I will have type checks and stuff where it makes sense. But trying to force Lisp to be a statically typed langauge is frankly a waste of time.
21:08:37
elderK
If someone like, populates a "binary structure" with garbage and tries to serialize it, it'll fail - but they might write some bogus stuff in the process.
21:09:05
elderK
Mostly, it'll be fine. But I mean, it's not transactional. STuff that is valid, will be written and then FAIL! Something isn't the right type.
21:09:49
elderK
_death: Thank you so much for your help over the past few hours. I really, really appreciate it.
21:10:13
_death
me, I'm very inconsistent with style and documentation for my personal projects, and I don't mind other people's undocumented lisp code (I like code), so I'm a preacher giving advice ;)
21:10:46
elderK
_death: Well, as you can see, I've docstring documented some stuff. But, I intend to tear that out and do better, nicer docstrings "out of line."
21:11:05
elderK
And of course, eventually, I'll write a README that covers the basics of how to use it, examples, etc.
21:15:36
_death
yeah.. I don't think there's one way to do things, but when that approach works it's pretty cool
21:17:35
elderK
Perhaps one of these days I'll rewrite it all using the MOP, as shka_ originally suggested.
23:34:04
elderK
ebrasca: I've finally made some progress with my "binary" library. There are a few more things to add support for, and a few other "chores" I want to do. But, it should be ready for "alpha use" very soon :)
23:35:02
elderK
I'll try using it for some actual stuff, though. Dog-food it :) Fix / refine it as necessary.
23:37:05
permagreen
I'd like to say my name is often displayed as green in chat clients, for whatever reason, but really I think people are just more prone to point it out to me when it is
1:14:11
fouric
Xach: is there a reason it's not being done aside from "not yet implemented"? e.g. some sort of not-inherently-thread-safe thing
1:15:20
elderK
It would be one thing, to ensure that "unrelated" stuff was compiled / loaded etc in parallel.
1:15:34
elderK
But to think about the effect on the environment, as things were being compiled / loaded.
1:16:17
elderK
I bet it /could/ be done. But, I imagine it would be a very detailed process, and a bit like navigating a minefield.
1:17:12
elderK
I mean, the specification does grant the possibility that the environment in which a file is compiled, is "based on" the environment the compile-file is called from, but could be distinct from the environment it "spawned from." Of course, most implementations (in my experimenting), share the environment.
1:17:39
elderK
Bike: :D Are the details explained as to why, somewhere? I'd find it a fascinating read.
1:18:15
fouric
although hypothetically if someone wrote a decent set of patches, would you accept them?
1:18:18
elderK
fouric: I'm not sure it's super unfortunate. I suppose it really depends on the size of the stuff you're building.
1:18:23
Bike
elderK: there's a big lock around the compiler, because it reads and writes global structures without any particular regard for coherence. as far as i understand.
1:19:12
fouric
and also if we want to build larger projects in CL, tools that do things in parallel are always better to have
1:19:57
elderK
fouric: You'd have to talk to froggey as to learn more about Mezzano's compiler and all that stuff.
1:20:26
Xach
fouric: I like the idea of parallel builds because that's ASDF's domain, and the implementation's. parallel fetching shouldn't be too hard in theory if threads or something are supported. but that's not universal.
1:20:48
elderK
Xach: Is SBCL moving towards supporting like, parallel compilation in the future? Or are these changes jsut to help improve performance on multi-core systems?
1:21:51
fouric
Xach: would a parallel-fetching patch that worked for *some* platforms (using e.g. bordeaux-threads) but didn't make things worse on the others be OK?
1:23:35
elderK
fouric: It builds an image and stuff, sure. But once it boots, everything is being built in Mezzano, afaik.
1:24:37
elderK
Which, has benefits and drawbacks. The benefits are that Mezzano can compile to suit the architecture it's running on, with the available features.
1:25:36
elderK
Right. I guess if you wanted, you could check out the Next browser and you know, see how long it takes to build? :D
1:26:23
Xach
fouric: well, that part is a "no". but in theory a system that parallelizes downloads with a possible cap on simultaneous downloads at 1 would be ok, I think.
1:27:33
elderK
fouric: I haven't yet written anything substantial enough in CL to really... feel the pain. That being said, making heavy use of STL in a "nontrivial" C++ project is painful almost immediately. I imagine CL is easier to parse, and perhaps to analyze in some ways, than other languages. Perhaps this means that we can compile larger projects in less time. Who knows?
1:29:37
elderK
I wonder if there are techniques in CL-world, similar to those in C/C++ land, to like, reduce compile-time dependencies from one module to another. You know, stuff like PIMPL or simple forward-declarations and stuff.
3:42:43
equwal
Is there a way to get a double-backquote macro like this one to evaluate without using EVAL? How might I do that?
3:44:18
equwal
But I'm aiming for (lister 'first second ) -> (list <value of first> <value of second>)
4:11:11
Bike
the macroexpander function receives the form SECOND as an argument, and you want the value of that form in the macroexpansion
4:15:29
equwal
I often find myself in a situation where I want to change the evaluation of a complicated macro and I just can't seem to get it done.
4:19:54
equwal
Well I have a function like `LET` that has some binds and code, but I want to be able to pass the binds as an environment variable instead of as raw code.
4:23:02
pillton
Do macros related to your LET like operator retrieve something from the environment?
4:23:20
equwal
I was putting together a FORTH in elisp, and it makes sense to call it with something like (eforth ((forth-fn . elisp-fn) ...) forth-code). Once I wrote that I realized that I needed to be able to write (eforth *ENV* forth-code) for code reusability .
4:35:30
equwal
Well I need the expansion of the new eforth-wrapper to be (eforth *env* forth-code) -> (eforth-old <val of env> forth-code)
6:56:09
emaczen
what is the common sense interpretation for BNF {<var>}* ? are the braces and asterisk redundant here?
7:02:17
beach
I guess you have to figure out what variant is used in the document where you found that syntax.
7:03:22
emaczen
https://cs.wmich.edu/~gupta/teaching/cs4850/sumII06/The syntax of C in Backus-Naur form.htm -- can someone help me out here?