<zacque>
From CLHS "case keyform {normal-clause}* [otherwise-clause] => result*", is there a reason for writing "{normal-clause}*" instead of "normal-clause*"?
<zacque>
In the ANSI CL standard, its syntax is "case keyform {↓normal-clause}* [↓otherwise-clause] -> {result}*"
acebulf has joined #commonlisp
<zacque>
Hmmm, my hypotheses is that {non-terminal} will introduce a list form? But that doesn't explain the syntax for "{result}*", which I think is to indicate that there may be multiple values returned
<zacque>
So, I find the use of "{}" to be inconsistent for a non-terminal group of one element only. And I'm asking whether it is indeed inconsistent or there is a special reason for such usage
waleee has quit [Ping timeout: 240 seconds]
waleee has joined #commonlisp
<Bike>
don't quote me on this, but my impression is that the clhs uses {} for grouping, because () would be confusing since lisp itself uses it all the time
<Bike>
so, "{normal-clause}*" and "normal-clause*" mean the same thing
<Bike>
you can see down in otherwise-clause where it has "({otherwise | t} form*)", where the () are literal, and the {} are not, and also don't indicate repetition (as in canonical EBNF) or the introduction of a list form
<Bike>
the use of "=> result*" and such is common, and a bit confusing since when you're talking about return values you're no longer dealing with syntax at all
<Bike>
the BNF syntax is described in more detail in 1.4.1.2, but it doesn't actually define what {} mean that i can tell
<Bike>
i have no idea what "{?normal-clause}*" is supposed to be
<zacque>
Bike: Thanks, I'm well aware of the section "1.4.1.2 Modified BNF Syntax", but it doesn't explain the BNF syntax that it uses. E.g. [] for optional, and {} for grouping.
<Bike>
oops, sorry. i haven't yet worked out how to get my terminal emulator to display unicode correctly.
mister_m has joined #commonlisp
<zacque>
> "{normal-clause}*" and "normal-clause*" mean the same thing <= Ya, that's what I assume to be true right now
<zacque>
Bike: Nope, it's fine
<zacque>
> the use of "=> result*" and such is common, and a bit confusing since ... <= I don't find it confusing, instead very helpful in understanding the form of the result return
yauhsien has joined #commonlisp
<Bike>
well, sure, i just mean it
<Bike>
's confusing in kind of a formal sense
<beach>
Good morning everyone!
razetime has joined #commonlisp
<razetime>
is there a way to run a commonlisp package?
<White_Flame>
packages are just namespaces. you just run functions
<razetime>
so what's the general method of bulding a large runnable application?
yewscion has quit [Ping timeout: 276 seconds]
unixlisp has joined #commonlisp
<beach>
razetime: An application is typically distributed with an ASDF system definition used to build it.
<beach>
razetime: You then do (asdf:load-system <name-of-system>) to build it.
<razetime>
i see. so package creation is not necessarily linked with this
<White_Flame>
lisp is an interactive systems. various things you load into the image have their own entry points you call
<beach>
razetime: An application will typically create one or more packages as part of the build process.
<White_Flame>
or various tools you can use & invoke
<zacque>
Rather than asking whether your way is good or not
<beach>
razetime: That's not a package. It's a system.
<razetime>
ok, the april system
<White_Flame>
write a repl?
<zacque>
A system is a collection of packages
<razetime>
White_Flame: april is an apl distribution
<White_Flame>
oh, you mean just do your read-eval straight into april instead of the lisp form
<razetime>
yes, exactly
<White_Flame>
should just be a 1-2 liner
<razetime>
it's meant to be more complicated than that
<White_Flame>
(but I'm not an expert on what other nuances it might need, so season to taste :) )
<razetime>
it seems like a single script will do
<zacque>
You may start with a script, then organise your application into a system as it grows
<contrapunctus>
I'm trying to write a CRDT library and am having trouble with how to structure it in terms of CLOS. There are different CRDTs, e.g. registers, sequences, maps. Operations for each depend on the type, as well as the implementation strategy for the instance (state-based vs op-based), and also handling of concurrent operations (several ways for each CRDT, depending on the type).
<contrapunctus>
I tried defining implementation type and concurrency handling as slots whose values are keywords + using EQL specializers, but that makes method calls ungainly...
<contrapunctus>
I thought of defining a `crdt:abstract-register` class which is subclassed by a `cmrdt:register` / `cvrdt:register` (state-based vs op-based) ...but that still leaves the matter of how to specify and dispatch on concurrency semantics.
sjl has quit [Quit: WeeChat 2.8]
<contrapunctus>
Thoughts, ideas?
semz_ is now known as semz
tyson2 has quit [Read error: Connection reset by peer]
unixlisp has quit [Ping timeout: 252 seconds]
razetime has quit [Ping timeout: 240 seconds]
yauhsien has quit [Ping timeout: 240 seconds]
razetime has joined #commonlisp
yauhsien has joined #commonlisp
yauhsien has quit [Ping timeout: 256 seconds]
<contrapunctus>
I could follow that up with different classes for each concurrency behaviour - so `crdt:abstract-register` is subclassed by `cmrdt:register` / `cvrdt:register` is subclassed by `multi-value-register` , `last-writer-wins-register` (for both packages, `cmrdt` and `cvrdt` !!) ...but that would lead to a large-ish number of classes.
slowButPresent has quit [Quit: leaving]
acebulf has quit [Quit: Leaving]
<beach>
contrapunctus: Maybe this is not relevant, but we (in the SICL project) have started writing libraries that take a CLIENT parameter. In our case, the library itself does not specialize to this parameter, but client code supplies a standard object, and can write methods on specified generic functions that do specialize to it. Maybe concurrency semantics could be done with such a CLIENT parameter?
<beach>
This idea works well if there is a lot of common and default code, but the "leaf" routines are likely to require some adaptation by client code.
<contrapunctus>
Hm...that might work. Thanks.
<beach>
Sure. You can look at Eclector as an example. The documentation is quite good (and not created from docstrings).
<beach>
Or Trucler or Clostrum for something simpler.
Bike has quit [Quit: Connection closed]
rotateq has quit [Ping timeout: 240 seconds]
<zacque>
Just found out that there is a "it" variable in the LOOP grammar, does anyone have an example of how to make use of it?
<zacque>
Couldn't find any description about it in the spec
<contrapunctus>
zacque: I think it's for using the result of the predicate for either WHILE or WHEN/UNLESS
<contrapunctus>
(can't remember which)
Inline__ has quit [Quit: Leaving]
<zacque>
Oh, both WHEN and UNLESS, not WHILE
<zacque>
Code: (loop for x below 20 when x collect it) and (loop repeat 20 unless nil collect it)
<beach>
zacque: It is the same use as in anaphoric macros. I never use it, because if you follow the rules of page 13 of the LUV slides, it will always be T or NIL.
<zacque>
For UNLESS, yes, it'll always be NIL
<beach>
And for WHEN it will always be T.
<zacque>
For WHEN, not necessarily always T
<zacque>
Huh? Why always T?
<beach>
Yes it will, if you follow the rules of page 13 of the LUV slides.
<zacque>
Try this out: (loop for x below 20 when x collect it)
<zacque>
Can I know what is the LUV slides?
<beach>
You are not following the rules of page 13 of the LUV slides here.
<beach>
Norvig and Pitman on Common Lisp style, Lisp User V<something>
<beach>
zacque: For this case, it basically says that it is expected that WHEN and UNLESS be given pure Boolean values.
<zacque>
Hmm, why is that so? CL only checks for nil and non-nil for test predicate
<ck_>
but the human reader might not
<beach>
It is not about semantics. It is about communication with the maintainer.
yauhsien has quit [Remote host closed the connection]
<beach>
zacque: If all semantically valid phrases were idiomatic, then we would have a total mess in most Common Lisp programs.
yauhsien has joined #commonlisp
<beach>
The set of idiomatic phrases in any language (natural or programming) is a tiny subset of the grammatical phrases.
<zacque>
I see, but if so, the "IT" variable is not that useful anymore
<beach>
Correct.
<beach>
And, as I said, I never use it.
<zacque>
Not that I want to use it, but it's the first time I acknowledge its existence
<zacque>
That's why I'm questioning its reason for existence
<zacque>
I see
aartaka has joined #commonlisp
<beach>
The LOOP macro was probably not designed by the same people who suggested the rule in question. Just like Graham when he wrote about anaphoric macros.
yauhsien has quit [Ping timeout: 240 seconds]
Inline has joined #commonlisp
<zacque>
Makes sense
<zacque>
I'm not familiar with anophoric macros, will read about it afterwards
frgo has quit [Ping timeout: 240 seconds]
<zacque>
Also, I don't think LUV slides is helpful in this case, but I get your point across
triffid has quit [Remote host closed the connection]
Inline has quit [Remote host closed the connection]
triffid has joined #commonlisp
Inline has joined #commonlisp
<zacque>
Nvm, I got confused, I'd expect its syntax to be "function-name ::= reader-function-name | writer-function-name", where "reader-function-name ::= symbol" and "writer-function-name ::= (setf symbol)"
<jackdaniel>
while luv slides are very insightful and are a good start for writing clean code, I think that the language "idioms" evolved slightly from the time these slides were written
<jackdaniel>
i.e Norvig is known for an excellent writing style, but if you read paip you'll notice plenty of places where lists and structures are used (instead of, i.e, standard classes)
yauhsien has joined #commonlisp
<rotateq>
zacque: For DEFCLASS you mean?
yauhsien has quit [Ping timeout: 250 seconds]
yauhsien has joined #commonlisp
pillton has quit [Quit: ERC 5.4 (IRC client for GNU Emacs 28.1)]
<zacque>
jackdaniel: Will keep that in mind
<zacque>
rotateq: Yes
yauhsien has quit [Ping timeout: 240 seconds]
<zacque>
The formal syntax of DEFCLASS
<rotateq>
zacque: Those are slot options, you give `:writer foo` and it specializes a method (SETF FOO) to the type which is called when you call (setf (foo object) ...).
yauhsien has joined #commonlisp
<zacque>
Are you sure that works? I've tried but it doesn't work that way
<jackdaniel>
if you just want to look up some symbol, type it in l1sp.org
<jackdaniel>
minion: tell razetime about pcl
<minion>
razetime: 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).
<beach>
jackdaniel: I was remarking on "writing in modern SBCL".
<jackdaniel>
I see
<rotateq>
razetime: And you can download the HyperSpec.
<beach>
razetime: Unless you have very specific needs, you don't write Common Lisp code for a particular implementation.
<jackdaniel>
and conslusion: " In a sense, memoization is the most powerful of all parallel programming techniques, because one processor simulates the execution of many processes with a single execution!"
rgherdt has joined #commonlisp
<rotateq>
jackdaniel: Indeed it can be powerful. :)
unixlisp has joined #commonlisp
igemnace has quit [Quit: WeeChat 3.5]
<jackdaniel>
(defun random () 5)
igemnace has joined #commonlisp
<rotateq>
I wrote a random-if macro some time ago for fun.
<jackdaniel>
did you see the library screamer?
Inline has quit [Quit: Leaving]
razetime has quit [Ping timeout: 246 seconds]
razetime has joined #commonlisp
<jackdaniel>
is it me or github managed to break most of links on websites hosted by it?
yauhsien has quit [Remote host closed the connection]
<razetime>
I'm trying to loop as long as a variable is true: is `(loop while (identity var)` correct?
yauhsien has joined #commonlisp
<jackdaniel>
no, you are missing one closing paren :)
<beach>
razetime: (loop while var ...) is fine.
<razetime>
oh, that will work?
<razetime>
neat.
<jackdaniel>
if you check for generalized boolean, then (loop while var …) is seen often enough in contemporary code that it could be considered an idiom, but if you stick to being explicit, then (loop while (not (null var)) …), or if you check whether it is T, then (loop while (eq var t) …)
<beach>
Why wouldn't it?
<beach>
jackdaniel: Er, that would be (loop until (null var) ... ) then.
<jackdaniel>
I thought that (loop while (not (null var)) …) would work ,)
<beach>
razetime: There are very few situations where Common Lisp limits the kind of forms you can put in a context of evaluation.
<jackdaniel>
jokes aside, sure, if you want to b e explicit then 'until'
<jackdaniel>
s/b e/be/
yauhsien has quit [Ping timeout: 240 seconds]
<beach>
razetime: What languages have you used in the past?
<razetime>
Thanks, I am quite new to this. I hope you don't mind my questions.
random-nick has joined #commonlisp
<beach>
razetime: Well, #clschool is the dedicated channels for truly elementary questions, although they are tolerated here to some extent.
<razetime>
I primarily use Ruby, JS and APL-like languages.
<beach>
s/s//
yauhsien has joined #commonlisp
<razetime>
I'll ask around there, then.
pve has joined #commonlisp
dlowe has quit [Ping timeout: 248 seconds]
analogsalad has joined #commonlisp
treflip has joined #commonlisp
dlowe has joined #commonlisp
attila_lendvai has quit [Ping timeout: 246 seconds]
igemnace has quit [Quit: WeeChat 3.5]
Inline has joined #commonlisp
lisp123 has joined #commonlisp
euandreh has quit [Ping timeout: 248 seconds]
yauhsien has quit [Remote host closed the connection]
yauhsien has joined #commonlisp
yauhsien has quit [Ping timeout: 240 seconds]
unixlisp has quit [Quit: Client closed]
Lord_of_Life has quit [Ping timeout: 252 seconds]
Lord_of_Life has joined #commonlisp
treflip has quit [Remote host closed the connection]
treflip has joined #commonlisp
Algernon69 has joined #commonlisp
igemnace has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
yauhsien has joined #commonlisp
Devon has joined #commonlisp
Inline has quit [Quit: Leaving]
yauhsien has quit [Remote host closed the connection]
Algernon69 has quit [Read error: No route to host]
yauhsien has joined #commonlisp
Inline has joined #commonlisp
Algernon69 has joined #commonlisp
yauhsien has quit [Ping timeout: 256 seconds]
lisp123 has joined #commonlisp
rgherdt has quit [Remote host closed the connection]
rgherdt has joined #commonlisp
Inline has quit [Quit: Leaving]
dlowe has quit [Remote host closed the connection]
aartaka has joined #commonlisp
Inline has joined #commonlisp
zacque has joined #commonlisp
beach` has joined #commonlisp
beach has quit [Ping timeout: 260 seconds]
beach` is now known as beach
tyson2 has joined #commonlisp
triffid has quit [Quit: triffid]
<zacque>
Hi, the use of symbols in CL seems to be a very powerful and flexible concept. But I still don't quite get it
<zacque>
Are there reading materials that explore into such a concept, e.g. using symbols in CL vs using name in other languages?
slowButPresent has joined #commonlisp
<lisp123>
not that i'm aware of
<zacque>
Not sure how to put it into words, using symbols/bindings create an indirection between the name and the objects that it denote
<zacque>
But it definitely feels different from using the names in other programming languages
<zacque>
lisp123: Ah, okay
<beach>
zacque: Sure, symbols are first-class objects in Common Lisp. Not in most other languages.
<beach>
... so you can use symbols to create your own namespace by mapping symbols to whatever objects you want to name. Say in a hash table.
<jmes>
Is there a way to use CLOS's :type keyword to specify a slot type but also accept nil? The catch is that I can't use :type (or my-type boolean) because then when the slot is t it would cause trouble in my case.
<_death>
you can check out a book called "Lisp" by Winston & Horn.. especially the first edition (which was written before CL existed) made heavy use of symbols
<_death>
jmes: (or null your-type) ?
<jackdaniel>
in old code you may find more uses of indirection with symbols, operators SET and GET are a testimony to that. I don't think that I saw newer programs that utilise this capability
ec has quit [Remote host closed the connection]
ec has joined #commonlisp
<jackdaniel>
i.e say that the value of FOO is BAR, then (set foo 42) will set the value of BAR to 42
<zacque>
I'm thinking about how the design of symbols in CL helps with programming in the large. It occurs to me that maybe symbol can be treated as an interface---in the sense that with symbol, I'm not tied to a single object, and that I'm always free to redefine it to stand for something else. So, very like programming to an interface
<zacque>
s/very like/very much like
<beach>
zacque: That doesn't sound like a feature of symbols, but of the overall semantics of Common Lisp.
<beach>
zacque: I call Common Lisp a "dynamic" (nothing to do with types) or "interactive" language by which I mean that the semantics are described as a sequence of interactions starting with an initial startup image.
<zacque>
Huh? Hmmm, doesn't the "overall semantics of Common Lisp" describes the feature of symbols? So they are the same thing?
<beach>
I don't think so. What makes you say that?
<zacque>
Erm, I assume that to be true from my limited knowledge because I can't tell the difference between "overall semantics of Common Lisp" and "feature of symbols"
<beach>
OK, here is an example. (defun f (x) (+ x 2)) then (f 234) then (defun f (x) (+ x 3)) then (f 234).
<beach>
The semantics of Common Lisp make it possible to do that, and the result is well defined.
<beach>
You can't do that in most languages.
<beach>
But there are not many symbols involved here. There are the names of the function and the variable, but a language without first-class symbols could do the same thing.
<beach>
In other words, the example does not show the use of symbols as first-class objects, but the language defines the behavior in such terms of course.
<zacque>
Ya, there must something special about first-class symbols, but I couldn't pinpoint it
<zacque>
Oh, I see
<jmes>
_death: that did the trick, TIL aboul the null type...
<zacque>
Is first-class symbol good for symbolic programming? I don't know anything about symbolic programming though
<beach>
zacque: Like I said, you can use symbols to create your own namespace. Since that is so easy, the Common Lisp language itself does that for things like functions, method combinations, classes, etc.
<beach>
zacque: Yes, if you want to be able to manipulate the elements of your programming language programmatically, symbols are very good to have.
<beach>
zacque: Like if you want to simplify an expression such as (+ x 0) or (* x 1), you need to represent x somehow, and Common Lisp can do that with symbols.
Bike has joined #commonlisp
<_death>
jmes: even without the null type, you could use, say, (or (eql nil) your-type)
szkl has joined #commonlisp
<pjb>
zacque: just try to write in C a function to generate a simple C function, such as, say, int f(int x){ return x; }
<pjb>
zacque: writing that in lisp, for lisp: (defun generate-simple-fun (fname) (list 'defun fname '(x) 'x)) (generate-simple-fun 'f) #| --> (defun f (x) x) |#
varjag has quit [Ping timeout: 240 seconds]
<jmes>
_death: ah, that's great because I was just trying to figure out how to solve a problem which this solves!
Algernon69 has quit [Read error: No route to host]
<pjb>
zacque: in lisp you can observe that it was trivial to give a name to the function at run-time (passing the symbol F to generate-simple-fun, and it was trivial for this function to add other symbols to the generated code, (eg. DEFUN, or X).
ardon has joined #commonlisp
Algernon69 has joined #commonlisp
<pjb>
zacque: the reason is because SYMBOL is the data type used for "identifiers" both in the compiler and at run-time, so there's an easy exchange between both.
<_death>
jmes: finally, you can have a full-blown predicate function determine whether an object is a particular type or not.. say (satisfies oddp) .. of course, it doesn't give much information to the compiler at that point
lisp123 has quit [Quit: Leaving...]
<pjb>
zacque: now, in C, there's an identifier type in the compiler. But you don't have access to it. So in your code generator function, you will have to create a new type for it. And for the syntactic tree, and you will have to generate the text, and run the compiler on it, and use the dynamic loader to load the compiled function and call it, using dlsym, yet another type for symbols in shared libraries…
<zacque>
beach: Hmmm, if I can use symbols to create my own namespace, it means that I can have the set of symbols to map over the set of objects, let's say of type A. So, in the namespace, a name "foo" will always denote some object of type A, and not other object of type B, C, and D. Am I right
<beach>
Yes.
<zacque>
pjb: Ah, thanks, I'm digesting it right now
igemnace has quit [Quit: WeeChat 3.5]
<beach>
zacque: As in (setf (gethash 'bill *friends*) (make-instance 'friend ...))
<beach>
Now you have a namespace of friends.
<zacque>
pjb: I see! Because in C, the identifiers in source code are simply strings! From the C compiler POV, a source code is simply a long string, whereas in Lisp, a source code is a list of symbols!
<beach>
More generally, it's an S-expression, with a recursive definition.
<beach>
An S-expression is either an atom or a list of S-expressions.
<pjb>
zacque: well, strings are only used as a format for exchange between run-time and compiler in C. But in the C compiler, and in the linkers, there are actually data structures to represent identifiers and symbols. And in the C code you would write to generate C code, you would also implement your own data structure to represent identifiers and instructions and expressions. All would be duplicated.
<_death>
that's wrong.. both a C implementation and a Lisp implementation accept strings.. in a Lisp implementation, the process is divided in a user-visible way where the string is treated by a Reader.. in a C implementation, there usually exists a frontend that takes the string and creates an intermediate representation (often a Lisp implementation will create other intermediate representations as well)
<_death>
the frontend may have a Scanner component, that takes a string and returns a list of tokens (some of which are symbolic), and a Parser component (which takes this list and returns a corresponding tree representation)
schjetne has quit [Ping timeout: 260 seconds]
srhm has quit [Remote host closed the connection]
chiheisen has quit [Read error: Connection reset by peer]
axvr has quit [Remote host closed the connection]
Schnouki has quit [Remote host closed the connection]
mcoll has quit [Remote host closed the connection]
sm2n has quit [Remote host closed the connection]
theothornhill has quit [Remote host closed the connection]
whereiseveryone has quit [Remote host closed the connection]
payphone has quit [Write error: Connection reset by peer]
brown121407 has quit [Remote host closed the connection]
sirufer has quit [Remote host closed the connection]
ggb has quit [Remote host closed the connection]
\f has quit [Remote host closed the connection]
jasom has quit [Remote host closed the connection]
nytpu has quit [Remote host closed the connection]
ggb has joined #commonlisp
Schnouki has joined #commonlisp
sirufer has joined #commonlisp
jasom has joined #commonlisp
whereiseveryone has joined #commonlisp
chiheisen has joined #commonlisp
payphone has joined #commonlisp
nytpu has joined #commonlisp
sm2n has joined #commonlisp
theothornhill has joined #commonlisp
axvr has joined #commonlisp
mcoll has joined #commonlisp
brown121407 has joined #commonlisp
\f has joined #commonlisp
srhm has joined #commonlisp
<_death>
often it's useful to talk about intermediate representation, because many problems can be treated as compilation-like problems.. since Lisp already gives you a useful IR structure to query and manipulate, and since C does not, the latter often give way to the Greenspun principle
<zacque>
It clicks for me when pjb says "SYMBOL is the data type used for 'identifiers'", I realise that SYMBOL is the data type for object identity
<zacque>
Thus a symbol can be used to denote any object or any class of object
Sankalp has quit [Ping timeout: 256 seconds]
<guest74>
anybody know of a library that will break a string down into subject/verb/indirect object, etc...
<guest74>
s/string/sentence/
euandreh has joined #commonlisp
<beach>
Guest74: In most languages, that can't be done in a unique way.
<guest74>
just english for now.
<beach>
In English, that can't be done in a unique way.
<guest74>
for simple sentences?
xaotuk has joined #commonlisp
<treflip>
Guest74: it's a serious (but nowadays routine) task in Natural Language processing
<beach>
"time flies like an arrow"
<_death>
I've not used it, but check out cl-nlp
<pjb>
gpt3?
Sankalp has joined #commonlisp
<guest74>
thanks _death:
<guest74>
i'm writing a text interface that accepts simple sentences. I haven't put much thought into how to parse what a user feeds it into the format needed.
ec has quit [Remote host closed the connection]
<treflip>
Guest74: I ended up using spacy [https://spacy.io/] through py4cl for that
ec has joined #commonlisp
<treflip>
Guest74: but if your text interface is simple and falls to the category of "controlled natural language", you could try Attempto Controlled English
<_death>
if the grammar is constrained, the problem becomes much easier
<guest74>
treflip: trying to keep everything all lisp.
rotateq has quit [Remote host closed the connection]
<guest74>
the types of sentences are restricted. I think for simple interactions all that is needed is an subject verb object preposition adverb/jective/something-else.
<guest74>
this is for interacting/creating generative interactive fiction.
<_death>
many lisp texts show approaches to parse and interpret constrained languages.. the Winston/Horn book I already mentioned, as well as On Lisp, use augmented transition networks.. PAIP also has a few chapters
<guest74>
This is something I'd prefer to have wrapped up in a bow, like, for once. I'm perfectly fine interacting with it through methods in the meantime.
<treflip>
Guest74: Another good book about natual language processing is "Natural Language Understanding" by James Allen.
aartaka has quit [Ping timeout: 276 seconds]
<guest74>
Thanks, all this encouragement to feed my NIH. ;)
<guest74>
anyways, anybody have thoughts on what should be in a text game engine?
<_death>
do you mean a text adventure game?
<guest74>
sure. all things text.
<treflip>
Guest74: There must be some interpreter for interactive fiction in cl, unfortunately I don't remember its name.
<treflip>
Maybe it could serve you as an example
<_death>
I remember an interesting program by J. Amsterdam (the guy behind ITERATE) called AAL (Adventure Authoring Language)
<Demosthenex>
i used to love MUDs.
rgherdt has quit [Ping timeout: 276 seconds]
<Demosthenex>
met my wife on one.
<guest74>
nice
<treflip>
There is also a Z-machine interpreter with a CLIM GUI.
<Demosthenex>
IgorMUD was a fun placee.
<guest74>
I don't need one, I'm mostly done writing one.
<guest74>
it's terribly simple. except for breaking down sentences into their parts.
<Demosthenex>
well, the idea of implementing a MUD in LISP is brilliant. LPC (from lpmud) was always hacky
<guest74>
anyways, I could cheat in processing and define only certain verbs with strict restrictions on what follows them.
zacque has quit [Quit: Goodbye :D]
waleee has joined #commonlisp
<guest74>
ok, i see the AAL guy just cheats and restricts how people say things.
<semz>
I doubt you'll get around that entirely
<guest74>
Shinmera: I'm going more for open world, generative quests etc. Dialogues are composed of a persons usual mannerisms and their specific need at the time.
yauhsien has joined #commonlisp
<Demosthenex>
i recall in LPC each room and each object in your player had a command hook to add new verbs.
<Demosthenex>
s/in your player/in your player's inventory/
<guest74>
semz: what I have is a generic function (action subject verb object preposition &optional something-cant-quite-name) which is what a parsed sentence should be funneled to, deleting all the unnecessary stuff, but able to deal with things like 'hit troll with axe".
<Demosthenex>
Guest74: are you giving the user the lisp repl (ie: reader macros) or are you reading an input stream to parse?
yauhsien has quit [Ping timeout: 246 seconds]
<Demosthenex>
i can't help with reader macros, and it'd make multiplayer hard. but if you do input stream, i'd do something like break the line by spaces and tokenize the first word, and then have a dispatch table passing the remaining arguments
<guest74>
reading to a string as some cheap form of security. I would like to provide access to the repl eventually. I envision a 'game' that teaches you lisp.
<Demosthenex>
maybe then reader macros on the repl is the way to go.
<guest74>
I mean, that's what I have. It's ugly. and doesn't deal properly with indirect objects, or any object that can have more than one placement in the generic.
<Demosthenex>
i think you're going to have to parse and process the string anyway. because your user will be typing text that is context sensitive to the game content
<Demosthenex>
ie: (hit (find-room-obj "troll") (search-inv "sword)) vs hit troll with sword
<Demosthenex>
"hit" == verb requires target of type entity in current room and optional "with" item from inventory
<Demosthenex>
i'm not sure how you could do that with reader macros and generic functions.
<guest74>
that's taken care of, the current place is marked and the objects inside it are marked as present (and locations).
<Demosthenex>
yes, i'm just saying specifying a target noun will have context that the user isn't expected to type.
<Demosthenex>
"climb ladder": verb climb, target is a local item or descriptive room decoration. could be overriding an exit function
<Demosthenex>
vs "hit troll": verb hit, target is a entity near the player
<Demosthenex>
generic functions could say (defgeneric hit ((monster entity)) ...) but it doesn't provide target selection, only specifying that the input must be an entity
<Demosthenex>
your game engine has to provide the context to the input
<Demosthenex>
that's why i think you can't skip a parsing step, because that's your opportunity to add context before dispatching to a generic function
<guest74>
They just have to name what they want to hit properly :)
<guest74>
To add context that's why I want something to break a sentence down into its components.
<Demosthenex>
most of the MUD playig i did wasn't freeform english. it was strictly commands
<Demosthenex>
put sword 3 in backpack 2
<Demosthenex>
so you had to have a command parser
<guest74>
yes, but that would be terribly simple now wouldn't it?
<Demosthenex>
i guess it depends on how deep you want to go ;]
<Demosthenex>
yes, a command parser is simple
<Demosthenex>
get amulet from sock vs i hereby fetch this here amulet from the cloth tube containing my foot
<Demosthenex>
are you trying to take commands for a game, or are you doing an experiment in natural language processing? ;]
<guest74>
maybe a little of both.
<Demosthenex>
commands break down things, NLP deduces commands from freeform text
<guest74>
but no matter how flowery you make that sentence, the simple structure remains the same.
<Demosthenex>
yes, the structure is similar, but the variety of flowery inputs will confuse the issue
<Demosthenex>
that's why i asked about NLP, i haven't the foggiest there. :P
<Demosthenex>
and natural language is often not specific enough, which is part of the reason there are computer languages
<guest74>
There was some lisp library that did that, I just can't remember the name and there is nothing on cliki.
<_death>
if the amulet is on the floor, and you say "give the amulet to xyzzy", your system could be smart enough to plan and execute, with "pick up amulet" as a step.. then you could say "solve this game", and the game could be smart enough to give "you win!" in response
<Demosthenex>
_death: you win, have a free internets.
schjetne has quit [Ping timeout: 260 seconds]
schjetne has joined #commonlisp
<treflip>
there is an interesting but crypting software written in lisp that supposedly extracts objects and relations between them from natural language texts
<treflip>
it's called EPILOG
<_death>
that episodic logic thing
<treflip>
yes
frgo has joined #commonlisp
frgo has quit [Read error: Connection reset by peer]
<treflip>
I didn't study it in details, so I may be wrong about it's NLP capabilities.
frgo has joined #commonlisp
<treflip>
Anyway, it must be an overkill for a text-adventure :D
<_death>
I don't think it has much to do with nlp.. it implements a kind of description logic
<_death>
it perhaps be used in a texture adventure game, after translating the english sentences to it
<_death>
*could
rotateq has joined #commonlisp
<guest74>
TAGGER might be the library I was thinking of. Though I remember a tree diagram and marking parts with keywords, maybe there's something else.
<_death>
there was some old library that uses HMMs.. possibly tagger
<treflip>
Guest74: TAGGER is likely to do part of speech tagging.
<_death>
yeah.. xerox
rgherdt has joined #commonlisp
schjetne has quit [Ping timeout: 256 seconds]
rgherdt_ has joined #commonlisp
<guest74>
now to test if dropping everything the function doesn't need works as expected.
<guest74>
scratch that, first figure out how to get output in a sensible format from tagger.
schjetne has quit [Remote host closed the connection]
schjetne has joined #commonlisp
attila_lendvai has joined #commonlisp
Krystof has joined #commonlisp
tyson2 has joined #commonlisp
Bike has quit [Quit: Connection closed]
Bike has joined #commonlisp
treflip has quit [Remote host closed the connection]
ttree has quit [Ping timeout: 276 seconds]
schjetne has quit [Ping timeout: 240 seconds]
matt` has joined #commonlisp
Dynom has joined #commonlisp
matt` has quit [Remote host closed the connection]
Devon7 has joined #commonlisp
Devon has quit [Read error: Connection reset by peer]
jmes has quit [Ping timeout: 252 seconds]
<dirtcastle>
I'm trying to install sbcl from binary
<dirtcastle>
it's saying src/runtime/sbcl not found
<dirtcastle>
aborting installation
analog_salad has joined #commonlisp
cage has joined #commonlisp
analogsalad has quit [Ping timeout: 240 seconds]
azimut has joined #commonlisp
jmes has joined #commonlisp
King_julian has joined #commonlisp
analog_salad has quit [Quit: bye]
<Sankalp>
dirtcastle: which OS are you installing on?
Bike82 has joined #commonlisp
<dirtcastle>
artix linux.
Bike has quit [Killed (NickServ (GHOST command used by Bike82))]
Bike82 is now known as Bike
<dirtcastle>
i will use guix on top of it. is it easier with guix?
<dirtcastle>
I'm using stumpwm. the wiki said it's better to get it from the official site
<dirtcastle>
Sankalp:
<Sankalp>
I have no clue...
<dirtcastle>
lol.
<kaskal>
dirtcastle install it from guix and save yourself some pain
<dirtcastle>
oh ok. kaskal
<dirtcastle>
stumpwm is a window manager written in common lisp. Sankalp
<Sankalp>
I see, interesting..
treflip has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
matt` has joined #commonlisp
<contrapunctus>
Is there any way to have methods dispatch on the slot values of an object?
<Bike>
not without some serious mop hacking. easy workaround: have your function (foo object) call a generic function (%foo object (my-slot object)) and then %foo can dispatch on that.
<edgar-rft>
dirtcastle: I'm using Debian Linux and have never tried to intall a binary from the SBCL home page, so I'm sorry to tell that I have no idea what the particular problem is.
<edgar-rft>
Unfortunately I have no idea whether Artix Linux provides a SBCL package.
<edgar-rft>
On Debian Linux my usual strategy is first to install the Debian-provided SBCL package, download the newest SBCL soucre code from the homepage and then use Debian's SBCL to compile the newest SBCL from the source code. I never had problems with it.
<dirtcastle>
oh lol edgar-rft . idk maybe I should try that
<dirtcastle>
the package is there in repo
matt` has quit [Remote host closed the connection]
<dirtcastle>
it's just the stumpwm wiki didn't want me to use that
ardon has joined #commonlisp
rgherdt_ has quit [Quit: Leaving]
ardon has quit [Remote host closed the connection]
ardon has joined #commonlisp
ardon has quit [Remote host closed the connection]
ardon has joined #commonlisp
<edgar-rft>
dirtcastle: Packages from Linux Distributions often contain additional scripts or code for better interaction with the other packages of the Linux distro. A reason why stumpwm doesn't want us to use distro-provided packages might be that it's harder for the developers to track down errors if we use modified SBCL versions.
ns12 has quit [Quit: bye]
Devon77 has joined #commonlisp
ns12 has joined #commonlisp
Devon7 has quit [Read error: Connection reset by peer]
akoana has joined #commonlisp
morganw has joined #commonlisp
Devon77 is now known as Devon
orestarod has joined #commonlisp
ttree has joined #commonlisp
cage has quit [Read error: Connection reset by peer]
cage has joined #commonlisp
jmes has quit [Remote host closed the connection]
King_julian has quit [Ping timeout: 240 seconds]
King_julian has joined #commonlisp
ec has joined #commonlisp
matt` has joined #commonlisp
treflip has quit [Quit: zzz]
matt` has quit [Remote host closed the connection]
dra has joined #commonlisp
rgherdt has joined #commonlisp
King_julian has quit [Ping timeout: 240 seconds]
jeosol has joined #commonlisp
<shka>
contrapunctus: cl-conspack is nifty
frgo has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
pfd has joined #commonlisp
analogsalad has joined #commonlisp
Madsy has joined #commonlisp
guest74 has quit [Quit: Connection closed]
King_julian has joined #commonlisp
schjetne has joined #commonlisp
ccregor has quit [Ping timeout: 256 seconds]
<dirtcastle>
edgar-rft: TIL. thanks for your time.
tyson2 has joined #commonlisp
anticomputer has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
pve has quit [Quit: leaving]
morganw has quit [Remote host closed the connection]
King_julian has quit [Remote host closed the connection]
King_julian has joined #commonlisp
matt` has joined #commonlisp
<shka>
is there library like trivial-integers? you know, with just aliases for (unsigned-byte 32) and the likes
<shka>
?
<White_Flame>
write one and get it in quicklisp.
<shka>
i am contemplating doing so, but i somehow suspect that something should be already out
<shka>
essentially trying to mimic C types
cage has quit [Remote host closed the connection]
<semz>
is it really that hard to write (unsigned-byte 32)
<shka>
no
<White_Flame>
it's just annoying
<White_Flame>
and "byte" there is kinda weird
<shka>
but you can't do (defmethod write-type ((type (eql '(unsigned-byte 32)))
schjetne has quit [Ping timeout: 252 seconds]
<semz>
how would you reliably get your alias as an input?
rgherdt_ has joined #commonlisp
rgherdt has quit [Ping timeout: 240 seconds]
<shka>
i have lib, lib has data-frames, data-frames have columns, columns have types, if type is unsigned-byte-32 when i serialize to binary write the content of column as 32 bit unsigned big endian
<shka>
if no explicit serializer matches to a type, fallback to the cl-conspack
<shka>
simple as that
matt` has quit [Remote host closed the connection]
Dynom has quit [Quit: WeeChat 3.5]
istewart has joined #commonlisp
schjetne has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
<_death>
what about a subtype of (unsigned-byte 32)
<_death>
note that (unsigned-byte 8) is a subtype, as well as (eql 1234567)
<_death>
for some foo, even (satisfies foo) could be a subtype
matt` has joined #commonlisp
<_death>
so, if you mean that your column type is similar in semantics to a specialized array's element-type, that means you only care about a limited set of nominal types
<_death>
this set is defined by you, and is unlikely to appear in some trivial-integers library
<shka>
_death: well, that is actually not a bad idea!
<shka>
thanks
<shka>
_death: yeah, that work real good!
tyson2 has joined #commonlisp
<_death>
cool, though I didn't suggest an explicit mechanism.. what did you pick?
King_julian has quit [Ping timeout: 240 seconds]
ski has quit [Quit: Lost terminal]
matt` has quit [Remote host closed the connection]
<_death>
I see.. but there you have two different treatments.. one tests using subtypep and another using eql
<shka>
yup
rotateq has quit [Quit: ERC 5.4 (IRC client for GNU Emacs 28.1)]
<shka>
i think that this is fine honestly
analogsalad has quit [Quit: bye]
<shka>
it allows to extend by a programmer
<shka>
and those signed/unsigned-bytes are frankly the most common case
<shka>
i should fix floats
<shka>
otherwise it is ok imho
rgherdt_ is now known as rgherdt
szkl has quit [Quit: Connection closed for inactivity]
<_death>
sure, I was thinking (deftype f () 'single-float).. also note that unlike say (unsigned-byte 8) the single-float type has an implementation-dependent representation, but I guess it's not a disaster to assume ieee floats for single/double :)
pranavats has left #commonlisp [Error from remote client]
<shka>
yeah...
<_death>
I also see some (safety 0) there.. maybe reconsider ;)
<shka>
oh, pay no attention to those, i was profiling
<shka>
and absolutely don't look at the main project source code if you are scared of few safety 0 :D
<shka>
_death: one more think, i am using chipz/salza2 for compression, but it is not amazingly fast
<shka>
i am willing to accept this, but maybe you have some tips?
<_death>
I think there was another one, based on Franz code.. don't know about their performance.. I guess it's always possible to optimize them and submit PRs ;)
<shka>
heh, ok
<_death>
also, hmm, I did have some patch for salza2
<_death>
don't remember the context of me writing it, or know if it's significant
<shka>
well, i guess compression is for, you know, using less space
<shka>
and that box is checked
<_death>
new compression schemes come out all the time, many about speed.. but Lisp community is too small to keep up and reimplement in pure lisp ;)
<shka>
compression is difficult
<shka>
and translating heavily optimized algorithms from C to lisp can be a painful work
<_death>
often they use intrinsics as well, so could be a good test case for sb-simd
<_death>
but since it's algorithmic code, maybe translating from the plain C versions could be automated, somewhat
<_death>
maybe something similar to f2cl
karlosz has joined #commonlisp
dra has quit [Remote host closed the connection]
orestarod has quit [Ping timeout: 248 seconds]
random-nick has quit [Ping timeout: 240 seconds]
karlosz has quit [Quit: karlosz]
karlosz has joined #commonlisp
karlosz has quit [Remote host closed the connection]
schjetne has quit [Ping timeout: 248 seconds]
attila_lendvai_ has joined #commonlisp
attila_lendvai has quit [Read error: Connection reset by peer]
dre has joined #commonlisp
<jasom>
_death: I don't know about modern compression algorithms, but the C code for some older compression software I looked at was quite obfuscated from the algorithm. I suspect hand-tuning for pcc or early versions of gcc to generate fast code.
karlosz has joined #commonlisp
jmdaemon has joined #commonlisp
<iisi>
I only vaguely remember a compression battle between DiskDoubler and, uh, Stacker, maybe. The latter was a disk driver. Both, hand-optimised assembly.
<iisi>
The one that won ran entirely in the CPU L1 cache, I think.
* iisi
tries in vane to think of a way tie this back to Lisp, retreats into a darkened corner
<iisi>
vain, too. Also.
<_death>
by diskdoubler do you mean dblspace.sys?
<_death>
jasom: well, looking at say https://github.com/lz4/lz4 it's not a huge library and the code doesn't seem so obfuscated
shka has quit [Ping timeout: 252 seconds]
jmd_ has joined #commonlisp
jmdaemon has quit [Ping timeout: 252 seconds]
<iisi>
No, Disk Doubler is what I meant. 680x0, Mac-only.
schjetne has joined #commonlisp
<_death>
ah.. I remember stacker, 20mb -> 40mb illusion was pretty cool