freenode/#lisp - IRC Chatlog
Search
23:54:04
_death
Shinmera: it could for example delay its response.. maybe also take into account the time of a new quicklisp dist upgrade.. and there could also be an interface for project authors where they could tweak things, perhaps disabling it entirely..
0:00:29
Shinmera
If I wasn't tied up with ELS, my thesis, exams, and Lichat, I'd offer to help out with such an infrastructure
0:00:49
Xach
I think I can crank out an rss feed per project within a few hours. (I can recycle some podcast rss code.)
0:51:19
mfiano
Is there anything in alexandria similar to this, but which will allow duplicating elements to find all combinations as well, such as (X X X) '(X X Y) etc? (let ((results)) (alexandria:map-permutations (lambda (x) (push x results)) '(x y z) :length 3) results) => ((Z Y X) (Y Z X) (X Z Y) (Z X Y) (Y X Z) (X Y Z))
1:08:24
jmercouris
AeroNotix: The more I work with this API, the more I realize how strange some things are
1:11:21
mfiano
Actually, what I need is the "power set", but with repetitions allowed. This is the standard power set. https://rosettacode.org/wiki/Power_set#Common_Lisp Does anyone know if my requirements has a name?
1:12:32
ykoda
lol! Yeah, I played around with a gtk library at one point but gave up. Since then I've been working on ECL + Cpp + QT
1:13:13
jmercouris
ykoda: Ah yeah, that is a very good combination, very easy, though deployment is a nightmare
1:13:13
ykoda
Something like this: https://common-lisp.net/project/ecl/posts/ECL-Quarterly-Volume-V.html#orgheadline10
1:14:21
ykoda
I've primarily been a Xamarin guy for cross platform / mobile, so it's a crazy different world
1:16:03
ykoda
Oh definitely, it's just a nice way to get at the native stuff through .Net (unless you use Xamarin forms)
1:17:29
ykoda
I'm thinking about using that combo for a project, but if it's going to be pain I'll find another way
1:17:33
jmercouris
ykoda: When deploying QT applications you usually want to bundle in a standalone app your users can double click, this is problematic because of some strange linking that occurs within EQL
1:18:05
jmercouris
Some modules are dynamically loaded, and this involves attempting to load the shared lib, which of course does not exist on every users' computer
1:20:12
jmercouris
but unfortunately it is a garbage tool that only works on the most standard of applications, and even then it doesn't work
1:20:37
jmercouris
The real question is what is your deployment strategy, and on which platforms do you wish to deploy
1:23:45
ykoda
Thanks, man! With lisp I've only ever built cli tools, never had any success with guis. I end up going back to C#
1:24:31
jmercouris
ykoda: Yeah, it is a challenge, you can try MCClim as well, I've heard good things about it
1:25:29
ykoda
I'll give that a look. A guy who I'm working with uses python + qt at work, so he's interested in using qt, but I might be able to talk him out of it
2:08:20
fiddlerwoaroof
ykoda: the only problem with mcclim is that it only works on Linux or Mac with XQuartz
2:08:52
fiddlerwoaroof
(although someone was working on a Windows backend, and I'm interested in fixing an old Mac backend)
2:40:36
asarch
Languages with similar syntax: '(Haskell Elm Erlang OCaml Caml), '(C C++ C## Java Go C# Vala)
2:40:59
asarch
While in Lisp: "Macros are what make lisp the greatest programming language in the world. When used properly, macros enable amazing feats of abstraction, programmer productivity, and code efficiency and security that are unheard of elsewhere. Macros let you do things you simply cannot do in other languages." -- From Let Over Lambda from Doug Hoyte
2:42:19
asarch
I was reading about the development process from Naughty Dog and its GOAL implementation, is it available?
2:44:41
aeth
Most gamedev stuff never gets open sourced. Id's classic engines are the most notable exceptions.
2:59:37
aeth
asarch: I am considering writing one. An eshell-like shell requires only several parts. (1) Turn the line "foo bar baz" into "(foo bar baz)" if the function foo exists, (2) if the function foo does not exist, use UIOP to call the external program "foo" with the arguments "bar baz", (3) implement piping, output/input redirection, etc., with gray streams or some other approach, ...
2:59:42
aeth
..., (4) gradually implement the basic shell commands like mv and rm as built-in CL functions with the POSIX API
3:00:30
aeth
There might be some trickier parts like the shell ";" and the shell "&&" and the shell "||"
3:02:09
mfiano
ACTION thinks "requires only several parts" reads as "doable in X amount of time", coupled with an 'etcetera', that doesn't really say much :)
3:02:42
aeth
mfiano: The etc is just to cover up for anything I missed. Is there anything other than |, >, >>, <, &>, etc.?
3:06:32
aeth
mfiano: But, you've caught me, I tend to implement the easiest 60% of something and then move on, so I'd probably stop half way through step 3 and leave it half-finished
3:07:00
mfiano
Moreso, I just didn't think 'several' belongs next to 'only' if you want to convey any meaning whatsoever :)
3:08:40
aeth
well, afaik the design for cloning eshell is just (1) execute CL commands at the top level if the function exists, (2) call external programs like a shell if the function does not exist, (3) implement shell redirection in CL, (4) reimplement the core shell functionality in CL so #1 is actually useful.
3:10:02
aeth
e.g. "+ 1 1" yields the same thing as "(+ 1 1)" and "ls -l" uses its own internal ls ("which ls" tells you that it uses a function in em-ls.el)
3:11:11
aeth
It looks like there's a third category of commands, Lisp functions with shell APIs and only shell APIs.
3:14:40
fiddlerwoaroof
jmercouris: hopefully, I need to learn more about the low-level details of osx first because there are some weird issues with the current library.
3:25:30
fiddlerwoaroof
Is there something that makes it so that the results of reader-macros don't get macroexpanded?
3:28:14
|3b|
things that would expand macros have no idea how the things they would expand were created, whether it involved reader macros or not
3:29:19
White_Flame
but an automatically quoted expansion wouldn't do well in '(foo #reader-macro-thing bar), as the quotes would then nest
3:29:20
fiddlerwoaroof
Weird, that's what I thought, but I'm getting function undefined errors because some macro doesn't seem to be getting expanded
3:34:30
White_Flame
if you're getting an error macroexpanding the reader macro, that smells like the error is happening during the reader macro processing itself, before its result is passed on
3:36:19
fiddlerwoaroof
and (macroexpand-1 '[ns-application shared-application]) even expands the macro
3:44:59
aeth
I think the SBCL REPL works by writing the expression to /tmp/ and then compiling that temporary file.
3:45:01
fiddlerwoaroof
They Read the input, Evaluate the read form, Print the result and then Loop back to the Read
3:45:04
beach
The first READ the expression. Then they EVAL what they read, and finally, they PRINT the result.
3:45:39
aeth
Some Lisps, like SBCL, compile the expression in the REPL. Other Lisps evaluate things in the REPL.
3:46:01
beach
pransninja: A modern implementation will just compile the code, stick it somewhere in memory as a function, and then call that function.
3:46:25
aeth
Lisps have a compiler and an interpreter (actually, I think SBCL has several interpreters iirc). By default, SBCL compiles everything, even things at the REPL. Some Lisps might use their interpreter at the REPL
3:47:15
aeth
Lisps have runtime compilation of functions, but they lack the whole continually analyzing the execution to recompile it more efficiently that people normally think of when they think of JITs.
3:47:37
fiddlerwoaroof
(setf sb-ext:*evalutator-mode* :interpret) makes sbcl into an intepreter, I think
3:47:45
aeth
Lisps are usually AOT-compilation where you can (re)compile a function at runtime before calling it.
3:48:26
fiddlerwoaroof
No, you can implement eval with an interpreter, which would be allowed on iOS
3:49:51
Bike
on clasp, which uses llvm, to do this repl compilation stuff it uses llvm's "JIT" thing, because llvm is otherwise based on serializing compiled code rather than running it, i guess.
3:51:35
fiddlerwoaroof
As we were saying the other day, "compiled language" and "interpreted language" are phrases that don't mean anything :)
3:53:24
pransninja
or a simple movie if you're very evil https://github.com/xoreaxeaxeax/movfuscator
3:53:46
|3b|
if i remember right, clisp can either evaluate directly, compile to bytecode and interpret that, or JIT the bytecode (last is experimental feature i think, not sure if it got released)
4:03:59
pransninja
The more I learn lisp, the more I see how it is super primitive, even simpler than ASM, yet so powerful.
4:10:32
pransninja
"And because NIL, as I mentioned previously, is the name of a constant variable with the symbol NIL as its value, the expressions nil, (), 'nil, and '() all evaluate to the same thing--the unquoted forms are evaluated as a reference to the constant variable whose value is the symbol NIL, but in the quoted forms the QUOTE special operator evaluates to the symbol directly. "
4:11:08
antonv
if I want with hunchentoot to set the session cookie to both 'www.mydomain.net' and 'mydomain.net', how whould I do that?
4:11:10
pransninja
So '() is the same as 'nil which is to say Symbol of nil which is the same as nil value?
4:12:17
antonv
pransninja: yes, in CL symbols have value, and some symbols refer themselves as the value
4:14:01
beach
pransninja: '<anything> is a reader macro that generates (quote <anything>) and QUOTE is a special operator that returns the argument unevaluated.
4:15:02
pransninja
antonv: Set the doamin to mydomain.net, or perhaps .mydomain because of RFC2109, but RFC6265 is mostly implemented everywhere
4:17:11
antonv
presiden: can you have in C a pointer variable? and then set the value of that pointer variable to it's own address? The same with NIL - it's a symbol whose value is itself
4:18:10
|3b|
so can be distinguished if you don't evaluate them. for example (mapcar 'length '(nil () 'nil (quote nil))) -> (0 0 2 2)
4:18:55
pransninja
antonv: You just set the :name of cookie to '.mydomain.net' and it will be sent with every subdomain too.
4:53:23
pjb
antonv: eg. void* p=&p; is wrong on some level, because &p is of type void** not void*. Now of course, given the rules of void*, it will be accepted. But is it acceptable?
4:54:58
pjb
To do the equivalent in C, you need a more complex structure, with struct, union, etc; basically you need to implement symbols in C.
7:15:20
earl-ducaine
Hey Lisponauts! Trying to determine what the potential difference might be between sb-int:fixnump and a naively defined (defun fixnump (object) (typep object 'fixnum))
7:16:22
earl-ducaine
I looked at the SBCL code, but it's not easy to decern what it accomplished appart from the usual SBCL coldboot-ish machinery.
7:19:32
beach
earl-ducaine: TYPEP can be quite expensive. FIXNUMP is just a matter of testing the last bit of the work and return true if it is 0.
7:20:18
|3b|
built-in one is also more likely to take advantage of type-inference in surrounding code, which would be lost by full function call
7:23:08
|3b|
also whether the compiler knows if it can skip the call entirely if you ignore the results, since it has no side effects, and some things like that
7:30:14
|3b|
probably most important difference is that typep is a supported function, so less likely to be randomly changed/removed by sbcl devs :)
7:48:46
beach
Hmm, I should learn to use reader conditionals. I mean, I know the way they work, but I don't naturally think of them for structuring my code.
7:50:07
beach
For example, I need to test SICL systems implementing things like the package dictionary, but I want to test it in some host environment like SBCL. Obviously, there are tons of package-lock violations then. I think perhaps reader conditional can help here.
7:52:21
beach
Even doing something like (defpackage package (...) (:metaclass built-in-class)) won't work in a host environment, but I can wrap the :metaclass part in a reader conditional.
8:23:10
beach
If I have an ASFD system for the SYMBOL dictionary and another for the PACKAGE dictionary, then invariably, they are going to depend on each other. I think I'll make a common system for both. Does that seem like a good idea?
8:28:38
mfiano
Is it good practice to use EXPORT in a macro which generates hundreds of functions that you want external?
8:29:50
mfiano
Shinmera: That's quite funny actually, because I am using it for the exact same thing.
8:37:26
mfiano
It was implemented almost 2 years before your first commit, and was designed for critical physics simulations outside of game development until it was renamed and served as part of my game development toolbox. Afterwards a few such as yours and Baggers' rtg-math showed up.
8:38:24
mfiano
I am only now adding swizzling because I am removing a custom accessor system I've been using, and wanted to integrate it into varjo to have the same API on the CPU and GPU
8:41:46
dmiles
well all the docs related to the symbol is always nice (varible, function, class, etc)
8:47:24
mfiano
Shinmera: I will give you some feedback though. It would be nice if you also defined SETF swizzles (or maybe I'm just blind), and you also support the other 2 GLSL masks.
8:48:26
mfiano
"there are 3 sets of swizzle masks. You can use xyzw, rgba (for colors), or stpq (for texture coordinates)."
8:49:30
mfiano
I am avoiding SETF too, I think. I don't really need it, and it has some additional tricky bits
10:32:49
dmiles
am i correct to assume most compiled lisp programs do not need eval or macroexpansion at runtime ?
10:34:33
Shinmera
Well, it's less that the compiler eliminates the need to do that, it's more that the cases where using eval or compile at runtime are hard to justify.
10:34:54
Shinmera
In the overwhelming majority of cases there are better ways to solve the problem than eval.
10:35:37
dmiles
Well assuming user code uses eval.. most of the time the compiler can still eliminate if in the end
10:38:47
beach
dmiles: If the application calls EVAL, it's because the code to be evaluated is not known at compile time, so it has to happen at run time.
10:38:57
dmiles
well forget that last question it is probably a red herring. the real reason i am asking to is if after compiling i should be able to expect that i can completely macroexpect things away at compile time
10:41:13
dmiles
on the side eliminating eval is not any more special than eliminating funcall or apply in most cases outside of (evaluating a string supplied by a user)
10:41:47
beach
EVAL takes a Common Lisp expression and that expression can be built at run time without any strings involved.
10:43:42
dmiles
i am asking "outside of some program that wanted to read a string with a lisp reader and eval it"
10:44:31
beach
An expression can be constructed at run time without any strings, and if the application programmer needs to evaluate such an expression, then it must happen at run time.
10:45:42
phoe
that's simple, because READ reads bytes from standard-input, so, technically, from streams
10:45:46
beach
The answer to your question is "no". It is not just in the case of a string that the evaluation must happen at run time, simply because there are other ways of building expressions at run time, and if they are not known at compile time, they must be evaluated at run time.
10:45:54
random-nick
dmiles: well, it is common for people to include a Read Eval Print Loop in their program, so some programs do use "eval"
10:46:47
phoe
but (let ((expr (list (random-operator) (random-argument) (random-argument)))) (eval expr))
10:47:39
Shinmera
Either the user knows what they're doing and it has to happen at runtime, or they don't and they should eat the slowdown.
10:49:42
beach
dmiles: No sane application programmer would write that, so it is pointless (as Shinmera says) to optimize it.
10:50:17
beach
dmiles: Yes, there is. It is called "software maintenance". The more pointless code you have, the harder it is to maintain.
10:51:04
dmiles
i already have the code that eliminates that (time is done) .. what i am trying to decide is if i can expect that i will not need to macroexpand as well
10:53:06
dmiles
i eliminate them with 4 lines of code: https://github.com/TeamSPoon/wam_common_lisp/blob/master/prolog/wam_cl/funcall.pl#L140-L143
10:54:34
phoe
to sum things up really fast and messy, you need to have the compiler at your disposal to properly implement EVAL.
10:54:57
Shinmera
What was the reason that eval is different from (compile NIL `(lambda () () ,expr))?
10:57:08
dmiles
the orignal question was "outside of the case of EVAL and some whereness of trying to eval at runtime" .. x y z
10:57:09
beach
dmiles: Because the arguments can contain arbitrary expressions that need to be evaluated before the function can be applied. This is elementary in implementing Common Lisp. You really should have a look at Lisp in Small Pieces.
10:57:47
dmiles
i was trying to avoid discussing eval :P but i accidently brought it upo in the question
10:58:53
dmiles
the question was "outside the case of EVAL, is there a reason one might have to macroexpand at runtime"
11:04:11
dmiles
phoe: yeah, though mostly i make a little lambda that returns that experession with load-time-value for things liek that if they dont seem constant
11:16:07
beach
So #.(random 666) is first an example of something that is NOT constant at compile time, and then you agree that it IS?
11:16:18
dmiles
ok so i think the answer to my question is: "except in the cases that the programmer is forcing the need for eval, (yet they can still use apply/funcall), except the case the programmer is using macroexpand (or evaluating the macroexpransion with hopes of evaluating it next), you should be able able to complle programs well enough that you will not need to relly on preserving your enviroment
11:16:55
random-nick
shouldn't everything evaluated with #. be constant at compile-time since it is evaluated at read-time?
11:17:45
dmiles
beach: really i assumed the lisp reader gave me a random number and i compile things never knowing the number ws random
11:18:36
beach
It gives you one number. So it is constant. But you gave this as an example of something that is NOT constant. And then you changed your mind.
11:19:57
dmiles
i was under the assumption it related to load-time-value (but i think that assumption was wrong)
11:21:38
dmiles
if the users code contained (read-from-string ".(random 666) ") that might be differnt
11:21:44
beach
Maybe you don't care whether your implementation is conforming or not, but if you do, I think you are in for A LOT of work.
11:24:22
dmiles
well i been working for 3 months it.. i have one month left in budget to be able to run 2 differnt applications.. then if i can get that done i get 2 more months to run/compile 2 more applications.. then after that i get to worry about conformance and passing the ansi-tests
11:30:32
dmiles
so my intial goal is compile and run "DAYDREAMER" and (PTTP or "Knowledge Machine") by end of January
11:39:18
flip214
Xach's report of ASDF 3.3.1 breakage in newer SBCL includes a few non-ASDF related things, AFAICT.
11:39:23
flip214
for example, http://report.quicklisp.org/2017-12-25/failure-report/cl-sendmail.html#cl-sendmail says
11:39:44
flip214
; Derived type of CHILD is (VALUES LIST &OPTIONAL), conflicting with its asserted type XMLS:NODE.
11:51:39
flip214
Xach: yeah. so QL tries to build systems even if any of the dependencies are known broken?
11:52:36
flip214
and re http://lispblog.xach.com/post/169109562413/fasl-package-pitfall: is the right solution a (:depends-on #+project-b :project-b) in the ASDF?