freenode/#lisp - IRC Chatlog
Search
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?
10:07:59
schjetne
May I ask a not-strictly Lisp question here, since you'd probably have to be a Lisper to understand what I'm talking about? If so, does anyone have any ideas how to get around the lack of restarts in non-CL exception systems?
10:10:27
schjetne
I'm doing the classic PCL log processing task, where I have files with lines that in turn has fields. If a field fails to parse I want to log an error, but I obviously want to log which file and line it is. So I have the choice between catching at the file level, and then losing every other line and field, or pass filename and line number to the field parsing routines, which means boilerplate and coupling
10:10:30
beach
schjetne: You should be able to implement a near-complete Common Lisp-style condition system in C.
10:10:51
heisig
schjetne: Depends on the language of your choice. C++ -> use Clasp, C -> use ECL, Java -> use ABCL :)
10:12:21
schjetne
I've made a typesafe DSL in Kotlin, which is nice for non-programmers (or programmers not heavily invested in the codebase) since they can get handy completion and typechecking. I suppose it's possible to consume the result of the DSL in ABCL
10:13:38
schjetne
One option is to pass a callback that is the restart to the line parser which in turn passes it to the field parser where the throwing happens
10:15:02
schjetne
But that sort of defeats the purpose of exceptions, when you have to do all kinds of in-band signalling, you're not far from manual error checking like old-fashioned C, or the pure functional languages.
10:16:33
schjetne
So ABCL is an option (but I'm not sure I want to deal with a lot of foreign function calling)
10:17:27
ogamita
schjetne: Ken Pitman has a metalinguistic implementation of the CL condition system including restarts; it could be ported to any language… (theorically).
10:18:30
schjetne
Another option could be to pass the responsibility on the error logging system to know in which file and line the problem happened (and ideally which line in the DSL files too, I wonder if that could be somehow extracted)
10:19:28
schjetne
But that probably means still passing something as explicit parameters, Kotlin lacking dynamic scope.
10:20:21
splittist
If the logger wraps the parser and provides the stream(s) to the parser, then it can track stream progress, perhaps.
10:25:58
schjetne
Maybe I can throw a list of all the exceptions thrown when passing the fields, and then throw a list of all the exceptions thown when parsing the lines, and catch all of them in order at the file level.
10:26:09
no-defun-allowed
David Schmidt was selling a macivory machine with 4 megawords which is about 16 to 20MB of memory if you wanted something modern-ish and not embedded.
10:26:17
v0|d
beach: i tried to compile small ECL binaries back in the day yet faild to run on routers
10:27:16
schjetne
Java exceptions have a notion of a cause, which can be another exception. In this case there would be multiple causes. There would be no way to control the restart behaviour, but it should do the trick.
10:52:30
jackdaniel
v0|d: you may be interested in fact that green threads (coroutines) and delimited continuations will be in next ECL release
10:54:02
jackdaniel
but yes, it will be possible to use both at the same time (i.e a few native threads on which multiple green threads run)
10:56:51
loke`
jackdaniel: That's very intyeresting. What does the API look like? Similar to Scheme?
11:03:11
jackdaniel
loke`: http://hellsgate.pl/files/6d156f6b-user.pdf (navigate to multithread) - this is old ecl documentation from before introduction of native threads (coroutines evaporated in a meantime)
11:04:03
jmercouris
I'm trying to completely eliminate cffi from my application, and if I can't find a suitable replacement for a sqlite wrapper, then I'll have to implement my own pseudo database with files in Lisp :D
11:05:06
Odin-
jmercouris: So, you're basically asking if someone has reimplemented SQLite in Common Lisp?
11:07:10
jackdaniel
if you refuse to use ffi you don't have many options left. you either need a database which you may access via some wire protocol and set up on the machine (i.e postgres), or you serialize/deserialize data
11:07:40
jmercouris
jackdaniel: what are the advantages of cl-store vs just printing and then reading the data structures from a file?
11:07:59
jackdaniel
as of sqlite: it is not a standard but rather sql database engine, so "cl library for sqlite" doesn't make much sense, "clone of sqlite" would be a better phrasing
11:08:08
jmercouris
e.g. let's say I have a list of alists, why not just print them to a file? why might I use cl-store in this case? not trying to argue, trying to understand
11:09:19
jackdaniel
cl-store may serialize for instance hashtables (you'd have to effectively reinvent serialization by yourself if you insist on printing objects to file)
11:09:56
jmercouris
so if I end up serializing things that aren't simple lists of strings or something, then it would be quite useful
11:09:57
jackdaniel
also serialization format may be (not necessarily is!) more compact and faster to read/write to disk / over the network
11:10:14
Odin-
Particularly because there's a bunch of types with no readable form mandated by the standard...
11:10:35
jmercouris
let's say you are developing a system, and you want it to depend on another system
11:10:52
jmercouris
that you are also developing, would you put those in the same repository, or different reposiitories?
11:11:46
Odin-
jmercouris: The thing about SQLite is that it's a full-featured relational database. It can do a _lot_ of neat tricks that aren't obvious if you're just thinking about storing values by key. :p
11:12:09
jackdaniel
as of question what I think you should do: I think you should access sqlite via ffi
11:13:24
jackdaniel
and regarding the second question: keep dependencies in the same repository and update them after testing they work (for builds), but also mainain a separate repository if you want to publish your library i.e on quicklisp
11:14:32
jackdaniel
it depends what you plan to do. if you are interested in providing final builds, then versioning all dependencies makes a lot of sense
11:15:05
jmercouris
Odin-: that's not my issue per se, for example, when I distribute a binary for macOS, I think some users are having issues because the image contains paths to locations of sqlite on my disk (because I installed via macports), things like that
11:16:36
jmercouris
ok, I will see how this part of the codebase evolves, and maybe I will break it out into a library depending on its usefulness/whether I decide to keep sqlite or not
11:17:13
jmercouris
I will look at what kind of data structures I plan on persisting/traversing and decide if it is simple enough to do in just lisp
11:17:26
jmercouris
maybe my needs aren't as great as something a powerful facutly like sqlite provides
11:17:43
Odin-
Hrm. I haven't really dealt with binary images much, but I'd presume there's a way to have the FFI object loading (which shouldn't depend on the exact location, but use system configuration) to happen when the image is loaded?
11:19:02
Odin-
jackdaniel: I'm just leaving space for the possible existence of completely insane implementations. :p
11:19:09
jmercouris
the issue with macOS, is that a user using brew, will not have things in standard locations
11:20:08
jmercouris
I have another question, where can I learn more about how struct comparison is done for a hash table with a :test of equalp?
11:21:00
elderK
Guys, is there a way to get ASDF to spit out an ordered list of files, like, that it loads for some system?
11:23:15
jackdaniel
another super-userful feature I'd love to see is: dump plan into a file which may be loaded without asdf involved to (say) compile the system
11:23:28
jmercouris
jackdaniel: so you are saying that a hash-table in CL will literally traverse a whole list and use equalp as a comparator to find an object?
11:24:35
jmercouris
if the above is true, it is erroneously called a hash table, and should be instead called a dictionary
11:25:50
jackdaniel
equalp was not initially planned to be an option for hash-tables, but a demand has been envisioned
12:07:27
elderK
Guys, are "structures that are literals", like, via make-load-form and stuff, guaranteed to be "coalesced"?
12:08:03
elderK
Are such literals even guaranteed to be like, "interned"? Or could they be reconstructed over and over and over and over.
12:09:13
ogamita
(list #S(point :x 2) #S(point :x 3)) #| --> (#S(point :x 2) #S(point :x 3)) |# mutable structures.
12:15:46
ogamita
elderK: IMO, by default structures are not similar one to the other. This section says that make-load-form defines a similarity between its argument and the object produced by its result, which is necessary for logical consistency. But it says nothing of the similarity between two different structures that happen to have the same slots.
12:16:32
ogamita
elderK: Therefore, AFAICS, CL will do no coalescing of the structures, but make-load-form could return a form that would internalize the structures it would create, and it could return several times the same one.
12:17:13
elderK
ogamita: Well, I use make-load-form already. But, like, you know, it expands to a form that recreates some instance, say.
12:17:28
ogamita
But notice what I said above: unquoted -> no expectation of coalesing or immutability. make-load-form couldn't known if the instance was quoted or not!
12:17:45
elderK
Or ,structure or whatever, I'd prefer it didn't keep calling (make-instance ...) every time that form was executed.
12:18:28
ogamita
So if you implement such a internalizing make-load-form, you should document it clearly that all your structure literals should be considered immutable, quoted or not.
12:22:03
elderK
There's a "top-level" function, read-from. It expects a symbol denoting the type to read, etc.
12:22:16
elderK
Then there are other functions, that don't do type checking and are internalish. They are specialized on type metaobject.
12:23:05
elderK
My macro expands into a call to read-from, rather than %read-from. Because, at that point in the expansion, there is no "visible" metaobject. The macro expander knows the metaobject (and that metaobject /will/ be avilable at runtime)
12:23:24
elderK
So I was thinking I could side-step that read-from, and use %read-from with a 'class literal', patched into the expansion
12:24:06
elderK
All the current way means is that there is some extra type-checking done, and a conversion from the "symbol" to teh "type metaobject"
12:24:26
elderK
(Which should be reasonably cheap: The metaobject is attached to the symbol's plist)
12:25:34
ogamita
jmercouris: putting everything in the same repository is easier to manage, and to keep the versions in sync.
12:27:04
jmercouris
ogamita: that was the idea I had in mind, I was just wondering if it was considered a sin or anything like that
12:35:55
Odin-
(Says the man with documentary evidence Google paid a lawyer to get a seal lifted on a warrant for his data.)
12:38:01
elderK
Guys, is it bad taste to like, generate the exports for a "superpackage" dynamically?
12:38:15
ogamita
what is the result of: (format nil "~8,'0X" (reduce (lambda (n b) (+ (* 256 n) b)) '(1 2 3 4) :initial-value 0))
12:38:15
ogamita
what is the result of: (format nil "~8,'0X" (reduce (lambda (n b) (+ (* 256 n) b)) '(1 2 3 4) :initial-value 0 :from-end t))
12:39:43
ogamita
(defparameter *packlist* '("CL" "FOO" "BAR")) (defpackage "SP" (:use . #.*packlist*) (:export . #.(let (n) (dolist (pack *packlist*) (do-external-symbols (s pack) (push (symbol-name s) n))) n)))
12:48:47
ogamita
Yep. With :from-end t you need to swap the parameters of the function. Ie. the accumulated value changes place.