freenode/#lisp - IRC Chatlog
Search
17:52:25
jmercouris
what I am not certain about is whether UIOP would work on all platforms in that case, or how that would work
17:54:23
Bike
sicl has to generate code for the machine and operating system. the fact sbcl runs on, like, sparc, doesn't mean that sicl will be able to, unless beach or someone writes a code generator for sparc.
17:54:57
Bike
i don't think uiop does much machine specific stuff... i could be wrong though. more like OS specific and lisp implementation specific is my impression
17:58:56
jmercouris
Bike: if SICL can be bootstrapped by SBCL on a Sparc machine, why couldn't SICL run on that machine?
18:00:22
phoe
if you mean the current way SBCL is run, which is that it compiles to portable CL that is then executed on SBCL, then sure, it is going to work even now
18:00:53
phoe
if you mean that SICL runs without an underlying SBCL, then something needs to turn (defun square (x) (* x x)) into a vector of raw bytes for the SPARC CPU to execute
18:01:26
Bike
Once you've built it with sbcl or whatever, it runs by itself. It no longer uses sbcl.
18:01:52
Bike
In the same way that when you compile a program with gcc, you can then run it on a machine that does not have gcc installed.
18:01:57
phoe
you want to run SICL on top of SBCL on top of sparc, or SICL on top of sparc with no SBCL in the middle?
18:02:28
francogrex
SICL is to be an independent implementation no needing SBCL etc... that's my undersanding
18:03:14
phoe
I remember beach mentioning there's a 3-4x performance hit when running SICL hosted on top of SBCL
18:05:37
phoe
so if your Lisp implementation is a standard Common Lisp program, then I guess that you can run it as a Common Lisp program
18:06:07
phoe
and generate intermediate code that is standard Common Lisp and is then compiled by the underlying compiler into whatever further representation it does.
18:08:31
phoe
the kernel is written in C, the rest is bootstrappable from any conforming CL implementation
18:09:40
scymtym
but in contrast to SICL, the SBCL code is written with restrictions to make this bootstrapping work
18:10:55
Bike
so you have a machine where sbcl can run, and you use it to build an sbcl appropriate for tomato, and then move it to the tomato, and there you go
18:11:38
phoe
or you can try building ECL on Tomato OS (because you have a C library!) and use it to compile SBCL on the target machine without cross compiling at all.
18:12:30
phoe
cross compilation is actually easy to grasp - your compiler can generate SPARC code even if it runs on x86_64.
18:13:50
Bike
I mean, okay, let's take a step back here. What is a compiler? A program that transforms programs in one language into programs in another language.
18:13:55
phoe
you can teach your compiler what the SPARC assembly looks like and teach it to turn your intermediate representation into that assembly
18:14:20
scymtym
jmercouris: note that you initially asked about a different operating system, so what people described above assumed the target CPU was already supported
18:14:29
francogrex
jmercouris: sbcl doesn't spontaneously for example "run" on ARM, someone had to work for make it generate and execute ARM specific machine code, it's a lot of work
18:14:58
phoe
you can run it on x86, you can run it on MIPS, on SPARC, on ARM, on a piece of paper, whatever - the result is a pile of bytes that also happens to contain valid SPARC code.
18:15:33
Bike
It doesn't generate C code which is then translated by a c compiler, no. (ECL does that)
18:16:02
jmercouris
so every time a new instruction set comes out, they have to make some translation layer for it?
18:16:58
Bike
Yes, for clasp, we don't generate machine code. We generate LLVM-IR, which LLVM can then translate into a variety of machine code formats.
18:17:30
francogrex
and FYI, C compiler like GCC isn't generic it also required a lot of work to port it to different archs
18:17:50
jackdaniel
ecl (or, to be precise, kyoto common lisp) was designed to target C compiler precisely to avoid the hassle of porting the implementation to each Arch x OS combination
18:17:54
Bike
It means we don't have to write the last compilation step and can rely on other people doing it, but on the other hand, those other people might do stupid things.
18:18:56
francogrex
jmercouris: you always can even from lisp implementations like SBCL, you ca go low level
18:18:56
Bike
they have done stupid things, and they're harder for us to fix because we have to convince other people that they are problems that need fixing
18:19:28
Bike
well, "stupid" might be a little strong for most of it. Sometimes they just have done things that don't match well with what we're doing but work great for what they're doing.
19:00:54
nij
What would you do in lisp to replace functionalities offered by `sed`? I'm writing a script that will (un)comment certain lines in `/etc/hosts`, and I couldn't think of a better way than sed..
19:21:25
aeth
yeah, idk about sed, but you can write Perl-like code in CL just by doing READ-LINE in a LOOP
19:22:51
aeth
The hardest part is that if you know CL, you'll start trying to think about how to optimize things better when it's literally just supposed to be a throwaway script.
19:23:30
scymtym
http://www.nongnu.org/txr/txr-pattern-language.html may be a good source of inspiration
20:42:59
_death
nice.. I look at planet lisp and see a new blog added (mgr) with a post about lisp & m5stack.. just a few hours ago I got one :D
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.