qhong has quit [Read error: Connection reset by peer]
skin1 has joined #commonlisp
habamax has quit [Ping timeout: 246 seconds]
habamax has joined #commonlisp
skin1 has quit [Ping timeout: 240 seconds]
eddof13 has quit [Ping timeout: 258 seconds]
yosef` has joined #commonlisp
jello_pudding has quit [Ping timeout: 255 seconds]
jello_pudding has joined #commonlisp
hrberg has quit [Ping timeout: 255 seconds]
hrberg has joined #commonlisp
aartaka has quit [Ping timeout: 258 seconds]
aartaka has joined #commonlisp
jeosol has joined #commonlisp
OlCe has quit [Ping timeout: 255 seconds]
anticomputer has quit [Remote host closed the connection]
dinomug has joined #commonlisp
aartaka has quit [Ping timeout: 258 seconds]
OlCe` has joined #commonlisp
kurfen_ has joined #commonlisp
kurfen has quit [Ping timeout: 255 seconds]
b00p has joined #commonlisp
wonko-the-sane has quit [Remote host closed the connection]
wonko-the-sane has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
qhong has joined #commonlisp
qhong has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
robin has quit [Ping timeout: 258 seconds]
waleee has quit [Ping timeout: 258 seconds]
bjorkintosh has quit [Remote host closed the connection]
bjorkintosh has joined #commonlisp
bjorkintosh has joined #commonlisp
bjorkintosh has quit [Changing host]
jonatack has joined #commonlisp
yosef` has quit [Quit: Client closed]
bjorkint0sh has joined #commonlisp
bjorkintosh has quit [Ping timeout: 258 seconds]
Lycurgus has joined #commonlisp
knusbaum is now known as jack_rabbit
wonko-the-sane has quit [Quit: leaving]
Lycurgus has quit [Quit: Tschüss]
Sario has quit [*.net *.split]
Sario has joined #commonlisp
bjork1intosh has joined #commonlisp
ronald_ has quit [Read error: Connection reset by peer]
bjorkint0sh has quit [Ping timeout: 248 seconds]
ronald_ has joined #commonlisp
jeosol has quit [Quit: Client closed]
pve has joined #commonlisp
wonko-the-sane has joined #commonlisp
wonko-the-sane has quit [Remote host closed the connection]
wonko-the-sane has joined #commonlisp
ronald__ has joined #commonlisp
Pixel_Outlaw has quit [Quit: Leaving]
ronald has quit [Ping timeout: 260 seconds]
bjorkint0sh has joined #commonlisp
bjork1intosh has quit [Ping timeout: 246 seconds]
dcb has quit [Quit: MSN Messenger 4.0.4]
shka has joined #commonlisp
azimut has joined #commonlisp
macdavid313 has joined #commonlisp
bjork1intosh has joined #commonlisp
bjorkint0sh has quit [Ping timeout: 246 seconds]
macdavid313 has quit [Ping timeout: 248 seconds]
avocadoist has quit [Remote host closed the connection]
avocadoist has joined #commonlisp
yosef` has joined #commonlisp
dim has quit [Server closed connection]
dim has joined #commonlisp
rgherdt has joined #commonlisp
gaze___ has quit [Server closed connection]
gaze___ has joined #commonlisp
dinomug has quit [Remote host closed the connection]
bjorkint0sh has joined #commonlisp
bjork1intosh has quit [Ping timeout: 246 seconds]
qhong has joined #commonlisp
rtypo has joined #commonlisp
bjorkint0sh has quit [Remote host closed the connection]
bjorkint0sh has joined #commonlisp
igemnace has joined #commonlisp
bendersteed has joined #commonlisp
gty has quit [Quit: gty]
gty has joined #commonlisp
bjorkint0sh has quit [Remote host closed the connection]
bjorkint0sh has joined #commonlisp
fosskers has joined #commonlisp
bjork1intosh has joined #commonlisp
bjorkint0sh has quit [Ping timeout: 248 seconds]
AmyMalik has quit [Server closed connection]
gty has quit [Remote host closed the connection]
gty has joined #commonlisp
gty has quit [Remote host closed the connection]
gty has joined #commonlisp
gty has quit [Client Quit]
macdavid313 has joined #commonlisp
micro has quit [Ping timeout: 260 seconds]
macdavid313 is now known as gty
macdavid313 has joined #commonlisp
micro has joined #commonlisp
Inline has quit [Quit: Leaving]
macdavid314 has joined #commonlisp
macdavid313 has quit [Ping timeout: 258 seconds]
gty has quit [Ping timeout: 248 seconds]
macdavid314 is now known as gty
Ellenor has joined #commonlisp
mgl has joined #commonlisp
habamax has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.1)]
Inline has joined #commonlisp
seok has joined #commonlisp
karlosz has joined #commonlisp
cage has joined #commonlisp
dino_tutter has joined #commonlisp
habamax has joined #commonlisp
yosef` has quit [Quit: Client closed]
igemnace has quit [Read error: Connection reset by peer]
karlosz has quit [Quit: karlosz]
gxt has quit [Remote host closed the connection]
gxt has joined #commonlisp
bjorkint0sh has joined #commonlisp
igemnace has joined #commonlisp
bjork1intosh has quit [Ping timeout: 248 seconds]
random-nick has joined #commonlisp
jeosol has joined #commonlisp
karlosz has joined #commonlisp
attila_lendvai has joined #commonlisp
attila_lendvai_ has joined #commonlisp
attila_lendvai has quit [Ping timeout: 258 seconds]
karlosz has quit [Quit: karlosz]
fosskers has quit [Ping timeout: 248 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
macdavid313 has joined #commonlisp
macdavid313 has quit [Ping timeout: 255 seconds]
seok has quit [Quit: Client closed]
seok has joined #commonlisp
Ellenor is now known as AmyMalik
antoszka has quit [Server closed connection]
antoszka has joined #commonlisp
karlosz has joined #commonlisp
attila_lendvai_ is now known as attila_lendvai
prokhor has joined #commonlisp
azimut has quit [Ping timeout: 246 seconds]
jeosol has quit [Quit: Client closed]
jmdaemon has quit [Ping timeout: 258 seconds]
NicknameJohn has joined #commonlisp
jello_pudding has quit [Ping timeout: 245 seconds]
karlosz has quit [Quit: karlosz]
tyson2 has joined #commonlisp
jello_pudding has joined #commonlisp
karlosz has joined #commonlisp
gty has quit [Remote host closed the connection]
gty has joined #commonlisp
skeemer has quit [Server closed connection]
skeemer has joined #commonlisp
blomberg has joined #commonlisp
<blomberg>
which scheme compiler should i use
waleee has joined #commonlisp
habamax has quit [Remote host closed the connection]
jonatack has quit [Read error: Connection reset by peer]
Brucio-61 has quit [Read error: Connection reset by peer]
Brucio-61 has joined #commonlisp
attila_lendvai has quit [Remote host closed the connection]
jonatack has joined #commonlisp
attila_lendvai has joined #commonlisp
<b00p>
whichever one you want. what are you trying to do?
<beach>
blomberg: Maybe ask in #scheme. This channel is dedicated to Common Lisp.
<blomberg>
what's the point of return if i dont use loops
<blomberg>
they say in scheme there is no return but no loops, what about in CL
<blomberg>
moreover i wanted to know is chicken as fast as sbcl
<beach>
blomberg: Common Lisp has several iteration constructs. It does not use tail recursion to simulate iteration.
<beach>
blomberg: As for the Scheme system you are considering, you had better ask in #scheme.
azimut has joined #commonlisp
karlosz has quit [Read error: Connection reset by peer]
<blomberg>
i asked them, but here too i use commonlisp
<blomberg>
it's a execution speed comparision question
<beach>
Try in #lisp then.
<beach>
blomberg: Do you know about recursion? If so, you know that there is a base case and a "induction" case? The base case exists so that the recursion can terminate. That's how iteration can be simulated using recursion. But then, recursive calls have to be in tail position to avoid eating up stack.
bendersteed has quit [Quit: bye]
<beach>
blomberg: But Common Lisp does not make any guarantees about tail-call optimization, so it has several excellent iteration constructs instead.
<b00p>
If you're coming from a different programming paradigm then (loop) will feel right at home.
<_death>
blomberg: if performance is important to you, you should probably not rely on hearsay and make your own experiments
vxe420 has quit [Server closed connection]
vxe420 has joined #commonlisp
dino_tutter has quit [Ping timeout: 248 seconds]
bjorkint0sh has quit [Remote host closed the connection]
bjorkint0sh has joined #commonlisp
<blomberg>
should i not use return inside functions
<blomberg>
if there are no loops then having the return keyword is pointless?
<beach>
blomberg: RETURN can be used to avoid nested conditionals. Like you can do (when ... (return ...)) and then continue without nesting.
<beach>
blomberg: Or (when ... (error ...)) and then more forms.
<beach>
Rather than (if ... (error ...) ...) where the last ... would be further.
<blomberg>
but scheme has no returns
<beach>
I don't care. This channel is dedicated to Common Lisp.
<beach>
You claimed that RETURN is useless, and I just showed you a situation without a loop where it is useful.
<blomberg>
so if some return x ; why not just return without the keyword as it always does in a conditional
<beach>
I think I just told you. Because you can avoid more nesting and deep indentation by using RETURN.
<blomberg>
(defun square (x) (return (* x 2)) ; is it valid
<blomberg>
*(defun twice (x) (return (* x 2))
<beach>
It is not valid because of a technicality, but it is also pointless because it would return the same thing without the explicit return.
<blomberg>
no need to write nested conditionals, but can you show where explicit return is useful in CL
<beach>
Imagine a function that has to check several preconditions before doing its work. You could start the function body by (when ... (error...)) (when ... (error ...)) (when ... (error ...)) And then have the rest of the body at low nesting depth.
<beach>
I think I just told you. Imagine for instance that a function returns something special if given NIL. (defun fun (x) (when (null x) (return-from fun ...)) <more processing>)
<beach>
If you don't use RETURN-FROM, then <more processing> needs to be indented and perhaps surrounded by a PROGN. With RETURN-FROM, it is indented just the two positions of a normal body form.
<beach>
blomberg: Does that make sense to you?
bjork1intosh has joined #commonlisp
bjorkint0sh has quit [Ping timeout: 248 seconds]
<blomberg>
return-form ? what's that
<beach>
RETURN-FROM is the valid version of RETURN. Remember, I said it's a technicality. (RETURN <something>) macroexpands to (RETURN-FROM NIL <something>). The first argument is a block name.
<blomberg>
(when (< 2 3) 5) ; isn't 5 returned without (return 5)
<beach>
Not if other forms follow, no.
<blomberg>
like when
<beach>
In (defun f (x) (when ... 5) (print ...))
<beach>
Then the when has no effect, and the PRINT is executed anyway.
<blomberg>
ok
<blomberg>
then when is useless
<beach>
No.
<blomberg>
when is like if?
<beach>
(defun f (x) (when ... (print ...)) is not useless.
<blomberg>
why when, when i can if?
<beach>
WHEN is like an IF without an 'else'.
<blomberg>
ahh
<beach>
blomberg: If you want to learn more about Common Lisp I recommend #clschool.
<blomberg>
that's what i was thinking
<beach>
blomberg: This channels is not really meant for newbie questions, though they are tolerated, especially if it is otherwise quiet here.
<blomberg>
ok, but there might be a way to circumwent that return , for example other languages like scheme
<blomberg>
without being fully functional
<beach>
You can avoid the return by more nesting. Instead of (defun f (x) (when ... (return <stuff>)) <more-stuff>) you just do (defun f (x) (if ... <return-stuff> <more-stuff>))
<beach>
Er, (defun f (x) (if ... <stuff> <more-stuff>))
<blomberg>
can you give real simple code that is more readable
<beach>
(defun divide (x y) (when (= y 0) 'not-possible) (/ x y)) vs (defun divide (x y) (if (= y 0) 'not-possible (/ x y)))
<beach>
Sorry.
<beach>
(defun divide (x y) (when (= y 0) (return-from divide 'not-possible)) (/ x y)) vs (defun divide (x y) (if (= y 0) 'not-possible (/ x y)))
<beach>
Notice that the (/ x y) is nested one level deeper in the second case.
<beach>
blomberg: But this discussion is getting very basic, so I recommend #clschool.
<blomberg>
ok
zxcvz has joined #commonlisp
NotThatRPG has joined #commonlisp
zxcvz has quit [Client Quit]
NotThatRPG has quit [Client Quit]
Lycurgus has joined #commonlisp
migap_ has quit [Server closed connection]
migap has joined #commonlisp
shka has quit [Ping timeout: 248 seconds]
dino_tutter has joined #commonlisp
sjl has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
jonatack has quit [Quit: WeeChat 4.0.4]
dinomug has joined #commonlisp
Lycurgus has quit [Quit: Tschüss]
tyson2 has joined #commonlisp
jonatack has joined #commonlisp
mgl has quit [Quit: Client closed]
igemnace has quit [Quit: WeeChat 4.0.4]
tyson2 has quit [Remote host closed the connection]
dino_tutter has quit [Ping timeout: 246 seconds]
NicknameJohn has quit [Read error: Connection reset by peer]
_whitelogger has joined #commonlisp
NotThatRPG has joined #commonlisp
mgl has joined #commonlisp
dcb has joined #commonlisp
seok has quit [Quit: Client closed]
thuna` has joined #commonlisp
seok has joined #commonlisp
tyson2 has joined #commonlisp
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgherdt has quit [Ping timeout: 246 seconds]
NotThatRPG has joined #commonlisp
mgl has quit [Quit: Client closed]
mrcom_ has joined #commonlisp
mrcom has quit [Read error: Connection reset by peer]
amb007 has quit [Ping timeout: 255 seconds]
amb007 has joined #commonlisp
b00p has quit [Ping timeout: 258 seconds]
shka has joined #commonlisp
dino_tutter has joined #commonlisp
cage has quit [Read error: Connection reset by peer]
cage has joined #commonlisp
robin has joined #commonlisp
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Pixel_Outlaw has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
lucerne has joined #commonlisp
lucerne has quit [Client Quit]
lucerne has joined #commonlisp
blomberg has quit [Ping timeout: 244 seconds]
hrberg has quit [Ping timeout: 240 seconds]
seok has quit [Quit: Client closed]
seok has joined #commonlisp
ldb has joined #commonlisp
bjork1intosh has quit [Ping timeout: 240 seconds]
<ldb>
I'm just surprised how many inconsistencies in floating point related features I have encountered across many programming language
<ldb>
There is a well known algorithm for complex number division that correctly handles inf but not used in Chez Scheme until I recently made a patch for that.
<ldb>
Different Common Lisps produce different results when convert rational to float
<ldb>
Lisp has pioneered complex number and ratio in programming languages but there is no common agreement on how to implement them
<jcowan>
Quite so, because standardizers have mostly not paid attention to them.
<jcowan>
Fortran did complex numbers before Lisp and should probably be followed
<semz>
I think "people who care about FP details" and "people who care about/make language implementations" have rather little overlap, sadly
<bike>
there's ISO/IEC 10967 but nobody cares about it.
<ldb>
Yeah, I guess people who make compilers would rarely find uses for FP arith more than benchmark the running time
<ldb>
bike: very helpful resource to me, thanks!
<bike>
no problem.
<bike>
i think the average language implementor probably cares more about floating point correctness than the average floating point programmer. source: i work in scientific computing and can assure you that it is not on the radar
<bike>
probably even worse in games
<semz>
games often feel like they don't even care about integer correctness
<bike>
ieee 754 also has a bunch of stuff that's pretty neglected. C has a bunch of exception handling stuff, half of which doesn't work
pve has quit [Quit: leaving]
tyson2 has joined #commonlisp
jeffrey has joined #commonlisp
<aeth>
Three categories: people who want correct floating point, people who don't use floating point (and I don't think it's actually *used* in compilers?), people who want fast floating point
zxcvz has joined #commonlisp
zxcvz has quit [Client Quit]
<aeth>
Gamedevs still romanticize the era of having to do strange and clever hacks for performance, especially the famous fast inverse square root in Quake 3's engine. In practice, if you benchmark things, you basically have so, so much time on a modern computer, though so micro-optimizations are mostly wasted effort, even if they do it.
<aeth>
There's only so many things you want to do n times a second and most games aren't that much more complex than in 2004, the era of single core Pentium III and Pentium IV.
bjorkintosh has joined #commonlisp
bjorkintosh has joined #commonlisp
<bike>
fast inverse square root is just good comedy.
<bike>
floating point is not usually used in compilers, no. even on the occasions when you actually want fractions (for example branch probabilities) it's pretty usual to use fixed point
rgherdt has joined #commonlisp
NicknameJohn has joined #commonlisp
ldb has quit [Read error: Connection reset by peer]
<ixelp>
Incorrect printing of floating-point number · Issue #394 · Clozure/ccl · GitHub
<ldb>
Yeah git blame shows that function havn't been changed since they moved to git
<White_Flame>
bike: the one place I'd imagine it used is in constant folding of floats
<ldb>
for constant folding, they just use what the language library provides
blunder has quit [Ping timeout: 245 seconds]
<ldb>
if the library is wrong the result is also wrong
<ldb>
I wonder how should I apply for maintainer of CCL
<ldb>
";;; THE ABOVE COMMENT no longer applies" holy moly
attila_lendvai has quit [Ping timeout: 258 seconds]
<bike>
White_Flame: true enough, and important to not fuck up
<aeth>
;;; THIS COMMENT IS FALSE
thuna` has quit [Remote host closed the connection]
<bike>
presents some complicated issues, like that you can't do it if rounding matters and the runtime rounding mode is unknown
<ldb>
Chez Scheme just assume one rounding mode
<ldb>
definitely not a serious consideration
cage has quit [Remote host closed the connection]
bjorkintosh has quit [Ping timeout: 248 seconds]
pestctrl` has joined #commonlisp
pestctrl has quit [Ping timeout: 258 seconds]
blunder has joined #commonlisp
<blunder>
CL's type system doesn't provide a means of creating distinct types from old ones in the manner of Ada or Haskell e.g. "type Meters is new Integer" which is trouble for me because I'd like to use method dispatch with these new types. I'm currently sticking the value in a cons cell with a symbol in the CDR e.g. '(2 . meters) and branching based on that. Is there a more idiomatic way to go about what
<ixelp>
GitHub - markcox80/specialization-store: A different type of generic function for common lisp.
<aeth>
It doesn't fully help, though, because DEFTYPE doesn't really... create new types. It just aliases them.
<aeth>
So it's very good for saying that a 3-length vector of single-floats is a vec3 or a (vec 3) and not so good at saying something is "meters"
<aeth>
structs might be the way to go, but that allocates an extra runtime "box" of sorts
<aeth>
What you'd really want to do is do such accounting at compilation time, which is doable, and maybe a library does it
<blunder>
Yes, I'm sure there are systems that add that functionality but I'm wondering if trying to do this at all is a sign of a flaw in my approach
<bike>
usually you would just make a new class with one slot.
<bike>
this isn't going to be as transparent performance wise as haskell newtype, of course
jello_pudding has quit [Ping timeout: 258 seconds]
<blunder>
aeth mentioned boxing but I just wasn't sure it was standard practice. thanks.
<bike>
haskell and ada can do what they do because they are statically typed. type checking is part of the semantics and once it's done the runtime is free to treat the newtype and whatever is underlying it identically. this kind of compile time typing isn't mandated in CL so generally they will remain distinguishable to the runtime, which has a little performance impact