freenode/#lisp - IRC Chatlog
Search
7:23:58
aeth
Well, I've officially found something else other than compiling C++ that takes up 100% of all my cores (well, technically, all my threads). Chess engines.
7:24:56
aeth
This is constantly at 100% everywhere so it's actually the most parallel thing I've seen run on my CPU
7:29:02
aeth
There were minutes of this massive computational power before I stopped this chess engine while in the depth of 30, all so it could say "bestmove e2e4"
7:53:37
edgar-rft
aeth: It's definitely worth the massive computation effort, because once copmuted, the bestmove will win *all* future chess games, just because your opponent can't move any better.
7:58:16
B3nszy
I'm only familiar with Python as far as programming languages go and using Spyder as an editor
7:59:03
B3nszy
I got recommended SBCL/Emacs/SLIME for a development environment, what are those things
8:01:26
aeth
Emacs is a text editor, one of the traditional Unix text editors, next to ed (no one uses this) and vim (very popular because it's everywhere, but hard to use). Its main claim to fame is that it's very customizable, with lots of plugins, written in the dialect of Lisp called Emacs Lisp.
8:01:43
aeth
Naturally, it has good support for editing Lisps and Schemes since it's written in a Lisp (but not Common Lisp)
8:02:10
aeth
SLIME is the Emacs add-on that turns Emacs from a text editor into a full-featured Common Lisp IDE.
8:10:54
aeth
SBCL is not the only popular implementation. On IRC (which might be a biased sample), CCL and ECL are also quite popular. Common Lisp is not a single-implementation language and most software tries to be portable to as many implementations as possible.
8:18:32
edgar-rft
B3nszy, tutorials howto setup Emacs, Slime, and Lisp can be found here: <http://www.cliki.net/Getting%20Started>
8:20:45
hajovonta
I have a rather disturbing issue with SBCL+Hunchentoot on Windows: when starting a server with (hunchentoot:start (make-instance 'hunchentoot:easy-acceptor :port 12345)), it immediately starts to consume 100% cpu
8:21:37
hajovonta
then when hitting Ctrl+C in the REPL, SBCL goes into SB-KERNEL:*MAXIMUM-ERROR-DEPTH* exceeded and crashes
8:21:59
aeth
B3nszy: What I mean is that SBCL generally produces the fastest code (compared to other implementations), which is one reason why it's currently very popular.
8:22:01
B3nszy
I've downloaded it for mac and have 4 folders... to start using it do I just go ont he application 'portacle' or do I need to do something with the 'all' 'config' and 'mac' fles
8:43:21
Shinmera
If you have it open and see the CL-USER> prompt, when you type code in there, you're already compiling and running lisp.
8:43:58
Shinmera
Since you're already familiar with programming, the now recommended way to start learning the language is PCL. http://www.gigamonkeys.com/book/
8:45:00
Shinmera
Just ignore the notes about "Lisp in a Box" in Chapter two, as that's outdated and has been replaced by Portacle.
8:46:54
aeth
CL might look like it's interpreted at the REPL, but it doesn't have to be. SBCL by default isn't. It's actually compiling at the REPL. e.g. (defun foo (x) (+ 42 x)) (compiled-function-p #'foo) => T ; in SBCL
8:47:40
Shinmera
It's not too far off if you use a library, but just spend a week or two or maybe three going through the book.
9:02:24
aeth
If you want emacs to balance your parentheses for you, there are several things that do that. One is called paredit
9:05:40
Shinmera
Well, for people like me that just need a quick setup, paredit being on by default is great.
9:06:50
Shinmera
I see the real problem in, not necessarily paredit itself, but rather that there's currently no introductory text that gets people going with using it.
9:08:39
Shinmera
Portacle has a help file that lists the keybindings, but that's a reference, not really something to learn it by.
9:13:43
aeth
If the syntax itself is confusing: foo(1, 2, 3) => (foo 1 2 3) and foo[1] => (elt foo 1) and foo["key"] => (gethash :key foo) and [1, 2, 3] => '(1 2 3) or #(1 2 3) if literal, (list 1 2 3) or (vector 1 2 3) if not literal
9:14:14
Shinmera
My confidence in thinking it's just a matter of introduction lies with the fact that I managed to get my dad going with it, despite him being very resistant against keybindings of any kind. (He's been coding in Fortran for like 40 years, mostly on Windows)
9:14:41
aeth
And the difference between a list and a vector in Lisp is a list is for in-order access (because it's a linked list), while a vector allows random access
9:17:12
resttime
Has anyone used SBCL on ARM? I'm curious whether there might be any platform issues/instability (specifically ARMel).
9:18:31
beach
Do you mean that SBCL does not have threads on that platform, or are you saying something about the ARM architecture itself?
9:21:53
aeth
B3nszy: If you have very basic Lisp questions you can try asking in the channel #clnoobs
9:25:10
resttime
Yeah, I'm sorta learning on waiting for QT5 bindings for that isn't platform locked for now. Kinda even thinking of writing bindings myself, but no clue wheere to start since there's no smoke.
9:25:47
Shinmera
Ask stassats if you're serious. He might have some pointers on the way he was going to go for the CommonQt rewrite
9:55:44
resttime
Looked into the process of writing bindings for C++ and it's really ugh... I don't think I realized how much work it would be lol
9:59:11
Shinmera
Clasp was created because he was sick of Python and needed to use the C++ science libraries.
10:00:11
resttime
I wonder if one day: Use clasp to offload the C++ parsing magic-ish stage and then generating the bindings for lisp implementations. A lisp version of SWIG I suppose would be the gist of it.
10:00:46
Shinmera
But clasp is slow, unstable, and so forth. It especially was two years ago when he first got the idea for that.
10:03:25
Shinmera
The second idea was to use Clang's tools straight up in C++ to do the parsing logic, but that was abandoned because it took him way too long to do anything at all.
10:04:08
Shinmera
The third was to use c2ffi, not sure what happened to that or what his current thoughts are.
10:08:06
lisp_guest
Shinmera, took him too long, as in the small/simple/quick stuff was too complicated/long to write?
10:16:14
Shinmera
If someone implemented the name mangling algorithm for GCC/Clang in Lisp we'd already be a long way there to binding to C++ directly without needing a C bridge.
12:08:10
p_l
Shinmera: the name mangling algorithm is the *easy* part, since you can easily get GCC to spew out the mapping
12:08:56
p_l
vtable stuff gets hairy, because it's start as plain offset but then you need to take care of inheritance which is where it gets... weird
12:09:30
p_l
Shinmera: without GCC being available you have no guarantee that you'll get vtable layout, which means you're dead on arrival for C++ interfacing
12:09:53
p_l
anyway, C++ compiler involved in compiling the module you're linking with is necessary at the point of compiling the binding
12:10:28
p_l
the sole exception is Windows, which is used to heterogenous languages, so serious modules tend to have COM bindings, and those have common API
12:11:08
p_l
on AIX, you can compile C++ code with alternative interface which is afaik easier to interface with, but I don't know how it goes into code mixing
12:11:48
Shinmera
p_l: Hold on, why do you need GCC for the vtable layout? Surely the algorithm to compute it must be replicable
12:12:49
p_l
Shinmera: it's in the class of "you only need to implement a C++ compiler to interface with C++" kind of task
12:13:21
_death
not just vtable layout.. passing this, exceptions, limitations wrt template support.. etc. and of course each implementation may have its own ABI.. there was a good book (likely outdated by now with all these new standards) by Lippman
12:13:49
Shinmera
_death: If I remember correctly Clang and GCC are ABI compatible, so that part is not that big a deal
12:14:22
p_l
Shinmera: in theory, in practice you hit dependencies on their own implementation of stdc++
12:15:07
Shinmera
Oh yeah I remember trouble in Clasp building related to differing stdc++ implementations
12:15:33
p_l
"string" in one binary is not the same "string" in another binary depending on flags and libs
12:16:08
p_l
if the binary is compiled with full debug symbols, you can extract all kinds of data, including exception handlers
12:18:12
Shinmera
p_l: Will a library built without DWARF symbols still correlate with one built with so you could just parse out the definitions from a debug-enabled one?
12:23:39
Shinmera
The C++ exceptions part is fortunately one that can be ignored for a lot of libraries as they don't use it.
12:24:08
Shinmera
So even if there was "just" a vtable and name mangling compiler in CL you could get pretty far.
12:24:58
p_l
I'd still recommend DWARF parser for various reasons, including getting data on types etc.
12:33:54
Shinmera
Right, but even without exceptions there's a lot of stuff that needs to be replicated to get this going.
12:35:20
Shinmera
As p_l suggested, if the DWARF doesn't influence the produced binary, one aspect instead of replicating a compiler would be to parse out the DWARF info and use that to feed the information needed to call methods.