freenode/lisp - IRC Chatlog
Search
22:56:01
Bike
" Terminates the thread THREAD, which is an object as returned by MAKE-THREAD. This should be used with caution: it is implementation-defined whether the thread runs cleanup forms or releases its locks first. " oh, good
22:58:04
Josh_2
I need a big boi thread to stop my other networking threads, currently I just use destroy-thread but the unwind-protect doesn't seem to be called
23:03:07
Josh_2
I think the best way to kill my threads would be to have a variable that the threads will atomic read to check if they should continue
23:13:27
tsizz
idk. all i remeber is that graham website about lisp and he wrote websites with lisp. and since i work with web for now, i thought that'd be cool
23:14:38
Josh_2
There is Hunchentoot which is a webserver and you can use a library like cl-who to generate html
23:15:12
Josh_2
I personally just write the JS normally and include the scripts in my cl-who functions
23:18:44
Josh_2
https://plaster.tymoon.eu/view/1244# this is the navigation bar in this image https://cdn.discordapp.com/attachments/252495909517131776/553259132589703169/yeet-site.png
23:19:15
Josh_2
So whenever I want a navigation bar I just call the function (navigation) within a with-html and it will display that bar in that site
23:20:50
Josh_2
So the client requests a page on my hunchentoot server, the server then generates the page dynamically and serves it to the client
23:22:00
Josh_2
But remember how you use <script src= ...> in html, well all my scripts are just included in my dynamically generated html
23:22:10
aeth
pjb: But only a implementation internals can do this with the simple-string that with-output-to-string returns, i.e. (type-of (with-output-to-string (out) (format out "Hello, world!~%"))) => (SIMPLE-ARRAY CHARACTER (14)) ; technically, only string is specified, but I'm sure some code would break somewhere if it wasn't a simple-array
23:23:21
aeth
If you implemented it yourself you'd have to copy it into a simple character array at the end, or manually adjust it with (simple-array character (*))s and subseq at the end to get the correct final length
23:24:14
Josh_2
tsizz: https://plaster.tymoon.eu/view/1288#1288 that is my html header which is part of all the pages
23:25:26
Josh_2
so my index page ends up being (defun index-page () (with-html (:html (header) (index-body))))
23:25:27
tsizz
import is big in JS/node, but isn't that not a thing in lisp or is that just my academia just talking about strictly functional programming
23:25:33
aeth
pjb: Actually, slight correction, I should have used typep since reporting either simple-array character or simple-string is up to the implementation.
23:27:10
Josh_2
so cl-who the library I'm using to generate that HTML is imported like (ql:quickload #:cl-who) once you have quicklisp installed :P
23:28:05
tsizz
Josh_2: okay cool thanks im reading the first part right now the why learn CL part hha
23:28:36
tsizz
i think this is the one of the most intriuging parts "You'll get more done, faster, using it than you would using pretty much any other language."
23:29:41
Josh_2
you will get things done faster if the program is sufficiently complicated, not sure if people will agree with me
23:30:28
Josh_2
doing simple things can seem a bit annoying but when it comes to doing harder things its a joy to use CL
23:33:14
Josh_2
well major libraries are all documented really well, but stuff you find on github might not be
23:36:08
tsizz
im just a bit confused bc natural language for browser is JS so when CL comes in the picture not too sure
23:36:46
Josh_2
so all ur webdev stuff still works but you can use CL as your backend instead of PHP
23:38:17
tsizz
but then dynamic stuff...? u use js or some CL library that compile to JS or something..?
23:38:20
Josh_2
The client sends a request to my Hunchentoot server, which then evaluates some functions to get the HTML it then sends that HTML to the client
23:41:16
aeth
tsizz: A slight variation on what Josh_2 is saying... I personally find that writing things from scratch in Common Lisp is easier than in just about any other language, but that the necessity to write things from scratch is greater, so I'm not sure there's a real net time savings or not. It does suggest that CL is well-suited for very underexplored problems, though.
23:41:51
aeth
Writing something in C++ or Java is much harder than CL but someone else almost certainly already wrote a library to do it.
23:46:46
aeth
Really, none of the above. ML is done on GPUs (or specialized hardware, like Google's TPUs).
0:02:08
no-defun-allowed
there's some ML libraries in CL without C, I am finishing up a deep network library with Petalisp, and GPU programming can be done in "Lisp" using oclcl
0:02:30
aeth
Isn't ML just essentially running CUDA or OpenCL (nothing to do with CL as in Common Lisp) or similar?
0:03:27
aeth
I'd be interested in seeing a proper abstraction over SPIR-V so Lisp-like GPU-oriented languages can compile down to it.
0:05:50
no-defun-allowed
yeah, but most people abstract the GPU (or TPU i guess?) as a machine that does matrix multiplication and element-wise sigmoids, adds and multiplies
0:06:03
verisimilitude
That would be amusing, at the least, using a Lisp for that idiotic idea of ``machine learning'', when it's more suited to proper symbolic manipulation.
0:07:12
no-defun-allowed
indeed, but symbol manipulation doesn't make much sense in a high performance matrix library, and you can't get the kids hooked on calculating derivatives unfortunately unless they're maxima users
0:07:39
no-defun-allowed
well, the IR is SSA like LLVM which isn't very lispy (i have a library that converts trees to LLVM IR/SSA for that reason)
0:07:49
no-defun-allowed
https://www.khronos.org/registry/spir-v/papers/WhitePaper.pdf may be of interest?
0:09:16
aeth
no-defun-allowed: In CL, you have far more abstractions available to you than in most other languages for dealing with things like e.g. GPU shaders. This is because you can transform arbitrary s-expressions into just about anything you want. Other approaches would probably be string-to-string or heavily object-oriented (not too unlike a database ORM) or similar messes.
0:09:38
aeth
verisimilitude: Common Lisp has been an acceptable FORTRAN for years at this point, especially SBCL. It's not just symbolic.
0:14:09
aeth
Bike: At the moment, most SPIR-V tools are LLVM and/or C++ oriented. Targeting SPIR-V properly from CL involves a lot more than e.g. targeting GLSL properly (really, that can just be generating a valid source string). Just look at https://www.khronos.org/spir/ and then https://www.khronos.org/assets/uploads/apis/2018-spir-api-ecosystem.jpg
0:21:41
aeth
verisimilitude: The way you harmonize symbolic behavior with numeric behavior is by writing some pretty low level CL. (SBCL works pretty well with the structs-of-arrays low-level pattern, and nothing is stopping other implementations from similarly optimizing.) You then abstract over these low-level details, including via macros, getting something pretty high level, as if you wrote your own programming language to solve the problem.
0:22:08
aeth
Not really a particularly good solution for ML in particular, though, because afaik serious ML is done on GPUs, so you'd need to write your own GPU-mini-Lisp.
0:23:05
no-defun-allowed
though, i wonder how hard writing a petalisp backend is, probably too hard for me, but running it on a GPU should be possible i think if you can copy over all the GPU-used functions too
0:27:35
aeth
You wouldn't want to put a proper Lisp on the GPU because proper GPU programming is all about knowing when to do things on the CPU and when to do things on the CPU. Implementing it as a DSL in CL means you can do all the macros, list processing (probably for the macros), etc., on the CPU in CL.
0:28:06
no-defun-allowed
of course, i'm suggesting a backend for a matrix processing library that offloads work to the GPU
0:28:36
aeth
I'm not sure about GPU compute, but GPU graphics shaders definitely have a "program" metaphor that imo is unnecessary. Why not just define-shader-function etc.?
0:31:47
aeth
The whole thing is structured for familiarity for C programmers, but it's pretty far from PDP-11 so it's imo pretty weird imo to see things like a main()
0:39:58
no-defun-allowed
makes the C++ people feel fuzzy inside, and makes the interface fuzzy for everyone else
0:40:59
aeth
More "UNIX philosophy" than C++. It's pretending you're doing something Unixy with independent programs like: head -n 42 foo.txt | grep bar
0:48:48
aeth
GLSL for GPU shaders is kind of strange. Every shader stage has its own main() but then you link them. But you'd just get a multiple main()s issue if you tried that with GCC and C... so it's inconsistent in its C-like behavior. Shaders aren't programs!
0:49:50
aeth
tsizz: Common Lisp is mostly compatible with the historic Lisps, so it seems more archaic than Scheme, which broke compatibility with historic Lisps and even itself.
0:51:26
aeth
tsizz: Common Lisp is a primarily a replacement for Maclisp and Interlisp, which predate Scheme, and Lisp Machine Lisp, which apparently came out in the same year as Scheme. See the timeline at https://en.wikipedia.org/wiki/Maclisp#History
0:56:03
aeth
tsizz: Newer is definitely always better for programming languages... because that way you can't use anyone else's code and have to write all of the key libraries yourself!
0:58:38
tsizz
aeth: since ur saying that tho, i feel like current languages do have way better support, but im not sure
0:59:26
aeth
tsizz: Current languages? Most new languages either have nothing or they're backed by Google, Apple, Microsoft, etc. Many are built on the JVM so they can just use Java libraries.
1:00:59
aeth
JavaScript has a ton of libraries because its bar for "library" is much lower. A single function can be a library in JS land.
1:02:23
aeth
(Okay, CL has one popular library that comes close to that: split-sequence, but it's very non-trivial and it has three functions.)
1:08:14
verisimilitude
Common Lisp wasn't designed in a week and wasn't designed solely by people who had no place designing a language.
1:08:40
verisimilitude
Not counting Ada revisions, I'm not aware of a single new language that is worthwhile.
1:14:57
aeth
verisimilitude: The ML family of languages (and influenced languages like Haskell) have some interesting ideas. There are also some specific language features that might be interesting, such as async.
1:17:23
aeth
Looks like Standard ML is 1983 so it predates CL by a year, though. Haskell is 1990, OCaml is 1996.
1:20:04
aeth
Another language of potential interest for proglang design features is Erlang (1986). I'm probably missing a few more, but quite a few interesting languages are pre-1984 languages.
1:21:16
aeth
The 1990s were mostly about web-oriented Unix scripting languages... exactly the sort of thing you'd probably not call interesting, e.g. most of the ones here: https://en.wikipedia.org/wiki/History_of_programming_languages#1990s:_the_Internet_age
1:22:57
aeth
verisimilitude: Just looking at that history page... Forth is 1970, APL is 1962, Smalltalk is 1972, Prolog is 1972, SQL is 1978... all of which might be interesting even to a CL programmer. I was trying to exclude languages that weren't "new", relatively speaking.
1:25:21
aeth
Julia seems to be the only really new (released this decade, specifically in 2012) major language that interests Lispers.
1:26:37
aeth
I don't really see what others seem to see in it, though. It's dynamically typed but the fast numerical code that does well in benchmarks uses type declarations... exactly like SBCL.
2:04:43
Hexstream
Check out the Common Lispers list! Discover Common Lisp open-source contributors and their best contributions! Add yourself! Gone are the days of toiling in obscurity, now everyone has a chance! We're ushering in a new era of unprecedented discoverability!
2:22:31
pjb
Once we've done (ql-dist:install-dist "http://dist.ultralisp.org/" :prompt nil), how can we select it as default distribution for ql:quickload?
2:51:24
Hexstream
The "barren" setting is a planned feature, but unfortunately won't happen soon. My version has always contained 148 "RS" links to easily get to the corresponding section in Robert Strandh's more barren version.
3:57:14
patrixl
I'm trying to use cl-sqlite on my Mac, as part of using Radiance. So Radiance + cl-sqlite needs regex support in sqlite, which is fine I can install it, however.....
3:57:38
patrixl
so I installed one with brew which supports it, and compiled regex support for that one and it works
3:58:02
patrixl
but it seems like cl-sqlite still uses the default sqlite and not the one compiled with brew. Not sure if I can somehow make it use the newer one?
3:58:20
patrixl
hopefully someone here has similar experience and can help... otherwise I'll have to dig in and figure it out ;)
4:00:31
patrixl
right, well as far as I can see, cl-sqlite is usinf cffi, so I would assume that it would need to find the correct libraries when cl-sqlite is being compiled?
4:00:59
jackdaniel
Hexstream: is there exclusion policy? while I appreciate the effort I have mixed feelings about such data aggregation and public release without my consent
4:05:23
patrixl
ok let me try to clear the cache ,and try what brew is suggesting, see if cl-sqlite can find the correct libs this time
4:05:47
patrixl
if not, then you would recommend adding brew's sqlite lib path to cffi:*foreign-library-directories*?
4:10:08
patrixl
yeah!!! now I am actually hitting bugs in Radiance, so at least I can move forward lol
4:11:10
Josh_2
anyone know how to send a mouse click event with Xlib? am using (xlib:send-event :pointer-window :button-press 256 :display display) but I get no-applicable-method :O
4:36:44
equwal
Is is possible to have an immutable variable? So (and (setf *five* 5) (setf *five* 6)) will give an error? I can make immutable structures with defstruct, but I can't store them.
5:12:51
pjb
equwal: well, defconstant defines a constant variable, which is a variable with a constant binding. However this constant binding can be made to a mutable object!
5:13:15
pjb
equwal: (defconstant +cell+ (cons nil nil)) (setf (car +cell+) 42) +cell+ #| --> (42) |#
5:14:09
stylewarning
Coalton now has basic pattern matching. (Not as expressive as a full fledged ML or Haskell but it’s getting there.) https://github.com/stylewarning/coalton/blob/master/src/library.lisp
5:44:50
stylewarning
it's better to just design an API that discourages mutability, e.g. by making copies, not exposing accessors, etc.
6:18:50
MichaelRaskin
beach: well, if I were _not_ coming it would mean I managed to get a committment to Lisp out of my coauthor. Which would also be great.
6:19:20
Josh_2
beach: it is send event I have (xlib:send-event :pointer-window :button-press 256 :display display) but that is very much not working
6:22:08
MichaelRaskin
beach: a PhD student here in Munich, he was given some projects about verifying mutex algorithms in various settings, and I had some code for playing with first order proofs, and so we decided to start with having a formal spec and a formal proof (and gradually reducing the part of proof we do manually)
7:29:47
gilberth
I was watching my tongue as I said to myself 'what' and some German words like "Wasser", "Wand", "war" etc. And I feel the difference.
9:46:34
moldybits
is there a reason you can't (push 1 (last x)) where x is a list? other than the standard not saying you should be able to.
9:50:26
moldybits
right, i just wondered if there was a particular reason for that being that case :o
10:02:13
MichaelRaskin
Indeed, both the case of empty list and the case of setting non-list are a bit undesirable
10:02:17
_death
it would also not do for (single-element), since it would need to change the binding of X so that it be (1 single-element).. (cdr (last x 2)) can work in other cases
10:02:19
no-defun-allowed
yeah, to replace the last cons in a list, you would need to back up a cons if the list has conses before it, or replace the variable if there is only one cons
10:03:45
phoe
because the compiler would have to figure out that the place for (last x) in this case would be the variable binding
10:04:01
phoe
and I don't think the compiler has the ability to know that at compile-time, especially if X is not constant but provided at run-time
10:04:18
phoe
so it has no idea whether it will have to set a CDR of some cons or if it will have to modify a variable binding
10:06:50
phoe
you'd need to close over the variable I guess, and, at runtime, check if you need to setq that variable or if you need to setf some cdr
10:15:41
vms14
wanted to ask, Why quicklisp stills being beta if it's used even in production stuff?
10:22:32
MichaelRaskin
vms14: what observable decisions are you going to make based on this information?
10:36:21
trafaret1
just wondering about is there tool for linux by which I can manager packages like ranger?