freenode/lisp - IRC Chatlog
Search
12:59:58
jebes
how does ecl and abcl stack up against sbcl/ccl? I've heard ecl talked about favourably here.
13:01:10
jackdaniel
but ecl may be used to deploy your library as a shared library (and use it from i.e C application as i.e my-library.so)
13:01:20
jebes
jackdaniel: so if i was writing a high performance game/code base, the benefit of ecl's c integration might be outweighed by its speed?
13:03:19
jackdaniel
datapoints: ecl is slow with gf dispatch, we plan to work on it after the upcoming release
13:03:40
jcowan
Does anyone know how to find the "all issues" page in the clhs, or even if there is such a page? Dr. Google not helpful.
13:04:42
jackdaniel
ecl can't save the image (so you don't have save-lisp-and-die, you compile software from files)
13:05:13
jackdaniel
I don't know how fast / slow is ghc or c++ with gcc. compilation time penalty comes from invoking gcc
13:06:22
jackdaniel
you may be interested in talking with dto and borodust on #lispgames (there are others who work with games and lisp, but I know that both worked with multiple cl implementations)
13:12:54
jebes
how hard is it to reduce consing in lisp? Is it possible to get it to 0 or close to zero?
13:17:11
borodust
hi jebes, yes, it is possible to make tight game loops non-consing, aeth is one of the masters of such art
13:17:14
jackdaniel
(one more datapoint: statically-linked application built with ecl when stripped may fit in ~5MB)
13:20:35
borodust
last time i tried ecl was much slower than sbcl/ccl for my grossly unoptimized games, but aeth had very important suggestion i didn't try out yet that might improve ecl performance - for some reason by default cffi defines very slow method of calling foreign code for ecl
13:21:27
jackdaniel
it is indeed around 80x faster, but to make it default I need to work a little on passing original pointer declarations
13:22:41
jackdaniel
(right now cffi, when you declare something to return (char *), passes (void *) downstream to the implementation, what doesn't really work when you compile with C compiler)
13:23:26
jackdaniel
but lately (a few months ago I think) I've managed to make vaarg calls work OK, so it should be already faster with default being :dlopen now)
13:24:33
jackdaniel
nope, dlopen is not default yet, probably because of pointers still not being carried correctly
13:26:14
jackdaniel
but it is not guaranteed to work if you have functions in there which return pointers to something else than void
13:27:38
borodust
well, that's unfortunate, but we will see :) i think it's all :pointer down the road, which i guess is translated to void* anyway
13:29:05
ogamita
jebes: for one thing, it is not specified how much consing an implementation may do. So you can find that a set of functions in CL don't cons on one implementation, but cons on another.
13:29:55
ogamita
jebes: Then, the main problem is that consing and garbage collecting are not costly operations. It's like fork in unix: they're over optimized by lisp implementations.
13:30:14
borodust
ogamita: when building games (or end product in general), we don't care about portability often, because we have a privilige to choose an implementation we want to build end-user executable with :)
13:30:34
ogamita
jebes: So minimising consing means minimising one of the fastest operations of a lisp system, and replacing them by slower operations!
13:32:20
ogamita
jebes: you may have a look at http://cliki.net/Performance, there are some links about making Lisp faster than C.
13:32:35
borodust
jebes: you can write assembly in lisp! ;p see sb-cga which i already mentioned, but please don't :D prematur... well, you know
13:33:18
jmercouris
is creating a bunch of defgenerics an implication to the users who extend a class that they should probably implement those methods if no default implementation exists?
13:33:19
ogamita
jebes: one good trick, is to use pre-allocated objects (eg vectors), and upgraded arrays for things like double-float that would require boxing (a kind of consing).
13:34:18
ogamita
Take a lisp expression, and write a specific compiler generating optimized assembly, knowing your context.
13:36:32
borodust
jebes: e.g. assembly-in-lisp (sbcl-specific) https://github.com/nikodemus/sb-cga/blob/master/ports/sbcl.lisp#L137-L145
13:39:34
ogamita
Yes, the problem with sbcl, is that so many programmers using sbcl don't care about conforming or portability. Of course quicklisp only tests compiling with sbcl. So if you use sbcl, even if you try, you're bound to use sbcl specific libraries and APIs…
13:40:03
jebes
when i write normal non insanity driven lisp, i like to test on multiple implemtatios
13:41:05
borodust
ogamita: well, sb-cga has code for other implementations which makes it portable, it's just helluva lot slower on other ones
13:41:05
jmercouris
using sbcl specific extensions and making your code non portable should be IMO a crime, unless absolutely necessary
13:41:25
makomo
jmercouris: i'm thinking the same thing hah. "restricting" yourself to portable CL sometimes feels like you're missing out :D
13:42:47
jmercouris
because people will basically RELY on SBCL existing and being ported to their platform
13:44:09
jackdaniel
1. official ql policy is that library works at least on two implementations; 2. portability libraries are commonly used (bt for instance)
13:46:47
jackdaniel
" < jmercouris> the only solution is to pull in as few dependencies as possible" sounds super-dramatic to me
13:47:50
ogamita
jackdaniel: well, one problem is that there's no declaration of the supported targets for portability libraries and for cffi libraries.
13:48:30
ogamita
if asdf had such declarations, you could compute the intersection of the supporter targets for all your dependencies. (and find often, that you only have one or two implementations in there…)
13:48:46
shrdlu68
I like to take a look a look at the pgloader issues page because it reminds me of the actual issues I'd run into if I chose to write some tool in CL.
13:50:31
ogamita
Nowadays, you have to choose between C89, C99, C11, C18. Between gcc, clang, icc, msvc, etc; Various version of gcc with different features (and pressed by clang, it obviously adds new useful features all the time now).
13:51:47
jmercouris
though YMMV depending on how you've set-up your data and whether you are using mysql etc etc
13:54:33
jmercouris
All code does really well with ORMs has nothing to do with whether it is functional, it serves as a nice abstraction
13:54:51
jmercouris
I don't want to imagine what the underlying tables look like, I don't care, I am only working with objects
14:03:06
ogamita
Basically, SQL is for RELATIONAL databases. RELATIONAL databases are a good mathematical way to represent data and query it easily. But it is not the way real data in the real world is structured. In the real world, your healthcare file is not stored in tables with the healfcare file of all the other patients. In the real world, it's in a folder and you bring it with you, as an instance of person, to the next instance of doctor, to
14:03:37
ogamita
So basically, what ORM show, is that you should throw away SQL and RDBMS, and get yourself an OODBMS.
14:04:08
ogamita
The other problem that this denotes too, is how (the code of) applications are distributed amongst systems.
14:04:22
pfdietz
It's data as viewed by a large organization, not by a customer. As a customer, you don't care that your data fits (perhaps poorly) into tables with other customers.
14:05:02
ogamita
With a RDBMS, you'd have most of the logic of your application in stored procedures. With OODBMS, it's in methods of objects. But you need a OODBMS that can store objects with their methods in the database, and run those methods on any processing CPU that access it!
14:06:28
ogamita
As you can see, quite a mess. By the way, java (and applets) could be used that way. But there are no such system in use. The web ate java and applets, digested it, and threw it away, replacing it with ecmascript. (so called "javascript").
14:07:24
ogamita
But my point is that even OODBMS have difficulties because of this running of methods in the processing CPU.
14:07:59
ogamita
Or not. After all, with mobile applications, you often have this model where only the UI is on the mobile, the processing is done on the backend thru the web API.
14:09:10
ogamita
Now, perhaps you could do something usable, by hooking Common Lisp as stored procedure language in Postgresql.
14:09:37
ogamita
p_l: it's to run lisp program eg. in ecl on Android, and interact with java over a socket to do the UI in Android.
14:11:27
p_l
why not use JNI and possibly ring buffers (especially if shared data structure could be done)?
14:13:54
ogamita
well, you'd have to use libecl in that case. I feel safer with a separate process and sockets.
14:18:36
p_l
but it gets you idiots who read a header "R3 Corda used in finance..." and immediately look for "FEDCOIN" to invest into ;)
14:19:20
jebes
i do not feel comfortable being grouped in with people that use blockchain unironically
14:29:09
elderK
Well, after a few hours, here is my first "shot" at a set of macros: https://pastebin.com/wHu3kSu3
14:32:56
elderK
Yes, it does but it destructures. So, doesn't that ensure each "binding" has the correct form?
14:35:28
jackdaniel
(let ((a (foo-with-side-effects)) (b (bar-with-side-effects))) (if (and a b) … …))
14:39:37
elderK
I wonder how you'd do that. You could recursively expand it, or I guess you could have something like (and (setf ... ...) ...)
14:40:09
jackdaniel
there are two ways, either nested let (recursive expansion) or a block/return-from combo
14:41:58
pfdietz
But you can find out, using MACROEXPAND. Each implementation may do it differently.
14:42:58
jackdaniel
(let ((a (or ,form (return-from bam nil)) (b (or ,form2 (return-from bam nil))) …)
14:46:14
jackdaniel
ah, alexandria reserves when-let* for doing it one-by-one (there is no if-let* though)
14:48:54
makomo
jackdaniel: hm interesting. what would the semantics of IF-LET* be though? if one of the variables is NIL, what exactly can you expect to be bound within the ELSE?
14:50:09
makomo
i suppose WHEN-LET* is acceptable because there's really no ELSE. it's just "ok, never mind then"
15:23:56
shka_
and each time he is presenting his work, I think: "wow, this person is working on saving the world!" :D
15:26:36
makomo
+1 from me as well, just watching the talk. great work drmeister, very inspiring! :-)
15:30:17
cage_
moreover i like the fact that cleavir is in the game too, i am always happy when i can see the results of an useful collaboration
15:34:17
makomo
cage_: agreed! this is a very awesome and exciting time for CL -- Clasp, SICL, Mezzano, etc.
15:48:59
cage_
i wish we could use clasp (or ECL, why not?) to target webassembly, unfortunately i am not the person that is able to do that
15:57:42
jmercouris
to which stream can I print so that (print "fish") only returns fish instead of also printing to standard out?
16:00:28
jmercouris
Yes, what I actually want to do is call print-object, and have it only return the string, and not to standard out as well
16:00:31
Xach
if you aren't sure what might be involved in the output process, a string-stream can produce more reliable results
16:00:55
Xach
jmercouris: princ-to-string or prin1-to-string are some other things that can help there.
16:02:10
dim
I like with-output-to-string, in my head it's doing all the optimisation that you get when switching to a StringBuilder API in other languages
16:13:39
jmercouris
here's another question, how can I implement print-object, where it doesn't show quotes?
16:16:22
jmercouris
I want a generic way to get a string representation of an object for printing ina list
16:16:46
Xach
print-object is not a good way to get a string. make your own generic function if you want to ditch the general concept behind print-object.
16:17:12
jmercouris
then I will have to reimplement it as well for all normal data types like strings, numbers, etc
16:18:14
jmercouris
Xach: I thought defgeneric just created prototypes, and no actual implementation
16:18:32
jmercouris
can you make an abstract implementation? like what (defmethod object-string (object object) ...)?
16:19:51
Xach
the point is more that PRINT-OBJECT has the weight of expectations that you should not discard lightly
16:20:23
Xach
one of those expectations is that the object you read back from print-object is the same as what it printed, or there's an error (via the #<foo> unreadable object syntax)
16:21:06
Xach
now, within your own world you can of course do whatever you like! but it is usually better to knowingly break the rules than unknowingly
16:21:24
makomo
jmercouris: in what kind of context will you be using your "OBJECT-STRING" though? if you know you'll be printing buffers, can't you directly just print (name buffer)? if you don't know you'll be printing buffers, of what use is just printing its name (i.e. you won't know whether it's a buffer or not)?
16:23:21
jmercouris
makomo: I pass a list of objects to a minibuffer for rendering completions, how they are rendered depends upon the object
16:23:37
makomo
jmercouris: so does that mean you'll print buffers as something like 'BUFFER "foo"', to signify that they're buffers? would the unreadable object syntax suffice for that then (or do you want to customize it because you don't like how it looks)?
16:23:40
specbot
Similarity of Literal Objects: http://www.lispworks.com/reference/HyperSpec/Body/03_bdb.htm
16:25:44
pfdietz
There's something categorical about the relationship between equality, copying, hashing, and printing/reading.
16:25:55
makomo
jmercouris: and when you select that completion, what is inserted? the string "www.asdf.com"?
18:03:55
specbot
Similarity of Literal Objects: http://www.lispworks.com/reference/HyperSpec/Body/03_bdb.htm
18:23:22
anamorphic
Is it legit to define a function with its package qualification? e.g. (defun foo:bar () ...)?
18:37:44
pjb
anamorphic: defun doesn't care where the symbol naming the function comes from. The only forbidden symbols for function names are those in the CL package.
18:38:39
Bike
jcowan is talking about the definition of "similarity" for types, which is deffo undefined.
18:39:12
anamorphic
That makes sense... thanks. I guess if you want foo:cons, you'd have to have package created with (:shadow #:cons) ahead of time
18:39:33
pjb
(defun type-equalp (a b) (and (subtypep a b) (subtypep b a))) #| more or less |# (type-equalp 'character 'base-char) #| --> t ; t |# in this ccl.
18:40:56
pjb
Well then it's easy: types are not first class objects, so they cannot be saved to compiled files or loaded.
18:42:33
Bike
jcowan says the definition of array similarity depends on the definition of type similarity. there is no latter. Problem.
20:30:51
dtornabene
its the third time I've tried to install it and I hit different bugs each time, decided to just move on
20:31:52
anamorphic
You don't need roswell for lem, but if you do it will create a few commands for you to start it from the command line more easily
20:35:56
dtornabene
I guess its not right to say that the *roswell* install failed, it was actually choking on the lem install
20:51:45
dtornabene
i've been awake for almost a day at this point so I wasn't super motivated to try and chase it down, that and this being the third time, and that it was a lark
21:02:59
dtornabene
anamorphic: nothing there either, haven't used that function before, I'm assuming that it means I'd need to already have a version cached in local projects before I "register" it?
21:03:50
anamorphic
Yeah, so under ~/.roswell/local-projects, do you see a path structure like: cxxxr/lem ?
21:08:12
dtornabene
I mean, I hadn't tried to build it outside of the 'ros install cxxxr/lem' process
21:08:58
anamorphic
Ah OK. If you're not using roswell, just cd into ~/.quicklisp/local-projects and git clone https://github.com/cxxxr/lem
21:12:20
anamorphic
Hmm can you past the whole thing? Do you have the ncurses headers installed? On debian/ubuntu you need apt install libncurses5-dev I think
21:18:33
anamorphic
I'll try a new git fetch locally and see what happens. Maybe it dosn't build on master right now
21:26:17
anamorphic
I think you can check by looking in ~/.quicklisp/lisp/quicklisp/dists/quicklisp/software/ ..
21:30:44
dtornabene
a little embarrassed that everything was so out of date, shows how little CL I've been writing
21:34:00
dtornabene
so, I'm assuming since I'm in a repl at the moment, to use it I have to back out of the repl, and load a file with it from the commandline
21:35:07
anamorphic
Once your in lem though. you're still in the CL that you started it from, so you can just switch to using lem's slime-like repl
21:35:25
dtornabene
well I'm in, and there are errors on the screen, looks like slime is mad at lem, or something
21:37:54
dtornabene
anamorphic: is it reading all of the modes I have installed for my system emacs?
21:43:25
dtornabene
anamorphic: thanks again I'm exhausted so I'm going to crash now, how wonderful to be able to crash and just wake up and get to work
22:00:19
quipa
Hello, does someone know of a implementation of pi-calculus based language in lisp / scheme?
22:20:57
jasom
jcowan: e.g. perhaps you have a method to convert an object to html representation; there could be a default method that puts a stub value in
22:21:26
jasom
logging an unexpected missing method without breaking the control flow is another possible use, though I think the condition system is probably better for that.
22:22:27
jcowan
In ST that would be defined in a particular class, but of course generic function methods don't belong to a class, so I never thought about it.
22:23:07
jasom
jcowan: no CLOS and ST are so similar in many ways, but when they are different they are almost completely backwards from each other.
22:23:11
Bike
if you implemented something more like smalltalk in MOP you could define a no-applicable-method method on your generic function class to delegate to method-not-understood
22:24:31
jcowan
I was kind of surprised that the gf argument to n-a-m is of type t rather than type gf, but it's nice, it means it can be called when an ordinary function with type declarations fails the declarations, if an implementation wants to
22:34:09
jcowan
wonderful Abstract Heresies blog post, GvR vs. the JVM on tail recursion: http://funcall.blogspot.com/2011/03/tail-recursion-and-debugging.html
22:53:18
LdBeth
quipa: well you have to deal with some system level programming or emulate some aspects of an OS
22:55:55
quipa
LdBeth: hum ok, why would that be an issue if I am using scheme to implement a pi-calculus?
22:58:18
LdBeth
<freenode_qui "LdBeth: hum ok, why would that b"> quipa: it’s possible with emulating scheduling and context switching from Scheme
23:01:16
LdBeth
So modeling pi calculus is fine but after all high performance might not be expected
23:02:17
quipa
Fine with me for now, just wanted to see if I could learn / understand it coming from Scheme
23:02:46
quipa
Basically I was trying to compile Pict programming language which from what I can see is written in OCaml and it got me thinking if it can be done in OCaml surely it can be done in Scheme / Lisp
23:26:53
aeth
jasom: Where SLIME fails is usually custom lambda lists, or in macros that behave similarly to FLET.
23:27:59
aeth
jasom: It will also fail completely in mini-languages because it will treat everything internal to it like a function
23:28:20
aeth
(well, if it has s-expressions at all, but let's not talk about trying to indent loop)
23:29:31
aeth
In particular, with custom lambda lists Emacs fails to match the &key and &optional (and probably &rest) indentation that it uses for DEFUN/etc.
23:31:12
aeth
By "similarly to FLET" I mean this: ((name lambda-list body) (name lambda-list body) ...)
23:31:51
aeth
In particular, I actually have my own custom version of FLET now and manual indentation does not play nice with paredit.
23:37:50
dim
so I think I just solved a huge problem in pgloader that I didn't know how to reproduce (until tonigth where I had an ssh connection to a box where it happened)... and it turns out (setf *print-circle* t) would save the day and avoid the crash.
23:41:23
Colleen
Unknown command. Possible matches: 8, set, say, mop, get, time, tell, roll, help, deny,
23:42:26
dim
Xach: I might have abused recursive data structures, but to my defense, that simplifies walking from anywhere so much and for such a small cost that I'm happy to do it that way
23:56:02
jasom
dim: I hung the slime repl by doing the following in the repl: (let ((*print-circle* t)) (print something-circular))
23:56:41
jasom
print, of course, returns the object that was printed, which gets printed by the repl after unwinding the dynamic binding of *print-circle* :(
23:57:44
no-defun-allowed
Same happens in most terminal repls too, but it prints out the elements of the list infinitely.
0:08:15
sjl
Doesn't necessarily even have to be circular stuff -- accidentally returning an 100mb vector of bytes and having it printed is unpleasant, but not circular.