freenode/#lisp - IRC Chatlog
Search
16:44:59
jmercouris
Quike: I don't think things are so simple, consider the recent scandal with the John Cena's reselling of his Ford GT
16:45:18
jmercouris
here's a quick link for those curious: https://jalopnik.com/john-cena-is-being-sued-by-ford-for-reselling-his-new-f-1820913011
16:47:21
jmercouris
does Ford not own Copyright on a "published" (manufactured) instance of each Ford-GT they produce?
17:47:00
jmercouris
shka_: sounds pretty wieldy to me, actually seems like it would be really clean, probably you had a comment on almost every line since assembler is pretty hard to decipher without comments
17:47:24
jmercouris
shka_: so it most likely looked like a table, on the left hand code, and on the right hand explanations
17:48:04
jmercouris
also assembler functions, from what I understand RARELY would need to be wide enough to be multiple lines
17:49:40
edgar-rft
God never documented his code when he created earth. That's why it's such a mess.
17:52:11
jackdaniel
comments, assembler, religion, and god put a close paren to end it. https://www.xkcd.com/312/
17:56:59
edgar-rft
In early programming languages it wasn't important to have a special comment char because the program text was written to be read by humans, not computers. The programmer had to look-up the CPU op-codes in the CPU manual and program the machine via hex numbers (memory address + op-code). No joke.
18:13:05
zigpaw
eight bit zx spectrum was great in this, as you had every op code translated directly to a single byte; you could literally learn most of those often used so you could transliterate asm code to hex on the paper (probably other 8bit computers too, but I had only experience with this one).
18:29:06
edgar-rft
jmercouris: I was talking about assembly language, too. On my first two computers it was *me* who was the assembler.
18:29:57
edgar-rft
I first wrote the assembly program on a piece of paper, then I programmed the computer via hexdumps.
18:56:49
oni-on-ion
i realised my positive perspectives on C are related to how it "let" me feel like half computer half human
19:03:25
jcowan
More accurately: "The name of Poet was almost forgotten; that of Orator was usurped by the sophists. A cloud of critics, of compilers, of commentators, darkened the face of learning, and the decline of genius was soon followed by the corruption of taste."
20:02:47
didi
Hey, little trick: if you have a list on slime, but you want to kill and yank one of its elements, eval (values-list *) and then you can kill and yank it.
21:36:56
sjl_
No, I write things that rely on LCO fairly often. I have debug 2 + safety 3 in my vlime config though
21:40:57
fiddlerwoaroof
But, I've discovered that evil-mode is the best implementation of the vim standard
21:41:24
jmercouris
there is literally no reason to use VI in this day and age when emacs can emulate it
21:41:30
sjl_
I try emacs every couple of years. I've tried viper, vile, evil, vimpulse... I think that's it. They're all meh compared to actual vim.
21:42:30
sjl_
It usually takes me about 30 minutes to run into a situation where I wonder "how can I do Vim thing X in whatever-the-emacs-vi-mode-is-called-this-year?" and the answer is "oh yeah you can't do that"
21:42:52
fiddlerwoaroof
sjl_: yeah, there are a couple things I miss from vim, but the better lisp experience + discovering how easily I could migrate the important parts of my vim config convinced me to make the jump
21:42:53
it3ration
Hey folks - I've been using Clojure in my day job for about a year and have been reading Practical Common Lisp. I'm curious if there are any good comparative resources on Clojure vs CL out there. So far, I vastly prefer Clojure's syntax, brevity, [] / #{} / {} syntax for vectors / sets / maps, consistency, etc. Basically, I'm looking for someone to show me benefits of CL over Clojure from a usage POV (not a performance POV). Thanks!
21:43:20
jmercouris
sjl_: the key to success in a tool is embracing the new tool instead of fighting it
21:44:06
fiddlerwoaroof
In other languages, you start your program in your debugger if you want to debug it
21:44:09
sukaeto
fwiw, I've been using emacs+evil for ~3 years now. I believe myself to be a heavy user of "vi the text editing language" + some of the VIM extensions to that language
21:44:17
it3ration
The names of things seem super antiquated compared to Clojure (aka, remove-if-not instead of filter, etc)
21:44:42
fiddlerwoaroof
In common lisp, the debugger is always listening and it pops up in the stack frame where the error happened when there's an error
21:45:03
fiddlerwoaroof
it3ration: that's sort of true, but there are also 40 year old code bases that still work
21:45:16
sukaeto
granted, I was never a heavy user of VIM plugins. I mostly just used it out of the box for the dozen or so years that I used it.
21:45:32
sjl_
Yeah being able to write code now and be confident it won't break in ten years is a big advantage of CL.
21:45:50
TMA
the emulation is not good enough. it has annoyances that are just wrong (like search timeout. pause for half a second while writing a regular expression and bam, the next character won't be part of the regex, but a normal command
21:46:15
sjl_
Clojure 1.3 breaking the world by removing clojure.contrib was one of the big things that pushed me away from Clojure.
21:47:13
fiddlerwoaroof
I've also found that multimethods in Clojure sound really useful but they never work the way I want them to when I try to use them
21:47:50
sjl_
it3ration: I moved from Clojure to Common Lisp and have no regrets. I haven't written specifically about Clojure vs CL, but I wrote about why I like CL here: http://stevelosh.com/blog/2018/08/a-road-to-common-lisp/
21:48:09
fiddlerwoaroof
Maybe that's solvable, but there've been several occasions where I've thought "Ah, a use case for a multimethod" and then discovered that the limitations of Clojure's multimethods mean they usually don't do what I want them to
21:49:50
fiddlerwoaroof
As far as vim/emacs goes, though, I agree that evil-mode isn't actually a complete vim replacement. But, I've generally found that I can take advantage of other emacs packages to come up with a decent new workflow
21:51:21
cgay
it3ration: even at 50 years old, i think i am still capable of change. CL should be too. :)
21:54:16
jcowan
"As long as it can balance parentheses, highlight comments and strings, and autoindent Lisp code that’s all you need to start." Of course, I write Lisp with an editor that can do none of those things (well, balance parens, but it's awkward to do so).
21:54:51
sjl_
I did the Schemer books with pen and paper, but *some* basic editing support really helps.
21:57:33
it3ration
I will say, having []'s in let blocks, and [], {}, #{} for vectors / maps / sets is super nice
21:58:36
cgay
I feel the opposite. The indentation makes it clear, whereas mixing () and [] means I have to balance parens mentally.
22:00:30
oni-on-ion
i like [] better than #() for vectors. shifting becomes a nuisance for any code, but snoopy-mode helps
22:02:19
jcowan
oni-on-ion: Chez (like all R6RS) treats [] like (), so you can use whatever convention you want.
22:04:37
oni-on-ion
ohhhhhh. well thats cool actually! did not know it was R6 either. opinion changed
22:09:09
sjl_
You can make CL read [] as vectors if you want, but it won't help you when reading other folks' code. It took a while but I got used to the extra parens.
22:21:35
jcowan
Does anyone have a class diagram (showing classes and their subclasses) for the CL package, either an actual picture (text or image) or code to generate it? Doesn't have to be pretty, just correct.
22:29:28
aeth
rumbler31: jcowan is the chair of the r7rs-large committee and since Common Lisp is the closest language to Scheme/Racket jcowan is probably mining Common Lisp for ideas
22:30:08
aeth
rumbler31: A diagram like that is probably only interesting to language implementers and people going really deep into MOP/CLOS/type stuff
22:32:18
oni-on-ion
not sure if this is the same thing but this is the version i've seen, outside of CLIM or Slime : http://sellout.github.io/2012/03/03/common-lisp-type-hierarchy/
22:32:45
jcowan
well, yes, that fits the CL model of numbers (the Scheme numeric tower is another story)
22:35:36
it3ration
what [perceived] advantage is there of a Lisp-2 over a Lisp-1? It seems to just make everything more verbose ..
22:37:30
aeth
it3ration: What you wind up doing is having a type foo made with the function foo and calling it the variable foo.
22:38:02
aeth
it3ration: e.g. list is of type list, is made with list (or make-list) and is best called list when there's only one
22:45:07
sjl_
I find it allows SBCL to catch some of my stupid mistakes too -- like if I name a parameter "timestamp" but try to use it in the body as "timestamp" it will tell me I'm an idiot, instead of evaluating time as the built-in function time.
22:48:29
oni-on-ion
oh thats a feature that something like GCC would have... just years and years of patterns, may as well get the compiler to warn about common things. not sure if it is smart
22:54:38
fiddlerwoaroof
sjl_: yeah, the extra "type-checking" a lisp-2 enables makes a huge difference
22:55:20
fiddlerwoaroof
I keep on doing things like (defn do-something [keys map] ...) in clojure and then scratching my head when clojure tells me sometime later that "keys is not a function"
22:56:33
fiddlerwoaroof
And, a lisp-2 isn't all that more verbose: when you're doing "functional" stuff, you just pass function values or symbols around
22:56:56
jcowan
call/cc, proper tail calls, syntax-rules, dynamic-wind vs. unwind-protect, and relentless monomorphism are much more significant.
22:58:14
fiddlerwoaroof
I know eval is evil, but I also like that scheme's eval takes an environment as a parameter
22:58:48
fiddlerwoaroof
If there were a good scheme-in-cl, I'd use that feature for safe remote code execution in a web context
22:59:39
fiddlerwoaroof
it3ration: https://github.com/slburson/fset https://github.com/ndantam/sycamore
22:59:48
oni-on-ion
fiddlerwoaroof: there is a lot of cl-in-scheme -- for eg. guile supports CL style defmacro , remote repl, etc
23:00:12
it3ration
I've been an engine programmer in the game industry for a decade, and wanted to [make the worst choice possible] have some fun and build a little engine in Clojure, but the memory management is just not gonna cut it probably, even with something like LWJGL
23:00:16
aeth
fiddlerwoaroof: eval(foo) in other languages is (eval (read-from-string foo)) in Common Lisp (and probably something similar in Scheme).
23:00:50
aeth
fiddlerwoaroof: It's the read[-from-string] part that you have to trust, especially if *read-eval* is T
23:01:00
it3ration
I've taken a look at some of the things out there, there's one guy doing some fun things in CL
23:01:05
aeth
fiddlerwoaroof: In CL, the main issue with eval is that you probably want a macro instead
23:03:16
it3ration
I've been a hardcore emacs user for about 15 years - using Clojure has been fun, I'm so tired of the imperative shitshow that is C / C++
23:03:18
oni-on-ion
why is GOAL the default mention for lisp and games? isnt that a couple decades ??
23:03:41
oni-on-ion
also lisp was well used in mario64 and nintendo64 stuff, also no one mentions ABUSE by crack dot com, with also their own lisp interpreter (that was my second exposure to it)
23:03:47
fiddlerwoaroof
xelf.me looks pretty cool too, but I've never been able to get it to work on mac
23:04:23
oni-on-ion
jasom: is that like saying steven spielberg used Xyz supercomputers and sets and actors, so whatcha gonna do for your hobby project ?
23:04:45
it3ration
I may be way off base here, but it seems like Clojure has better parallelism / concurrency support on the JVm
23:04:55
oni-on-ion
it3ration: what! actually ? i read the history on it. worked in an apartment etc. (similar to my adventures in vancouver )
23:05:11
aeth
The thing is, that's Lisp as a scripting language. #lispgames is more about Lisp as an engine implementation language, or at least partially as one (lots of C/C++ libraries and in some cases like OpenGL they're unavoidable).
23:05:15
jasom
oni-on-ion: even outside the AAA field, games written completely in any lisp are unusual
23:05:51
it3ration
aeth: yeah, that's the only reason I haven't fully dived in - it'd have to be for fun only, because writing a cross-platform engine in CL is the path to NEVER EVER SHIPPING haha
23:05:59
fiddlerwoaroof
But it's not too hard to implement core.async-like patterns using something like ChanL
23:06:21
fiddlerwoaroof
and then there's also lparallel which provide equivalents of clojure's pmap, as well as more complicated constructs
23:06:26
oni-on-ion
oh ah yep. CL and its images. its like you marry a lady then she got her dog the cat her cousins grandma parents old collections of dolls ahhhh
23:07:02
oni-on-ion
if i were doing real parallel or gpu or numeric work, i would go full-forward face-first into julia hands-down
23:07:09
aeth
it3ration: But it's not never shipping, it's more like full maturity in 10 years from the start point, perhaps with something shippable a few years before it's really mature.
23:07:30
jasom
writing a cross-platform engine has almost always been hard; OpenGL appears to have been a historical anomoly
23:07:47
aeth
it3ration: You don't have to write a backend for Metal. You can just (1) ignore macOS or (2) use Vulkan and moltenvk
23:08:51
it3ration
I mean, i've been an engine programmer for a long time - writing an engine is so orthogonal to shipping a game
23:08:58
oni-on-ion
also the simple/tiny/crossplat "raylib" works in web and mobiles. also i heard SDL does too. lots of solutions....
23:09:10
it3ration
I bet shipping a CL game on mobile would be an absolute nightmare, but I'm not sure
23:09:27
jcowan
fiddlerwoaroof: Unfortunately, there's no portable way to create global environments at runtime. There is the interaction environment (the one the REPL uses, if there is a REPL, which there usually is), and you can create environments from libraries, but they are not reliably mutable
23:09:39
aeth
it3ration: Except certain kinds of games definitely are best made on a custom engine, e.g. Factorio or Minecraft.
23:10:05
aeth
If you're shipping a typical game, a mainstream engine probably is the best fit, but if you stray too far, a custom engine can still make sense given how much you'd have to hack around insomething like Unity to get acceptable performance.
23:10:39
aeth
Of course, you *can* hack around something like Unity to make a game it's not suited for, e.g. Cities: Skylines.
23:11:48
it3ration
They're generating near-optimal code with intrinsics per-platform in Unity these days, they tried to hire me awhile ago
23:12:16
aeth
it3ration: You could non-portably use SBCL's define-vop and then have a fallback in native CL for non-supported implementations and architectures.
23:12:59
aeth
it3ration: What I do is I preallocate everything before the game loop. Essentially the object pool pattern with a twist
23:13:32
aeth
it3ration: Of course if you wanted platform support you'd have to port it to the consoles yourself
23:14:18
fiddlerwoaroof
here's some more code using intrinsics for SSE stuff: https://www.pvk.ca/Blog/2013/06/05/fresh-in-sbcl-1-dot-1-8-sse-intrinsics/
23:14:22
aeth
it3ration: What I'd personally do if I ever was successful enough to think about console ports is make the console ports a commercial feature of my permissively-licensed engine.
23:14:37
aeth
it3ration: i.e. The three PC OSes are free, but you'd pay to have the console renderers
23:16:44
it3ration
I know there's some guy doing CL game stuff on Youtube, I can't remember his name
23:16:48
aeth
The task of game engines definitely plays to SBCL's strengths, although my engine is still geting acceptable FPS in CCL
23:18:14
aeth
it3ration: One good thing about SBCL is that it's mostly public domain with a fallback to BSD (iirc) and with some permissively licensed components from elsewhere. So if porting to consoles is incompatible with the GPL, you can still do it with SBCL.
23:18:42
aeth
CCL is apparently Apache licensed so it should also be compatible with console ports even where the task is GPL-incompatible
23:19:53
aeth
(I don't know if this is an issue or not. If I ever have a problem where I need to port one or more implementations to consoles, I'd have enough money to pay someone to solve that problem.)
23:20:07
didi
TIL SBCL let me (declare (optimize (debug 0.5))). I thought only natural numbers were allowed.
23:20:32
no-defun-allowed
it executes code with (debug 0) half the time and (debug 1) the other half
23:21:09
aeth
didi: I'm not very surprised because it probably uses <, =, >, <=, and >= to make its decisions
23:24:38
sjl_
> SBCL allows any real value for optimization qualities. It may be useful to specify 0.5 to get backtrace argument display without argument documentation.
0:39:36
pillton
anniepoo: The function you are stepping through should be compiled with the following optimize declarations: (optimize (debug 3) (safety 3) (speed (0)))).
0:47:59
pillton
anniepoo: (defun foo (x y) (declare (optimize (debug 3))) (break) (print x) (print y))
0:49:36
pillton
I don't think this functionality is as good as it is in other development environments. Having said that, what is the right thing to do with macros?
0:54:23
aeth
Debugging with FORMAT doesn't seem like the end of the world. Shouldn't be too hard to refactor into logging if you leave it in and target any stream.
1:23:46
dariken
how to make executable binary in SBCL that doesnt take the whole Lisp image with it? something like tree shaking that only takes the necessary parts.
1:28:55
pillton
dariken: That isn't possible. You can pass :compression t to sb-ext:save-lisp-and-die.
1:39:24
fiddlerwoaroof
dariken: in the general case, I think that's equivalent to the halting problem
1:42:10
anniepoo
(fwiw, yes, the one I'm presumably gonna write has to have some limitations - it's known to be impossible in the general case, like apply)
1:46:59
fiddlerwoaroof
anniepoo: if you're having issues with macros, the macrostep expander is really useful
1:51:10
anniepoo
I'm getting the strange behavior that it doesn't step into functions called from the first function
1:51:12
LdBeth
however in general case of applications especially commercial software you won't let user eval arbitraray code
1:55:19
pillton
LdBeth: Some CL implementations compile the dispatch function used in generic functions upon first invocation.
3:20:48
stylewarning
fiddlerwoaroof: no way except to access the slot directly. That'll change in due time of course.
3:22:34
stylewarning
(Supposing that I don't replace it with structs, I'll probably make each one its own slot. But it's a detail I'm not so concerned with at the moment.)
3:23:00
stylewarning
(in Coalton, of course, the way to extract values will be through pattern matching, which also isn't implemented)
3:25:04
jcowan
I've actually been wearing my ISLisp implementor's hat today, thinking about how to implement ISLisp in CL. I'm realizing that it's going to be *very* expensive to use only portable CL rather than being able to depend on SBCL
3:25:58
jcowan
For example, (+ 'x) only should raise an error per CLHS, but SBCL guarantees to return an error. So either I wrap + with a safe version that always raises an error (and not by a type declaration either, but by actual code), or I just say "Use SBCL".
3:26:19
stylewarning
fiddlerwoaroof: yes, I'd add it here: https://github.com/tarballs-are-good/coalton/blob/master/src/coalton.lisp#L264
3:26:31
jcowan
Kent Pitman has an implementation, but he can't/won't open source it. There is OpenLisp, which is not open, and a bunch of broken implementations.
3:27:11
fiddlerwoaroof
Anyways, I have a suspicion that that type of thing always _will_ raise an error in implementations people user
3:32:44
fiddlerwoaroof
I only know about it because it's been adapted to work with a racket-module like system
3:49:56
fiddlerwoaroof
Anyways, I think your implementation of Hindley-Milner might be my best chance of my understanding how the algorithm works: it looks a lot cleaner than most of the other places I've looked
3:50:56
fiddlerwoaroof
This might be because I'm really bad at reading ML-style languages or my eyes glaze over when people write page after page of type judgments
4:05:04
fiddlerwoaroof
I'm kinda interested to what degree a lisp would benefit from something like the smalltalk "IDE"
4:05:56
oni-on-ion
yeap =) opengenera was closest; lisp experiments were precursor to smalltalk environment afaik. current attempts are mezzano and mcclim
4:09:06
jcowan
Interlisp (of which Genera is the only surviving implementation) and Smalltalk came out of the same hacker culture, and they shared a great deal, especially the image-based rather than file-based representation.
4:09:50
fiddlerwoaroof
jcowan: yeah, one of my many overly ambitious projects is to implement a fully-image based modern CL system
4:10:40
fiddlerwoaroof
I've been thinking of using sqlite's appendvfs to append a relational database to an image, and stuff all the source in there with arbitrary metadaya
4:11:22
fiddlerwoaroof
And then define a suite of functions that can generate temporary buffers from the database that contain a projection of your source-code
4:11:41
jcowan
There are bits in the Squeak image that were set by hand before 1980 and have no representation in the source file.
4:12:01
fiddlerwoaroof
i.e. something like (buffer-with-methods generic-function &rest specializers) that would give you a temp file with all the relevant methods
4:12:42
fiddlerwoaroof
jcowan: I thought that at some point they went back and reimplemented the vm from scratch so that that was no longer the case?
4:15:36
jcowan
Xerox sent out the image and a bunch of docs to various outside organizations and asked them to implement VMs according to their own notions, and the result was a lot of Smalltalks and the book _Bits of History, Words of Advice_