freenode/#lisp - IRC Chatlog
Search
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.
18:33:16
senecaty
Why does my isprime function always return nil? https://bpaste.net/show/1af47b67733a
18:59:38
aeth
What channel is it? Have they heard the "get a link via IRC bot that gives you a cookie, and that's the only way to paste" idea yet?