freenode/#lisp - IRC Chatlog
Search
19:14:43
edgar-rft
seok: I think the minimum is 1) lisp-mode (comes with Emacs), 2) Slime for the communication with the external Lisp process, and 3) Quicklisp on the CL side, everything else is optional.
19:23:36
White_Flame
my installation steps are typically emacs, then quicklisp, then https://github.com/quicklisp/quicklisp-slime-helper
19:35:52
mrcom
seok: Other useful packages: company, ethan-wspace, hungry-delete. If using sly: sly-company, sly-quicklisp.
19:42:44
mrcom
seok: Other useful cemacs.d tweaks: cua settings (enabling/disabling Windows/Mac style cut/paste/delete); indent-tabs-mode; mouse-whell-scroll-amount; toggle-comment-on-line; recentf-save-file. If using ethan-wspace: (setq mode-require-final-newline nil)
19:47:23
mrcom
seok: Slime stuff I had enabled before switched to sly: (setq slime-contribs '(slime-editing-commands slime-typeout-frame slime-fancy-inspector slime-repl slime-trace-dialog slime-sprof slime-scratch slime-presentations slime-c-p-c slime-xref-browser slime-autodoc slime-references inferior-slime slime-asdf))
19:55:36
mrcom
seok: (setq slime-net-coding-system 'utf-8-unix) (setq slime-scratch-file "~/.slime-scratch") (setq slime-autodoc-use-multiline-p t)
0:23:09
kinope
In reference to my previous question about logand or mod being performant. I think I get it now, It's not a question of if they are as performant as C/C++. But of how much flexibility I want to trade for the performance. I sometimes forget that a C compiler and a Lisp compiler (some implementations) both generate native code. So in the end it's possible for computation written in CL to be just as performant, given a
0:23:09
kinope
sufficiently capable compiler AND the required declarations so that it may produce the intended result. Am I off the mark?
0:35:20
White_Flame
kinope: if the CL compiler knows that the operands fit in a machine word, you can expect it to be as fast as C
0:51:21
pjb
kinope: you're correct if you are thinking in terms of generated code. (Note that even in the case of C, it's really not obvious what the generated code will be. It is said that C was designed so that it may compile to simple (PDP-7/PDP-11) instructions, but this was in 1969. C17 is quite different, but foremost, the processors used today are very different.
0:51:46
pjb
kinope: so the mapping of the semantics of operators to current processors is not obvious, even for C.
0:53:10
pjb
kinope: and if you compare directly CL to C, the semantics are very different, even if in apparence, there may be direct translations between C and lisp (Ă -la rosetta stone).
1:15:30
Pixel_Outlaw
pjb Any insight on the cost of trashing and reassignment in CL vs mutation? I bet it's a bit more anticipated in Schemes.
1:24:25
mrcom
kinope: Here's what SBCL generates: (disassemble (locally (declare (optimize (safety 0) (speed 3))) (defun foo (a b) (declare (type fixnum a b)) (logand a b))))
1:27:30
White_Flame
Pixel_Outlaw: conses tend to be the cheapest things to allocate, as it's just the 2 cells and no other storage overhead
1:39:57
White_Flame
Pixel_Outlaw: I think in every language, mutation will always be faster to execute for the mainline case. There's simply less related work to do
1:40:09
lottaquestions
how does one know if the original element obtained by rest from a list was an atom or a list?
1:44:01
kinope
pjb: Do semantics differ between CL implementations also? I'm thinking of ecl and how it compiles to C, must one then think in terms of C's semantics when writting optimised code for ecl.
1:44:37
White_Flame
certainly byte-coded implementations will have significantly different performance characteristics than native compiled ones
1:45:08
pjb
kinope: the CL standard indeed let some things undefined, up to the CL implementation. But conforming programs run in conforming implementation have a very specific semantic.
1:46:14
lottaquestions
@White_Flame: checkout this function and the results I get, it explains my conundrum: https://pastebin.com/BrekMZWu
1:46:57
White_Flame
kinope: basically, if something claims to be "Common Lisp", then it should follow the exact same specified semantics. But other non-CL Lisps can do whatever they want to mold to their environment to make them a lighter layer
1:48:03
lottaquestions
because I use rest, an atom is transformed into a list, and I get a match against the second a
1:49:20
pjb
lottaquestions: so what will it be? Do you consider cons cells or proper-lists? What about dotted-lists?
1:50:40
kinope
Okay, so the semantics should stay constant, but the performance characteristics will change depending on where the implementation sits on the stack of abstractions (on a virtual machine, or on top of C runtime)
1:51:03
pjb
lottaquestions: in this kind of functions, you could also want to specify what occurs for vectors and arrays, and perhaps other structures.
1:51:22
White_Flame
kinope: the CL spec is considered quite well specified as far as ensuring semantics goes. Decades-old code still runs
1:52:38
pjb
lottaquestions: you're using first/rest which is ok for a proper-list, but then you're comparing search-expr with the whole-list-of-expr that you have named whole-expr.
1:53:18
White_Flame
lottaquestions: btw, (let ((func (lambda ...)) (funcall func ...)) should be replaced with:
1:54:17
lottaquestions
White_Flame: Thanks. I struggled with that one. Especially since I didn't fully understand the difference between a lisp-1 and a lisp-2
1:54:55
White_Flame
yep, and #clschool might be more appropriate then, as here you'll usually get "very complete" answers with minutia that isn't the best for beginner learning
1:56:53
White_Flame
lottaquestions: your count-adder should be recursive itself, with a single RESULT binding outside that function. A simple incf result inside count-adder will make things easy
2:13:16
pjb
seok: CL has a *default-pathname-defaults* which is bound to a pathname designator, which may contain some directory component (but also other components).
2:13:43
pjb
seok: and of course, there are extensions in CL implementations running on POSIX systems…
2:15:12
pjb
seok: you may try: (uiop/os:getcwd) but only on CL implementation running on POSIX systems that have some posix extension
2:31:03
xristos
i try not to waste time with irc drama, but pjb has given me good advice in the past, and i don't see why a ban is merited here?
2:38:07
xristos
for the record i don't agree with this ban, he's spending his personal time here to help others, i've gotten useful advice from pjb, him mentioning POSIX is informative, i don't see why he should be banned
2:39:06
no-defun-allowed
In #clschool he accused me of only talking "degenerate" stuff and not about Common Lisp, and we generally haven't gotten along well.
2:42:56
PuercoPop
But I would think not. pjb has been giving unhelpful answers here for more than a decade
3:37:45
potta_coffee
I've been using Dr Racket to write Scheme for a while, and I use Sublime at work, I want to write Common Lisp now but nothing really seems to be satisfactory. It looks like Emacs is supposed to be the answer but
3:39:01
potta_coffee
It seems like it's really powerful, lots of features. Just a lot of time investment for me when I really just want to bang out some code
3:39:24
beach
Emacs with SLIME is currently the best development environment we can propose for using FLOSS Common Lisp implementations.
3:39:30
potta_coffee
Just thought I'd ask here and see if anyone is successfully using any alternatives
3:40:00
beach
So you don't really plan to learn Common Lisp? Just "bang out some code" and be done with it?
3:40:16
White_Flame
emacs is just an editor, and only a few keystrokes to do the lisp integration is required to learn
3:40:40
White_Flame
I'm no fan of emacs and use it because it's the best lisp environment; you don' thave to go deep with emacs at all
3:42:08
potta_coffee
beach, quick iteration and trying things out is an effective way for me to learn, the Emacs shortcuts are foreign to me and get in the way when all I want to do is experiment with a language
3:43:18
potta_coffee
Anyway...just wanted to see if anyone uses an alternative that I haven't heard of before I decide if I'm just going to invest in messing with Emacs
3:43:43
beach
potta_coffee: Here is one piece of information that may help you decide: If you choose an editor that is not able to indent your code properly, then you are going to waste more of your time than it takes to learn Emacs.
3:43:49
beach
Worse, you are going to have strange bugs and when you show the code here in order to get help, you are going to waste the time of others as well, because you are going to force them to count parentheses in badly indented code.
3:43:51
White_Flame
beyond emacs, there is VI integration. There's some level of integration with eclipse and atom, I think
3:45:18
White_Flame
obviously, you could just use any text editor and manually load from the REPL if you want :-P
3:45:22
Oladon
potta_coffee: Another thing for you to consider is that there is no such thing as a language in isolation.
3:46:16
Oladon
potta_coffee: A language in use (as opposed to in theory) inherits much, good (and bad for languages other than Lisp) from its community, and the community is made up of users with conventions
3:47:18
Oladon
I don't know that I'd call it a convention, but it's certainly a... tradition? Expectation? It's become the most common editor for real reasons.
3:47:25
White_Flame
alt-p to get the previous line of the repl, and ^c ^k to reload a .lisp file into the REPL. Those are the only 2 shortcuts you need
3:47:28
Oladon
My challenge to you is not to dismiss those reasons, but rather to ask yourself what they are.
3:47:59
White_Flame
and recompilation is all available from the emacs menus, if you're averse to keystrokes in general
3:50:38
White_Flame
and here's a cheatsheet of commands, both general emacs & slime-specific: http://pchristensen.com/wp-content/uploads/2008/02/slimecommands.pdf
3:52:33
potta_coffee
Part of what was scaring me away from Emacs, I started looking into it and was just stumbling into endless information about configuration and customization
3:52:48
Oladon
potta_coffee: Hehe. Emacs is an excellent editor out of the box, so no need to worry about that yet.
3:53:12
Oladon
The thing about Emacs, which you'll hopefully stick around long enough to discover, is that it's _fully_ customizable.
3:54:00
potta_coffee
Oladon: I have another editor, I customized heavily with lots of packages and settings, put my laptop away for a month and now I can't remember how to use it
3:55:35
White_Flame
sometimes youtube videos can help, as they're more displaying the actual interactions
3:58:01
potta_coffee
Is it trivial to configure Emacs for several different languages and switch between those environments?
3:59:35
White_Flame
it's what lets you jump to definitions of things, compile files/forms/etc into a running lisp session, etc
3:59:50
potta_coffee
So I'd have to have something other than SLIME that lets me use other languages
4:00:07
White_Flame
well, if by "use" you mean just syntax highlighting and such, many of those are built-in
4:00:23
White_Flame
if you mean live interaction with a running process, then yeah that's more the realm of SLIME
4:06:12
terpri
well, mostly cl-specific; there was at one point slime support for scheme48, though it might be bitrotten by now
4:07:54
terpri
it would be neat to have slime support for more lisp dialects. scheme has geiser which is pretty good, but slime is a lot more sophisticated
4:10:21
terpri
(someday there may be guile-cl, which would probably simplify slime integration considerably :))