freenode/lisp - IRC Chatlog
Search
18:42:13
nij
Hi! I understand env object depends on the implementation. Does anyone know how env objects are represented in sbcl? In particular, how can I (just for fun) create an env object by hand?
18:45:00
Bike
sbcl environments are a struct called "lexenv". If you want to make environments, look at the sb-cltl2 contrib.
18:50:21
nij
MichaelRaskin: I just hope to create a minimal env by hand.. sort of like creating a list like (list 1 2 3).
18:55:14
nij
(let ((env nil)) (sb-cltl2:augment-environment env :variable '(x) :declare '((special x))))
18:57:26
dieggsy
do i always need to defgeneric before defmethod? just defmethod seems to work at the repl, but i wonder if there are downsides
18:58:20
Bike
if you defmethod without a previous defgeneric, a defgeneric is implicitly defined. it's fine. there are some downsides, like the point of definition being less obvious to a reader, and the inability to specify some subtleties about the lambda list
18:59:02
Bike
and you can't specify defgeneric options like the argument precedence order or method combination
19:03:25
nij
With CL, I can never read/write the content of a specific location in the memory like C's pointer, even with CFFI.. is that correct?
19:13:32
Bike
i mean usually lisp implementations don't have defined interfaces to let you mess with lisp objects that way
19:20:03
_death
there are also some nice videos about munging other processes's memory with ptrace.. https://www.youtube.com/watch?v=PuGgCOyBMyc
19:40:17
nij
(setf (cffi:mem-ref (cffi:make-pointer 0) :int) 0) ;; <= Does this really create a C pointer? Or it's just some equivalence (modulo abstraction) in CL?
19:47:14
_death
I'm not sure what you think a C pointer is.. it is usually a simple number (an address) during runtime.. a C compiler also maintains type information that tells it what code to generate to dereference or increment it, for example
19:49:32
dieggsy
hmm. so i've got this simple class for a playing card: https://paste.dieggsy.com/2021-04-24T15:49:25 - however, from cl-user, (cards:card-value (cards:card '(11 D))) and (cards:card-value (cards:card '(J D))) return different things
19:49:37
_death
in CFFI these pointers are not typed, so cffi:make-pointer just takes the address, and you need to specify the type when you dereference it, for example
19:53:26
gigamonk`
diegsy: looks like your code translates 11 to CARDS::J but when you pass it J (which is in whatever package you are in) it just passes it through in the (t v) branch.
19:54:28
dieggsy
gigamonkey: my code should be translating J to 11 (and keeping 11 as is) though, no?
19:56:06
gigamonkey
What you said before was equivalent to (cards:card-value (cards:card '(CL-USER:::J CL-USER::D)))
19:56:47
dieggsy
gigamonkey: oh, is it not even hitting the ((J) 11) branch because it's trying to compare CL-USER::J to CARDS::J ? and then just storing it as the symbol CL-USER::J
19:57:08
theothornhill
dieggsy: I pasted everything into repl without declaring packages, and it returns J for each case
19:57:43
dieggsy
theothornhill: yep, because the package is the bit i'm interested in and causing the behavior lol
19:57:54
gigamonkey
dieggsy: this is a case where the stylish thing might be to use keyword symbols.
19:58:39
dieggsy
gigamonkey: ah, because they're part of the :keyword package and like, auto qualified or some such
19:59:26
gigamonkey
not sure what auto qualified means but yeah, basically you are refering to them by explicit package but it's concise because the package name is empty.
19:59:43
dieggsy
gigamonkey: just to be clear, that really is the only simple workaround here, right? since i'm working with packages there *is no* notion of "just" J, it's going to be either CL-USER:J or CARDS:J
20:00:27
_death
dieggsy: you can also export J, so that when you use-package :cards or import it you don't need to qualify it
20:01:47
gigamonkey
If you need more info on this, I would of course recommend http://gigamonkeys.com/book/programming-in-the-large-packages-and-symbols.html ;-)
20:01:49
_death
dieggsy: or you can compare just the name instead of identity (case uses eql, you can use say cond and string=)
20:03:29
dieggsy
gigamonkey: ah, thank you!! it has indeed been years since i last picked that up (or did any CL programming)
20:04:04
dieggsy
_death: oh shit, i had no idea you could do string= with symbols.... at any point in my lisp journey lol. i've a lot to learn.
20:04:09
nij
was reading this last night. super useful => http://gigamonkeys.com/book/programming-in-the-large-packages-and-symbols.html
20:05:03
_death
dieggsy: it takes a string designator, which symbols are.. if you want to be more precise, you could (equal (symbol-name x) "J")
20:06:00
Josh_2
dieggsy: dw, I've been using Lisp for years and i only realized this a few weeks ago...
20:07:01
dieggsy
_death: wait, how do i import J ? I assume i add it to (:export ...) up top but when i try (import 'CARDS:J) i get a name conflict error
20:07:39
_death
dieggsy: that's because you previously interned a symbol with the name "J" in cl-user
20:09:23
_death
nij: designators are for convenience.. you wouldn't want to rename all your operations just because you make them a bit more convenient
21:41:41
charles`
for .asd files, What are the trade offs of making an asdf package then doing defsystem vs using asdf-user package
21:41:57
pseudonymous
This is probably obvious, but when using parenscript,`(ps (@ a b c))` compiles to `at(a, b, c)` for me, not `a.b.c` as advertised. Same kind of issue when attempting to use chain. Any ideas why ?
21:45:02
pseudonymous
Bike: Oh.. Auch. And spot-on. I have had some troubles loading my package when using use-package for various libraries so I've instead defined local package nicknames for all. And of course I need to respect that nickname even inside the ps macro. Thanks :)
23:26:51
ebrasca
OK reading the code I found "Convert a profile into an almost human-readable format"
23:30:37
Pixel_Outlaw
Hello all, is hunchentoot still king for making very simple web servers? I just need to make a trivial program that allows multiple people on my office VPN to fill some fields and save to database.
23:40:09
charles`
Pixel_Outlaw: I would say yes, for sure if you are keeping it simple. It is very cool that you are using Lisp for your office.
23:41:40
Pixel_Outlaw
Thanks, you'd not believe how hard it is go get 30 people to pick an meeting time over email. You get looooooong email chains. I'd hoped to present a calendar with pickable time slots so everyone just picks their availability and BOOM we save a 20 responce email chain.
23:42:47
Pixel_Outlaw
Also, we do COVID temperature reports daily and in theroy this could collect that and get it off to HR for their records.
23:43:24
Pixel_Outlaw
Right now, they all walk by poor Monica's office and verbally report so she can fill a spreadsheet. :P
23:47:25
MichaelRaskin
Not sure if any of the newer options are better, but you probably don't care about approximately anything (performance? features? who cares for 50 users)
23:59:56
ebrasca
drmeister: Thaks for the implementation idea , I did find a way to get a flame graph and how to visualize it.
0:15:05
White_Flame
Pixel_Outlaw: sure, I started with Clack, but while it's syntactically simpler to set up, it's far less accessible than hunchentoot
0:15:39
White_Flame
clack has no documentation, uncommented source code, and does not expose many things easily
0:16:21
Pixel_Outlaw
White_Flame, yes the curse of hackers "just getting things done" with "works here" and no time for documentation.
0:16:59
White_Flame
clack also isn't very good IMO, regarding error handling, not handling many things correctly, broken websockets implementation, etc
0:16:59
Pixel_Outlaw
We'll see if hunchentoot plays nice on Windows 10 which is the virus we perpetuate at work. :P
0:31:23
White_Flame
radiance does look interesting. once our web stuff is more mature, maybe I'll take a harder look at it
1:55:46
charles`
White_Flame: clack is not really meant to be used by someone developing websites. It is just a internal thing that Fukamachi decided to make separate and modular. It is meant to be used via niggle or caveman which has good documentation. clack by itself is not a drop in for hunchcentoot.
1:56:41
White_Flame
well, I wonder if those other things have workarounds then for when clack loses errors and such ;)
1:57:38
charles`
I have yet to actually try caveman, but it actually looks better than hunchentoot with more batteries included.
1:58:51
no-defun-allowed
Hyeh, you use <these-class-names> and Python @annotation syntax with Caveman?
2:46:34
Guest50292
i like the idea of migrating my server to hunchentoot so i can live code it remotely
2:54:07
CrashTestDummy
Ok, cool, I have a question about the results I am seeing from running the tests...
2:55:18
CrashTestDummy
Is it normal to receive various failures from the tests after doing a build from the 2.1.3 source?
2:55:26
CrashTestDummy
Expected failure: fopcompiler.impure.lisp / FOPCOMPILER-DEPRECATED-VAR-WARNING
2:55:30
CrashTestDummy
Skipped (broken): gethash-concurrency.impure.lisp / (HASH-TABLE UNSYNCHRONIZED)
2:56:04
CrashTestDummy
Expected failure: fopcompiler.impure.lisp / FOPCOMPILER-DEPRECATED-VAR-WARNING
2:56:08
CrashTestDummy
Skipped (broken): gethash-concurrency.impure.lisp / (HASH-TABLE UNSYNCHRONIZED)
2:56:20
CrashTestDummy
Expected failure: x86-64-codegen.impure.lisp / MOV-MOV-ELIM-IGNORE-RESIZED-REG
2:56:28
CrashTestDummy
Are those "Expected failures", "Skipped (broken)", and "Invalid exit status" items normal? Or am I doing something wrong?
3:09:26
dieggsy
A lot of the CL projects i've been looking at haven't been worked on for 2+ years. is this stability, abandonment, little of both?
3:10:49
beach
dieggsy: Probably depends on the project. My projects Flexichain and Cluffer have not been touchechd because they are stable.
3:11:36
CrashTestDummy
The typical answer is that a lot of the projects are just "complete" and don't need to be updated because CL is such a "stable" language. In other words, the libraries don't need to be updated to keep up with the language since the language doesn't change.
3:18:42
Jachy
Similarly, library dependency chains aren't such gigantic monsters like they can be in other ecosystems, so there's less chance for churn to update libraries solely because libraries they depended on updated
3:30:52
nij
CrashTestDummy: I have no idea. I did rememeber receiving some failures of testing.. but that didn't bother me.
3:33:34
beach
nij: What is your reason for being interested in environment objects? If it is just to see how things could be done, check out our libraries Clostrum and Trucler on GitHub.
3:40:20
jcowan
nij: CL is stable because no one person, group, or implementer group controls the evolution of the language. The current standard has been in place for 30 years, and most unofficial extensions have been worked on in parallel, so that even what is not standard is de facto portable.
3:40:38
Jachy
nij: https://github.com/guicho271828/asdf-viz shows some dependency graphs of a few systems. It might be illustrative to compare to the example on https://github.com/0815fox/node-dependency-visualizer/ for Angular (a JS framework)
3:41:09
Jachy
I invite you to run the visualizers on a sampling of CL libs vs JS libs though to compare overall complexities, especially on similarly-scoped projects. Multiple selection pressures contribute to the differences.
3:41:57
Jachy
(You can also see what I mean by churn with the JS project's recent commit in the doc/js folders, "add --all option to npm ls (needed from npm 7 on)".)
3:56:36
nij
beach: environment objects - I'm just curious to see how to make one like making a list as in (list 1 2 3).
3:56:37
Bike
if you're asking why people make breaking changes to software, it's because sometimes the old interface sucks
3:58:43
Bike
to some extent, and that's why my computer has instructions for working with binary coded decimal
4:16:26
jcowan
The Scheme standards are not as stable as the CL standards: they do grow. But very little of that is backward incompatible.
4:40:31
CrashTestDummy
Anyone here ever use Qemu (or some other hardware emulation rather that a normal VM) to compile the SBCL source?
4:47:12
moon-child
jcowan: really, huh. I always thought the main point of cl (and the reason it was so big) was to keep majority compatibility with all the lisps that preceeded it
4:47:47
jcowan
In many respects, yes. But CL was the firat "mainstream" lisp to do lexical scope, an idea borrowed -- from Scheme.
5:10:17
Nilby
I don't think dynamic scope is cheating, since it's basicly what the hardware does. But special variables seem a little like cheating, since it's like having undo on your memory.
5:10:25
beach
So the MacLisp compiler used lexical scope, but the interpreter used dynamic scope. The next Lisp system I used was Franz Lisp on Unix, and they worked very hard to make everything use dynamic scope.
5:17:04
moon-child
to my recollection, it was responsible for a number of elisp's performance problems
5:21:44
charles`
I don't see why one would be "cheating" and the other not though since I see them as basically the same thing. specials just have the advantage of being able to control which variables are dynamic
5:35:44
Nilby
I'll probably explain it wrong, so I don't want to annoy our experts. Old fashioned dynamic scope isn't much different than writing to a memory location. Lexicals can increase performance because they allow optimizations, increased locality, simplified management, as well as helping get rid of a class of bugs.