libera/#commonlisp - IRC Chatlog
Search
1:25:42
nyx_land
the real problem with guix IME as a Common Lisp person is that it doesn't feel at all like it's designed to be a fully interactive environment like CL. you write code, you recompile everything, you can't inspect the running system live really (there's Geiser but I found it to be a very subpar experience). on top of that, developing CL with guix tooling feels very unnatural.
1:26:19
nyx_land
an init system in CL would be really cool, not sure why no one has ever attempted something like that but it's probably way more complicated that I'm aware of
1:27:03
nyx_land
a CL package manager would be a slog just based off my experiences making packages for nix and guix
8:34:33
Guest69
Sorry to crosspost from #ecl if that is not good boy behaviour, but I'm having troubles doing basic stuff like getting function info via describe/inspect or requiring uiop; any kind soul to help a noob?
8:37:52
pjb
Guest69: uiop is part of asdf. You should install quicklisp anyways. Have a look at http://cliki.net/Getting+Started
8:38:49
pjb
No. Install quicklisp, it makes its own installation of asdf. Avoid cl- packages from linux distributions.
8:40:09
jackdaniel
a known issue. it does not fail, it is just that for some core functions the necessary information is not recorded
8:40:26
jackdaniel
essentially ecl holds metainformation about functions in a separate file accessed with interface provided by ecl-help module
8:41:08
jackdaniel
if you define a function in the repl, then the prototype will be available, but unless you save that data, when you load the fasl in the fresh image this information will be gone
9:22:55
hayley
Because they chose to write it like that. But only the text format is similar to Lisp, and it's different enough that trying to read it with a CL reader is not pleasant.
9:23:42
hayley
e.g. https://github.com/no-defun-allowed/wasm2ps/blob/master/Code/reader.lisp And I recall...memory instructions(?) have an annoying "align=X" syntax that I haven't touched, because wasm2ps doesn't handle memory instructions.
9:25:02
hayley
If I recall correctly, they could benefit from learning that we have #- instead of #_, and don't put our close-parens on their own lines (though I know Z3 also messes up the latter, as smt-lib is also S-expression based).
9:25:38
Nilby
assembly code is already in prefix, e.g. "oper arg arg ...", but is delimited by source lines. turning it into s-exps is trivial and makes so you can group it not by line.
9:26:43
rendar
i made a small language with prefix `oper arg arg` where you can specify some arg "out of band data" with [], e.g. `oper arg[opts] arg[opts2]`
9:49:59
hayley
It won't, because approximately no web developer touches the text serialisation of WebAssembly.
9:51:15
hayley
(Contrived counter-point: it contributes to the mystification of Lisp, because people will think it's something their favourite compiler spits out. As some have pointed to intermediate representations in GCC and said "Look, Lisp is in your C compiler!" for little reason, after seeing ().)
9:51:41
hayley
No source-level debugging? It would be like debugging a C program by starting at the generated assembly.
9:53:13
Nilby
well hopefully at the very least it will make life easier for us, when we can just cl:read wasm and use macros on it
9:58:16
hayley
Apologies for my cynicism still. Someone once said that Lisp implementations had good compilers because they saw their favourite compiler (for some other language) use S-expressions, and I had to describe how that is not how anything works. So I am too convinced that showing Lisp exists as a (serialised format of an) "intermediate representation" is worth much.
10:00:57
hayley
Then you haven't encountered a (; ... ;) block comment; wasm2wat would produce a lot of those in my experience.
10:00:58
beach
hayley: I am sure you were trying to say something profound, but I just can't parse it.
10:02:56
beach
How did their discovery of the use of S-expressions force them to describe how "anything works"?
10:03:24
Nilby
hayley: i understand your scepticism, but at least i think it's nice to be able to: (write expr) | wat2wasm > foo.wasm and maybe get something you can run
10:03:26
hayley
Once I read a comment on a forum, which was an "answer" to the question "Why are Common Lisp implementations quite fast, despite implementing an interactive and dynamically-typed language?" The "answer" was something like "If you look into the implementation of a C compiler, you will find S-expressions there, and Lisp programs are similar to that."
10:03:58
hayley
You know, I had better just dig up the original text, I'm sure I can find it somewhere.
10:05:53
beach
hayley: And how did this observation make you (too) convinced that it is worth much to show that Lisp is used as an intermediate representation?
10:08:55
hayley
The claim, I think, is based on the (correct) observation that one of the internal representations of GCC can be printed as S-expressions. But that observation has little to do with why GCC and Lisp compilers produce good code.
10:11:29
hayley
I found the comment now, and they got the claim wrong; as they claimed LLVM uses some intermediate representation similar to S-expressions, which is definitely not the case. On the other hand, Andrew Appel said that a SSA IR is like functional programming.
10:12:36
Nilby
llvm's target description language "td" really looks like it would be better as s-exps too
10:15:22
hayley
Nilby: Anyways. What would you achieve by emitting WebAssembly code that way? Specifically, I guess, what could one achieve, where having a S-expression printer would save a substantial amount of time?
10:16:07
hayley
The wasm2ps code generator is quite bad, and just uses FORMAT to produce PostScript code, but it works.
10:16:46
Nilby
hayley: it just seem easier. like one could make a small macro set, and have a decent DSL
10:18:58
hayley
I'm still not sure what you'd use it for. And, according to Shriram Krishnamurthi, the most interesting (or "expressive") features in programming languages cannot be implemented using macros alone.
10:22:04
Nilby
i used to write a bunch of Dylan, which is very close to infix CL, so i know well the pain points in losing s-exps
10:22:44
hayley
For example, it is not possible to give Common Lisp async/await syntax, as it would require some sort of continuations (or transforming the whole program to continuation-passing style), which you cannot do with "local" macros.
10:23:34
jackdaniel
I think that we all agree that macros are not a "silver bullet", but they come handy for /some/ tasks
10:23:45
hayley
Honestly syntax doesn't bother me, unless it is too complicated. I usually write my notes in a pseudo-ML language.
10:23:56
random-nick
hayley: doesn't async/await only require transforming all the async functions into CPS?
10:24:35
hayley
jackdaniel: Sure. I was wondering what Nilby would do by adding macros to the WebAssembly text format still, since there is a lot one could conceivably want to add.
10:25:55
hayley
random-nick: Right. But the boundary between async and sync functions is quite painful, and some Common Lisp features like dynamic variables and condition handlers really don't work with CPS transformations.
10:26:21
Nilby
i guess i'm thinking of something like just spitting out little pieces of code in web app, instead of using parenscript
10:29:38
hayley
Okay. I'd say Parenscript works quite well because it is targeting another high level language (JavaScript), and so a fairly simple translation method works fine. Depending on what you want to compile to WebAssembly, a similar translator could be quite complicated, and might need a more complex IR.
11:01:38
Colleen
lisp123: Guest74 said 21 hours, 46 minutes ago: I think I'm going to make a github with all the Moby files as I had to dig them out of archive.org. They're also at project gutenberg but they rather stupidly present the readme's as the text so you have to dig and get the links to an ftp site.
11:04:08
lisp123
Guest74: based on your later comments, not sure how useful this resource this...I rather a smaller base, but more quality
11:13:42
Nilby
lisp123: what do you want to use continuations for? also "On Lisp" shows one way to do them
11:21:09
lisp123
Nilby: Yes, I've implemented the On Lisp continuations, quite good but some slight deficiencies
11:21:39
lisp123
Continuations are quite useful when writing Artificial Intelligence programs (where Lisp excels)
11:35:43
Guest74
lisp123: https://github.com/JMC-design/Moby depends on what your needs are. Either way, I've got parsers for most of the stuff there, so you can take an easier look at the data.
11:41:56
Guest74
So Norvig wrote this https://norvig.com/spell-correct.html , and someone copied it quite literally into CL. I'm not sure what constitutes a good spell checker, but this is a spell checker.
11:45:06
Guest74
I couldn't test with the data he did, but I ran the same tests as Aspell http://aspell.net/test/cur/ and the cl version came up around 45%.
11:46:25
Guest74
at the same time, it got almost everything right given as examples in journal articles for 'difficult' cases.
11:49:00
Guest74
So if someone is interested in spell checking this might be a good place to start. I'd think less brute forcing might be nice, testing for hand shift on the keyboard, only checking a keys neighbours instead of every character, and for those who want to through context in, there's a really good data set of word frequencies and 4-5 n-grams by