freenode/#lisp - IRC Chatlog
Search
18:12:43
ebrasca
fiddlerwoaroof: How can you be sure you have 100% coverage or data waiting to be lost?
18:19:52
fiddlerwoaroof
ebrasca: yeah, for filesystems it gets more complicated because the stakes are higher
18:20:47
fiddlerwoaroof
In my experience, though, unit tests are a good way to discover edge cases and especially because they're easier to write and maintain than a lot of other sorts of tests
18:21:19
fiddlerwoaroof
Proofs, for example, often are too difficult to change to be feasible for anything except the most important code
18:48:09
phoe
which is an original development, not coming from clojure - mostly because clojure doesn't have places
18:48:31
fiddlerwoaroof
ebrasca: well, I'd say the first thing to do is to write unit tests, because that's easy to do and it'll help you think about things like API design and code structure
18:48:55
fiddlerwoaroof
phoe: is that just relying on the macroexpansion provisions of the specification?
18:49:51
phoe
fiddlerwoaroof: not really; I am currently rewriting arrows to expand into LET* for readability
19:16:15
phoe
my current implementation of arrows makes the assumption that each form passed to the threading macro is going to be evaluated; splicing such a form into a form with special evaluation rules, e.g. OR, breaks this assumption
19:16:39
phoe
and now that I think of it, I have no idea if this is acceptable from an implementation of arrow macros
19:19:45
fiddlerwoaroof
I've written a lot of Clojure code that uses arrows with macros that change evaluation rules
19:24:42
pfdietz
Property based tests are wonderful and powerful. I use them to find all sorts of bugs.
19:25:16
pfdietz
All those weird SBCL bugs I report? All due to various kinds of property based tests.
19:26:12
pfdietz
Example property: "the SBCL compiler should never signal an error, even on erroneous input".
19:26:42
pfdietz
Or: "a valid Common Lisp expression should do the same thing regardless of OPTIMIZE settings".
19:28:57
fiddlerwoaroof
pfdietz: yeah, it's a great tool my experience, though, is that I use the property tests to generate more deterministic test cases in my unit test suite.
19:30:39
pfdietz
Sure, you want to capture the failures, just to make sure they dont unfix themselves later. But PBT keeps finding new bugs as development introduces them. And sometimes it finds a very low probability failure, something that took billions of inputs to expose.
19:39:33
pfdietz
Nice! It's interesting that they have value later. That may say something deep about testing.
19:52:53
pfdietz
I have considered using random test generation and minimization to generate unit tests, not by keeping failures, but by keeping tests that satisfy some other property (coverage, killing mutants). This might give a distilled unit test set that preserves some of the value of a prolonged run of the random tester.
19:57:42
fiddlerwoaroof
pfdietz: I think unit test's primary value is in helping you figure out the problem space as you're working
19:58:24
fiddlerwoaroof
Making it efficient to run 100+ picked examples every minute or so to verify that you're making progress
21:28:15
no-defun-allowed
The HyperSpec is a bit like a dictionary. It is rarely a good idea to try to learn how to do things from it, but you can clear up your understanding using it.
21:37:40
dbotton
In quickproject the defpackage is placed in package.lisp is there a reason for not placing the defpackage in the actual package at the top?
21:42:30
dbotton
Correct, lotuseater was offering possible answer to my question that multiple files being used for same namespace
21:43:37
mfiano
modules have dependencies, just like the root module. You don't have to load serially
21:43:55
dbotton
So we go back to my question, rephrased, what is the advantage of having a packages.lisp file instead of leaving defpackage at start of files
21:44:52
mfiano
library chosen randomly: https://github.com/Shinmera/verbose/blob/master/verbose.asd#L17
21:45:07
lotuseater
I also had this question in my mind when it comes to frequently changing some files
21:46:52
dbotton
Ie you have to copy out the definition of the package from the packages file when re-using the package
21:47:38
mfiano
I am having a hard time parsing what you are even saying. Maybe someone else can ask the right question so you can ask the right question.
21:47:54
dbotton
Let me give an example, if I have a file that defines a package of string functions
21:48:29
dbotton
If I want to copy that file to a new project, I have to copy that file and also cut and paste from that packages.lisp
21:50:05
Xach
dbotton: if a project is big enough to have a separate package file, it's common to define a system for it, and depend on the system, not copy things around.
21:50:35
Xach
I sometimes copy rather than depend-on, but only for pretty small self-contained things. Single functions, or self-contained files of related things.
21:53:06
dbotton
Ok, so you find in large projects defining all the packages in one file works out well.
22:20:51
fiddlerwoaroof
I've found it more convenient to centralize packages in package.lisp because then, when I want to move a set of definitions to a new file, I just put (in-package :the-package) and copy/paste
22:21:08
fiddlerwoaroof
Ultimately, I want to store the code in the lisp image and treat files as disposable
0:17:19
lotuseater
cepl seems nice but I'm not aware how to start, the videos are for the old version
0:42:03
mfiano
Speaking of compiler macros, I don't remember the last time I needed to write one, but I have a question related to them: Do I have to gensym when introducing a new lexical variable as part of its expansion to prevent unwanted capture in the same case as for regular macros?
1:56:28
_death
mfiano: yes.. e.g., (define-compiler-macro foo (x y) `(let ((z ,x)) (list z ,y))) (let ((z 123)) (foo 1 z)) ==> (1 1)
2:37:13
_death
https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node101.html#SECTION001240000000000000000
5:00:34
fiddlerwoaroof
So, Lispworks is the only implementation (of three) I can get to work on my new laptop
5:03:47
aeth
I'm surprised it works at all. These sorts of things tend not to care about obscure, GCed languages.
5:04:44
fiddlerwoaroof
mmap: Cannot allocate memory / ensure_space: failed to validate 1073741824 bytes at 0x1000000000
5:05:31
no-defun-allowed
aeth: A funny coincedence, while I'm reading about how refcounting is faster on a M1 processor.
5:10:28
no-defun-allowed
It takes 6.5ns to create and free a NSObject on M1/Objective-C, and 6.7ns to create and eventually free a standard-object on x86-64/SBCL. That's a 3% performance increase; something you'd expect from Intel marketing these days :)
5:11:12
no-defun-allowed
fiddlerwoaroof: Seriously though, do you find it any faster? Most articles I find say it's much faster than an Intel MacBook.
5:32:25
aeth
oni-on-ion: Apple is migrating to ARM because (1) its ARM chips are competitive with Intel's x86-64 chips and (2) Apple wants to eventually merge macOS (a cost) with iOS (where all of their profit is)
5:34:28
aeth
on the one hand, JVM would also be hard to emulate; on the other, there might actually be Java apps on macOS worth emulating
5:34:35
theemacsshibe
An interesting headline: "Microsoft contributes to Java port for Apple silicon Macs"
5:35:30
aeth
fiddlerwoaroof: Yes, a disturbing trend. iOS is the world's most popular locked-down platform.
5:38:40
aeth
fiddlerwoaroof: maybe it's good news for iOS, but it's bad news for macOS, and I'm not looking forward to getting bug reports from Mac users.
5:41:28
aeth
I have no idea how you'd even attempt to mix the CL workflow with stuff like this, though: https://lapcatsoftware.com/articles/unsigned.html
5:43:26
fiddlerwoaroof
And, the basic path is straightforward: sign the sbcl executable and always launch your app through that executable
5:54:04
aeth
That's basically saying to avoid save-lisp-and-die exporting even if you do that on every other platform.
5:54:43
fiddlerwoaroof
The objective-c runtime as a whole is a much nicer thing to interact with than the low-level APIs of alternative platforms
5:55:26
fiddlerwoaroof
Anyways, this is what abstraction is for: something like ASDF could make a "thing" that works on whichever platform you're targeting
5:56:07
oni-on-ion
objective-c is one of my top favorite languages, there was a point i made my own runtime. it talked to gnu smalltalk =)
5:58:22
aeth
fiddlerwoaroof: afaik, you can't sign it in a way that doesn't have scary warnings without paying Apple 100 $/year
5:59:26
aeth
According to the article, "Mac developers must sign up for the Apple Developer Program, sign a legal agreement, and pay an annual fee of USD $99 plus tax in order to obtain a Developer ID code signing certificate and upload software to Apple for notarization."
6:01:03
aeth
The only thing that saves CL here is that most non-commercial applications will just be distributed in .lisp source code form for local compilation and running on a presumably-signed already-installed CL compiler
6:01:31
fiddlerwoaroof
The thing is, most applications you could just pop up a loading screen and compile the code on the fly
6:01:56
aeth
Any end-user application written in CL (which can't assume that the user has their own CL installed) will either have to be commercial or money-losing.
6:02:26
aeth
That's not really the common workflow, though. Generally, you export an executable if you don't expect the user to have CL installed.
6:03:02
aeth
No, the output of save-lisp-and-die would, afaik, have to be signed, which costs 100 USD/year.
6:03:58
aeth
Now you have to distribute a matching SBCL version. Java can get away with this because lots of things use Java.
6:04:29
oni-on-ion
hmm lisp (fasl) can be disasm quite easily ? can one only distribute the fasl/core and are those somewhat protected ?
6:05:17
fiddlerwoaroof
But, if you're not distributing to developers, you'd need all this stuff anyways
6:06:02
fiddlerwoaroof
You also need some functions like this to grab resources out of the app bundle: https://github.com/cjdev/aws-access/blob/master/src/objc-utils.lisp
6:08:48
aeth
Alternatively, $99/year is like an entire computer a decade, on top of having to actually buy an entire Apple computer a decade in order to test/build the application.
6:11:02
aeth
Breaking the law in the process of making your software is essentially a non-starter for distributing software, anyway.
6:11:44
fiddlerwoaroof
I mean, if you're going the commercial route, you're not going to worry about $99/year