freenode/#lisp - IRC Chatlog
Search
22:00:26
Josh_2
Xach: I have called (set-rgb-fill 145 216 247) which is a bright blue and I'm getting a solid white
0:00:56
charles`
Do you ever find a new piece of software and get sad that it isn't "made with Lisp"?
0:52:02
aeth
anything that starts with set- that isn't an FFI wrapper probably should be a SETF instead, if that's your API
0:52:26
aeth
that is, idiomatic CL doesn't really have getters and setters in the name, it just has a (setf foo) and a (foo)
0:54:04
Josh_2
Xach: https://plaster.tymoon.eu/view/2264#2264 this is the offending part of the code
1:00:00
Josh_2
if I have a scale from -10 to +10 how can I translate that into a value between 70 and 670? ie 0 would be 370
1:07:16
White_Flame
consider the 2 ranges to be a midpoint and the length outward in both directions
1:10:01
White_Flame
you're some percent down the -10..+10 segment, and want to be the same percent down the 70..670 segment
1:11:45
White_Flame
and 2 equations, one where y ends up -10 to +10, and another where y ends up 70 to 670
1:13:03
White_Flame
y = 20*x - 10 would be the 1st line. You can see that 20 is the range, and 0 is the midpoint
1:14:33
aeth
I'd caution against using the basics of algebra in numerical stuff because floats only approximate reals.
1:15:26
White_Flame
well, these basics of algebra can be expressed with rationals, assuming starting from integers as pixel values
1:15:33
aeth
there is quite a debate over which algebraically-equivalent way to LERP to use, which is why alexandria:lerp has a huge comment
1:16:10
White_Flame
and the precision is fine for the limited number of transformations that happen in most visualizations
1:17:01
aeth
White_Flame: alexandria:lerp uses 1.0, not 1.0f0, so you can just use 'RATIONAL as your *read-default-float-format* before loading alexandria if you want rationals :-)
1:18:31
aeth
It means that whichever float that returns is a side effect of a compile time global variable.
1:22:56
Xach
Josh_2: https://github.com/xach/octree/blob/70c5ba6a5ddbf6d05540dad561e9ceffe6255da7/hex-art.lisp#L63 has a function that might help a trifle
1:27:05
Josh_2
Xach: thanks. White_Flame sorry I didnd't understand :( my maths skills are non existent
1:27:36
White_Flame
well, that was the minimal explanation I can think of, assuming algebra is tackled :)
1:27:46
White_Flame
take my function, and put the result into alexandria:lerp with your 70-670 range
1:28:17
White_Flame
that range-mapper returns a function that will perform the scaling for you, with clamping
1:31:04
no-defun-allowed
ACTION was thinking that Khan Academy JavaScript has a poorly named MAP function which is approximately LERP which is from Processing
1:34:16
Josh_2
Xach: here is an example of the images I am using your library to generate https://imgur.com/onBuPWr.png
2:04:52
pfdietz
Ok. I now have COVER doing coverage checkpoint and rollback. Next step: automatic generation of minimized coverage-increasing test inputs.
2:19:17
PlusEffect
I'm having trouble with SBCL 2.1.x on my Lenovo IdeaPad 3 Chromebook; sb-posix compilation unit failures
4:05:12
beach
francogrex: I will probably leave most platforms up to people who have access to them and who would like to see SICL run on those platforms.
4:05:43
beach
jmercouris: The platforms that SBCL runs on have no impact on the SICL code generator.
4:07:57
beach
jmercouris: And SICL does not depend on SBCL in any way whatsoever. It can use any ANSI conforming Common Lisp implementation that can also run CLOSER-MOP.
4:13:20
beach
jmercouris: SICL is meant to be a clean-slate implementation, so I want my own version of the garbage collector, of generic dispatch, of the optimization techniques we have designed, etc. I don't want to depend on any other implementation.
4:24:59
beach
I can't help wondering why jmercouris is interested in the subject, yet hasn't watched my presentations "Creating a Common Lisp implementation". :)
4:27:07
beach
phoe's description of a compiler is not quite true for Common Lisp, as I explain in those videos. A C compiler starts with an empty global environment (which is why there are all those #include things) whereas a Common Lisp compiler essentially needs a running Common Lisp system.
4:32:45
PlusEffect
I think I figured out how to compile SBCL on my Chromebook! Just had to comment out some tests that were not relevant on my platform.
4:32:47
aeth
A lot of general compiler stuff doesn't quite fit with CL. Especially the huge focus in most compilers on parsing.
4:34:46
beach
Yes, most compiler books have a large part about parsing. That's why I use Muchnick's book most of the time.
4:34:58
Bike
modern (since, i don't know, several decades) optimizing compilers have lots of their own theory of course
4:35:11
no-defun-allowed
I thought most of the compiler complexity was in IR, and only crappy interpreter tutorials take far too long on parsing -- oh, okay.
4:35:15
PlusEffect
It fails stat.2 and stat.4, I think, because I'm probably using those security modules that are mentioned in the comments. The root directory appearing writable to others somehow?
4:35:24
Bike
no, i mean, the actual complexity of an optimizing compiler is definitely the optimizing part, yes.
4:35:50
no-defun-allowed
My favourite coauthor had to write a "compiler" from whatever language (call this one Foo) to JS, and it was very much Foo source -> Foo AST -> JavaScript source
4:36:32
aeth
no-defun-allowed: An introduction to compilers, e.g. online or in a book, could be 50% or more about parsing... but obviously the optimization part is how you turn a 5 week compiler project into an infinite week compiler project.
4:37:45
beach
It used to be the case that parsing was a large part of the time a compiler took, probably because not many optimizations were performed. So parsing technology became a big deal.
4:38:32
no-defun-allowed
I wish they'd just provide e.g a YACC file, and get the damn thing over with, but there's also the tendency to stretch the material out by introducing one construct, then the grammar, then the evaluation rules, etc. But I'm not bored enough to rant about random stuff I read on the Internet again.
4:40:10
aeth
I really don't know how any individuals get past the parser part. It's time consuming. Even Scheme-in-CL took me a while and it's Scheme. In CL.
4:41:23
no-defun-allowed
I was going to say that someone actually wrote 41 thousand words on writing an interpreter without an evaluator, but they had in fact written an interpreter, and it was hidden by all the crap on parsing.
4:42:38
no-defun-allowed
aeth: Depending on your definition of parsing, doesn't C++ parsing range between annoying and not context free and outright undecidable? I got away with writing a few dispatch characters to fake Scheme syntax ([, ], #t and #f) though.
4:43:52
no-defun-allowed
There was a lot of bikeshedding there on writing the parser without a generator, yes.
4:45:12
no-defun-allowed
OpenCL gives you ulong (in place of unsigned long) and friends, possibly so they don't have to write unsigned long4 for the vector type.
4:45:57
dbotton
Why does (merge-pathnames #P"/Users/dbotton/common-lisp/clog/static-files/" "/tutorial/tut-11.html") results in the tutorial portion of the path disappearing ie => #P"/Users/dbotton/common-lisp/clog/static-files/tut-11.html"
4:47:44
no-defun-allowed
merge-pathnames doesn't really join paths together, from my reading of the CLHS: "Constructs a pathname from pathname by filling in any unsupplied components with the corresponding values from default-pathname and default-version."
4:49:20
no-defun-allowed
This begs the question of what function joins paths together, but in this case, you might be better served by ASDF:SYSTEM-RELATIVE-PATHNAME.
4:50:35
no-defun-allowed
e.g (asdf:system-relative-pathname :netfarm "bunnies.asc") on my system returns #P"/home/hayley/netfarm-projects/netfarm/Code/bunnies.asc". You could use something like (asdf:system-relative-pathname :clog "static-files/tutorial/tut-11.html") perhaps.
5:01:45
aeth
maybe this? (uiop:merge-pathnames* (make-pathname :directory `(:absolute "foo" "bar" "baz")) "whatever.html")
5:03:05
dbotton
That would mean I would have to tell users of my api to convert their path's to lists..
5:04:17
no-defun-allowed
That call to MAKE-PATHNAME will return in #P"/foo/bar/baz/", which isn't really helpful in any case.
5:05:01
aeth
no-defun-allowed: well, you'd , or ,@ depending on the problem but it seems like it doesn't give the API that dbotton wants
5:17:34
aeth
I think I'm going to update something in some of my code that solves the problem, but not with uiop:subpathname, so probably not as robustly
5:23:04
dbotton
I wouldn't have noticed it in mine if had not by chance tried merge-pathnames with a subdirectory following the file to merge on