freenode/lisp - IRC Chatlog
Search
3:57:36
nyef
Heh. Well, I managed to use the MacIvory for a bit, mostly looking at the document explorer, but also using the lisp listener to evaluate such classic forms as (+ 3 4) and (disassemble #'+).
4:21:09
beach
For Common Lisp mode of Second Climacs, I use the reader from SICL to parse the buffer contents. But SICL is big and not ready for general use, and only a small part of it is needed for Second Climacs. I could include the reader in Second Climacs, but then I would have code duplication. Or I could extract the reader from SICL into a separate repository and have Second Climacs depend on that repository. Any advice?
4:22:46
nyef
How important is it that Second Climacs be usable by other people outside of the context of SICL?
4:26:10
beach
But it will depend on the SICL reader and on some parts of Cleavir (which is still part of SICL) for the Common Lisp code analyzer.
4:27:43
beach
I still plan to extract Cleavir from SICL, because Cleavir is more generally useful in other implementations.
4:28:17
nyef
Ah, better question: How important is it that the Common Lisp mode for Second Climacs be usable outside of the context of SICL?
4:31:36
beach
Maybe I'll start by extracting the reader into a separate repository. It could be useful as an independent module.
4:32:17
nyef
What about "just" having a way to package only the reader as a separate distributable thing, but leaving it in the SICL repository?
4:34:09
nyef
Well, if they're pulling from source control, they'll need to pull all of SICL, but if they're just working from distribution archives, then you'd provide a just-the-sicl-reader archive that they could install somehow?
4:34:10
beach
Bike: The other day, I hinted at a feature where one could hold the mouse over a lexical variable and have potential definition points (LET bindings or assignments) be highlighted.
4:37:17
beach
I guess that initially I can just ask that people clone SICL, but then only use the reader. Ultimately, I might do something different, but since Second Climacs is not going to be finished in the near future, I can always thing about it later.
4:38:59
beach
Bike: I think it would be cute to include such functionality in Second Climacs. It would be unique in editors for Common Lisp as far as I can tell.
4:40:34
beach
True. I have the source info in Second Climacs already. I just need to pair it up with AST and HIR generation.
4:41:05
beach
The "parse result" of Second Climacs is very similar to the CST (Concrete Syntax Tree) that I started implementing in Cleavir.
4:41:56
beach
And I would like for Cleavir to use CST as input. If only S-expressions are provided, it is easy to generate CST from it (but it will have no source information).
4:44:51
beach
The Second Climacs "parse result" included stuff like comments and other things for which the reader macro returns no values. But I can include that in the definition of CST even if the default reader does not provide it.
4:47:58
beach
Bike: The reason I have not worked on an implementation-independent lambda-list parser for Cleavir is that I really want source code manipulation to work on CSTs, and that's a big change to make. Oh well, so much work, so little time.
4:51:17
beach
One cute thing I implemented for CSTs (but it has probably bitrotted by now) was "intelligent macroexpand" whereby a CST would be re-created from an initial CST and the macro expansion of its associated S-expression (as accurately as possible). That way, source information would be preserved around macro expansion.
4:54:38
Bike
for the DX analysis i had it just warn along the lines of "there's a bad dynamic-extent declaration somewhere"
4:55:42
beach
So, right now, the GENERATE-AST part of Cleavir has some functions that can handle both S-expressions and CSTs, but most of them still handle only S-expressions. I first thought I would do that for all functions. But now I think that I just make them handle CSTs and require an initial CST creation if all we have is an S-expression.
4:56:04
beach
That's a big change to make though, and I don't know how to do it without disturbing my client too much.
4:56:13
nyef
Ugh. That reminds me. I still need to work out the proper semantics for DX in SBCL. So far as I'm aware it's not exactly broken, but there are definite optimization opportunities that the current implementation can't take advantage of.
4:57:33
beach
Bike: Every function in the GENERATE-AST part needs to be modified so that uses (and sometimes creates) CSTs. That's the big part.
4:58:02
beach
Bike: Some of those functions could just extract the S-expression for now as long as they recognize CSTs.
4:58:34
nyef
Bike: I might have said that. I certainly said that it was a pile of hacks that nobody has ever understood completely.
5:00:14
beach
Bike: All of the code in CODE-UTILITIES need to be rewritten, or rather, a new library (say CST-UTILITIES) needs to be created. The big part is the implementation-independent lambda-list parser.
5:01:15
beach
Bike: Right now, the result of the lambda-list parser is a standard instance with a slot for each kind of parameter, but that won't do, because an implementation may introduce new lambda-list keywords, and their position in the lambda list may be important.
5:02:50
beach
So we need a lambda-list parser that preserves the order, presumably as a list of standard instances. And we need some parsing technology, probably Earley or combinator parsing so that client code can add new rules in a modular way.
5:05:24
beach
Anyway, a complete set of CST utilities would be very useful for other things as well, so it may be worth the effort.
5:10:21
borei
i have 2 types of objects - Vector and Matrix - they are linear algebra object(s) with defined math on the them - like sum and mulitply by number, components can be different - double, int, complex
5:12:02
borei
my question would be - i exported "+" operator from both packages, how lisp will know what one to use
5:13:02
beach
borei: You would have a generic function named (say) + and then each package would define methods on it specialized to its own classes.
5:13:51
beach
borei: That way, client code would just use + and the generic dispatch of your Common Lisp system would figure out what method to apply.
5:16:42
beach
borei: Not directly, no. Clasp uses Cleavir for its compiler and I am the author of Cleavir. Bike works both on Clasp and on Cleavir.
5:19:01
borei
i remember i saw your nickname in commiters, maybe different person, i was inspired by drmeister to look towards lisp
5:20:40
beach
I see. I don't think I have committed anything to Clasp. Congratulations to discovering Common Lisp!
5:23:36
borei
thanks ! seems like it's gonna be very steep learning curve, not sure if my approach is correct or not. currently im trying to build some analogy with traditional languages like C/C++, Tcl, but that approach can start to play significant drawback later, because lisp feature will not be absorbed.
5:27:07
axion
Does it make sense to define different ftype declarations for primary methods or is it even possible?
5:42:25
edgar-rft
the funny thing is that Lisp already had a tradition when C etc didn't ebven exist
5:54:21
beach
ACTION is thinking about how to define concrete syntax trees (CSTs) so that they are useful both for source tracking in the Cleavir compiler and for incremental analysis of Common Lisp code in Second Climacs.
5:56:44
beach
Unknown reader macros can do arbitrary things, like adding an expression that was not read, removing an expression that was read, or changing the order between sub-expressions that were read.
6:02:55
borei
find good explanation to my question and generic function - https://en.wikipedia.org/wiki/Generic_function
6:05:02
borei
loke: agree, syntax is ... different, but logic - is ok. my concerns is - not to miss LISP features which are not available in other languages. for now i have zero knowledge about such features.
6:06:08
loke
You can start by writing code in a style that is familiar to you, and then you will find yourself using more and more Lisp-specific stuff.
6:06:18
aeth
borei: The only Lisp feature you're not going to see done well in some other language is macros. If a language does macros Lisp- style on s-expressions, it's probably a cousin of Lisp.
6:06:46
aeth
What makes Common Lisp special is that it has quite a lot of different paradigms in one language, and because of the syntax, they don't seem out of place.
6:06:50
loke
Now, the most important benefit of Lisp isn't really the language per se,e but rather the way in which you develop. The way in which you write code and recompile functions in a running program. All of that is much more important tan language features you can learn later.
6:09:01
aeth
Some languages have workaround hacks for hotloading stuff, but in Lisp that's the norm.
6:10:23
borei
it's hidden from me for now, need to get momentum. i have program (not completed) which is mix of C/C++ and Tcl and now im converting it to C/C++ and Lisp, so learning on the fly.
6:10:56
aeth
Imo, the best way to learn imo is to just write and write and write, and revise older code to be more idiomatic Lisp later.
6:11:43
aeth
It's a large language, but every time you learn something new, you can see if there's something in a previous program that you can rewrite to be better. But first there needs to be previous programs.
6:12:45
aeth
Just write lots of tiny functions that, if you can get away with it easily, return values rather than set things.
6:13:34
aeth
Few functions are too small. If you're concerned about the performance of having an extremely tiny arithmetic function add: (declaim (inline foo)) right above the line (defun foo ()
6:13:59
aeth
But only inline tiny functions, and if you're not sure disassemble to make sure they're actually tiny!
6:40:59
beach
I think I have an idea for a separate library for Concrete Syntax Trees (CSTs). I'll create a repository and write some code and some documentation.
11:05:42
dxtr
So what's the common thing to do in multi-file projects? Are all files their own package or the same?
11:08:31
jackdaniel
some prefere file-per-package, others have a separate packages file and source scattered trough many files
11:08:59
jackdaniel
sometimes it's just one package for whole system, or two packages (interface, and internal implementation)
12:38:49
phoe
I've somehow installed OpenJDK7 on FreeBSD on SPARC and managed to run ABCL on it. Installing Quicklisp fails though and all I get is, debugger entered on ERROR: "Invalid argument".