freenode/#lisp - IRC Chatlog
Search
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)
23:30:54
Bike
with the gray streams extension, you can define methods on the stream-read-byte function.
0:35:19
Bike
because that's exactly what gray streams provides, and most implementations support the extension.
1:15:11
Bike
is "metamorphosis" the name of a library or are you referring to butterfly development or what
1:27:58
edgar-rft
one can perfectly morph in 1 dimension, so methamorphosis must not necessarily be complex
2:00:25
caltelt
Is there anything similar to clojure's edn for cl? A way to read in a safe subset of the language that can be used for data transfer, conf files, etc?
2:04:41
edgar-rft
there's read-line returning one line as a string plus a parser for safe tokens, to be written by *you*
2:34:19
Bike
that doesn't mean anything. it's not returning true because (getf emp1 :gender) will be the list (QUOTE MALE).