freenode/#lisp - IRC Chatlog
Search
11:45:13
jmercouris
amerlyq: you can see them here: https://github.com/robert-strandh/SICL/tree/master/Papers/Global-environments
11:48:01
jmercouris
beach: I'm assuming it is portable since I take it this one of the things SICL brings to the table
12:55:39
jmercouris
can someone please help explain some unexpected behavior, I have this simple file I am loading: http://dpaste.com/0FRTE2V
12:55:53
jmercouris
in the SLIME REPL I do: (trivial-main-thread:call-in-main-thread #'gtk-tutorial::start)
12:57:43
jmercouris
I tried to change my .swank.lisp to: (setf swank:*communication-style* :fd-handler), but then it is impossible to quickload cl-cffi-gtk
13:01:56
Nilby
This is one of the reasons I don't use slime for this kind of thing, but maybe if you start gtk first, and then start swank and connect to it?
13:02:35
jmercouris
Nilby: what do you mean? start SBCL in a terminal, quickload cl-cffi-gtkk, load swank, start a swank server, and then connect slime to it?
13:03:21
jackdaniel
Nilby: do you have backdoor in your head? people peek into it to answer instead of you ,)
13:06:59
decent-username
If people are already talking about GTK. What's a good library to use for writing GTK-3 GUIs?
13:09:04
jackdaniel
(and provide some small bindings which are needed for my lisp app via callbacks or whatever)
13:10:34
decent-username
The issue I'm currently having with CL it's missing libraries. In order to write those libraries I need to really know C.
13:11:03
decent-username
The GTK discussion shows, that there's apparently no solid GTK library for CL.
13:11:11
jmercouris
OK, so to use SLIME AND get proper widget rendering I've appended: (swank:create-server :port 4006 :dont-close t) to the bottom of my file for convenience, I load it in a terminal, then slime-connect
13:11:37
jmercouris
You don't need to know C to write Common Lisp libraries, not even ones that utilize CFFI
13:11:58
decent-username
jackdaniel: Because one needs to understand what's going on under the hood, to write good libraries.
13:12:04
jmercouris
CFFI is hard to learn since I couldn't find a good tutorial, but technically speaking it is straightforward
13:12:17
jackdaniel
decent-username: do you mean that you want to write clones of C libraries? or that you want to write bindings?
13:12:42
jackdaniel
because if you write bindings, then you are not writing Common Lisp library but rather a wrapper over C library (meaningful difference)
13:13:18
jmercouris
all of this said, now that you know my solution, how can I do this in Emacs to avoid having to spawn a terminal and load SBCL and perform some operations
13:13:22
jackdaniel
hm, then I don't think that peeking how C library works will give you much advantage
13:13:41
Nilby
jmercouris: Your paste worked for me, running it outside of emacs in the main thread. But when I tried it in another thread I got sbcl to SIGABRT, which leads me to believe that it tries to create it's own threads from C libraries.
13:14:05
jmercouris
Nilby: yes, it does try to make its own threads, it tries to make a GTK main thread
13:14:26
jackdaniel
hence "underhood workings" also will be very different -- unless you want to write C in Common Lisp
13:14:40
decent-username
jackdaniel: I for my part want to write a CL game engine as a learning project. But basically all tutorials for these kind of things are in C. I'm not sure if there's an official OpenGL API for CL.
13:15:42
jackdaniel
cl-opengl gives you bindings, but yes, shared objects which export the api exhibit C ABI
13:16:11
jmercouris
I think the real statement is this: a lot of the world runs on C or CFFI, in order to be effective you should know C
13:16:27
jmercouris
because you will want to leverage existing libraries to avoid having to write everything down to assembler
13:17:11
jackdaniel
this statement is not very compelling, and the assembler remark is plain inadequate, why would you want to write everything down to assembly? doesn't CL implementations compile things to assembly?
13:17:55
jmercouris
for example, I'm using CFFI for Next, because writing a web engine that meets modern web standards and performance would take me tens of thousands of man-hours
13:18:27
jmercouris
it is intellectually flawed, but this is a casual conversation, not an academic debate :-D
13:20:02
decent-username
Does someone of you have a roadmap for someone who sees that there aren't any good GTK libaries for CL, and who wants to write a good one.
13:21:31
jmercouris
Qt is not slow, the implementation of the renderer on your port may be slow, and on every port, but Qt itself, no not slow ;-)
13:21:38
jackdaniel
you need to back up this statement with benchmarks, because its memory footprint is very small lately, and I don't remember it being slow
13:23:33
decent-username
jackdaniel: The main reason I prefer GTK over QT, is that GTK feels more native to UNIX-like OSs. Themes are automatically inherited and other things like that.
13:24:21
jmercouris
This feels a little bit off-topic now, let's please not discuss the merits of Qt vs GTK
13:44:27
jmercouris
so I ended up making a simple file, then I open up eshell sbcl --load my-loading-file.lisp which loads cl-cffi-gtk on the correct thread, then I slime connect, etc
13:44:36
jmercouris
I'm sure I could make an elisp function to do this, maybe I will in a little bit
13:44:49
Nilby
But it seems to work consistently not under slime. I think there's probably a way to get slime to run it in the main thread.
13:45:01
decent-username
jmercouris: I've just downloaded Next. I had it bookmarked from a year ago or so. I've wanted to change my setup to GNU GuixSD + StumpWM. I might also change my default browser while I'm at it.
13:45:38
jmercouris
Nilby: quickloading on the main thread is not the answer though, and neither is modifying swank init to use fd-handler
13:49:33
Nilby
It doesn't create threads when loading this example, only after calling (start). Also since swank uses a socket, if I remember correctly gtk usually needs you to register sockets with it to work. But then it probably won't know how to hand off to slime.
13:51:34
jmercouris
sbcl --load file.lisp, then (trivial-main-thread::call-in-main-thread #'gtk-tutorial::start)
13:51:57
jmercouris
then try the same thing, by starting slime and just loading that file with C-c C-l
13:52:55
jmercouris
In the first example, I forgot to mention that you slime-connect to localhost:4006 before running the trivial-main-thread code
13:52:56
Nilby
Maybe one would want it to work like emacs works with gtk, by having it's own event loop and handing off some events to gtk.
13:53:38
jmercouris
yeah, that is how it is usually done with this library there is a (within-main-loop) macro that does that
13:53:54
jmercouris
however, I cannot use that, as it breaks rendering for some special widgets on macOS (as we discussed earlier)
15:00:42
Xach
it looks like cl-dbi recently dropped its use of cl-syntax (which is nice) but it does break dbd-oracle
15:01:04
Xach
cl-syntax is the thing that prompted people to use @export (defun foo ...) rather than putting exports in defpackage
15:08:42
beach
minion: memo for jmercouris: Yes, the code for first-class global environments is written in entirely portable Common Lisp. But, of course, compilers of existing Common Lisp implementations don't use them, so you need a Cleavir-based compiler for that.
15:09:51
minion
jmercouris, memo from beach: Yes, the code for first-class global environments is written in entirely portable Common Lisp. But, of course, compilers of existing Common Lisp implementations don't use them, so you need a Cleavir-based compiler for that.
15:10:50
jmercouris
is SICL just a technology demonstrator, or do you eventually plan to make it a complete implementation that one can download and use?
15:13:13
beach
I have been busy with ELS submissions, but otherwise, I am working on code generation.
15:13:36
jmercouris
what percentage of the way is the task complete would you estimate? (making SICL a complete implementation)
15:14:32
beach
I don't think there is much left in order to make it work, but then there is a lot of work left to make it fast.
15:16:11
beach
I am secretly hoping that, once I have an executable, I will get a bit more help with the tedious work.
15:27:52
jackdaniel
ebrasca: do you mean why the name is "sicl"? afair beach said that there is no particular reason and it is not an acronym of anything (except of the CL suffix of course)
15:29:46
jackdaniel
ebrasca: my answer would be "why not?". that said sicl is implemented from scratch in full Common Lisp - luxury other implementations did not have - they have grown from previous lisp incarnations or are bootstrapped from other languages
15:30:38
jackdaniel
and using full Common Lisp instead of i.e subset gives you cleaner code; moreover some hardware characteristics has changed and they are taken into account when it is designed
15:32:18
jackdaniel
afaik sicl project has its own assembly emitter, I don't remember its name. I'd suspect that it is up to the cleavir's lir implementer to use it or to use some custom "LAP"
16:05:58
beach
ebrasca: I don't think it is appropriate for me to pollute #sicl with yet another series of utterances about why I started the SICL project. If you really want to know, join #sicl.
16:06:04
beach
The assembler that SICL uses is called Cluster, and it is a separate repository. You will likely be disappointed by it, because it does not have a surface syntax, since it is meant as a backend for compilers.
16:06:05
beach
If you were to write an assembly program for it, it would look like (list (make-instance 'instruction :mnemonic "MOV" :operands ...) (make-instance 'instruction :mnemonic "ADD" :operands ...))
16:08:19
pjb
Wouldn't it be trivial for a lisper to write: (defun assemble (instruction) (apply (function make-instance) 'instruction :mnemonic (symbol-name (car instruction)) :operands (mapcar (function assemble-operand) (cdr instruction)))) ?
16:09:16
beach
So rather than imposing a syntax on the user, and syntax seems to be what everyone can disagree upon, I allow for whatever surface syntax you want.
16:18:10
beach
ebrasca: I guess I can say one unique thing, which jackdaniel already hinted. SICL is the first implementation I know of that is written entirely using the full Common Lisp language.
16:18:11
beach
Even an implementation such as SBCL (with very little code in any other language) can not use the full language for certain modules, in particular the compiler. The SICL bootstrapping technique is unique, and allows me to use the full language for every module.
16:19:18
pfdietz
The SBCL type system implementation has some hairy code that would benefit greatly from being able to use CL's full object system.
16:44:18
|Pirx|
I'm playing with hunchentoot, I want it to handle all requests with the same function (looking up uris in a hash table and returning a fixed string), not maintaining a list of handlers, not serving files, what would be a good way to do that?
16:45:10
|Pirx|
define-easy-handler use a handlers list, depending on uris, but I want the same functions for everything
17:30:22
alandipert
hi all, i'd be grateful for any feedback from anyone on my ELS submission about my WIP browser-based implementation, JACL. thanks in advance - https://tailrecursion.com/~alan/documents/jacl-els-2020-draft.pdf
18:20:10
alandipert
_death https://gist.github.com/alandipert/bf7167580f385d7eb8f6dd0fb38698cf demonstrates most of what's currently available
18:28:26
alandipert
i've been plugging away at it for over a year though, with no signs of stopping. looking forward to collaborating on it with people after it reaches a certain point
18:31:24
Xach
alandipert: glad to see some review of jscl, which is what immediately sprang to mind for me
18:32:56
alandipert
Xach thanks, yeah, jscl... i've really enjoyed exploring jscl, it's filled with excellent ideas
18:33:34
alandipert
the way it supports multiple values is especially clever, i will probably end up with a similar approach
18:34:16
_death
hmm, disconnected so don't know if this went through.. I guess one question would be, what is the rationale for creating something new from scratch instead of improving an existing implementation
18:36:41
alandipert
_death i struggle with this, but decided ultimately that the jscl project goal was not in alignment with my own. and so i couldn't expect other users to want to collaborate on a rewrite
18:45:47
dlowe
and when you show them the amazing frob you made, they'll say yeah but I made a better frob using import frob and then extending it
18:49:13
vms14
the only stuff I've achieved with lisp was yet another html generator with code able to make you cry and some clx windows using xshape so they're characters moving on the screen
18:53:57
alandipert
_death a SPA type thing? or were you doing electron stuff? or something different
18:54:37
_death
alandipert: I usually avoid anything that requires javascript (my main browser has js disabled by default).. but for this it was kind of needed so I went all out
18:54:41
dlowe
the only reasonable choices are to enjoy lisp by yourself (and the very intelligent and good looking lispers on IRC) or use whatever the people around you are using
18:57:12
alandipert
how did you find yourself propagating effects in response to clicks? in a past life i've taken a Cells type approach, albeit from clojurescript
18:58:12
_death
alandipert: the probability propagation is made on the server.. if you mean the UI, it's react
18:59:01
alandipert
_death gotcha. so you are receiving full graphs from the server, and react is relegating them with the local UI state it sounds like?
19:00:02
_death
alandipert: currently probability propagation happens using a junction tree.. before that, I used variable elimination to query for each node.. also implemented pearl's belief propagation (extended for polytrees), and approximate approaches such as likelihood weighting
19:01:45
_death
I also implemented several BN structure/parameter learning algorithms.. and before that hidden markov model, bayesian classifiers, etc. basically I'm reading a book about probabilistic graphical models and implementing most of what it talks about
19:05:51
_death
alandipert: it takes a while to read a book that way.. and also, it's intertwined with many papers ;)
19:06:48
alandipert
Nilby i'm humbled you're familiar with it :-) working on that was ridiculously fun
19:18:43
alandipert
vms14 as far as i'm concerned, it it were possible to "win" at the reading of PAIP, the creator of SLip has won
19:22:36
alandipert
vms14 oh, just because he started with the compiler and bytecode interpreter in PAIP and ended up with a lisp system with cooperative multitasking and an emacs clone
19:31:08
Nilby
I just took it as entertainment. What I actually want to use is the other way around, the browswer inside emacs inside CL.
19:32:05
vms14
ebrasca: because I'm not able to find how to start playing withthat, more than with the turtle library
19:35:29
vms14
ebrasca: it's a "cursor" that goes drawing lines when it moves, just take a look at the slip site
19:36:48
vms14
the thing is I want to use slip for making a blog, but the documentation says "look at this shiny code I wrote and figure it by yourself :D"
19:42:22
Nilby
Well documented things destroy our opportunity to practice writing documentation, and independently understanding dense and arcane code.
19:52:46
vms14
docstrings talk about what a function does, write documententation is a thing we usually don't want to do, specially if we don't know how many people would use that
19:54:27
vms14
anyway I suppose lispers are used to look at the code and track what the heck the software is doing
22:06:10
Xach
A long time ago I bought a book about X, and it mentioned that some limits are what they are to accomodate Common Lisp tagged integers.
22:13:46
no-defun-allowed
Basically they allow a fixnum to be represented in one word without heap memory by jamming the fixnum in the pointer with a different bit pattern to actual pointers.