freenode/#lisp - IRC Chatlog
Search
10:47:12
jackdaniel
and the type system in common lisp is quite elaborate already for better or worse
10:57:19
contrapunctus
agumonkey: I used to love them, but then I realized that it's basically a let* without local variable names acting as "comments" of sorts...so sometimes they just obfuscate code.
11:02:45
jmercouris
does anyone know of any successful systems that allow for some sort of intelligent markup?
11:03:01
jmercouris
e.g. I can reference a symbol in my documentation, and then some documentation export tool does something intelligent with it
11:03:48
jmercouris
if nobody knows of any succesful usages of this markup, I am also interested in why that might be, and suggestions for some sort of markup
11:04:23
edgar-rft
_death: thank you for the pointers to the original discussions and historical background information :-)
11:04:58
Gnuxie[m]
jmercouris: using markup won't be portable and you have to be considerate for what it will look like when someone calls #'documentation
11:05:03
no-defun-allowed
The jmercourtis had a problem making nice-looking documentation, and thought "Oh, I'll use a documentation generator!" Then he had two problems.
11:05:50
Gnuxie[m]
that being said, it would be possible to have a macro like Shinmera's documentation utils and figure out how to offer both
11:06:27
no-defun-allowed
jmercouris, when confronted with a documentation-making problem, thought to himself, "I know, I'll use a documentation generator." Now he has two problems.
11:07:26
no-defun-allowed
jmercouris: My experience is that instead I wrote my own documentation in Markdown, then because I wanted a nice book, I ported to TeX. Then that made for a poor website, so I ported to Scribble.
11:08:00
jmercouris
am I correct in thinking that you are from Australia, or am I confusing you with some one else?
11:08:45
no-defun-allowed
contrapunctus: The problem for me has consistently been that introducing the protocol and the code feel like they should be done in different orders.
11:09:07
no-defun-allowed
jmercouris: No, I transferred and I'm in a weird superposition which is mostly in first year. Let's say I have 7/8 of a year down though.
11:10:13
no-defun-allowed
contrapunctus: Also in my very specific sitation, I want to write my implementation with a restrictive license, but the specification with a permissive one. So tangling the two would get legally tangled too.
11:10:50
jmercouris
You can use a 'licenses' directory which specifies what is licensed under what, but intermingling licenses in the same file is indeed messsy
11:11:04
no-defun-allowed
jmercouris: Take a look at <https://theemacsshibe.gitlab.io/documentation/> for the output of this approach.
11:12:18
jmercouris
I would like a single point of truth though... I don't want to make discrete sources
11:12:46
no-defun-allowed
You also have the case that a documentation string lies about what the code it documents does.
11:13:24
no-defun-allowed
If there is a discrepancy, I look at what I wrote down in the book, a documentation string if present, and the implementation, and decide which I meant to write. Usually it's what's in the book, and that is usually because it makes the most sense.
11:14:06
no-defun-allowed
That is to say that intentionally accidentally forgetting implementation details leads to documentation which convinces you to remove the painful details.
11:16:21
no-defun-allowed
Yes, literate programming is a thing people do, and you can do it with org-mode.
13:32:38
edgar-rft
gendl: I would do C-h k RET in the slime-repl-buffer and then track down how slime sends the code to CL.
13:50:23
gendl
jackdaniel: perfect, thanks! I was on a fascinating journey through slime-repl.el and got as far as swank-repl:listener-eval and was trying to unwind what slime-rex is doing...
13:58:33
gendl
I need it to load the swank portion of my slime extension called "glime.el" before load-file'ing the glime.el itself.
14:00:45
jackdaniel
so we have clime, glime, slime; the great unification portability layer will be called .lime
14:09:12
gendl
(slime-eval `(cl:when (cl:find-package :gendl) (cl:funcall (cl:read-from-string "gendl:load-glime"))))
14:10:49
gendl
and (slime-eval `(cl:when (cl:find-package #:gendl) (cl:funcall (cl:read-from-string "gendl:load-glime")))) does not work.
14:33:08
lukego
gendl: you can also look in *slime-events* buffer to see the socket messages back and forth, that sometimes helps to understand where to look
15:14:03
lowIQflatearther
are there any lisp web tools for build e commerce ontp systems? https://www.bivio.biz/bp/bOP
15:16:40
lowIQflatearther
I haerd that the stock market in Norway runs on prolog and has many many transactions
15:47:54
pjb
lowIQflatearther: http://www.fractalconcept.com/asp/m4$u/sdataQvctRqSQMNXhDM==/sdataQuEY-NQ=
16:04:48
lowIQflatearther
http://www.fractalconcept.com/asp/asdataQuEXZkvXCs3qnNcICX== http://www.hpcplatform.com/(broken link)
16:04:53
gendl
lowIQflatearther: I'm in the process of spinning up this: https://payments.common-lisp.net/printshop
16:10:26
gendl
I've known lisp for a long time but this is done with a framework which I would hope wouldn't take so long to learn.
16:10:47
gendl
as part of making that printshop I've also been cleaning up and fixing bugs in the framework along the way.
16:12:24
gendl
the printshop code itself is MIT licensed but not quite released to the public yet. The framework is called Gendl and that is AGPL licensed.
16:13:43
gendl
I've worked on other CL-based systems which do handle hundreds of hits per second so I would expect the same scaling techniques could be used with this if needed.
16:15:15
gendl
lowIQflatearther: what is your background with Lisp? what drew you to ask this question?
16:34:41
gendl
well I'm very likely biased but I would advise learning a higher level framework such as https://common-lisp.net/gendl/gendl but some may opine that it would be better to learn raw CL first.
16:35:34
gendl
but gendl still doesn't have a really smooth onboarding story - so my advice is more in principle than maybe practical at this junction
16:37:16
gendl
that clog looks super interesting but I think it's not really for "web" development -- it's for making full-blown GUIs and letting them be rendered in a web browser.
16:38:40
gendl
with gendl you get dependency-tracking in the server side which works with Ajax to keep track of the html page state and which sections need to be refreshed when things are changed. so you can do react-like stuff but without any client-side programming .
16:42:00
gendl
like when you choose a number of prints on that printshop, the data entry form appears on the page -- that's using Ajax behind the scenes but the CL code on the server side is just a declarative conditional which computes the data entry section of the page -- something like `(data-entry-section (when <the number of prints is greater than zero> <the data-entry-section lhtml rendering>))
16:42:14
gendl
`(data-entry-section (when <the number of prints is greater than zero> <the data-entry-section lhtml rendering>))`
16:42:46
gendl
react meaning when the user changes one control on the page, the rest of the page updates accordingly without any explicit procedural code telling it to do so.
16:43:04
gendl
react is a framework which lets you set up those relationships declaratively (in Javascript)
16:44:41
lowIQflatearther
gendl: so the single page node app thing is not just hype? like devops and agile? I hate offshoreing programing too I say ban that crap and boot foriegners liek h1bvisa
16:45:40
irc_user
SPAs are cool. I've been looking for some good lisp options but there aren't that many.
16:45:49
gendl
some folks feel that declarative programming is simpler and easier to debug than procedural programming.
16:46:56
gendl
ok SPA - I guess that is what I do mostly although I don't think of it as anything special really
16:48:13
Jachy
There's exactly one Lisp SPA framework I heard about a while back that seemed to be getting close to replicate where ClojureScript was in 2014 with Figwheel (which is still ahead of modern JS stacks, many of which have gone the opposite way from interactive development and towards Typescript)
16:48:14
gendl
yesterday I got lectured by a frontend developer that m server-side approach is "wrong" and this kind of thing "should" be done client side with js.
16:49:27
gendl
well I guess I'm making assumptions about what react actually is. I admit I've never looked at it in detail.
16:49:43
irc_user
ClojureScript + Reagent + Reframe is really the only thing I found for client side lisp apps
16:49:45
lowIQflatearther
my idea is this 1 seelct things to act on 2 choose actions maybe many 3 choose list of targets for example I hate how in gmail I get 40 recrutier emails, I would love to 1 choose all recrutiers who emailed me, 2 choose a resume and write a littel somethign to them 3 send but in other scenaritos it would be like 1 choose 50 role playign game fiel 2 choose to email them and save them in
16:49:54
Jachy
server-side rendering == sending mostly baked HTML down the wire, just like we all did before modern JS frameworks.
16:49:54
Jachy
isomorphic == they can re-use some of the same JS code on the front-end as on the backend (e.g. Node server)
16:51:10
gendl
server-side rendering is entirely sending baked HTML down the wire. But with Ajax it can be done in a fine-grained manner.
16:51:43
gendl
and a declarative Lisp based framework such as Gendl can help a lot to keep track of which bits need to be sent and which not.
16:52:51
gendl
I suppose I'm old-school in that sense. I've watched the web from its inception and watched the client-side ecosystem metastasize into the monster it is today.
16:53:12
lowIQflatearther
I don't get why client side was ever seen as good. Gimmick to sell more stuff? and half those javascript windows fail in flaky way and have to be reponed which slows user down
16:54:59
pjb
lowIQflatearther: there are commercial web site implemented in Common Lisp. On of them was ViaWeb, bought by Yahoo! re-implemented in C++.
16:55:09
lowIQflatearther
ok so is your web framework making money and helping people with awesome web gui?
16:55:40
lowIQflatearther
oow that reminds me of a paul graham thing I read one time....yeah!!! no SQL db neede wither jsut files! AWESOME
16:56:04
Jachy
_why quote: "When you don't create things, you become defined by your tastes rather than ability. Your tastes only narrow & exclude people. So create."
16:56:06
lowIQflatearther
I think they sidestepped scaling by simply have sets of customers on a new box and got cheap freebsd box
16:56:51
lowIQflatearther
when he said the app forked a lisp interpreter that then had a conversation with the client I was like damn this guy jsut solved concurrency by cheating in wily way SO AWESOME
16:58:35
lowIQflatearther
its like get input break into pieces aissign to variable put in lisp or hash then write queries to get what want
16:59:49
lowIQflatearther
the thing like a file manager where you can select all by holding shift key then hold CTL to uncheck a few of say the 40 things THATS what I want to know is it part of HTML
17:04:31
lowIQflatearther
well in php I could do that on some php site I was on in like long ago times
17:05:03
lowIQflatearther
its like we get new buzzword the the ability to indicate what I want on web is regressing liek dumbing people down on phone apps
17:05:47
gendl
but when you start talking about "one framework to rule them all" then client-side becomes a swamp in my opionion.
17:05:47
irc_user
Correct me if I'm wrong but to highlight HTML elements dynamically you need javascript running client-side.
17:05:52
lotuseater
yes i thought it is for not having to ask and wait for the server to do something
17:07:28
lowIQflatearther
doesnt HTML itself have radio button then choose then click send and it all goes back to server gets read at data and BOOM
17:14:23
Jachy
What lowIQflatearther is asking for either has to be done in JS or implemented by the browser. HTML doesn't and shouldn't specify such high level interactive behavior... But fun fact, classic HTML tables do support something like this. You can ctrl+click a cell, ctrl+click another cell, ctrl+click and drag to select multiple cells/rows, ctrl+click a selected one to deselect, and ctrl+c to copy the cell data of selected cells.
17:15:36
Jachy
(But you don't specify that behavior, it just comes for free with the browser's implementation of HTML tables. If you didn't have it, you could add it with external JS.)
17:20:50
nij
I'm actually looking for an example to showcase why lisp macro is better than macros in other langs.
17:21:47
nij
Writing my-cond as a function would requires many quotes (my-cond '(c1 a1) '(c2 a2) '(c3 a3)...)
17:23:37
nij
Wezl: It implements set comprehension using macros.. but why can't it be implemented using functions?
17:26:12
phoe
if you are willing to wrap everything in closures, you can write IF and COND as functions
17:28:52
Wezl
my-or a b = if a then a else b , except that doesn't work because haskell is statically typed (ugh) and doesn't allow kebab-case (ugh)
17:29:01
stylewarning
To be clear, which I think some people lose in these discussions, it is perfectly OK and natural to have *an* OR-like operator that is a function.
17:29:28
Bike
it's pretty simple, nij. When you write (my-or x y), if my-or is a function, the x and y forms will be evaluated before the function is called. So nothing in the body of my-or can possibly help.
17:31:43
nij
I bet other langs (without lazy eval) also have their OR implemented this way.. by using macro.
17:31:51
beach
nij: And macros are needed when you don't want function-call semantics. Period. If you can live with function-call semantics, then you don't need macros.
17:33:27
phoe
if you don't want to treat everything as function arguments, then a macro can help you
17:34:13
loli
or as a function makes sense if your language has a way to get lazy semantics for function calls
17:34:50
Wezl
you can write C macros that allocate a closure, or define a function, or evaluate as lisp, but you lose your speed and elegance
17:35:00
pjb
nij: You can have some kind of lazy evaluation with thunks, ie. closures: https://termbin.com/3d4x
17:35:15
Jachy
nij: Yeah. If Lisp's designers forgot to include OR, or made it a non-short-circuiting one (there's no law that says or must stop evaluating expressions after something hits true, it's just very common behavior across all languages), you could easily write your own short-circuiting one with a macro.
17:35:16
nij
They can always protect themselves by saying "Oh I never need to extend the syntax.. why would you do so?"
17:35:25
stylewarning
loli: it’s usually defined at its most primitive level as a Boolean circuit as just a functional relation
17:35:48
loli
in the case of match, macros are very nice, as you can extend existing forms if the macro is made right.
17:35:49
stylewarning
The fact OR turned into this short circuiting thing seems like a curious artifact of history
17:36:21
pjb
There is already a OR function in CL: SOME (SOME 'identity '(nil nil nil t t nil)) #| --> t |# (SOME 'identity '(nil nil nil nil)) #| --> nil |#
17:36:23
beach
nij: Fortran programmers used to say "I don't need functions". C programmers say "I don't need classes".
17:36:31
_death
you could write (defun my-or (&rest args) (some #'funcall args)) .. then (my-or (lambda () t) (lambda () (loop))) will work
17:37:32
loli
https://help.luddy.indiana.edu/techreports/TRNNN.cgi?trnum=TR44 there is this classic paper over that
17:37:33
nij
and Lisp programmers say "I don't need a large community and extensive documentations."
17:39:08
nij
(defun my-or (&rest args) (some #'funcall args)) (my-or (print 42) (print 24)) ;; => error
17:39:11
pjb
nij: note that if you want to try a lisp that doesn't use eager evaluation of function arguments, it's a trivial change to EVAL.
17:39:58
_death
nij: (defmacro delay (&body forms) `(lambda () ,@forms)) now you can (my-or (delay (print 42)) (delay (print 24)))
17:41:03
_death
nij: for operators like OR, AND, IF, COND, and such this approach could work at the cost of syntactic verbosity and perhaps efficiency
17:45:22
loli
from lambda alone I can define all the numbers in the world, no specific number reader for me!
17:46:24
Wezl
there are numbers, it's aiming for a scheme-level amount of primitives, not like unlambda :P
17:48:31
lotuseater
there are papers by Guy Steele with "lambda the ultimate declarative/imperative"
17:51:56
lotuseater
or in a funny talk "no, calling lambda universal is too restrictive. it is omniversal"
18:11:02
minion
CL-ASHOK`: SICL: SICL is a (perhaps futile) attempt to re-implement Common Lisp from scratch, hopefully using improved programming and bootstrapping techniques. See https://github.com/robert-strandh/SICL
18:15:10
beach
CL-ASHOK`: phoe was the one who came up with the interpretation of SICL as an acronym: "SICL Implements Common Lisp".
18:16:08
phoe
beach: no, I actually came with the interpretation of Strandh's Invalidation of the C Language
18:44:04
White_Flame
hmm, is there a function that takes absolute #p"/foo/bar/" and relative #p"baz/blort/" and returns #p"/foo/bar/baz/blort"?
18:48:03
White_Flame
for what exactly? If I were to do this manually, it would be appending the 2 directory pathname lists together and creating a new pathname
18:48:45
contrapunctus
White_Flame: for some reason I'm unable to connect to https://common-lisp.net/project/asdf/uiop.html#UIOP_002fPATHNAME but I'm pretty sure I saw something for this in UIOP
18:49:55
White_Flame
CL-ASHOK`: well, that would take further conversion from pathname to string. Any manual use of this is large enough to be contained in a library function, and applying relative paths to an existing one _seems_ like it should exist already
18:50:50
CL-ASHOK`
White_Flame: Ah okay, now I understand. I'm currently doing via strings but I'm not one for efficiency
18:54:31
White_Flame
yeah, I tried merge-pathnames* again with different orderings and it seems to do what I want. However, the docs do not describe this behavior
18:55:17
White_Flame
hmm, yeah, I think the proper conclusion here is that yes, I was being quite dense
19:08:38
pjb
Note that a directory pathname could contain a version! If you use it as :defaults to make-pathname or with merge-pathnames with a file pathname, you could get a file pathname with a version…
19:16:09
CL-ASHOK`
I have 8 lisp files, and things are starting to get unwieldy, I forget parts of the code I wrote before
19:40:18
CL-ASHOK`
pjb: :-) I know....but for beginners its hard because I have some bad habits ;) Like storing functions in the wrong files cause I'm lazy to think which is the best place to put them :D
19:40:27
pjb
CL-ASHOK`: even 323 files, 152529 LOC is not really large, it's just a normal-sized application.
19:41:16
White_Flame
it's easier to have multiple files open than the same file in different places, htough
19:41:16
pjb
CL-ASHOK`: our computers have large RAM, and fast SSD, so you can have a small number of large files.
19:42:00
pjb
CL-ASHOK`: the only thing is that in lisp, some definitions need to happen at compilation-time, so it is easier to have them in separate files, to be compiled and loaded, before we compile the rest. eg. defpackage, defmacro, defconstant.
19:42:15
CL-ASHOK`
White_Flame: How to use? Looks really interesting. I tried it and then typed psql::function-name (stored in package psql), but it didn't give me the doc string
19:43:16
pjb
now the grouping of definitions in logical units should be helped by tools such as emacs. We can use ^L in emacs buffers. But it would be nice to have something better. Like the Smalltalk Browser (systems|classes|categories|methods) and stuff like that.
19:43:58
pjb
In emacs, we could tag toplevel forms (this would be mostsly done automatically from the context, but we could add or change tags explicitely) and then emacs would provide a tag browser.
19:45:04
White_Flame
CL-ASHOK`: http://pchristensen.com/wp-content/uploads/2008/02/slimecommands.pdf
19:45:23
pjb
CL-ASHOK`: point-to-register C-x r SPC to store the point in a named register (one letter) and later, jump-to-register C-x r j <the-letter>
19:45:54
White_Flame
(there are probably newer cheatsheets around,but that's the one I happen to have bookmarked)
19:46:26
pjb
CL-ASHOK`: note that M-. M-, is a stack. You can M-. several times, and use several times M-, to pop back.