freenode/#lisp - IRC Chatlog
Search
20:09:43
random-jellyfish
what is the recommended way to generate code in another language from common lisp?
20:10:55
random-jellyfish
for example let's say I want to convert (def hello (print "hello world")) to def hello: print('hello world')
20:11:39
housel
The pretty-printer can be helpful for that, see for instance https://github.com/dylan-lang/lisp-to-dylan
20:11:40
dialectic
are you doing any context sensitive analysis at all? Like making sure variables are really in scope etc.
20:11:43
aeth
FORMAT goes surprisingly far in macros like that, especially if you're OK with it generating strings at compile time
20:12:42
random-jellyfish
dialectic at this point I don't need semantic analysis, the compiler of the target language can deal with that
20:13:33
dialectic
I would just build up an AST and dispatch on the first element in the list, recursively outputing to a stream.
20:14:57
dialectic
I presume it would be (def hello () (print "hello world")). So you'd have (case (car form) ((DEF) ...printing-code-for-def...))
20:15:17
dialectic
This is one of those things where you'll learn faster if you just go forth and try it.
20:15:48
dialectic
If you need indenting and readability later, as others pointed out, check out the pretty printer.
20:16:37
vsync
stacksmith: wayland must be opposed so its poor offering is never put forth further as a suitable replacement for X11
20:16:56
vsync
ACTION would not feel this way if anything about wayland got anything about the point of what is useful in X11
20:17:42
aeth
I game on Linux and I use a tiling window manager on Linux and I use the proprietary nvidia drivers on Linux. So I'm basically part of every group that hates Wayland.
20:19:38
vsync
I realize that doesn't exactly lend credence to my opinions on software/network architecture in This Modern Age
20:26:36
jackdaniel
all I can say is that it works and that I do not recommend log4slime when you connect to a remote swank (log4slime is an emacs appender tailored for slime, very nice one at that)
20:27:21
vsync
well I'm looking to misuse it potentially... wonder how much its core use case is baked into the architecture haha
20:37:30
vsync
jackdaniel: oh wow there is much more to your log4cl/clim screenshot if I scroll down
20:38:36
jackdaniel
yes, I have these big screens now so I can waste the network bandwidth with tall screenshots :)
20:38:44
vsync
I need to see if streams are suitable for my concept as well... need to do some reading on streams, series, generators/gatherers
20:39:45
vsync
I know there are Gray/simple streams, and SERIES library... has anyone implemented generators/gatherers as in cltl2?
20:41:32
jackdaniel
so you either convert all your sequences to series and use its mapping/iteration facilities
20:41:47
jackdaniel
or you marshall / demarshall forth and back to be able to i.e loop over something
20:42:45
vsync
(or I guess that if you like it you would use it instead of base CL... haven't grokked fully what all it offers though)
20:56:38
dialectic
What's the origin of the name "Swank" anyway? Does it mean anything in particular? I've always wondered this.
22:39:38
no-defun-allowed
Packages don't know what symbols do really, so you need to export the accessors too.
23:38:26
manualcrank
I need a ordered data structures like c++'s map and multiset. (It can't be a library; I need something I can just cut and paste.)
23:39:11
manualcrank
Sedgewick's red-black binary search tree @ https://algs4.cs.princeton.edu/code/edu/princeton/cs/algs4/RedBlackBST.java.html is perfect for map and can be easily adapted to obtain a multiset (with a count field in each tree node to track duplicates).
23:39:47
manualcrank
The minimal Lisp code to illustrate the problem is here: <http://pasted.co/5dd7f925>
23:39:50
no-defun-allowed
this AVL tree implementation is pretty simple: https://two-wrongs.com/purely-functional-avl-trees-in-common-lisp.html
23:40:56
manualcrank
The logic and structure of both versions is identical, I'm almost certain there's something about Lisp semantics (setf's in particular) that doesn't translate.
23:41:34
manualcrank
That AVL version doesn't do queries based on the ranks of the keys in the tree.
23:48:43
pjb
manualcrank: red-black trees are particularly difficult to debug. I have an implementation that has been in need of debugging for 10 years…
23:49:16
pjb
manualcrank: I'm not saying that you will need ten years to do it, but that you should plan to spend your summer, debugging and writing test cases.
23:49:49
manualcrank
I was going to try and adapt the AVL code next (i guess it needs code to at least track the size of each branch)
23:50:10
manualcrank
but i don't know anything about avl trees. red-black trees i learned in sedgewick's coursera course
0:03:23
stacksmith
Personally, I prefer skiplists. It only takes a couple of years to debug a skiplist implementation.
0:54:48
loke
stacksmith: The freetype engine is more than just subpixel AA. It also uses Harfbuzz for layout, meaning that complex scripts are rendered correctly (such as Hindi or Arabic)
0:56:28
loke
stacksmith: Another benefit is that it uses fontconfig, which means that your system font configuration is honoured.
3:13:09
stacksmith
LdBeth: checkout https://github.com/stacksmith/cl-with I wrote it exactly for that reason. And a few others.
3:15:13
stacksmith
It figures out and rebinds all slots by default. Or you can fine-tune which slots and how to name them. Same syntax for CFFI objects.
3:53:09
aeth
LdBeth: I think there can be issues with automatically exporting instead of exporting in defpackage, though
4:22:50
dialectic
beach: You should know, the link to your paper on generic dispatch seems to be broken now.
4:28:15
dialectic
I read the cached google on Google already (I guess monopolies are good for some things...) so no hurry, just thought I'd let you know in case you didn't already.
4:29:34
beach
I have been asked to provide an index for all the SICL-related papers, and as part of that work, I am putting them in a sub-directory.
6:51:03
flip214
Is there some HTTP/3 client library for CL available? Or a server (plugin for hunchentoot)?
6:56:51
flip214
loke: thanks, having HA-Proxy in front for load-balancing and HA would make sense anyway.