freenode/#lisp - IRC Chatlog
Search
12:17:13
jeosol
stylewarning: I missed your comment, about CL being better. My comment yesterday was because I discovered a nasty date related bug in my large code base. It didn't take long to fix the change, just need to add :before defmethod
12:18:04
jeosol
regarding your comment being better. That's possible. I mostly focus on the (my) application side and try to do most things as I understand the language
12:20:16
jeosol
what is the best way to read the output log file (can get as large as 10MB) of a program that runs for several hours, typically 2 to 7 hours. I have to do this for multiple cases also.
12:21:40
jeosol
The reason I want to read the file, is that it emits several messages during the run, e.g., changes in the state of the program, current simulation time (infer % complete), and other info that may be useful to make dynamic changes for next run
12:23:03
jeosol
For an example of such a message, here is one (running tail -f file) => STEP 1011 TIME= 5607.00 DAYS ( +2.0 DAYS REPT 1 ITS) (9-MAY-2031)
12:24:39
jeosol
In this case and for this message, I would be picking up information about TIME (5607 days) and DATE (9-MAY-2031). I figure I'll use some time of regex but it would not be efficient to read the whole file each time (methinks)
14:03:27
jeosol
_death: The file grows each time. hmm. I guess I don't understand how the file stream will work in this case.
15:47:25
beach
I think I have a more complete specification of the SICL garbage collector(s): http://metamodular.com/garbage-collector.pdf
16:18:55
beach
caltelt: Speaking of JVM, I have read several papers on excellent compacting garbage collectors for Java, but then at the same time I hear that the default garbage collector is of type stop-the-world. I can't quite reconcile the two pieces of information.
16:26:00
caltelt
Depends on which version of Java we're talking about. I think the original GC for the JVM was stop-the-world, but latest versions use the ParallelGC.
16:27:53
caltelt
Nowadays, the three main GC's I know of that people use are Parallel, Concurrent Mark Sweep, and (the new shiny) G1 gc
17:18:43
p_l
Shenandoah (latest) doesn't stop the world unless required (too slow compaction rate while concurrent, critical lack of free memory)
17:20:30
p_l
beach: stop-the-world and compacting also aren't exclusive, but orthogonal (and usually compacting *force* stop the world unless you deal with multi-processor lispm or system where forwarding pointers were made through Software (Shenandoah, Azul)
17:26:46
makomo
i need some advice regarding a DSL within lisp i'm going to build. (as i've probably mentioned before) it will be used to define and simulate hardware. now, i would want most of the language to be statically typed, so that everything is chcked *before* the simulation is run
17:27:58
makomo
since the DSL is embedded within lisp, what would be the best way to do stuff like type checking? do i really want to walk the lispy AST and go from that, or should i use macros and expand into stuff that will assert the correctness of these DSL programs?
17:28:13
caltelt
Also of note, those GC's are only for the standard openjdk/hotspot JVM's. Other implementations such as IBM have their own GC's (and heap layouts)
17:29:16
stylewarning
makomo: If your DSL is statically typed, then you should, in your DSL, either declare the types, or do type inference. In any case, a type analysis would be good for safety.
17:29:57
stylewarning
makomo: when you translate your DSL into Lisp, you can declare all of the types within Lisp. You can even be especially good about data allocation so no GC happens.
17:31:37
makomo
stylewarning: hm, what do you mean when i "translate it into Lisp"? to me it already is Lisp :-D. do you mean something like "after the DSL stuff expands into code that will build the model of the simulation (using Lisp's data structures)"?
17:31:52
makomo
i.e., let the DSL expand into code that builds the model, and then check that model?
17:32:27
stylewarning
No, reverse order. You analyze the model for type safety and the like, then expand it into fully-typed, type-safe
17:33:14
makomo
stylewarning: how do i get to the model though without "codewalking" the thing myself?
17:34:12
makomo
stylewarning: what i have in my mind is: DSL (Lisp macros) -> expand into Lisp code that builds the model using CLOS and other stuff
17:34:32
makomo
i.e. defining a component will be translated into something like (make-instance 'component ...)
17:35:07
makomo
yes, stuff like (defcomponent <name> <pins> <list of options like wires, subcomponents, processes>)
17:36:58
Bike
how do types factor in here? something like "don't connected an output pin to another output pin" doesn't seem like it requires walking or any runtime checks
17:37:06
stylewarning
What does it mean to have a sub-component though? How does it interact with other components?
17:37:41
makomo
stylewarning: "addr" and "data" specify that internal wires that are named ADDR and DATA are connected to the two pins of the memory, and that's how they communicate
17:38:12
makomo
Bike: and also like being able to assign from pin A to pin B only if they're of the same width
17:38:39
makomo
yes, it shouldn't require any checks while the simulation is running, only while it is being "compiled"
17:39:09
makomo
but how/where should i implement these checks? within these DSL macros? as an after-step after the model is built (by the DSL macros)?
17:40:40
Bike
mm, i would say verify it once you've wired up all the intermediate structures you get from the macros
17:41:04
Bike
so that e.g. if you define two components you can redefine one without worrying about the other until you're actually ready to go, kind of thing
17:41:42
makomo
Bike: mhm, that seems to make more sense for me, since it's more modular that way. the checking of the model is done after it has been constructed
17:41:59
p_l
beach: your complaint reminds me of how annoyingly fragmented and "hidden" of sorts information about GC is :(
17:42:00
stylewarning
Also be sure to understand the difference between a component specification (which you can inspect in terms of wire widths, inputs, outputs, etc.) and actual components (which may or may not be CLOS instances at the end; they may be funky efficient compiled code, etc)
17:43:10
stylewarning
If you defclass a component, I actually suggest you defclass a component-specification. Then you use these specifications to build a model, then you compile that model.
17:43:30
beach
p_l: Yes, I see. The published techniques are pretty informative, but what a particular system does may not be very transparent.
17:44:17
makomo
stylewarning: for me, "model" are the component/process specifications. the "non-spec" classes are just particular instances of this specification/model that will be actually run
17:45:27
makomo
stylewarning: by "defclass a component" do you mean "define a component", i.e. define it using this DSL?
17:45:38
stylewarning
makomo: A class shouldn’t be the substrate in which you store specifications, and instances shouldn’t be implementations of those specifications, in my opinion
17:46:33
makomo
oh, that's what you mean -- like, i shouldn't represent a component's specification using a CLOS class, but rather a CLOS object (which is an instance of the SOMETHING-SPEC class)?
17:47:13
makomo
yup, that's what i currently have. i did think about representing the components' specs as actual CLOS classes though, but that would require MOP trickery and stuff
17:47:34
stylewarning
Whatever “machine” you’re building will require a graph or tree of these component spec instances, which you can walk and check regarding pins and whatever.
17:47:45
makomo
and i'm still not clear on the benefits i would get (except "neat" stuff like instances of these classes corresponding to instances of the specifications, the wires being just plain slots, etc.)
17:48:02
makomo
stylewarning: mhm, definitely. why would you avoid using CLOS classes like this though?
17:48:20
stylewarning
I think MOP should be used when one wants to introspect and reflect on CLOS itself.
17:49:17
makomo
stylewarning: hmm idk. i don't have that much experience with MOP, but this seemed like one of those "wow it fits really nicely as an idea here" kind of things
17:49:25
stylewarning
Using MOP here is, IMO, gratuitous shoehorning of a problem into a somewhat unnatural and overly expressive framework
17:49:32
makomo
i.e. the fact that a "class" from this object language corresponds to a class within my host language is pretty cool
17:51:01
skidd0
is there an easy way to get a member of a list (of structs) by a slot value (an id i've set)?
17:51:45
pjb
(find slot-value list-of-structs :key (function slot-accessor) :test (function some-other-equal-function))
17:52:01
skidd0
i could loop through all the elements in the list and stop when I find it, but i'm figuring there's a built-in or simpler answer
17:52:57
stylewarning
makomo: Having component-specs doesn’t stop you, by the way, from generating component classes when you compile your model. Maybe that’s the easiest way to prototype it at first
17:55:32
stylewarning
makomo: I wouldn’t even worry about the DSL bit at first. I’d start by defining classes and all that stuff without a macro just to nail down exactly what you want
17:56:14
makomo
stylewarning: yup, yup, that's how i've started. for now the DSL bit is completley imaginary
17:56:38
stylewarning
Top-down development of a DSL is only good if you’ve decided on what you’re doing pretty articulately. Otherwise it turns into spaghetti 🍝
17:56:45
makomo
as you said, first i want to build the whole simulator and related parts within lisp. macros are just a finish touch
17:57:35
makomo
stylewarning: and regarding code generation/compilation of these processes? the processes themselves are arbitrary code, and i'm thinking about how exactly this code should be generated
17:58:09
stylewarning
makomo: the processes may be arbitrary code but you should limit how data is input or output
17:58:52
makomo
the macros could expand into lambdas that would store this code, but if i want to add type checking and similar later on, i can't just create these lambdas right away
17:59:57
stylewarning
Component code just have “ports” (maybe lambda arguments if there’s no temporal aspect to this) for tx/rx of data
18:01:24
makomo
a component's process only has access to the wires internal to the process (including its pins). the fact that these wires are connected to other components is a separate thing
18:01:28
stylewarning
Maybe the code should even have explicit time parameters, so you can simulate what happens in any individual timestep. This again gets into exactly the type of thing you’d like to simulate.
18:03:22
makomo
stylewarning: mhm, but that's something that's out of scope for this software i think
18:03:45
makomo
at least if i understood you correctly (i'm thinking of stuff like transport and inertial delays that VHDL has)
18:05:08
makomo
stylewarning: however, one of the things i would like to do is to compile the code (to Lisp), rather than interpret it myself. what i'm not sure about is whether this code should be put into lambdas when the DSL macros are expanded, or should it be done "manually" by me, using COMPILE, etc.?
18:06:10
makomo
(also, this means that primitives like signal assignment, etc. would be either macros or functions that would call appropriate lisp functions and modify the instantiated model under the hood)
19:54:23
figurelisp
When i write 'this 'is 'madness in emacs slime repl why does it only returns last symbol as output? Why not all three?
19:57:33
Bike
i suppose sbcl doesn't clear the input buffer after every repl read like emacs does, or something.
20:01:29
Bike
there's not really a "correct" or "incorrect", it's just however the repl feels like working
20:15:07
edgar-rft
makomo: electrical circuits usually contain circular components (feedback paths), have you considered that in your hierarchical topology?
20:16:52
brontosaurusrex
Trying to follow this : https://mitpress.mit.edu/sites/default/files/sicp/full-text/book/book-Z-H-10.html#%_sec_1.1.2
20:21:43
brontosaurusrex
So there is a scheme dialect of lisp and there are various dialects of scheme ... ?
20:22:13
Bike
something like that. the distinction between "dialect" and "language" is almost as vague as it is in natural language.
20:22:40
Bike
i recommend asking what scheme to get for sicp in #scheme. i'm sure they have heard that exact question many times.
20:24:09
edgar-rft
brontosaurusrex, this is a COMMON LISP channel, ask in #scheme (because they kow it better than we)