freenode/#lisp - IRC Chatlog
Search
16:56:30
loli
I've found with inferior-shell I really like making quick scripts in CL, though the loading of CL as a standalone script is always somehwat painful if you don't ros it up
16:56:42
loli
yeah that's nice, I'm guessing you have undefined functions just search the bash path?
17:04:22
loli
the last feature you'd need to have a nicely working lisp shell on unix, is the ability to smoothly run stuff like ncurses windows, which it seems emacs currently can't easily
17:05:58
Nilby
You have to run it outside emacs to do ncurses, or use the thing that links a real terminal library into emacs.
17:09:12
loli
I've found for scripting that sometimes I have very short bash scripts, due to how annoying SBCL treats libraries when in shell mode
17:11:37
loli
so I have to do weird loading, that is often more annoying to figure out than otherwise
17:11:51
shka_
Nilby: i don't know, i suspect that this is somehow related to the dexador using connection pool but i am to tired to debug this right now
17:50:58
jcowan
Call by identity is good because it matches with the guarantee of putting something into a slot or variable: what comes out is eql to what went in.
17:51:59
jcowan
extending "slots" to include the car and cdr of a pair, the elements of an array, etc.
17:53:44
Josh_2
anyone had an issue with emacs where it occasionally pops up saying '<keypress> is not a valid command' meaning I have to hit the key twice? Very annoying
18:00:43
jcowan
pbaille: ##lisp is suitable for discussing all Lisps: CL, Scheme, Picolisp, you name it. It's also about the only channel where comparisons between different Lisps fits in.
19:21:52
theseb
Compilers in general strip the original high level source to an intermediate representation before barfing out assembly. Well since Lisp is a stripped down syntax that might be used for this intermediate representation, isn't it (sort of) true that compilers basically roughly just convert high level source to a lisp like lang and then implement that lisp source in assembly?
19:23:12
gigamonkey
Insofar as s-exps are a good way to represent ASTs and most compilers generate ASTs and then go from there, yes.
19:26:07
theseb
gigamonkey: to run lisp you need an evaluator...so i presume when people say they "compiled a program"...the executable literally has to implement an evaluation engine in assembly EVERY time?
19:29:11
gigamonkey
But if you take EVAL out of the language it doesn't actually change much and then you can compile a Lisp program down to assembly with no more ability to evaluate arbitrary Lisp.
19:50:08
Odin-
theseb: Well, you can think of the underlying processor's instruction set as the evaluation engine.
19:53:32
phoe
it's sorta tangential to the meat of the issue - how to pass parameters, what's copied, how to assign stuff
20:24:38
Bike
i might also mention that the only way to detect copying is eq and that it's otherwise an implementation detail
20:30:22
phoe
I kinda feel compelled to, because C++ people are gonna ask "what is copied then, because I really want to mutate this number like I can do in C"
20:39:30
ordoflammae
phoe: it seems like, if you're going to program lisp, you shouldn't want to "mutate" a number location, since that kinda' goes against the whole ideal of functional programming.
20:40:28
ordoflammae
Bike: It seemed like phoe was talking about mutating what number a particular variable is referencing without using that variable (pointers, etc.)
20:40:54
ordoflammae
I mean, yeah, you can't actually mutate the actual number (whatever that might mean), but you can mutate a particular address location.
20:41:34
ordoflammae
But you really oughtn't be doing that with lisp, you're kind of running against the grain of the entire language.
20:43:15
nij
One thing about CLIM is that.. the interface it produces is not emacs, so all good bindings aren't usable there. Is there a way to make emacs more "CLIM-like"? If so, what kind of work should be done?
20:53:38
nij
Bike: is this an attempt to make an editor in which the experience is close to a lisp machine?
21:10:45
jcowan
gigamonkey: The Chez Scheme compiler works exactly thereseb described: each pass converts Scheme to simpler Scheme, until what's left is an S-expression representation of machine language. But every stage can be run using the Chez interpreter and produces the correct result. SO if a stage is bad, you can just leave it out until you fix it.
21:13:38
jackdaniel
most notably presentations - note that when in the repl you return an unreadable object, you still can inspect it
21:42:46
Bike
when typep (or whatever) sees a type specifier defined by deftype, it uses the macro-function deftype defines to expand into a new type specifier to work with
21:45:39
kagevf
engblom: you can use invert-face RET default to toggle between light and dark mode in emacs
21:46:22
loli
for example https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node51.html they give square-matrix
21:48:46
loli
Ideally I can test my list-of on certain types like I have a list of ints and I can typep it
21:49:12
Bike
if you're defining list-of in the obvious way as (deftype list-of (type) `(or null (cons ,type (list-of ,type)))), it won't terminate
21:51:23
Bike
SATISFIES works with a global function name, so you probably can't make that work, unfortunately
21:51:48
loli
so I have to generate every type I care about? How do arrays work with their type specification
21:52:13
phoe
and there's a whole thing about array specialization that conses don't need to care about
21:52:43
loli
what a shame, so I guess I'll make a macro definition that spits out order-1 types from a forall
21:57:32
loli
we can state it takes an integer and gives back an integer, does this not use the same satifies system, or is it baked in like the array?
21:58:20
loli
yeah... satisfies sadly only takes arguments with 1 argument, Maybe I can prop something together with dynamic variables to inject it?
21:59:23
loli
I tried this before: (deftype list-of (type) `(and list (satisfies ,(is-type-of type)))). Now let us try dynamic binding
22:06:55
loli
yeah I could see a gensym approach working if you specalized the type at every single application instance you found
22:16:39
gigamonkey
CL-ASHOK: I think Conrad Barski came up with the "Made with Secret Alien Technology" and the googly-eyed alien logo before he wrote Land of Lisp.
22:18:23
loli
for those curious about the solution I have. the specalizer looks something like this. https://ghostbin.lain.la/paste/jwg6j Note that the concatenate call is incorrect because I forgot the function to coerce a symbol into a string
22:19:19
Nilby
dieggsy: block until what? you could bt:join-thread on it's taskmaster thread if that's what you mean.
22:20:14
dieggsy
Nilby: until i kill the thread i suppose --- that is what i mean, i think. how do i get it's taskmaster thread ?
22:25:05
loli
this works across packages as well, no weird name kludging due to dynamic variables right?
22:26:17
loli
how nice, we can probably make it even slightly nicer by giving it a name so the error messages are nicer
22:26:44
loli
shouldn't it complain about a not global functions ince we are just accessing the lambda inside the gethash
22:27:34
saturn2
get-predicate calls compile to make it a global function if it does not already exist
22:30:11
loli
one last question, how do you use typep with types that take types like this? I never figured that one out
22:32:45
loli
the odd thing about this form is that it takes the symbol, so I don't see how I can apply it
22:37:37
Nilby
dieggsy: You can do it, but it's not in the API, so I probably shouldn't reccomend it.
22:38:20
Nilby
dieggsy: This is probably a bad idea, but (bt:join-thread (slot-value (slot-value hunchentoot::*acceptor* 'hunchentoot::taskmaster) 'hunchentoot::acceptor-process))
22:39:23
dieggsy
Nilby: fair. i'm trying to set up a simple server for local Oauth 2.0 authentication. Basically I just need a one time server that waits (blocks), gets a request with some info, sends back "done, close this tab", then dies and other code can go on to do stuff wtih that info
22:39:58
dieggsy
i've done it in CHICKEN, but there I had manual control over the thread the web server started in
22:41:03
dieggsy
or, maybe i'm being an idiot and i just work the entire logic into the easy-handler. .... that would make more sense I think
22:41:05
loli
hmm one small error, saturn2 it seems when I compile the file it says the type is undefined, is this due to staging?
22:45:17
dieggsy
Nilby: would you happen to know if i can make an easy handler send a response and *then* shut down the hunchentoot server too?
22:45:55
dieggsy
the way i understand it the easy handler depends on the last return value as opposed to some kind of send-response function, so i don't see that working either
22:48:59
loli
I've never really gotten over the gensym issues like this in the past, since the language doesn't help. saturn2 I guess what we could do is declare a package for these functions to live, so it doesn't clash, sadly we can't gensym that namespace
22:52:08
Nilby
dieggsy: This seemed to work (bt:make-thread (lambda () (sleep 5) (hunchentoot:stop hunchentoot:*acceptor*))) or I guess you could just call (exit) or something.
22:55:44
loli
I'll complete this extension later, I at least have a plan to fix it, thanks again saturn2
23:01:08
saturn2
loli: i think there's probably a way to make it all work by using load-time-value, but it's tricky...
23:10:42
josrr
dieggsy: maybe you can use hunchentoot:send-headers; it returns a stream where you cand send de response. https://edicl.github.io/hunchentoot/#send-headers
23:26:53
saturn2
loli: okay i guess i was wrong, there's no way to make the load-time-value trick work in a deftype, it only works in a regular macro or symbol-macro
23:27:20
loli
how does that work, saturn2, I've had this issue when I tried implementing module functors into CL before IIRC
23:28:07
saturn2
well, if you need your macro to have persistent side effects, you can make it expand to (progn (load-time-value (side-effects-here)) (other-stuff))
23:31:42
saturn2
but in that case you might as well just give your custom type predicate a symbol name and use regular defun
23:32:17
loli
do hygenic macros help at all? I know Racket has a reflective tower with their macro system
23:33:25
loli
it seems a lot of research has gone into pushing hygenic macros, I think they are much stronger, but I lack enough scheme knowledge to see how they got their tower of abstraction
23:34:25
dieggsy
i dunno about stronger, pretty much every scheme will provide unhygienic macros as well cause there's some things you can't do with hygienic macros
23:35:39
loli
but the interesting thing is, he mentions in a number of his articles about better composing macros
23:35:48
saturn2
i always thought hygenic macros mostly just saved you from having to type alexandria:once-only
23:37:35
saturn2
what you would need is a way for a macro to hook into the loading mechanism and do stuff when the containing file is loaded
23:37:54
loli
http://okmij.org/ftp/Scheme/macros.html#ck-macros I believe here he mentions the CPS style passing they typically do. But I believe Racket provides good kinds of abstractions for this as well
23:39:06
Bike
i think the problem is just that CL's type system can't do what you want it to do, rather than anything about macros exactly
23:40:39
dieggsy
i know i could just write one, but is there a standard CL way to denote a bytestring
23:45:17
dieggsy
cool, that does work. send-headers and stopping within the handler also seems to be working. neat
23:46:11
dieggsy
saturn2: eh, it's simple enough i'd rather not pull in another dep, but that's a good library to keep in mind, thanks
23:48:26
josrr
dieggsy: hunchentoot depends on flexi-streams; you can use flexi-streams:string-to-octets
0:13:19
nij
,tell beach : Have you found out how to use CommonDoc to parse Scriba, say the example in this page? http://commondoc.github.io/docs/formats.html
0:27:59
nij
::notify beach : Have you found out how to use CommonDoc to parse Scriba, say the example in this page? http://commondoc.github.io/docs/formats.html
0:29:07
Colleen
Unknown command. Possible matches: 8, set, say, mop, get, block, time, tell, roll, help,
0:29:10
Colleen
Unknown command. Possible matches: 8, set, say, mop, get, block, time, tell, roll, help,
0:29:31
Colleen
minion: Unknown command. Possible matches: 8, time, tell, set, say, mop, get, tell to, have a, grant,
0:29:39
Colleen
See 'help about' for general information. Try 'help X' to search for or retrieve information about a command.
0:29:53
Colleen
Command Syntax: tell USER &STRING COMMAND
Documentation: Show someone else the output of a command.
0:42:18
srandon111
i heard that common lisp support in netbsd is poor and that it does not support threading
0:43:37
gourdhen
it's just I notice you guys spend a lot of time talking about the gc - and not talking about lisps without gcs
0:45:18
no-defun-allowed
And then the performance of some memory manager that isn't a GC can be way worse, and often even more unreliable (unfair comparison: average reference-counting implementation vs. Metronome on a bad day).
0:46:06
no-defun-allowed
Bike: https://github.com/carp-lang/Carp/blob/master/docs/LanguageGuide.md#dynamic-functions says you get lists at compile-time.
0:46:09
gigamonkey
But (based on skimming the docs) if you want a static, no gc language for interrop with libs in some environment in a Lisp dialect (so you can have macros) their thing seems fine.
0:46:30
gigamonkey
I have never heard of it before today so I have no idea how good the thing actually is.
0:46:34
no-defun-allowed
That's the other thing - I don't want to be caught dead with a static language.
0:48:24
no-defun-allowed
gourdhen: In short, the GC is a pain if you have a bad one, but not having one is more of a pain.
1:00:06
moon-child
I think it's more that a language without a gc either leaks or has fundamentally different semantics than what you would expect from a lisp
1:02:02
no-defun-allowed
I mean, you can call it Lisp or "a dialect" or even "an exo-lisp" or whatever crap people say, it still looks awful to write any programs with.
1:04:32
no-defun-allowed
Wonder how well a Haskell "dialect" with dynamic types and mutable objects would be received. Lispers excuse a lot more than that.
1:05:30
no-defun-allowed
gigamonkey: I'd keep the infix notation, and make >>= do what it does in C just to throw them off.
1:08:29
no-defun-allowed
Point is, it can be called whatever, if it doesn't have late binding I'm out
1:10:16
gigamonkey
srandon111: There's a download for a binary of an old verison. Grab that and the latest source and see if you can build the latest. Might Just Work.
1:11:41
no-defun-allowed
sbcl.org won't load here today, but I swear I saw a release note that said they restored the non-threaded build; potentially suggesting that there is a threaded build. Or not.
1:34:10
dieggsy
are global parameters that can be setf'd pretty common ? if not, are there alternatives ?
1:35:03
dieggsy
what i mean is, say i have some client library for a web API that requires a client id and a secret ke - is it reasonable to have (defvar client-id) (defvar secret-key) and have the person using the library setq them?
2:43:14
gigamonkey
dieggsy: note, however that you almost certainly want to use the *name* convention for DEFVAR'd and DEFPARAMETER'd variables.
2:43:57
dieggsy
gigamonkey: oh, i actually sent them that way, i guess matrix did something weird because markdown syntax lol
2:52:18
mister_m
I have a list of strings I'd like to turn into a property list, is there a function that will give me an uninterned symbol to use as a "key" for a property list?
2:53:52
mister_m
sorry, to be more clear: I have a string that I'd like to turn into a symbol that will not be interned in the current package
2:59:25
dieggsy
If i'm e.g. going to generate a lambda-list in a defmacro from a list of strings should i use intern or make-symbol ?
3:01:13
gigamonkey
In general it's best not to create new symbols that are exposed to your users. Though I'm sure there exceptions.
3:02:47
dieggsy
gigamonkey: it's json, parsed with jonathan.the relevant bit looks something like ... :|parameters| '("char_id" "lang") ...
3:03:22
gigamonkey
If the symbols are going to be exposed as part of the API, you should probably INTERN them into the appropriate package.
3:03:35
dieggsy
gigamonkey: do i have to intern them though? i'm using intern for the defun name, but if i'm making symbols for a parameter list
3:03:43
gigamonkey
If they're just parameter names in the macro expansion, you can use MAKE-SYMBOL or GENSYM.
3:04:30
gigamonkey
Yeah, if the name is purely internal I'd use MAKE-SYMBOL or GENSYM. Probably MAKE-SYMBOL in this case is it seems slightly more descriptive of what you're doing.
3:06:29
gigamonkey
And you may want to further lispify the names, e.g. (mapcar #'(lambda (s) (make-symbol (substitute #\- #\_ (string-upcase s)))) '("char_id" "lang"))
3:34:28
beach
phoe: So instead of accepting the term I introduced a long time ago for a concept that otherwise does not have a widely agreed-upon name (i.e., uniform reference semantics), you introduce four new terms.